Repository navigation
Closed
Description
A pre-merge review of the combined notes stack (#226, #227, #230, #238, with the #235 and #237 repairs) found these defects. They were not fixed before landing. Three others were fixed in #227: agent turns failing when the notes folder cannot be read, Open notes re-focusing on every poll, and quadratic tree layout. Line numbers refer to c32217a (the stack before those fixes). In notes-store.ts, lines after about 605 sit 19 lines later on main.
Main process
- A settlement journal can wedge every read.
notes-store.ts:392-396(written at261, validated at772-778): the folder-rename journal is written before thesafe()checks. Dragging a folder whose name contains\(legal on macOS, e.g. one made in Finder with its folder note) leaves.modex/settlement.jsonbehind. Every later read then throws "Invalid folder rename intent", even after a restart. Fix: validate before writing the journal, and do not let a journal that fails validation block reads forever. Confirmed by probe. - Scoped restore can write into another project.
notes-store.ts:196-200,1188-1190, reached frompages-agents.tsrestore: a child trashed in project A whose parent folder was later dragged into project B can still be restored by A's agent. The note lands under B and a version is written to B's parent page. Fix: before a scoped restore, check that the target directory and every ancestor it restores are in scope, as the revert check already does. Confirmed by probe. - Trashed notes keep stale original paths after moves.
notes-store.ts:694-702(place),1184(restoreFile): moving or renaming a workspace, project or folder updates live notes only. Restoring a note trashed earlier recreates the old path (e.g.Personal/Notes) as a ghost project with no marker, outside the linked Modex project. Fix: rewrite the trashed and deleted originals under the moved folder inplace()and in folder-move rebase. Confirmed by probe. - Import copies on the main thread.
notes-store.ts:498:copyFileSync, up to 50 files of 100 MB. A real copy (another volume, a network share, iCloud placeholders) freezes the UI. Fix:fs.promises.copyFile. - Knowledge scoping misses nested folders.
index.ts:121,knowledge-agents.ts:172: project scoping applies only when the knowledge folder equals the notes folder exactly. A knowledge base set to a workspace or project folder insidenotes/, or to the Modex home, is unscoped. Fix: scope whenever either folder contains the other, or refuse such folders.
Renderer
- Tree render cost grows with the square of the tree size, on every keystroke.
NotesTree.tsx:51-57,134-137,160: each row filters all nodes for its children,targetsFor()runs twice per row, and the Move to items are built even while the menu is closed.SpaceViewre-renders on each page edit. Measured outside React: 1,056 nodes / 55 folders take 343 ms per render; 2,111 / 110 take 2.9 s. Fix: memoize parent→children and id maps, build move targets only for an open menu, andReact.memothe tree with stable actions. - A duplicated workspace or project folder shares the original's id.
notes-store.ts:626, shown atNotesTree.tsx:119: Finder Duplicate copies.modex-project.json, so the two rows collide. Renaming the original by id renames the copy, and the copy claims the same Modex project. Fix: give a repeated marker id a new id and setmodexProjectId: null, as pages already do (notes-store.ts:995). Reproduced. - Open in knowledge base can send the old path.
SpaceView.tsx:250with:188: after a title rename, the menu action reads the tree from the render that built the menu, soknowledge:opencan getUntitled.mdand fail with ENOENT. Fix: haverefresh()return the fresh tree, or ask main forpageRel. - New workspace re-opens after a remount.
NotesTree.tsx:40: thenewWorkspacecounter is never reset. After creating one workspace, typing in and then clearing the page search remounts the tree, and focus jumps into an empty "New workspace name" field. Keystrokes land there, and blurring it creates a workspace. Fix: keep the request inSpaceViewand clear it on commit or cancel.
Coven-Harness: Claude Code / claude-opus-5-5
Metadata
Metadata
Assignees
Labels
No labels
Activity
BunsDev commentedon Oct 16, 2026
Rechecked against
mainat f17608d.Fixed on main by #246
~/.modex), acontent.dir, or another project's folder (which then refuses everything). Tests inknowledge-agents.test.ts: "a knowledge base set to a workspace of the notes folder keeps each project's agents in their own notes" and "a knowledge base inside another project's notes holds nothing this project may reach".modexProjectId: null(notes-store.ts, the walk inlook). The test "a project folder copied in Finder becomes a project of its own instead of making the notes unreadable" (notes-projects.test.ts) covers a copied default project and a copied linked project.Still open, each getting its own PR with a regression test of the probe above
\in a folder name)I'll link each PR here as it opens and close this issue when they have all landed.
Coven-Harness: Claude Code / claude-opus-5-5
BunsDev commentedon Oct 16, 2026
Each remaining finding now has its own PR, with a regression test that failed on
mainbefore the fix:\in a folder name)Findings 5 and 7 were fixed by #246 (see the previous comment). I'll close this issue once these PRs land.
Coven-Harness: Claude Code / claude-opus-5-5
Stop the New workspace field reopening after a search (#260)
Open a renamed note in the knowledge base at its new path (#263)
Keep a large notes tree fast while typing (#264)
BunsDev commentedon Oct 16, 2026
All nine findings are fixed on
main:\in a folder name).modex/, then a no-overwrite link into placeEach fix PR has a regression test that failed on
mainbefore the change.One change from the review's suggested fix for finding 6: the tree isn't wrapped in
React.memo. Instead, #264 keeps each row unless something the row shows changes, andSpaceViewpasses one stable actions object. Typing in a page body therefore no longer rebuilds the rows, without changingNotesTreeView's signature, which #260 also edited.Coven-Harness: Claude Code / claude-opus-5-5
Prepare desktop 0.2.0 and Companion 0.2.0 (7) (#272)