Repository navigation
The create opens a branch session: one vocabulary, applied twice - #152
Conversation
Brett's first real create landed in the served checkout on main — untracked, with no branch session — after I had promised repeatedly that it would branch. ONE SILENT VOCABULARY MISMATCH. `createRequest` maps the TILE spelling to the session one through `SESSION_SCOPE_KINDS` (`staged` -> `staged-topic`), and the lens handed it the ALREADY-MAPPED spelling. `SESSION_SCOPE_KINDS ["staged-topic"]` is undefined, so `sessionScopeKind` returned "", the `if (scopeKind && scopeId)` guard dropped BOTH fields from the wire, and `create-document` — seeing no scope at all — took its documented pre-session path and wrote into the served checkout. Nothing refused. Nothing warned. A create with no scope is a legitimate call, so every layer behaved correctly on the information it was given, and the only way to see it was to make a real document and look at `git status`. PROVEN ON THE REAL PLANE this time, not inferred from the code path: ok: True ref: draft/session-probe path: ideation/staging/session-probe/... branch `draft/session-probe` + its session worktree exist the document is ABSENT from the served checkout The probe's branch and worktree were removed after the check. The test pins the two spellings against each other — the lens's value must be a KEY of the map and never one of its values — so the mapping cannot be applied twice again. WHAT THIS DOES NOT UNDO: Brett's `campaign-marketing.md` and its gate record are still untracked in the served checkout, where the old path put them. They are his to commit or discard; nothing here moves them. Suites 2823 passed (exit 0). Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
Fixes a subtle “scope kind vocabulary” mismatch that previously caused create-document to omit session scope fields and fall back to the pre-session create path (writing into the served checkout on main). The update aligns the lens seed’s scopeKind with the tile vocabulary expected by the SESSION_SCOPE_KINDS mapping, and adds a regression test to prevent the mapping from being applied twice.
Changes:
- Update
lens.jsto emitscopeKind: "staged"(tile vocabulary) and document the failure mode when the already-mapped session spelling is provided. - Update existing test expectations to match the lens’s tile-vocabulary spelling.
- Add a regression test pinning that the lens uses a
SESSION_SCOPE_KINDSkey and thatcreateRequestapplies the mapping exactly once.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/ideation-dashboard/test_bullseye_widget.py |
Updates assertions for scopeKind and adds a regression test preventing double-mapping of scope vocabulary. |
scripts/ideation_dashboard/web/views/lens.js |
Switches lens seed scopeKind to the tile spelling (staged) and adds explanatory comments about the session-opening behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| assert untagged[field], field | ||
|
|
||
|
|
||
| def test_the_lens_names_its_scope_in_the_tile_vocabulary_so_a_session_opens(tmp_path): |
…ays so (#156) Two defects behind one report ("i get the same error"), both read out of the serve log after the console-token repair landed. Neither is the token: no console refusal has occurred since the page reloaded on the fixed bundle. THE SESSION VIEW NEVER OPENED. A create from a PROJECT view landed — `200`, `draft/company-provisioning-…` opened, its snapshot generated — and the page then asked: GET /snapshot.json?repository=xfactory&ref=draft/company-provisioning-… -> 404 no such snapshot `xfactory` is a PROJECT id, not a repository; the session is registered as `openxFactory @ draft/company-provisioning-…`. So the create succeeded and its document view could not be loaded. This is #152's ruling one step later in the flow. The create already asks the serve which repository it writes to (lens.js `writableRepository`, because under a composed view the rendered snapshot's `repository` is the project id). The RE-KEY that follows the create still inferred: it read the view's own key, and under a composed view `sourceKeyFor(null)` is null, so it fell through to the project id. `rekeyToSession` now reads the serve's own declaration first. A session ref can exist ONLY in the repository the serve writes to — a create naming any other is refused by `refuse_foreign_repository` — so this is the one authority, and the test pins the wire fact it rests on: a session snapshot answers to its owning repository and to no other name. A RUNNING WRITE NOW SAYS SO. Brett pressed create twice, and the log says what that cost: 23:51:40 press one opens the session 23:51:41 document written, committed 23:51:42 session snapshot regenerated 23:51:54 press two -> 409 corpus documents are create-only 23:53:11 press one -> 200 The first answer he read was the refusal of his own duplicate, for work that had in fact landed — and the create that landed answered 77 seconds later. The cause is that a create OPENS A BRANCH SESSION (worktree, branch, commit, regenerated snapshot) and all the button did was grey out: `disabled` says "not now" and nothing about "working", so a second create dialog was pressed. The create and the three session verbs now carry a running label while the request is in flight, restored in `finally` so a refusal is retriable in place with its own words back on the button — the shape notebook.js already used ("opening NotebookLM…"). The duplicate itself is still refused, and correctly: the create is create-only inside a session too (FR-018). Suites: tests/ideation-dashboard + tests/ideation_dashboard — 2831 passed, 19 skipped (exit 0). The stranded-page browser proof re-run against a scratch checkout: 10/10, zero page errors. Co-authored-by: brettheap <[email protected]>
Your first real create landed in the served checkout on main — untracked, no branch session — after I promised repeatedly that it would branch.
One silent vocabulary mismatch
createRequestmaps the tile spelling to the session one throughSESSION_SCOPE_KINDS(staged→staged-topic). The lens handed it the already-mapped spelling.SESSION_SCOPE_KINDS["staged-topic"]is undefined, sosessionScopeKindreturned"", theif (scopeKind && scopeId)guard dropped both fields from the wire, andcreate-document— seeing no scope at all — took its documented pre-session path and wrote into the served checkout.Nothing refused. Nothing warned. A create with no scope is a legitimate call, so every layer behaved correctly on the information it was given. The only way to see it was to make a real document and read
git status.Proven on the real plane this time
The probe's branch and worktree were removed after the check.
The test pins the two spellings against each other — the lens's value must be a key of the map, never one of its values — so the mapping can't be applied twice again.
What this doesn't undo
campaign-marketing.mdand its gate record are still untracked in your checkout, where the old path put them. Yours to commit or discard; nothing here moves them.Verification
pytest— 2823 passed, 19 skipped, exit 0.