museion/postsmodel-write-rail: one seam pairs every library write with the rescan (#179) #185

Closed
AlexKucera wants to merge 4 commits from fix/postsmodel-write-rail into main
pull from: fix/postsmodel-write-rail
4 Commits
Author SHA1 Message Date
AlexKucera 23b2090054 fix(posts): finish-audit closeout for #179
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
Reviewer fanout (ponytail/security/general) fixes: bind hoisted to the
WorkspaceView root task (stale boundHome after a Home repoint while
another pane was showing), railWriteReturningReason emits .writeFailed
(pinned, flip-verified), dead home: params deleted from the three ask
sheets, saveDraft locals inlined; AGENTS.md docs delta applied; devlog
closeout. Suite 655/655, lint parity with base.
2026-11-10 16:48:35 +01:00
AlexKucera 3bef1d12b1 docs(devlog): #179 write rail session log
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
2026-11-10 03:12:23 +01:00
AlexKucera 06283b6287 refactor(posts): route every library write through the write rail (#179)
CI / ci (push) Canceled after 0s
One internal seam (PostsModelRail.swift) now pairs every library
verb store write with exactly one library rescan and owns the error
strip: saveDraft, newPostFromSession, rename, trash, createProject,
moveToProject, archivePost, restorePost, unarchiveProject,
importFiles, convertToPost, and runPass pass-state advance (12 sites
on this base; the pass snapshot/stats writes, the publish stamp, and
the editor flush stay outside by design).

The model owns the Home: boundHome is set by bind() alone (app
construction + Settings repoint); every public verb lost its home:
parameter (create post/outline/session-born, rename, move, archive,
restore, trash, convert, project creation, import, select, cards,
passes, blind read, publish).

The three rail entries are railWrite/railWriteReturningReason/
railWriteKeepingStrip — deliberately NOT overloads: a shared base
name let unlabeled trailing-closure calls resolve into the labeled
non-generic entry (Swift binds trailing closures to labeled first
parameters), silently bypassing the strip and the pairing.

Views + 11 test files swept to the homeless signatures (160 sites).
RED suite green: 3/3. Full unit suite: 654/654. Fixes #179
2026-11-10 03:05:48 +01:00
AlexKucera 8c5ceffa3c test(posts): pin library write-rail seam (#179)
CI / ci (push) Canceled after 0s
RED: PostsModelRail skeleton (one internal seam pairing a library write
with exactly one rescan + the error strip, three error routings) and the
seam-observability suite. On the base every verb hand-copies the
write-then-rescan-then-strip choreography, so nothing reaches the rail:
executed 3 / failed 3, events [] at every verb. Fixes #179
2026-11-10 02:41:05 +01:00