refactor(posts): route every library write through one rail
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
#179: every library-reflecting store write (draft save, session-born post, rename, move to project, archive/restore, trash, convert, project creation, import batch, pass advance) now rides one internal seam — performWrite pairs the write with exactly one rescan and owns the error strip (cleared BEFORE the write so importFiles' per-file failure messages survive the success tail; a nil-Home refusal writes nothing). The model owns the Home: watchedHome is private(set), set only by bind (construction + the Settings repoint); no public method takes a Home parameter — 14 view call sites and ~115 test call sites swept, dead home plumbing cut. The editor's debounced flush, the card closes, the pass substrate and the micropub publish stay off the rail by design (own error semantics, no library regroup). A converged review finding is closed with a guard: the pass advance re-resolves watchedHome after the engine's minutes-long turn, so a mid-pass Settings repoint now refuses the advance with an honest strip message instead of silently stamping pass state into the repointed library (wrong-piece write on a slug collision). createProject failures now surface in the sheet AND the strip — the rail-owns-the- strip posture supersedes the #108 sheet-only rule. Five rail pins (PostsModelWriteRailTests, suite members): write → one library refresh + strip cleared, failed write owns the strip, nil-Home refusal, import batch keeps per-file messages, mid-pass repoint refuses the advance — the last two flip-verified against their guards. ScriptedEngine gains endHeldPrompt (release a held turn as ended). Verification: suite 657/657 the evening this landed; the next-morning re-run could not start — both test runners hung before establishing connection (#134 testmanagerd wedge; an untouched control suite hangs identically — machine state, not this diff; reboot pending). Rail pins 5/5 isolated after the last test-only edit; swiftlint at baseline parity; swiftformat clean. Closes #179 [Generated by AI]
This commit is contained in:
1 parent
627ecf515e
commit
5bf09552f6
27 files changed
+572
-345
No files matched your search
@@ -174,7 +174,7 @@ struct EngineSmokeTests {
|
||||
await mentor.openSession() // the resident chat engine
|
||||
let chatPid = try #require(mentor.childProcessIdentifier)
|
||||
let post = try PostStore.writeNew(body: "# Smoke Pass\n\nVerdict me.", home: home)
|
||||
model.select(post.id, home: home)
|
||||
model.select(post.id)
|
||||
for _ in 0 ..< 250 where !model.posts.contains(where: { $0.id == post.id }) {
|
||||
try await Task.sleep(nanoseconds: 20_000_000)
|
||||
}
|
||||
@@ -182,7 +182,7 @@ struct EngineSmokeTests {
|
||||
// In a Task — the pass child's pid is only observable while it runs
|
||||
// (the old EngineLifecycleTests poll; the zsh wire latency holds the
|
||||
// turn open long enough to catch it).
|
||||
let run = Task { await model.runPass(kind, home: home, mentor: mentor) }
|
||||
let run = Task { await model.runPass(kind, mentor: mentor) }
|
||||
var passPid: pid_t?
|
||||
var polls = 0
|
||||
while passPid == nil, polls < 250 {
|
||||
|
||||
Reference in new issue
Block a user