Skip to content

Give each project its own notes, and bring files into notes (#230, #238) - #227

Merged
BunsDev merged 75 commits into
mainfrom
notes-projects
Oct 15, 2026
Merged

BunsDev merged 75 commits into
mainfrom
notes-projects

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Integration target: main (Val's decision, 2026-10-15 18:5x UTC). #227 lands directly on main, which already has #236. The release-reviewed-batch keeps #228, #235, #239 and #216. #235's and #237's repairs are already inside #227.

Landing note (2026-10-15). This PR now carries the rest of the notes stack to main:

Coven-Harness: Claude Code / claude-opus-5-5


Stacked on #226 (the workspace tree). Notes in folders, slices B3, B5 and B6: each Modex project gets its own notes, its agents stay inside them, and the knowledge base can be the notes folder.

Each project has its own notes (B3)

  • Linking: adding a project gives it a notes project in the default workspace, and existing projects get one when notes first open. The marker records the Modex project and its code folder.
  • Removing a project keeps its notes, unlinked. Adding the same folder again links them back. The confirmation now says the notes stay.
  • Chat sidebar: with one workspace it's unchanged. With more than one, projects are grouped under collapsible workspace headers, and the project menu offers Open notes (which reveals the project in Space) and Move to .
  • IPC: notes:workspaces, project:notes, project:workspace.
  • Relabel: the thread's right-hand panel is now the Side panel ("Show side panel ⌘J"), so "workspace" means one thing. The repository card's heading is now "Repository", and the Store app's native menu changes to match. Internal names, test ids and ⌘J are unchanged.

Agents work in their own project's notes (B5)

  • PagesAgents works out the turn's project's notes when the turn starts, before its first await, and stays inside them.
    • Search lists only that project's notes.
    • Reading or changing another project's note is refused ("outside this project's notes").
    • create puts a note at the top of the project's notes.
  • New tools stay inside the project: list, create_folder, move, and read_file (text up to 1 MB). Everything is still addressed by ID, never by path, and there's no binary write or permanent delete.
  • PAGES_TOOLS gains the four tools for both CLIs' allowlists.

The knowledge base can be your notes (B6)

  • Knowledge setup offers Use your Modex notes (knowledge:useNotes).
  • When the knowledge base is the notes folder, a page's menu says Open in knowledge base (a deep link to its own file) instead of copying, and knowledge:copy refuses.
  • The knowledge tools then stay inside each project's notes as well. Paths outside are refused before they reach the companion, and search reads the project's own files directly, so no other project's results can leak.
  • The routines spec now puts routine output in the routine project's notes.

Tests

  • Unit:
    • notes-projects.test.ts: linking, detach and relink, same-name projects, backfill on open, the workspace summary;
    • a scoped case in pages-agents.test.ts and in knowledge-agents.test.ts;
    • the CLI allowlist tests expect the new tools.
  • E2e: sidebar-workspaces.spec.ts passed locally: notes created on add, Open notes, a second workspace, Move to, collapsing, and remove keeping the notes. minimal-rail, workspace-store and app specs are updated for the Side panel labels.

Claude Code refuses Fable with "You're out of usage credits. Switch to
another model..." before running anything. Modex showed that as an
assistant bubble plus an "unknown" failure card and stopped.

Now, when the refusal arrives before any reply, tool or reasoning, the
runner reruns the turn on Opus in the same session, posts a warning
naming both models, and notes it on Auto's route receipt. Later Fable
turns start on Opus for an hour. A refusal after work started keeps its
failure card, so nothing runs twice. If Opus also fails, the card lists
the fallback under recovery.

The Claude backend drops the CLI's synthetic API-error reply, which the
failed result repeats. The classifier reads "out of usage credits" as
rate limited with its own summary. Settings > General can turn the
fallback off; it is on by default.

Coven-Harness: Claude Code / claude-opus-5-5
Exclude fallback notices from empty-reply detection and revise the open Auto route to the model that actually ran, without learning a user override. Verify cancellation and cooldown expiry. Include current main with the iPhone timing-budget fix.

Coven-Harness: Codex / GPT-6
Keep empty fallback replies retryable and record the actual Opus route without a false user override.

Coven-Harness: Codex / GPT-6
Build and full unit suites pass. Focused UI verification still encounters
intermittent native-show launch timeouts; preserved diagnostics show delayed
actual event delivery under high host load. Keep existing assertions intact
and require fresh CI before landing. Independent integration review cleared.

Coven-Harness: Codex / GPT-6
Preserve the reviewed fallback fixes while integrating thread deletion and archive behavior. Cover pending credit refusal during owner-removal admission.

Coven-Harness: Codex / GPT-6
Tree-identical to the verified review head 2d05bc9; preserve original branch history for delivery.

Coven-Harness: Codex / GPT-6
Preserve the reviewed fallback, archive, and owner-removal behavior with the
landed Knowledge and Space changes. Independent integration review cleared.

Coven-Harness: Codex / GPT-6
The first slice of notes in folders. NotesStore keeps SpaceStore's page
contract (ids, revisions, 30-second typing checkpoints, cascading trash
and restore, revert, comments, the same error texts) over a folder laid
out Workspace > Project > folders, with Personal > Notes as the default.

Each note carries modex_id frontmatter, so moves, renames and crashes
never lose which page a file is; a page with children is a folder that
holds a folder note of the same name. Version history, comments, trash
batches and a last-seen index live in .modex/. Writes go history, note,
index, and reading finishes whatever a crash interrupted. Edits, moves,
new files and deletions made outside Modex become versions of their
own. Migration builds the folder beside notes/ from app/space.json and
publishes it with one rename, never writes space.json, keeps a backup,
and recovers pages an older build changes later.

Modex does not use it yet; SpaceStore now exports its reader and
validators and a SpacePagesStore interface for the switch.

Coven-Harness: Claude Code / claude-opus-5-5
Retain both reviewed status entries. Combined build and full unit suite pass. Local UI verification remains incomplete after native-show and test timeouts under extreme host load; preserve traces and require fresh CI.

Coven-Harness: Codex / GPT-6
Store now holds a NotesStore over MODEX_HOME/notes instead of SpaceStore
over app/space.json; the space:* commands and the Pages tools keep their
contract. On first use, the pages of app/space.json move into
Personal > Notes and that file is never written again.

A page's file takes its title's name when the title loses focus or
another page opens (notes:settle); typing never renames files. Version
history labels edits made outside Modex "Outside Modex".

The e2e specs that read space.json now read the note files, and the
forced save failures refuse the history folder instead of replacing
space.json with a directory. New notes.spec covers the migration and an
edit made outside Modex.

Coven-Harness: Claude Code / claude-opus-5-5
NotesStore now lists the folder as workspaces, projects, folders, notes
and files (notes:tree, with a version for cheap polling). It can create
workspaces, projects and folders, create a page in a project or folder,
rename any container or file, move notes, folders and files into a
project or folder (projects into a workspace), and delete an empty
container. Workspace and project ids live in their marker files; other
folders and files keep theirs in the index, found again by path or by
inode after a Finder move. A moving page gets a version before its file
moves. Reveal in Finder and Open are local-only commands.

Coven-Harness: Claude Code / claude-opus-5-5
Space's sidebar now lists Workspace > Project > Folder > pages and
files from notes:tree, polled like pages. Space options can create a
workspace; a row's menu creates a project, folder or page in place,
renames (edited inline), moves (Move to... lists only valid places),
reveals in Finder, and deletes what is empty. A page opens as before, a
folder with a folder note opens that page, and a file opens in its
default app. Container rows are named by their name alone so they never
collide with a page of the same title. If the tree cannot load, the
previous page tree remains.

Coven-Harness: Claude Code / claude-opus-5-5
ChatGPT copies its citations as private-use marker characters around
source IDs that only resolve inside that conversation, so pasted and
imported pages showed them as boxes followed by IDs like turn5view0.
Pasting into a block and importing Markdown now drop those markers,
and entity markers keep their visible name.

Pasting a whole report into a page title used to flatten its lines into
one and cut it at 200 characters. The title now keeps the first line,
without a heading marker, and the rest goes to the top of the page.

Coven-Harness: Claude Code / claude-opus-5-5
Adding a project now gives it a notes project in the default workspace
(existing projects get one when notes first open); removing it keeps the
notes, unlinked, and adding the same folder again links them back. The
chat sidebar groups projects under their workspaces once there is more
than one, and a project's menu offers Open notes and Move to <workspace>.
With one workspace the sidebar is unchanged.

The thread's right-hand panel is relabelled "Side panel" (and the Store
app's menu with it), so "workspace" means one thing; internal names and
shortcuts are unchanged.

Coven-Harness: Claude Code / claude-opus-5-5
The Pages tools now resolve the turn's project's notes once, when the
turn starts, and stay inside them: search lists only that project's
notes, reading or changing another project's note is refused, and a new
note goes at the top of the project's notes. New tools list a folder,
create folders, move a note or folder within the project, and read text
files (UTF-8, up to 1 MB). Tools still address notes by ID, never by
path, and there is still no binary write or permanent delete.

Coven-Harness: Claude Code / claude-opus-5-5
Space > Knowledge base offers "Use your Modex notes", which makes the
notes folder the Open Knowledge folder, so Space and the knowledge base
are one set of files. A page's menu then offers "Open in knowledge base"
(the page's own file) instead of a copy, and knowledge:copy refuses.

With the notes folder as the knowledge base, each project's agents
read, write and search only that project's notes through the knowledge
tools as well: paths outside are refused before reaching the companion,
and search reads the project's files directly. The routines spec now
puts routine output in the routine project's notes.

The CLI allowlist tests now expect the Pages folder tools added for
project-scoped agents.

Coven-Harness: Claude Code / claude-opus-5-5
# Conflicts:
#	apps/desktop/src/main/commands.ts
#	apps/desktop/src/main/index.ts
#	apps/desktop/src/shared/types.ts
#	apps/store-desktop/src/main/demo.ts
#	docs/status.md
Retry the menu opener once within its existing deadline, retaining the actual menu-item assertion and guarding delayed presentation. Cover ignored taps, delayed opening and deadline overruns.

Coven-Harness: Codex / GPT-6
The runner prepares Pages on every turn, and preparing now links the project's notes. A
symlinked notes folder or a corrupt marker made that throw, which failed every turn in
every project, even with Agent notes off. Preparing now records the error on the lease;
each Pages call refuses with it instead of running unscoped.

Coven-Harness: Claude Code / claude-opus-5-5
The focus effect re-ran whenever the tree changed, and any page save makes a new tree on
the next 1.5-second poll. After Open notes, typing in another project's page kept
re-expanding the requested project and scrolling the tree back to it, and its row stayed
highlighted. Each request is now a new object, applied once, and opening a page clears it.

Coven-Harness: Claude Code / claude-opus-5-5
Each folder and file looked itself up by searching the whole id index, by path and then by
inode, and each sibling group was copied on every insert. A layout runs on Space polls,
at turn start and in the image handler, and with 9,900 files it took 21 to 51 seconds on
the main process. The index is now read into path and inode maps once per layout and
kept current as ids move. The same folder lays out in about 0.25 seconds.

Coven-Harness: Claude Code / claude-opus-5-5
Its tree equals #226's final head 8cdaef5, which this branch already contains.

Coven-Harness: Claude Code / claude-opus-5-5
Coven-Harness: Claude Code / claude-opus-5-5
Include native window paint and geometry readiness plus paired iPhone menu recovery. Full build and units passed; 302 desktop E2E cases and 7 website cases passed.

Coven-Harness: Codex / GPT-6
Files in notes: import, preview, drag to move, page images, and a folder watcher
Coven-Harness: Claude Code / claude-opus-5-5
@BunsDev BunsDev changed the title Give each project its own notes, keep its agents in them, and let Knowledge open them Give each project its own notes, and bring files into notes (#230, #238) Oct 15, 2026
@BunsDev
BunsDev changed the base branch from main to release-reviewed-batch October 15, 2026 18:26
Four conflicts, each resolved by keeping both sides:
- index.html: the image CSP allows both modex-notes: (page images) and modex-image: (Images assets).
- markdown.ts: web URLs and modex-image asset URLs pass through; any other image path is resolved
  beside the page by localImage, which blanks anything it cannot serve.
- App.tsx and SpaceView.tsx: SpaceView takes both openProject (Open notes) and onOpenImages.

Coven-Harness: Claude Code / claude-opus-5-5
Ported from the Codex review branch notes-final-review (caba43e). The earlier fallback kept
the error message only, so an exception with an empty message, or a non-Error throw, left
the lease without an error and its calls ran unscoped. Every exception shape now records
a reason. SpaceView now consumes each Open notes request, so a tree that remounts after a
search or filter does not replay it. Adds regressions for both, and for the layout keeping
ids from the cached index.

Coven-Harness: Claude Code / claude-opus-5-5
@BunsDev
BunsDev changed the base branch from release-reviewed-batch to main October 15, 2026 19:32
@BunsDev
BunsDev merged commit a2140e6 into main Oct 15, 2026
5 checks passed
@BunsDev
BunsDev deleted the notes-projects branch October 15, 2026 19:33
BunsDev added a commit that referenced this pull request Oct 15, 2026
…ts (#246)

Follow-ups from a code review of the notes stack (#222, #226, #227, #230).

Knowledge tools fence by real paths: a document path that lands in the notes
folder must land in the turn's own project, whether the knowledge base is the
notes folder, a workspace inside it, a folder that holds it, or a content.dir
inside it. Search over such a base is read locally, asynchronously and
bounded, skipping other projects' notes. Before, only a base that was exactly
the notes root was confined, and a content.dir broke the prefix.

Pages and knowledge tools look up the project's notes on every call, so
moving them to another workspace mid-turn no longer refuses every call. A
read-only turn finds the project's notes without making them, and an unknown
project gets none rather than every project's.

NotesStore: a copied workspace or project folder gets its own id instead of
making the store unreadable; detachProject drops the cached look;
linkProject answers from the last look when already linked; the watcher
ignores dot folders (.modex, .ok, .git) but not markers; pageRels() serves a
whole call. The sidebar hides a workspace whose projects a filter hides.

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — 3c39b614 Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant