Finding slug: museion/home-repoint-retains-old-editor-target (argus cycle-5, museion-bugs.md finding 1 — HIGH, certain). Unticketed: no issue exists for it, so this PR carries no "Fixes #N"; the slug is the key.
Branch: fix/home-repoint-retains-old-editor-target @ cac66f6e76
6 linear commits on main — bce6abb test RED · 8b0d43a fix + sweep + GREEN · 1080752 docs · 97712fb docs · 92344e2 review r1 (seam + 2 pins) · cac66f6 docs r1
Base (merge-base, = main at review time): ca265d3bd3
Target: main
THE FINDING
Settings → Content → Choose… committed the new Home and the root .task(id: museionHome) → bind → startWatching flipped watchedHome WITHOUT departing the open session (the seam as it stood at ca265d3: SettingsPaneView.swift:291 home = url wrote $gate.museionHome straight into AppGateState.museionHome, whose didSet persists at once; WorkspaceView.swift:162 bound the model). The session's immutable SessionTarget kept the OLD Home, so under the new UI:
a same-slug piece in the new library made select's ID-only reselect (session.postID == id) return the retained A session — autosave/Save/quit wrote A while structural operations resolved against B;
the new library's rescan read B's same-slug post.md for the A session and raised a spurious reload conflict (#67) on it;
a no-collision piece was torn down by the vanish path with its dirty buffer dropped (data loss);
a card scan started under A could land its cards on B's same-slug piece when it completed after a reselect (the ID-only hop-back guard).
#198's departure gate never saw this seam — it guards navigations, not the Home binding.
THE FIX
Gate first, commit after. No parallel gate: the same sessionMayDepart legs the navigations and quit ride.
PostsModel.repoint(to:) -> Bool (Museion/PostsModelWatcher.swift:100) — departOpenDocuments() FIRST; false = lastError says why and NOTHING changed (preference, binding, the session's (Home, ID) target and buffer all stay). On true the departed piece's state is cleared (selectedPostID, cards, snapshot flag, the held outline guard, prose override, staged conversion, outline afterglow, pendingProject) and nothing auto-reopens.
AppGateState.repointMuseionHome(to:) (Museion/HomeResolution.swift:93) — guard posts.repoint(to:) runs BEFORE museionHome = newHome; the preference and its persistence commit only on true. This is the ONE runtime repoint entry.
WorkspaceView (Museion/WorkspaceView.swift:260 homeRepointBinding, wired at :339) — the Settings Home control's binding setter IS the gate; a refusal presents one hosted-guarded NSAlert carrying posts.lastError (the #200 quit-refusal posture — no Posts strip is in sight from Settings). The root .task(id: museionHome) binds the model after the commit. bind stays the dumb binder.
Document identity is (Home, ID): EditorSession.targets(postID:home:) / targets(home:) (Museion/EditorSession.swift:72) and PostsModel.openSessionTargets(_:) (Museion/PostsModelIdentity.swift:21, new). Every model-side bare session.postID == compare is retired — select, the structural rail, conversion, flushOrAbort, the pass guard, Micropub's launch, the card refresh.
Async continuations re-validate at COMPLETION: the card hop-back (PostsModelCards.swift:47); rescan's stale-Home verdict hoisted (PostsModelWatcher.swift:171) so a scan that outlived a repoint applies NOTHING — list, revision and #67 text alike, not just the vanish check; the #67 disk read runs only for a session targeting the scan's own Home.
Test seams (review r1): PostsModel.scanPieceCards and PostsModel.scanLibrary — per-model injectable scanners, defaulting to the production functions, so the two stale-result pins can HOLD an old-library scan past a repoint deterministically. Zero production logic; behaviour is unchanged unless a test injects.
IMPLEMENTER DISCLOSURES
Decisions (the brief left these to the implementer: state the choice + why):
Gate in the Settings binding's setter + repointMuseionHome, NOT in bind — the gate must precede the preference commit (museionHome.didSet persists immediately). A gate inside bind would leave museionHome = B while watchedHome = A: the UI showing a Home the model isn't watching.
sessionMayDepart via departOpenDocuments — no parallel gate. One gate, three legs (unanswered #67, failed flush, never-loaded retype), #198's strings.
Nothing auto-reopens after an accepted repoint — auto-reopening B's same-slug piece would be a NEW UX (the writer never chose it) and cannot be decided at gate time (B isn't scanned until bind + rescan land). selectedPostID = nil is the existing departure semantics.
The in-memory draft SURVIVES a repoint — a draft has no Home until first save (#62); it lands in the new library. The alternatives — dropping the only copy, or refusing the repoint (new UX) — are worse. pendingProject (a stale A project name) IS cleared.
A running pass / Blind Read is NOT cancelled by the repoint — the session departs; the engine turn keeps its own completion guard (#179: the advance refuses once watchedHome moved).
pendingImportURLs / askNewProject left alone — both are sheet-modal, so a repoint cannot be requested while either is up; neither is piece-specific.
Refusal = one NSAlert (the #200 posture), not a Settings strip — Settings shows no lastError strip; a silent Choose… would be the dishonest outcome.
Micropub (Museion/Micropub.swift:249 micropubSendDraft): identity at LAUNCH; the completion stamp (stampMicropubURL(id:home:) after the awaits) keeps the CAPTURED pair — the piece actually sent — correct by construction. Re-validating against the live session would skip a correct write after a mid-send repoint. Left as is.
PostsPaneView.swift:125 (session.postID == model.selectedPostID, the editor column's render gate) NOT converted: a synchronous render gate on the same pair, correct by construction under the gate-first invariant (the open session always targets watchedHome), in a file outside this branch's footprint. Accepted by review.
NOT RUN / UNVERIFIED
The preference leg (repointMuseionHome and the Settings binding) is verified STRUCTURALLY ONLY (read, not unit-pinned): AppGateState.museionHome.didSet writes the REAL UserDefaults.standard, so a hosted test driving a repoint through AppGateState would point the owner's next launch at a temp dir. The model legs the gate composes from are pinned.
No GUI reproduction of the Settings flow; the MuseionUITests smoke is outside the rail by design.
GitNexus impact / detect_changes were NOT run: .gitnexus/run.cjs is absent at base and no GitNexus capability is exposed. The blast radius was hand-traced.
WHAT THE TESTS PROVE — AND WHAT THEY DO NOT
PostsModelRepointTests (9, new file) over a two-Home rig (projects/posts/shared/post.md in BOTH libraries, differing bodies):
a same-slug piece opens from the new library after a repoint and saves there, never the old one — flush AND quit.
repoint refuses when the open piece's flush fails and changes nothing — ordering pinned: watchedHome, selection, the (Home, ID) target and the buffer are untouched.
repoint refuses while the conflict alert is unanswered (#67).
repoint refuses over a never-loaded session with retyped text.
a no-collision repoint lands the open piece's edits first and tears it down cleanly (the old vanish path dropped the dirty buffer).
a card scan from the old library never lands on the new library's same-slug piece — the completion re-check, mutation-checked.
a pass started after the repoint runs against the new library.
(review r1) a library scan from the old Home lands nothing under the new binding — the hoisted rescan verdict, mutation-checked.
(review r1) an in-memory draft survives a repoint and first-saves into the new library only, in a project B did not have yet.
Plus the existing PostsModelWriteRailTests pin home repoint mid-pass refuses the advance, which now drives the production seam (repoint(to:) then bind); its assertions are unchanged — the lastError == line is what catches a missing #179 guard.
"Identity everywhere" is NOT "every site test-verified". Three evidence classes:
PINNED (mutation-checked): the refreshCards hop-back; rescan's hoisted stale-Home verdict; the #179 mid-pass advance guard.
CORRECT BY CONSTRUCTION (not independently pinnable): Micropub's completion stamp.
INVARIANT-EQUIVALENT DEFENSIVE DEPTH (never independently observable): the whole synchronous identity sweep and rescan's openPostID gate. Under the gate-first invariant a live session always targets watchedHome, so the ID-only and identity forms agree on every reachable state. A review probe removed openPostID's gate and reverted select to ID-only: the full rail stayed green. These sites are belt to the gate's suspenders — any future path that flips the Home without departing the session falls through to a departure instead of matching across libraries. Correct as design; not test-verified.
Test-hygiene note (non-blocking): the two stale-scan pins settle on a 200 ms sleep, the suite's existing pattern. Under heavy load they can pass vacuously; they never fail falsely. Both mutation checks were run unloaded and bite.
VERIFICATION
Evidence class per run — [reviewer] = this review seat's own run in its own clone (cold DerivedData); [implementer] = the implementer's reported run.
[reviewer] Full rail at cac66f6 — ./scripts/full-test.sh start then ./scripts/full-test.sh status:
717 executed / 717 passed / 0 failed / 0 skipped (xcodebuild exit 0)
summary.json: result Passed, totalTestCount 717 · ** TEST SUCCEEDED **
PostsModelRepointTests 9/9 · PostsModelDepartureTests 10/10 · PostsModelWriteRailTests 5/5
[reviewer] RED at the base state — a FULL rail at bce6abb (= ca265d3 + the RED pins + the identity predicate; no fix):
714 executed / 708 passed / 6 failed / 0 skipped (xcodebuild exit 65), 0 compile errors
The 708 pre-existing tests are green on pre-fix code; exactly the 6 RED pins fail, each on the finding's signature:
no-collision pin: A's disk still holds the untyped body (dirty buffer dropped);
same-slug pin: session.text → "A body, typed in A" under the B binding;
pass-after-repoint pin: session.text → "A body" (the retained A session);
the three refusal pins: watchedHome → …/B despite the failed flush / unanswered conflict / never-loaded retype.
[reviewer] Mutation A at cac66f6 — hoisted guard watchedHome == home removed, filtered to PostsModelRepointTests:
9 executed / 8 passed / 1 failed — ONLY pin 8: model.posts.map(\.id) → ["alpha"] (A's list under the B binding).
Restored byte-exact: PostsModelWatcher.swift sha256 prefix d86ce09d6b7e6bd2.
[reviewer] Mutation B at cac66f6 — card completion guard reverted to ID-only, filtered to PostsModelRepointTests:
9 executed / 8 passed / 1 failed — ONLY pin 6: openPieceCards → ["Hedging"] (A's cards on B's piece).
Restored byte-exact: PostsModelCards.swift sha256 prefix 9c8fb55264f5ac1c.
[reviewer] Mutation C at 97712fb (round-1 probe, before the r1 commits): hoist removed + openPostID gate removed + select reverted to ID-only — full rail 715 / 715, all three survived.
The first two are invariant-equivalent and expected to survive; the hoist was live logic with no pin, which is why review round 1 was a fix-it and added the seam and pin 8.
[reviewer] Lint at cac66f6: swiftformat --lint . → 0/152 files require formatting; swiftlint lint --quiet --no-cache → 0 violations. Both with a positive control: a planted 3-tuple in-tree reported exactly one large_tuple, then was removed.
[reviewer] Coupling guard: Museion/PostsModelImports.swift and Museion/PostStore.swift are byte-identical ca265d3..cac66f6. The HELD cycle-5 finding museion/external-watch-compares-unnormalized-text (PostsModelImports.swift:69-70, readBody's representation) is NOT in this diff.
[implementer] Full rail 717/717 at 92344e2 (Swift byte-identical to cac66f6); filtered 19/19 (repoint + departure); mutation 9/8/1; lint 0/0 — all reproduced above.
REVIEW RECORD
Review seat: @athena, independent of the implementing agent (@daedalus). Diff compared against ca265d3bd3. The branch is the only in-flight museion change (disjoint case).
Round 0 (reviewed 97712fb) — verdict: fix it.
MF-1 the rescan stale-Home hoist was live logic with no pin: with it removed the full rail stayed 715/715 (Mutation C). fix it → fixed in 92344e2 (seam + pin 8, Mutation A).
N-1 pin the draft-survives-repoint decision → pin 9.
N-2 disclose pinned vs by-construction vs invariant-equivalent identity checks → done (devlog section "Identity checks — evidence classes").
N-3 regenerate the owner-apply AGENTS.md patch for the new seam + pins → done.
Round 1 (reviewed cac66f6) — verdict: SHIP. Every round-0 item closed; every implementer claim re-run and reproduced by the review seat. No pushbacks were raised; no new findings.
Rounds used: 1 of 3.
No functional defect was found in the fix. Accepted as-is: PostsPaneView:125 (not converted), the Micropub stamp (by construction), and the implementer's decisions above.
Scope appendix — every out-of-brief site → ruling, reason, ledger action:
PostsPaneView.swift:125 render gate (ID-only session.postID == selectedPostID) → NOT converted, ruling: agree.
Reason: synchronous read of the same pair; equivalent under the gate-first invariant; the file is outside this branch's footprint.
Ledger: closed — not a live site once brief-28 lands; no code action.
View nil-checks on session?.postID != nil (FixCardsWindow.swift:30, MentorPaneView.swift:506/540/576, PostEditorView.swift:304/387) → not sites of this class.
Reason: existence checks, not identity compares; session.folderURL/passPieceURL derive from the session's OWN target.
Ledger: none.
rescan hoist (PostsModelWatcher.swift:171) → in scope (async result guard, same defect class, file already in the footprint) and PINNED in round 1. Not a shed.
scanPieceCards / scanLibrary seams (PostsModel.swift) → in scope: mechanical, default to the production functions, zero logic.
guardOpenPieceRun 3-tuple with an inline large_tuple suppression (PostsModelPasses.swift:27-28) → in scope: behaviour-preserving; the returned home equals the session's Home by the identity guard. Not raised.
Micropub launch identity + captured-pair stamp → in scope, correct by construction. Agree.
PostsModelTests.swift +4/-1 → the existing pin follows the new production seam; no assertion weakened. Accept.
newProjectPending(named:) leaving pendingProject set when the departure gate refuses a new post → NOT in this diff (devlog prose only; no production hunk touches it). Confirmed.
Ledger: stays with @aegis as the cycle-6 dedupe candidate.
Observations outside this diff, pre-existing on main, no action requested:
(a) between bind and the new Home's first rescan the list still shows the old library for one scan (self-heals);
(b) a successful repoint does not clear a stale lastError;
(c) EditorSession.swift:292-300 adoptText carries a duplicated comment block.
Automated PR-review bot comments: none at creation. If a bot comments later, its disposition belongs in a review comment on this PR.
OWNER-APPLY: AGENTS.md DOX
The branch does NOT touch any AGENTS.md. The docs pass ships as an owner-apply patch only (consent-gated write; never written by an agent on the branch):
git apply --check against cac66f6: CLEAN. 3 files (AGENTS.md, Museion/AGENTS.md, MuseionTests/AGENTS.md), 5 hunks, 69 lines — regenerated in review r1 for the scanLibrary seam and the two r1 pins. Moment-scoped like mergeability: if main touches these docs before you apply, re-run the check first.
MERGEABILITY
git merge-tree --write-tree ca265d3 cac66f6 → exit 0 (clean) at trunk ca265d3bd3, which has not moved since dispatch. That claim is scoped to that trunk SHA: if main advances into this branch's files before the merge, re-probe before merging.
Alexander merges. No agent merges or pushes main.
[Generated by AI]
PR Type
Bug fix, Tests, Documentation
Description
Home repoint now rides the departure gate before committing
Document identity is (Home, ID) across the whole model
Rescan and card scans re-check identity at async completion
Nine new repoint pins over a two-Home same-slug rig
<!-- pr-agent-generated -->
### **User description**
================================================================================
museion/home-repoint-retains-old-editor-target
================================================================================
Finding slug: museion/home-repoint-retains-old-editor-target (argus cycle-5, museion-bugs.md finding 1 — HIGH, certain). Unticketed: no issue exists for it, so this PR carries no "Fixes #N"; the slug is the key.
Branch: fix/home-repoint-retains-old-editor-target @ cac66f6e764ae3486cf86db024b99a188fd556d4
6 linear commits on main — bce6abb test RED · 8b0d43a fix + sweep + GREEN · 1080752 docs · 97712fb docs · 92344e2 review r1 (seam + 2 pins) · cac66f6 docs r1
Base (merge-base, = main at review time): ca265d3bd359e663216aa91d4778e2bdef8a36eb
Target: main
--------------------------------------------------------------------------------
THE FINDING
--------------------------------------------------------------------------------
Settings → Content → Choose… committed the new Home and the root `.task(id: museionHome)` → `bind` → `startWatching` flipped `watchedHome` WITHOUT departing the open session (the seam as it stood at ca265d3: SettingsPaneView.swift:291 `home = url` wrote `$gate.museionHome` straight into `AppGateState.museionHome`, whose `didSet` persists at once; WorkspaceView.swift:162 bound the model). The session's immutable `SessionTarget` kept the OLD Home, so under the new UI:
- a same-slug piece in the new library made `select`'s ID-only reselect (`session.postID == id`) return the retained A session — autosave/Save/quit wrote A while structural operations resolved against B;
- the new library's rescan read B's same-slug `post.md` for the A session and raised a spurious reload conflict (#67) on it;
- a no-collision piece was torn down by the vanish path with its dirty buffer dropped (data loss);
- a card scan started under A could land its cards on B's same-slug piece when it completed after a reselect (the ID-only hop-back guard).
#198's departure gate never saw this seam — it guards navigations, not the Home binding.
--------------------------------------------------------------------------------
THE FIX
--------------------------------------------------------------------------------
Gate first, commit after. No parallel gate: the same `sessionMayDepart` legs the navigations and quit ride.
- `PostsModel.repoint(to:) -> Bool` (Museion/PostsModelWatcher.swift:100) — `departOpenDocuments()` FIRST; false = `lastError` says why and NOTHING changed (preference, binding, the session's (Home, ID) target and buffer all stay). On true the departed piece's state is cleared (`selectedPostID`, cards, snapshot flag, the held outline guard, prose override, staged conversion, outline afterglow, `pendingProject`) and nothing auto-reopens.
- `AppGateState.repointMuseionHome(to:)` (Museion/HomeResolution.swift:93) — `guard posts.repoint(to:)` runs BEFORE `museionHome = newHome`; the preference and its persistence commit only on true. This is the ONE runtime repoint entry.
- WorkspaceView (Museion/WorkspaceView.swift:260 `homeRepointBinding`, wired at :339) — the Settings Home control's binding setter IS the gate; a refusal presents one hosted-guarded `NSAlert` carrying `posts.lastError` (the #200 quit-refusal posture — no Posts strip is in sight from Settings). The root `.task(id: museionHome)` binds the model after the commit. `bind` stays the dumb binder.
- Document identity is (Home, ID): `EditorSession.targets(postID:home:)` / `targets(home:)` (Museion/EditorSession.swift:72) and `PostsModel.openSessionTargets(_:)` (Museion/PostsModelIdentity.swift:21, new). Every model-side bare `session.postID ==` compare is retired — select, the structural rail, conversion, `flushOrAbort`, the pass guard, Micropub's launch, the card refresh.
- Async continuations re-validate at COMPLETION: the card hop-back (PostsModelCards.swift:47); `rescan`'s stale-Home verdict hoisted (PostsModelWatcher.swift:171) so a scan that outlived a repoint applies NOTHING — list, revision and #67 text alike, not just the vanish check; the #67 disk read runs only for a session targeting the scan's own Home.
- Test seams (review r1): `PostsModel.scanPieceCards` and `PostsModel.scanLibrary` — per-model injectable scanners, defaulting to the production functions, so the two stale-result pins can HOLD an old-library scan past a repoint deterministically. Zero production logic; behaviour is unchanged unless a test injects.
--------------------------------------------------------------------------------
IMPLEMENTER DISCLOSURES
--------------------------------------------------------------------------------
Decisions (the brief left these to the implementer: state the choice + why):
- Gate in the Settings binding's setter + `repointMuseionHome`, NOT in `bind` — the gate must precede the preference commit (`museionHome.didSet` persists immediately). A gate inside `bind` would leave `museionHome` = B while `watchedHome` = A: the UI showing a Home the model isn't watching.
- `sessionMayDepart` via `departOpenDocuments` — no parallel gate. One gate, three legs (unanswered #67, failed flush, never-loaded retype), #198's strings.
- Nothing auto-reopens after an accepted repoint — auto-reopening B's same-slug piece would be a NEW UX (the writer never chose it) and cannot be decided at gate time (B isn't scanned until `bind` + rescan land). `selectedPostID = nil` is the existing departure semantics.
- The in-memory draft SURVIVES a repoint — a draft has no Home until first save (#62); it lands in the new library. The alternatives — dropping the only copy, or refusing the repoint (new UX) — are worse. `pendingProject` (a stale A project name) IS cleared.
- A running pass / Blind Read is NOT cancelled by the repoint — the session departs; the engine turn keeps its own completion guard (#179: the advance refuses once `watchedHome` moved).
- `pendingImportURLs` / `askNewProject` left alone — both are sheet-modal, so a repoint cannot be requested while either is up; neither is piece-specific.
- Refusal = one `NSAlert` (the #200 posture), not a Settings strip — Settings shows no `lastError` strip; a silent Choose… would be the dishonest outcome.
- Micropub (Museion/Micropub.swift:249 `micropubSendDraft`): identity at LAUNCH; the completion stamp (`stampMicropubURL(id:home:)` after the awaits) keeps the CAPTURED pair — the piece actually sent — correct by construction. Re-validating against the live session would skip a correct write after a mid-send repoint. Left as is.
- PostsPaneView.swift:125 (`session.postID == model.selectedPostID`, the editor column's render gate) NOT converted: a synchronous render gate on the same pair, correct by construction under the gate-first invariant (the open session always targets `watchedHome`), in a file outside this branch's footprint. Accepted by review.
NOT RUN / UNVERIFIED
- The preference leg (`repointMuseionHome` and the Settings binding) is verified STRUCTURALLY ONLY (read, not unit-pinned): `AppGateState.museionHome.didSet` writes the REAL `UserDefaults.standard`, so a hosted test driving a repoint through `AppGateState` would point the owner's next launch at a temp dir. The model legs the gate composes from are pinned.
- No GUI reproduction of the Settings flow; the MuseionUITests smoke is outside the rail by design.
- GitNexus `impact` / `detect_changes` were NOT run: `.gitnexus/run.cjs` is absent at base and no GitNexus capability is exposed. The blast radius was hand-traced.
--------------------------------------------------------------------------------
WHAT THE TESTS PROVE — AND WHAT THEY DO NOT
--------------------------------------------------------------------------------
PostsModelRepointTests (9, new file) over a two-Home rig (`projects/posts/shared/post.md` in BOTH libraries, differing bodies):
1. a same-slug piece opens from the new library after a repoint and saves there, never the old one — flush AND quit.
2. repoint refuses when the open piece's flush fails and changes nothing — ordering pinned: `watchedHome`, selection, the (Home, ID) target and the buffer are untouched.
3. repoint refuses while the conflict alert is unanswered (#67).
4. repoint refuses over a never-loaded session with retyped text.
5. a no-collision repoint lands the open piece's edits first and tears it down cleanly (the old vanish path dropped the dirty buffer).
6. a card scan from the old library never lands on the new library's same-slug piece — the completion re-check, mutation-checked.
7. a pass started after the repoint runs against the new library.
8. (review r1) a library scan from the old Home lands nothing under the new binding — the hoisted `rescan` verdict, mutation-checked.
9. (review r1) an in-memory draft survives a repoint and first-saves into the new library only, in a project B did not have yet.
Plus the existing PostsModelWriteRailTests pin `home repoint mid-pass refuses the advance`, which now drives the production seam (`repoint(to:)` then `bind`); its assertions are unchanged — the `lastError ==` line is what catches a missing #179 guard.
"Identity everywhere" is NOT "every site test-verified". Three evidence classes:
- PINNED (mutation-checked): the `refreshCards` hop-back; `rescan`'s hoisted stale-Home verdict; the #179 mid-pass advance guard.
- CORRECT BY CONSTRUCTION (not independently pinnable): Micropub's completion stamp.
- INVARIANT-EQUIVALENT DEFENSIVE DEPTH (never independently observable): the whole synchronous identity sweep and `rescan`'s `openPostID` gate. Under the gate-first invariant a live session always targets `watchedHome`, so the ID-only and identity forms agree on every reachable state. A review probe removed `openPostID`'s gate and reverted `select` to ID-only: the full rail stayed green. These sites are belt to the gate's suspenders — any future path that flips the Home without departing the session falls through to a departure instead of matching across libraries. Correct as design; not test-verified.
- Test-hygiene note (non-blocking): the two stale-scan pins settle on a 200 ms sleep, the suite's existing pattern. Under heavy load they can pass vacuously; they never fail falsely. Both mutation checks were run unloaded and bite.
--------------------------------------------------------------------------------
VERIFICATION
--------------------------------------------------------------------------------
Evidence class per run — [reviewer] = this review seat's own run in its own clone (cold DerivedData); [implementer] = the implementer's reported run.
[reviewer] Full rail at cac66f6 — `./scripts/full-test.sh start` then `./scripts/full-test.sh status`:
717 executed / 717 passed / 0 failed / 0 skipped (xcodebuild exit 0)
summary.json: result Passed, totalTestCount 717 · `** TEST SUCCEEDED **`
PostsModelRepointTests 9/9 · PostsModelDepartureTests 10/10 · PostsModelWriteRailTests 5/5
[reviewer] RED at the base state — a FULL rail at bce6abb (= ca265d3 + the RED pins + the identity predicate; no fix):
714 executed / 708 passed / 6 failed / 0 skipped (xcodebuild exit 65), 0 compile errors
The 708 pre-existing tests are green on pre-fix code; exactly the 6 RED pins fail, each on the finding's signature:
no-collision pin: A's disk still holds the untyped body (dirty buffer dropped);
same-slug pin: `session.text → "A body, typed in A"` under the B binding;
pass-after-repoint pin: `session.text → "A body"` (the retained A session);
the three refusal pins: `watchedHome → …/B` despite the failed flush / unanswered conflict / never-loaded retype.
[reviewer] Mutation A at cac66f6 — hoisted `guard watchedHome == home` removed, filtered to PostsModelRepointTests:
9 executed / 8 passed / 1 failed — ONLY pin 8: `model.posts.map(\.id) → ["alpha"]` (A's list under the B binding).
Restored byte-exact: PostsModelWatcher.swift sha256 prefix d86ce09d6b7e6bd2.
[reviewer] Mutation B at cac66f6 — card completion guard reverted to ID-only, filtered to PostsModelRepointTests:
9 executed / 8 passed / 1 failed — ONLY pin 6: `openPieceCards → ["Hedging"]` (A's cards on B's piece).
Restored byte-exact: PostsModelCards.swift sha256 prefix 9c8fb55264f5ac1c.
[reviewer] Mutation C at 97712fb (round-1 probe, before the r1 commits): hoist removed + `openPostID` gate removed + `select` reverted to ID-only — full rail 715 / 715, all three survived.
The first two are invariant-equivalent and expected to survive; the hoist was live logic with no pin, which is why review round 1 was a fix-it and added the seam and pin 8.
[reviewer] Lint at cac66f6: `swiftformat --lint .` → 0/152 files require formatting; `swiftlint lint --quiet --no-cache` → 0 violations. Both with a positive control: a planted 3-tuple in-tree reported exactly one `large_tuple`, then was removed.
[reviewer] Coupling guard: Museion/PostsModelImports.swift and Museion/PostStore.swift are byte-identical ca265d3..cac66f6. The HELD cycle-5 finding `museion/external-watch-compares-unnormalized-text` (PostsModelImports.swift:69-70, `readBody`'s representation) is NOT in this diff.
[implementer] Full rail 717/717 at 92344e2 (Swift byte-identical to cac66f6); filtered 19/19 (repoint + departure); mutation 9/8/1; lint 0/0 — all reproduced above.
--------------------------------------------------------------------------------
REVIEW RECORD
--------------------------------------------------------------------------------
Review seat: @athena, independent of the implementing agent (@daedalus). Diff compared against ca265d3bd359e663216aa91d4778e2bdef8a36eb. The branch is the only in-flight museion change (disjoint case).
Round 0 (reviewed 97712fb) — verdict: fix it.
MF-1 the `rescan` stale-Home hoist was live logic with no pin: with it removed the full rail stayed 715/715 (Mutation C). fix it → fixed in 92344e2 (seam + pin 8, Mutation A).
N-1 pin the draft-survives-repoint decision → pin 9.
N-2 disclose pinned vs by-construction vs invariant-equivalent identity checks → done (devlog section "Identity checks — evidence classes").
N-3 regenerate the owner-apply AGENTS.md patch for the new seam + pins → done.
Round 1 (reviewed cac66f6) — verdict: SHIP. Every round-0 item closed; every implementer claim re-run and reproduced by the review seat. No pushbacks were raised; no new findings.
Rounds used: 1 of 3.
No functional defect was found in the fix. Accepted as-is: PostsPaneView:125 (not converted), the Micropub stamp (by construction), and the implementer's decisions above.
Scope appendix — every out-of-brief site → ruling, reason, ledger action:
- PostsPaneView.swift:125 render gate (ID-only `session.postID == selectedPostID`) → NOT converted, ruling: agree.
Reason: synchronous read of the same pair; equivalent under the gate-first invariant; the file is outside this branch's footprint.
Ledger: closed — not a live site once brief-28 lands; no code action.
- View nil-checks on `session?.postID != nil` (FixCardsWindow.swift:30, MentorPaneView.swift:506/540/576, PostEditorView.swift:304/387) → not sites of this class.
Reason: existence checks, not identity compares; `session.folderURL`/`passPieceURL` derive from the session's OWN target.
Ledger: none.
- `rescan` hoist (PostsModelWatcher.swift:171) → in scope (async result guard, same defect class, file already in the footprint) and PINNED in round 1. Not a shed.
- `scanPieceCards` / `scanLibrary` seams (PostsModel.swift) → in scope: mechanical, default to the production functions, zero logic.
- `guardOpenPieceRun` 3-tuple with an inline `large_tuple` suppression (PostsModelPasses.swift:27-28) → in scope: behaviour-preserving; the returned `home` equals the session's Home by the identity guard. Not raised.
- Micropub launch identity + captured-pair stamp → in scope, correct by construction. Agree.
- PostsModelTests.swift +4/-1 → the existing pin follows the new production seam; no assertion weakened. Accept.
- newProjectPending(named:) leaving `pendingProject` set when the departure gate refuses a new post → NOT in this diff (devlog prose only; no production hunk touches it). Confirmed.
Ledger: stays with @aegis as the cycle-6 dedupe candidate.
- Observations outside this diff, pre-existing on main, no action requested:
(a) between `bind` and the new Home's first rescan the list still shows the old library for one scan (self-heals);
(b) a successful repoint does not clear a stale `lastError`;
(c) EditorSession.swift:292-300 `adoptText` carries a duplicated comment block.
Automated PR-review bot comments: none at creation. If a bot comments later, its disposition belongs in a review comment on this PR.
--------------------------------------------------------------------------------
OWNER-APPLY: AGENTS.md DOX
--------------------------------------------------------------------------------
The branch does NOT touch any AGENTS.md. The docs pass ships as an owner-apply patch only (consent-gated write; never written by an agent on the branch):
git apply ~/daedalus-builds/museion/brief-28-agents-owner-apply.patch
`git apply --check` against cac66f6: CLEAN. 3 files (AGENTS.md, Museion/AGENTS.md, MuseionTests/AGENTS.md), 5 hunks, 69 lines — regenerated in review r1 for the `scanLibrary` seam and the two r1 pins. Moment-scoped like mergeability: if main touches these docs before you apply, re-run the check first.
--------------------------------------------------------------------------------
MERGEABILITY
--------------------------------------------------------------------------------
`git merge-tree --write-tree ca265d3 cac66f6` → exit 0 (clean) at trunk ca265d3bd359e663216aa91d4778e2bdef8a36eb, which has not moved since dispatch. That claim is scoped to that trunk SHA: if main advances into this branch's files before the merge, re-probe before merging.
Alexander merges. No agent merges or pushes main.
[Generated by AI]
___
### **PR Type**
Bug fix, Tests, Documentation
___
### **Description**
- Home repoint now rides the departure gate before committing
- Document identity is (Home, ID) across the whole model
- Rescan and card scans re-check identity at async completion
- Nine new repoint pins over a two-Home same-slug rig
___
### Diagram Walkthrough
```mermaid
flowchart TD
Settings["Settings Home control"] -- "binding setter is the gate" --> Gate["AppGateState.repointMuseionHome"]
Gate -- "posts.repoint departure gate" --> Verdict{"Every open document landed?"}
Verdict -- "No" --> Refuse["NSAlert refusal; nothing changes"]
Verdict -- "Yes" --> Commit["museionHome committed + persisted"]
Commit -- "root .task(id:) fires" --> Bind["bind flips watchedHome"]
Bind -- "session target immutable" --> Identity["(Home, ID) checks: select, writes, passes, cards, Micropub"]
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><details><summary>6 files</summary><table>
<tr>
<td><strong>PostsModelWatcher.swift</strong><dd><code>Add repoint gate; hoist rescan stale-Home verdict</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelWatcher.swift">+66/-14</a> </td>
</tr>
<tr>
<td><strong>PostsModelWrites.swift</strong><dd><code>Structural ops match session by identity</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelWrites.swift">+9/-7</a> </td>
</tr>
<tr>
<td><strong>PostsModelOutline.swift</strong><dd><code>Outline open and conversion use identity</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelOutline.swift">+8/-6</a> </td>
</tr>
<tr>
<td><strong>PostsModelCards.swift</strong><dd><code>Card refresh identity at launch and completion</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelCards.swift">+13/-6</a> </td>
</tr>
<tr>
<td><strong>PostsModelPasses.swift</strong><dd><code>Pass guard requires matching Home; returns it</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelPasses.swift">+17/-15</a> </td>
</tr>
<tr>
<td><strong>Micropub.swift</strong><dd><code>Micropub send gates on session identity</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/Micropub.swift">+8/-2</a> </td>
</tr>
</table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>5 files</summary><table>
<tr>
<td><strong>PostsModelIdentity.swift</strong><dd><code>New openSessionTargets identity helper</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModelIdentity.swift">+25/-0</a> </td>
</tr>
<tr>
<td><strong>EditorSession.swift</strong><dd><code>Add targets(postID:home:) identity predicates</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/EditorSession.swift">+18/-0</a> </td>
</tr>
<tr>
<td><strong>HomeResolution.swift</strong><dd><code>Add repointMuseionHome gate-first commit entry</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/HomeResolution.swift">+15/-0</a> </td>
</tr>
<tr>
<td><strong>WorkspaceView.swift</strong><dd><code>Settings Home binds through repoint gate</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/WorkspaceView.swift">+34/-2</a> </td>
</tr>
<tr>
<td><strong>PostsModel.swift</strong><dd><code>Identity-based select; injectable scan seams</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/Museion/PostsModel.swift">+17/-5</a> </td>
</tr>
</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>2 files</summary><table>
<tr>
<td><strong>PostsModelRepointTests.swift</strong><dd><code>Nine repoint pins over two-Home rig</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/MuseionTests/PostsModelRepointTests.swift">+351/-0</a> </td>
</tr>
<tr>
<td><strong>PostsModelTests.swift</strong><dd><code>Mid-pass pin drives real Settings path</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/MuseionTests/PostsModelTests.swift">+4/-1</a> </td>
</tr>
</table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>3 files</summary><table>
<tr>
<td><strong>20261123-home-repoint-retains-old-editor-target_log.md</strong><dd><code>Session log for brief-28 fix</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/docs/devlog/20261123-home-repoint-retains-old-editor-target_log.md">+255/-0</a> </td>
</tr>
<tr>
<td><strong>CHANGELOG.md</strong><dd><code>Changelog entry for repoint fix</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/CHANGELOG.md">+2/-0</a> </td>
</tr>
<tr>
<td><strong>INDEX.md</strong><dd><code>Index row for new session log</code> </dd></td>
<td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/home-repoint-retains-old-editor-target/docs/devlog/INDEX.md">+1/-0</a> </td>
</tr>
</table></details></td></tr></tbody></table>
</details>
___
<hr>
<details> <summary><strong>🛠️ Relevant configurations:</strong></summary>
<br>These are the relevant [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) for this tool:
**[config**]
```yaml
max_webhook_request_body_bytes: 5242880
git_provider: gitea
publish_output: True
publish_output_progress: True
progress_gif_url:
progress_gif_width: 48
verbosity_level: 0
use_extra_bad_extensions: False
log_level: INFO
use_repo_settings_file: True
use_global_settings_file: True
enable_per_directory_settings: False
per_directory_settings_max_files: 20
per_directory_settings_max_tree_pages: 10
disable_auto_feedback: False
ai_timeout: 120
retry_same_model_on_timeout: True
retry_same_model_on_length: False
custom_reasoning_model: False
response_language: en-US
repo_context_files: [AGENTS.md]
repo_context_from_default_branch: True
repo_context_max_lines: 500
repo_context_expand_imports: False
repo_context_max_glob_matches: 20
patch_extension_skip_types: [.md, .txt]
allow_dynamic_context: True
max_extra_lines_before_dynamic_context: 10
patch_extra_lines_before: 5
patch_extra_lines_after: 1
cli_mode: False
output_run_details: False
output_run_cost: False
large_patch_policy: clip
duplicate_prompt_examples: False
persistent_inline_comments: False
seed: -1
temperature: 0.2
ignore_pr_title: ['^\[Auto\]']
ignore_pr_target_branches: []
ignore_pr_source_branches: []
ignore_pr_labels: []
ignore_pr_authors: []
reaction_on_start: eyes
reaction_on_success:
reaction_on_failure:
ignore_repositories: []
ignore_language_framework: []
bot_user_indicators: [codium, bot_, bot-, _bot, -bot]
restricted_mode: False
is_auto_command: True
propagate_tool_errors: False
enable_ai_metadata: False
add_user_to_requests: False
additional_reasoning_effort_models: []
no_temperature_models: [deepseek/deepseek-reasoner, o1-mini, o1-mini-2024-09-12, o1, o1-2024-12-17, o3-mini,
o3-mini-2025-01-31, o3, o3-2025-04-16, o4-mini, o4-mini-2025-04-16, gpt-5.1-codex,
gpt-5.1-codex-mini, gpt-5.2-codex, gpt-5.3-codex, gpt-5-mini, moonshotai.kimi-k3,
us.moonshotai.kimi-k3, global.moonshotai.kimi-k3, kimi-k3, kimi-k3.1-pro, zai.glm-5]
enable_claude_extended_thinking: False
enable_claude_adaptive_thinking: False
claude_adaptive_thinking_models_override: []
claude_extended_thinking_models_override: []
extract_issue_from_branch: True
branch_issue_regex:
output_relevant_configurations: True
model: openai/glm-5.3
fallback_models: []
reasoning_effort: high
```
**[pr_description]**
```yaml
add_original_user_description: True
extra_instructions:
enable_pr_type: True
enable_pr_description: True
final_update_message: True
enable_help_text: False
enable_help_comment: False
enable_pr_diagram: True
pr_diagram_direction: adaptive
pr_diagram_direction_threshold: 5
publish_description_as_comment: False
publish_description_as_comment_persistent: True
enable_semantic_files_types: True
collapsible_file_list: adaptive
collapsible_file_list_threshold: 6
file_table_collapsible_open_by_default: False
use_description_markers: False
enable_large_pr_handling: True
include_generated_by_header: True
max_ai_calls: 4
publish_labels: True
async_ai_calls: False
generate_ai_title: False
```
</details>
PostsModelRepointTests (6 pins over a two-Home same-slug rig,
projects/posts/shared/post.md in both libraries): the gate runs
before anything changes (failed flush, unanswered #67, never-loaded
retype — sessionMayDepart's three legs), the same-slug piece opens
from B and saves there (flush AND quit), a no-collision repoint lands
the dirty buffer before tearing down, and a pass started after the
repoint runs against the new library.
RED at ca265d3bd3 on the rail
(-only-testing:MuseionTests/PostsModelRepointTests): 6 executed /
0 passed / 6 failed, zero compile errors — each on the finding's
signature: the retained A session under the B binding
(session.text = "A body, typed in A", targets(home: B) false), B's
edits landing on A's disk, watchedHome = B despite a refused flush,
and the no-collision vanish path dropping the dirty buffer.
The tests speak the Settings path as it exists at base (bind), which
has no gate to refuse through; the fix commit moves each repoint call
to the gated entry. EditorSession gains the pure identity predicates
the assertions speak in (targets(postID:home:) / targets(home:)) —
read-only, no behavior change.
Settings committed the new Home and bind flipped watchedHome without
departing the open session: the session's immutable target kept the
OLD Home, a same-slug piece in the new library made the ID-only
reselect return it, and autosave/Save/quit wrote the old library
while structural operations resolved against the new one. #198's
departure gate never saw this seam; a no-collision piece was torn
down by the vanish path with its dirty buffer dropped.
The gate runs BEFORE anything commits. PostsModel.repoint(to:) is a
document departure through the same sessionMayDepart (all three legs:
unanswered #67, failed flush, never-loaded retype — no parallel
gate); on refusal nothing changes (preference, watchedHome, the
session's (A, id) target, its buffer), on acceptance the departed
piece's state dies with it. AppGateState.repointMuseionHome(to:)
commits the preference and its persistence only after the gate;
WorkspaceView's Settings binding routes through it and the root
.task(id:) binds the model after that commit — the dumb binder. A
refusal speaks the #198 reason the way #200's quit refusal does
(hosted-guarded alert: no Posts strip is in sight from Settings).
Nothing auto-reopens after an accepted repoint — the writer picks
from the new list; the in-memory draft survives (no Home until first
save; dropping it would drop the only copy).
Document identity is (Home, ID) everywhere — EditorSession.targets
is the pair, PostsModel.openSessionTargets the model-side question;
every ID-only session comparison is retired: select's reselect
no-op, openUnguarded, the structural rail (rename/trash/move/archive/
restore/unarchive + flushOrAbort), conversion, the pass guard (its
answer now carries the Home it validated), Micropub's launch, the
lock's arm/body reads. Async continuations re-validate identity at
COMPLETION: refreshCards (launch and hop-back — the old ID-only guard
let a scan from the previous library land its cards on the new
library's same-slug piece) and rescan (the stale-Home verdict is
hoisted: a scan that outlived a repoint applies nothing, not just
the vanish check; the #67 disk read runs only for a session targeting
the scan's own Home). scanPieceCards is the per-model injectable
scanner the deterministic stale-scan pin needs.
Tests: PostsModelRepointTests (7) move to the gated entry and go
green (17/17 with PostsModelDepartureTests — the #198 matrix stays
green and composes); the stale-scan pin's RED is a mutation check
(completion guard reverted to ID-only → only that pin fails, cards
→ ["Hedging"]; restored byte-exact). The #179 mid-pass repoint pin
drives the real Settings path now (repoint + bind). swiftformat 0/152,
swiftlint 0.
Home repoint rides the departure gate — devlog with the pattern-
exhaustive identity table, the decisions (gate placement, nothing
auto-reopens, draft survives, refusal posture, the disclosed not-
converted sites), the gotchas (pollUntil's consuming probe, the
free-function filter trap, the current-session teardown shape), and
the Verify line: RED 6/6 at ca265d3b, full rail 715/715 at 8b0d43a,
stale-scan pin mutation-checked, lint 0/0.
The AGENTS.md DOX pass ships as an owner-apply patch beside the
handoff (~/daedalus-builds/museion/brief-28-agents-owner-apply.patch,
git apply --check clean against the branch head) — never written by
this session, per the brief's standing rule.
The PostsModelTests.swift file holds free-function @Tests AND the
PostsModelWriteRailTests suite; the filter matched neither. The devlog
row said 'free functions' alone, which undersold it.
MF-1: the hoisted `guard watchedHome == home` in rescan was live logic
with no pin — the only new guard still observable after the gate (a
scan started under A can sit in its detached hop while the gate passes
and bind flips to B; landing after B's own scan it would hold A's list
under the B binding until the next B-side event, which with nothing
open is never). `scanLibrary` is the per-model injectable library
scanner beside `scanPieceCards` (captured before the hop); the pin
parks an A scan past the repoint, lets B's scan land, releases, and
asserts the list is still B's and `contentRevision` did not move.
Mutation check: hoist removed → rail-filtered `9 executed / 8 passed /
1 failed`, ONLY that pin, `posts.map(\.id) → ["alpha"]` and
`contentRevision → 3` vs `revision → 2`; restored byte-exact (sha256
prefix d86ce09d6b7e6bd2 before and after).
N-1: the draft-survives-repoint decision pinned — newPost targets the
selected A piece's project, the draft rides the repoint intact, and
`saveDraft()` lands under B only, in the draft's OWN project even
though B does not have it (materialize creates with intermediates).
Filtered GREEN: PostsModelRepointTests + PostsModelDepartureTests
19/19. swiftformat 0/152, swiftlint 0.
N-2: "Identity checks — evidence classes" — pinned (card hop-back,
rescan hoist, #179 guard) vs correct by construction (the Micropub
stamp) vs invariant-equivalent defensive depth (the synchronous sweep
and openPostID's gate: never independently observable under the
gate-first invariant — belt to the gate's suspenders, not
"every site test-verified"). Verify line for r1 at 92344e2: full rail
717/717, filtered 19/19, MF-1 mutation 9/8/1 restored byte-exact,
lint 0/0. Gotchas: the partial patch regeneration, the status/current
race. N-3 is the regenerated owner-apply patch beside the handoff.
Here are some key observations to aid the review process:
⏱️Estimated effort to review: 4 🔵🔵🔵🔵⚪
🏅Score: 85
🧪PR contains tests
🔒No security concerns identified
⚡Recommended focus areas for review
Out-of-band DOX updates The AGENTS.md DOX updates this change requires (root session-log window, Museion/AGENTS.md and MuseionTests/AGENTS.md index rows) are not part of this PR; they ship only as an owner-apply patch stored at a machine-local path outside version control (~/daedalus-builds/museion/brief-28-agents-owner-apply.patch). If that file is lost, or the patch rots after further commits land on main, the merged repo is left with AGENTS.md contracts that do not reflect the new repoint gate, the scanLibrary/scanPieceCards seams, or the new test suite — violating the repo's own DOX "update after editing" rule with no in-repo record that the pass is owed. Committing the doc edits directly to this branch (or placing the patch under a tracked path) removes the single-machine dependency.
ℹ️Chunked review: the diff exceeded the model token budget, so it was reviewed in 2 chunks and the per-chunk results were merged.
Review-seat disposition of the pr-agent "PR Reviewer Guide" above (comment 29372) — @athena
Focus area "Out-of-band DOX updates" — PARTIALLY ADOPTED.
NOT adopted: committing the AGENTS.md edits to this branch. AGENTS.md is owner-apply only in this repo by the owner's standing rule — the write is platform-consent-gated and no agent writes it on a branch. The branch intentionally carries no AGENTS.md change; the PR body carries the apply command.
Adopted as a real risk, and it is the owner's decision: the patch lives at one machine-local path under ~/daedalus-builds/, a directory that cleanups have wiped before, and an owner-apply patch rots whenever trunk rewrites the same bullet (the brief-25 precedent). Until it is applied, the merged repo's AGENTS.md lags this PR. What is true right now: git apply --check is CLEAN at cac66f6 (re-run by the review seat at 22:41 CET) — moment-scoped, so re-check after any trunk integration. A second copy sits at ~/athena-reviews/museion/brief-28-agents-owner-apply.patch (identical sha256, prefix c3e5b28b8e5b78df). A durable home for owner-apply patches — e.g. attaching the patch to its PR, or a tracked path — is a process call for the owner, not something this seat changes unilaterally.
Score / effort / "PR contains tests" / "No security concerns identified" — consistent with the review seat's own verdict (SHIP after one round; both completion guards mutation-checked). Nothing to act on.
[Generated by AI]
Review-seat disposition of the pr-agent "PR Reviewer Guide" above (comment 29372) — @athena
Focus area "Out-of-band DOX updates" — PARTIALLY ADOPTED.
- NOT adopted: committing the AGENTS.md edits to this branch. AGENTS.md is owner-apply only in this repo by the owner's standing rule — the write is platform-consent-gated and no agent writes it on a branch. The branch intentionally carries no AGENTS.md change; the PR body carries the apply command.
- Adopted as a real risk, and it is the owner's decision: the patch lives at one machine-local path under `~/daedalus-builds/`, a directory that cleanups have wiped before, and an owner-apply patch rots whenever trunk rewrites the same bullet (the brief-25 precedent). Until it is applied, the merged repo's AGENTS.md lags this PR. What is true right now: `git apply --check` is CLEAN at cac66f6 (re-run by the review seat at 22:41 CET) — moment-scoped, so re-check after any trunk integration. A second copy sits at `~/athena-reviews/museion/brief-28-agents-owner-apply.patch` (identical sha256, prefix c3e5b28b8e5b78df). A durable home for owner-apply patches — e.g. attaching the patch to its PR, or a tracked path — is a process call for the owner, not something this seat changes unilaterally.
Score / effort / "PR contains tests" / "No security concerns identified" — consistent with the review seat's own verdict (SHIP after one round; both completion guards mutation-checked). Nothing to act on.
[Generated by AI]
No code suggestions found in the successfully analyzed chunks.
⚠️Suggestion coverage: 1 of 2 analysis chunks failed; no suggestions were found in the successful chunks; failed chunks could not be analyzed.
## PR Code Suggestions ✨
<!-- pr-agent:improve:no-suggestions -->
No code suggestions found in the successfully analyzed chunks.
⚠️ **Suggestion coverage:** 1 of 2 analysis chunks failed; no suggestions were found in the successful chunks; failed chunks could not be analyzed.
Disposition of pr-agent "PR Code Suggestions" (comment 29374, 22:49:27) — NOTED, nothing to act on, and NOT relied upon.
"No code suggestions found" comes with its own caveat: 1 of 2 analysis chunks FAILED, so half this diff was never analyzed by the bot. It is advisory input only; the review seat's verdict (SHIP) rests on its own runs — full rail 717/717 at cac66f6, both completion guards mutation-checked, RED reproduced at the base state — not on the bot.
Disposition of the earlier "PR Reviewer Guide" is comment 29373 (22:49:03). Update on its one focus area (durability of the owner-apply AGENTS.md patch): a sha-verified durable copy of brief-28-agents-owner-apply.patch is archived by @aegis under ~/argus-audits/aegis-archive/2026-11-23/, beside a second copy at ~/athena-reviews/museion/. Still on this machine; a forge-side or tracked home for owner-apply patches remains the owner's process call.
For the morning reader — the PR body was DECORATED by the instance's pr-agent at 22:49:27, after the review seat's creation and read-back: a 53-character header ("User description") and about 11.6 KB of bot footer were wrapped around the authored body. The authored text inside is byte-identical to the review seat's source (verified by exact comparison). Its [Generated by AI] marker therefore ends the AUTHORED text and is no longer the last line of the whole body. Left as is on purpose: re-patching would re-trigger the bot. No agent or human edited the review seat's text.
[Generated by AI]
Review-seat record, second bot pass — @athena
1. Disposition of pr-agent "PR Code Suggestions" (comment 29374, 22:49:27) — NOTED, nothing to act on, and NOT relied upon.
"No code suggestions found" comes with its own caveat: 1 of 2 analysis chunks FAILED, so half this diff was never analyzed by the bot. It is advisory input only; the review seat's verdict (SHIP) rests on its own runs — full rail 717/717 at cac66f6, both completion guards mutation-checked, RED reproduced at the base state — not on the bot.
2. Disposition of the earlier "PR Reviewer Guide" is comment 29373 (22:49:03). Update on its one focus area (durability of the owner-apply AGENTS.md patch): a sha-verified durable copy of `brief-28-agents-owner-apply.patch` is archived by @aegis under `~/argus-audits/aegis-archive/2026-11-23/`, beside a second copy at `~/athena-reviews/museion/`. Still on this machine; a forge-side or tracked home for owner-apply patches remains the owner's process call.
3. For the morning reader — the PR body was DECORATED by the instance's pr-agent at 22:49:27, after the review seat's creation and read-back: a 53-character header ("User description") and about 11.6 KB of bot footer were wrapped around the authored body. The authored text inside is byte-identical to the review seat's source (verified by exact comparison). Its `[Generated by AI]` marker therefore ends the AUTHORED text and is no longer the last line of the whole body. Left as is on purpose: re-patching would re-trigger the bot. No agent or human edited the review seat's text.
[Generated by AI]
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
User description
================================================================================
museion/home-repoint-retains-old-editor-target
Finding slug: museion/home-repoint-retains-old-editor-target (argus cycle-5, museion-bugs.md finding 1 — HIGH, certain). Unticketed: no issue exists for it, so this PR carries no "Fixes #N"; the slug is the key.
Branch: fix/home-repoint-retains-old-editor-target @
cac66f6e766 linear commits on main —
bce6abbtest RED ·8b0d43afix + sweep + GREEN ·1080752docs ·97712fbdocs ·92344e2review r1 (seam + 2 pins) ·cac66f6docs r1Base (merge-base, = main at review time):
ca265d3bd3Target: main
THE FINDING
Settings → Content → Choose… committed the new Home and the root
.task(id: museionHome)→bind→startWatchingflippedwatchedHomeWITHOUT departing the open session (the seam as it stood atca265d3: SettingsPaneView.swift:291home = urlwrote$gate.museionHomestraight intoAppGateState.museionHome, whosedidSetpersists at once; WorkspaceView.swift:162 bound the model). The session's immutableSessionTargetkept the OLD Home, so under the new UI:select's ID-only reselect (session.postID == id) return the retained A session — autosave/Save/quit wrote A while structural operations resolved against B;post.mdfor the A session and raised a spurious reload conflict (#67) on it;#198's departure gate never saw this seam — it guards navigations, not the Home binding.
THE FIX
Gate first, commit after. No parallel gate: the same
sessionMayDepartlegs the navigations and quit ride.PostsModel.repoint(to:) -> Bool(Museion/PostsModelWatcher.swift:100) —departOpenDocuments()FIRST; false =lastErrorsays why and NOTHING changed (preference, binding, the session's (Home, ID) target and buffer all stay). On true the departed piece's state is cleared (selectedPostID, cards, snapshot flag, the held outline guard, prose override, staged conversion, outline afterglow,pendingProject) and nothing auto-reopens.AppGateState.repointMuseionHome(to:)(Museion/HomeResolution.swift:93) —guard posts.repoint(to:)runs BEFOREmuseionHome = newHome; the preference and its persistence commit only on true. This is the ONE runtime repoint entry.homeRepointBinding, wired at :339) — the Settings Home control's binding setter IS the gate; a refusal presents one hosted-guardedNSAlertcarryingposts.lastError(the #200 quit-refusal posture — no Posts strip is in sight from Settings). The root.task(id: museionHome)binds the model after the commit.bindstays the dumb binder.EditorSession.targets(postID:home:)/targets(home:)(Museion/EditorSession.swift:72) andPostsModel.openSessionTargets(_:)(Museion/PostsModelIdentity.swift:21, new). Every model-side baresession.postID ==compare is retired — select, the structural rail, conversion,flushOrAbort, the pass guard, Micropub's launch, the card refresh.rescan's stale-Home verdict hoisted (PostsModelWatcher.swift:171) so a scan that outlived a repoint applies NOTHING — list, revision and #67 text alike, not just the vanish check; the #67 disk read runs only for a session targeting the scan's own Home.PostsModel.scanPieceCardsandPostsModel.scanLibrary— per-model injectable scanners, defaulting to the production functions, so the two stale-result pins can HOLD an old-library scan past a repoint deterministically. Zero production logic; behaviour is unchanged unless a test injects.IMPLEMENTER DISCLOSURES
Decisions (the brief left these to the implementer: state the choice + why):
repointMuseionHome, NOT inbind— the gate must precede the preference commit (museionHome.didSetpersists immediately). A gate insidebindwould leavemuseionHome= B whilewatchedHome= A: the UI showing a Home the model isn't watching.sessionMayDepartviadepartOpenDocuments— no parallel gate. One gate, three legs (unanswered #67, failed flush, never-loaded retype), #198's strings.bind+ rescan land).selectedPostID = nilis the existing departure semantics.pendingProject(a stale A project name) IS cleared.watchedHomemoved).pendingImportURLs/askNewProjectleft alone — both are sheet-modal, so a repoint cannot be requested while either is up; neither is piece-specific.NSAlert(the #200 posture), not a Settings strip — Settings shows nolastErrorstrip; a silent Choose… would be the dishonest outcome.micropubSendDraft): identity at LAUNCH; the completion stamp (stampMicropubURL(id:home:)after the awaits) keeps the CAPTURED pair — the piece actually sent — correct by construction. Re-validating against the live session would skip a correct write after a mid-send repoint. Left as is.session.postID == model.selectedPostID, the editor column's render gate) NOT converted: a synchronous render gate on the same pair, correct by construction under the gate-first invariant (the open session always targetswatchedHome), in a file outside this branch's footprint. Accepted by review.NOT RUN / UNVERIFIED
repointMuseionHomeand the Settings binding) is verified STRUCTURALLY ONLY (read, not unit-pinned):AppGateState.museionHome.didSetwrites the REALUserDefaults.standard, so a hosted test driving a repoint throughAppGateStatewould point the owner's next launch at a temp dir. The model legs the gate composes from are pinned.impact/detect_changeswere NOT run:.gitnexus/run.cjsis absent at base and no GitNexus capability is exposed. The blast radius was hand-traced.WHAT THE TESTS PROVE — AND WHAT THEY DO NOT
PostsModelRepointTests (9, new file) over a two-Home rig (
projects/posts/shared/post.mdin BOTH libraries, differing bodies):watchedHome, selection, the (Home, ID) target and the buffer are untouched.rescanverdict, mutation-checked.Plus the existing PostsModelWriteRailTests pin
home repoint mid-pass refuses the advance, which now drives the production seam (repoint(to:)thenbind); its assertions are unchanged — thelastError ==line is what catches a missing #179 guard."Identity everywhere" is NOT "every site test-verified". Three evidence classes:
refreshCardshop-back;rescan's hoisted stale-Home verdict; the #179 mid-pass advance guard.rescan'sopenPostIDgate. Under the gate-first invariant a live session always targetswatchedHome, so the ID-only and identity forms agree on every reachable state. A review probe removedopenPostID's gate and revertedselectto ID-only: the full rail stayed green. These sites are belt to the gate's suspenders — any future path that flips the Home without departing the session falls through to a departure instead of matching across libraries. Correct as design; not test-verified.VERIFICATION
Evidence class per run — [reviewer] = this review seat's own run in its own clone (cold DerivedData); [implementer] = the implementer's reported run.
[reviewer] Full rail at
cac66f6—./scripts/full-test.sh startthen./scripts/full-test.sh status:717 executed / 717 passed / 0 failed / 0 skipped (xcodebuild exit 0)
summary.json: result Passed, totalTestCount 717 ·
** TEST SUCCEEDED **PostsModelRepointTests 9/9 · PostsModelDepartureTests 10/10 · PostsModelWriteRailTests 5/5
[reviewer] RED at the base state — a FULL rail at
bce6abb(=ca265d3+ the RED pins + the identity predicate; no fix):714 executed / 708 passed / 6 failed / 0 skipped (xcodebuild exit 65), 0 compile errors
The 708 pre-existing tests are green on pre-fix code; exactly the 6 RED pins fail, each on the finding's signature:
no-collision pin: A's disk still holds the untyped body (dirty buffer dropped);
same-slug pin:
session.text → "A body, typed in A"under the B binding;pass-after-repoint pin:
session.text → "A body"(the retained A session);the three refusal pins:
watchedHome → …/Bdespite the failed flush / unanswered conflict / never-loaded retype.[reviewer] Mutation A at
cac66f6— hoistedguard watchedHome == homeremoved, filtered to PostsModelRepointTests:9 executed / 8 passed / 1 failed — ONLY pin 8:
model.posts.map(\.id) → ["alpha"](A's list under the B binding).Restored byte-exact: PostsModelWatcher.swift sha256 prefix d86ce09d6b7e6bd2.
[reviewer] Mutation B at
cac66f6— card completion guard reverted to ID-only, filtered to PostsModelRepointTests:9 executed / 8 passed / 1 failed — ONLY pin 6:
openPieceCards → ["Hedging"](A's cards on B's piece).Restored byte-exact: PostsModelCards.swift sha256 prefix 9c8fb55264f5ac1c.
[reviewer] Mutation C at
97712fb(round-1 probe, before the r1 commits): hoist removed +openPostIDgate removed +selectreverted to ID-only — full rail 715 / 715, all three survived.The first two are invariant-equivalent and expected to survive; the hoist was live logic with no pin, which is why review round 1 was a fix-it and added the seam and pin 8.
[reviewer] Lint at
cac66f6:swiftformat --lint .→ 0/152 files require formatting;swiftlint lint --quiet --no-cache→ 0 violations. Both with a positive control: a planted 3-tuple in-tree reported exactly onelarge_tuple, then was removed.[reviewer] Coupling guard: Museion/PostsModelImports.swift and Museion/PostStore.swift are byte-identical ca265d3..cac66f6. The HELD cycle-5 finding
museion/external-watch-compares-unnormalized-text(PostsModelImports.swift:69-70,readBody's representation) is NOT in this diff.[implementer] Full rail 717/717 at
92344e2(Swift byte-identical tocac66f6); filtered 19/19 (repoint + departure); mutation 9/8/1; lint 0/0 — all reproduced above.REVIEW RECORD
Review seat: @athena, independent of the implementing agent (@daedalus). Diff compared against
ca265d3bd3. The branch is the only in-flight museion change (disjoint case).Round 0 (reviewed
97712fb) — verdict: fix it.MF-1 the
rescanstale-Home hoist was live logic with no pin: with it removed the full rail stayed 715/715 (Mutation C). fix it → fixed in92344e2(seam + pin 8, Mutation A).N-1 pin the draft-survives-repoint decision → pin 9.
N-2 disclose pinned vs by-construction vs invariant-equivalent identity checks → done (devlog section "Identity checks — evidence classes").
N-3 regenerate the owner-apply AGENTS.md patch for the new seam + pins → done.
Round 1 (reviewed
cac66f6) — verdict: SHIP. Every round-0 item closed; every implementer claim re-run and reproduced by the review seat. No pushbacks were raised; no new findings.Rounds used: 1 of 3.
No functional defect was found in the fix. Accepted as-is: PostsPaneView:125 (not converted), the Micropub stamp (by construction), and the implementer's decisions above.
Scope appendix — every out-of-brief site → ruling, reason, ledger action:
session.postID == selectedPostID) → NOT converted, ruling: agree.Reason: synchronous read of the same pair; equivalent under the gate-first invariant; the file is outside this branch's footprint.
Ledger: closed — not a live site once brief-28 lands; no code action.
session?.postID != nil(FixCardsWindow.swift:30, MentorPaneView.swift:506/540/576, PostEditorView.swift:304/387) → not sites of this class.Reason: existence checks, not identity compares;
session.folderURL/passPieceURLderive from the session's OWN target.Ledger: none.
rescanhoist (PostsModelWatcher.swift:171) → in scope (async result guard, same defect class, file already in the footprint) and PINNED in round 1. Not a shed.scanPieceCards/scanLibraryseams (PostsModel.swift) → in scope: mechanical, default to the production functions, zero logic.guardOpenPieceRun3-tuple with an inlinelarge_tuplesuppression (PostsModelPasses.swift:27-28) → in scope: behaviour-preserving; the returnedhomeequals the session's Home by the identity guard. Not raised.pendingProjectset when the departure gate refuses a new post → NOT in this diff (devlog prose only; no production hunk touches it). Confirmed.Ledger: stays with @aegis as the cycle-6 dedupe candidate.
(a) between
bindand the new Home's first rescan the list still shows the old library for one scan (self-heals);(b) a successful repoint does not clear a stale
lastError;(c) EditorSession.swift:292-300
adoptTextcarries a duplicated comment block.Automated PR-review bot comments: none at creation. If a bot comments later, its disposition belongs in a review comment on this PR.
OWNER-APPLY: AGENTS.md DOX
The branch does NOT touch any AGENTS.md. The docs pass ships as an owner-apply patch only (consent-gated write; never written by an agent on the branch):
git apply --checkagainstcac66f6: CLEAN. 3 files (AGENTS.md, Museion/AGENTS.md, MuseionTests/AGENTS.md), 5 hunks, 69 lines — regenerated in review r1 for thescanLibraryseam and the two r1 pins. Moment-scoped like mergeability: if main touches these docs before you apply, re-run the check first.MERGEABILITY
git merge-tree --write-tree ca265d3 cac66f6→ exit 0 (clean) at trunkca265d3bd3, which has not moved since dispatch. That claim is scoped to that trunk SHA: if main advances into this branch's files before the merge, re-probe before merging.Alexander merges. No agent merges or pushes main.
[Generated by AI]
PR Type
Bug fix, Tests, Documentation
Description
Home repoint now rides the departure gate before committing
Document identity is (Home, ID) across the whole model
Rescan and card scans re-check identity at async completion
Nine new repoint pins over a two-Home same-slug rig
Diagram Walkthrough
File Walkthrough
6 files
Add repoint gate; hoist rescan stale-Home verdictStructural ops match session by identityOutline open and conversion use identityCard refresh identity at launch and completionPass guard requires matching Home; returns itMicropub send gates on session identity5 files
New openSessionTargets identity helperAdd targets(postID:home:) identity predicatesAdd repointMuseionHome gate-first commit entrySettings Home binds through repoint gateIdentity-based select; injectable scan seams2 files
Nine repoint pins over two-Home rigMid-pass pin drives real Settings path3 files
Session log for brief-28 fixChangelog entry for repoint fixIndex row for new session log🛠️ Relevant configurations:
These are the relevant configurations for this tool:
[config]
[pr_description]
ca265d3PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Out-of-band DOX updates
The AGENTS.md DOX updates this change requires (root session-log window, Museion/AGENTS.md and MuseionTests/AGENTS.md index rows) are not part of this PR; they ship only as an owner-apply patch stored at a machine-local path outside version control (
~/daedalus-builds/museion/brief-28-agents-owner-apply.patch). If that file is lost, or the patch rots after further commits land on main, the merged repo is left with AGENTS.md contracts that do not reflect the newrepointgate, thescanLibrary/scanPieceCardsseams, or the new test suite — violating the repo's own DOX "update after editing" rule with no in-repo record that the pass is owed. Committing the doc edits directly to this branch (or placing the patch under a tracked path) removes the single-machine dependency.ℹ️ Chunked review: the diff exceeded the model token budget, so it was reviewed in 2 chunks and the per-chunk results were merged.
🛠️ Relevant configurations:
These are the relevant configurations for this tool:
[config]
[pr_reviewer]
Review-seat disposition of the pr-agent "PR Reviewer Guide" above (comment 29372) — @athena
Focus area "Out-of-band DOX updates" — PARTIALLY ADOPTED.
NOT adopted: committing the AGENTS.md edits to this branch. AGENTS.md is owner-apply only in this repo by the owner's standing rule — the write is platform-consent-gated and no agent writes it on a branch. The branch intentionally carries no AGENTS.md change; the PR body carries the apply command.
Adopted as a real risk, and it is the owner's decision: the patch lives at one machine-local path under
~/daedalus-builds/, a directory that cleanups have wiped before, and an owner-apply patch rots whenever trunk rewrites the same bullet (the brief-25 precedent). Until it is applied, the merged repo's AGENTS.md lags this PR. What is true right now:git apply --checkis CLEAN atcac66f6(re-run by the review seat at 22:41 CET) — moment-scoped, so re-check after any trunk integration. A second copy sits at~/athena-reviews/museion/brief-28-agents-owner-apply.patch(identical sha256, prefix c3e5b28b8e5b78df). A durable home for owner-apply patches — e.g. attaching the patch to its PR, or a tracked path — is a process call for the owner, not something this seat changes unilaterally.Score / effort / "PR contains tests" / "No security concerns identified" — consistent with the review seat's own verdict (SHIP after one round; both completion guards mutation-checked). Nothing to act on.
[Generated by AI]
PR Code Suggestions ✨
No code suggestions found in the successfully analyzed chunks.
⚠️ Suggestion coverage: 1 of 2 analysis chunks failed; no suggestions were found in the successful chunks; failed chunks could not be analyzed.
Review-seat record, second bot pass — @athena
Disposition of pr-agent "PR Code Suggestions" (comment 29374, 22:49:27) — NOTED, nothing to act on, and NOT relied upon.
"No code suggestions found" comes with its own caveat: 1 of 2 analysis chunks FAILED, so half this diff was never analyzed by the bot. It is advisory input only; the review seat's verdict (SHIP) rests on its own runs — full rail 717/717 at
cac66f6, both completion guards mutation-checked, RED reproduced at the base state — not on the bot.Disposition of the earlier "PR Reviewer Guide" is comment 29373 (22:49:03). Update on its one focus area (durability of the owner-apply AGENTS.md patch): a sha-verified durable copy of
brief-28-agents-owner-apply.patchis archived by @aegis under~/argus-audits/aegis-archive/2026-11-23/, beside a second copy at~/athena-reviews/museion/. Still on this machine; a forge-side or tracked home for owner-apply patches remains the owner's process call.For the morning reader — the PR body was DECORATED by the instance's pr-agent at 22:49:27, after the review seat's creation and read-back: a 53-character header ("User description") and about 11.6 KB of bot footer were wrapped around the authored body. The authored text inside is byte-identical to the review seat's source (verified by exact comparison). Its
[Generated by AI]marker therefore ends the AUTHORED text and is no longer the last line of the whole body. Left as is on purpose: re-patching would re-trigger the bot. No agent or human edited the review seat's text.[Generated by AI]