CI / ci (push) Canceled after 0s
Wayfinder map #158, Build S1: the pure logic slice the writing lock consumes — no chrome, no clock of its own. WritingGoal (words | minutes, one goal per block, fixed at arm) + WritingGoalRun: update(text:) takes whole-document text and netNewWords falls out of the delta (deleting costs — net, not gross; a big paste counts). now is injected into every call, so the countdown cannot pause by construction; the minutes deadline is arm+minutes (inclusive), isMet is live truth, unlatched (delete below target un-mets — complete on the first true tick), and progress(now:) is the clamped 0…1 the readout hairline rides. Word counting goes through the new internal DraftStats.words(in:) — net-words and first-draft stats share one tokenizer and can never drift. Finish-audit fanout: the Int() conversion trap in secondsRemaining fixed at the seam (isFinite + Double(Int.max).nextDown cap — the naive cap is itself off-by-one at 2^63; flip-verified pin), two unpinnable > 0 guards in progress deleted, baselineWords narrowed to let. Equatable and the ?? armedAt fallback kept deliberately (S2 consumes the former; removing the latter costs formula duplication). S2 throttle note landed on #162. Suite 602/602 (xcresult count), swiftformat + swiftlint clean in app and test targets. Two traps filed to the swift wiki (bare @Suite stripped by swiftformat; the Double(Int.max) cap).
52 KiB
52 KiB
MuseionTests
Purpose
Unit tests for the Museion application target, hosted in the app process (TEST_HOST).
Ownership
Owned by the root AGENTS.md contract.
Local Contracts
- Uses Swift Testing (
@Test,#expect) — not XCTest. - Imports
@testable import Museion; app code is default-MainActor, so cross-actor tests need@MainActoror nonisolated declarations in app code. - Deployment target and versions follow the app target; leave
CURRENT_PROJECT_VERSION = 1here.
Work Guidance
- Non-trivial logic leaves one runnable check behind: the smallest test that fails if the logic breaks. No fixtures or per-function suites unless asked.
EngineGateTests.swiftbuilds fakehermesshell scripts in temp dirs and runs them through the realProcesspath — copy that pattern for any future child-process testing. Untouched by #151 (probe/model facts, onPass-fires-per-passing-check, once-per-model).GatelessLaunchTests.swift(#151) pins the gateless seam:startLaunchCheckno-ops under hosted tests (never probes nor arms the chain — a fired chain would write the REAL profile roots),wireAutoFirearmsonPass, theEngineStatusSurface.visibilitypill mapping (idle/pass+healthy → hidden, checking → pulse, fail AND pass+provisioning-failed → failed), and theMentorEngineStatus.stateheader mapping (incl. the outrank rule — engine failure beats a lingering provisioning failure).ACPClientTests.swiftextends it into a full fake ACP server: a zsh script speaking real NDJSON JSON-RPC over stdio (makeFakeACP), with a per-binary mode file (crashAfterHandshake,hangOnPrompt— streams then holds the turn reading,cancelOnPrompt— one chunk then stopReason cancelled,noStopReason— prompt result without stopReason,refuseOnPrompt— refusal, no chunks; default full) and a base64-encoded fix-card payload — shell quoting can never break the wire JSON.makeFakeACP+acpTempDirare internal (shared-helper convention) for reuse by later test files (#24); every spawn appends its argv line to<name>-spawn-logbeside the fake (#137 — the which-engine-ran observable) and everysession/promptappends its wire line to<name>-prompt-log(#122 — the what-the-engine-was-asked observable);makeStrictFakeACPstays private. #124:hangOnPromptis the cancel-acknowledging hold — while the turn is held the fake keeps reading;session/cancelanswers the held promptstopReason "cancelled"(the real engine's contract), stdin EOF without a cancel (teardown) answers end_turn so the child exits; during the hold ONLYsession/cancelis answered — any other request waits until teardown. Every fake-spawning test tears down viadeferat rig creation (client.close()/model.shutdown(), both idempotent) — a cancelled or interrupted test cannot leak the child; explicit mid-test teardown remains only where it IS the mechanism or a regression bound. The full mode streams aagent_thought_chunkbefore the message chunks — pinning the #24 dogfood thought lane (thinking lands in a collapsed.thoughtrow, never in the critique text). Crash assertions use Swift Testing'sconfirmation(hook the callback BEFORE triggering the crash).makeStrictFakeACP(same file) guardssession/newthe way adapter ≥0.21.5 does — rejecting a missingmcpServerswith-32602— pinning the wire contract the lenient fake can't catch. #24 turn-outcome seam tests live INSIDE the suite — suite-name filters (-only-testing:MuseionTests/ACPClientTests) do not run free functions: ended/cancelled/failed mapping, labeled prompt renders the label not the wire stub. #28: the fake gains the session-lifecycle surface — unique session ids persession/new, a prompt-sid echo,loadReplaymode (answerssession/loadfor a planted id by FIRST streaming user+agent+thought chunk updates then the load response — the adapter's replay-before-response contract; #30: the load response carries the REAL 0.21.5 shape —_meta.hermes.sessionProvenance.acpSessionId, NO top-levelsessionId, so every resume pin guards the live wire; an empty result stays the unknown-refusal; aloadReplayLegacyknob answers the OLDER top-level-sessionIdshape — pinning resumeSession's dual-shape acceptance),session/fork→ freshF-<n>id (unknown id → empty-string sessionId, the adapter's refusal shape), andmcpServersstrictness on new/load/fork alike.ProfileProvisionerTests.swiftextends it: the fake creates profiles at<binaryDir>/profiles/<name>(self-locating, race-free under parallel tests); payload dirs are built at runtime; the bundled-payload test asserts manifest ↔ payload correspondence. The fake speaks-p <any-profile> mcp list/mcp add(per-profile markermcp-registered-<profile>= already registered, invocation logmcp-add-invocation-<profile>for the exact add command line, one stdin line read,mcp-add-failsreject knob) AND-p <profile> config set(argv logconfig-set-<profile>,config-set-failsknob), logging everyprofile createtoprofile-create-log(#134). #136:config setalso maintains a KEY=VALUEconfig-store-<profile>map (dedup per key), and the fake speaksconfig get <key>(store value, or the not-set line on stderr exit 1) andconfig unset <key>(argv logconfig-unset-<profile>, store line removed,✓ Unset …; unset-when-absent = exit 1) — the live-probed wire shapes. #134 (Profiles S1):ProfileSurfaceTests.swift(own file — registry mapping, ×3 provisioning + exact config-set lines, allocation symlinks, re-pass no-op, adoption, marker heal/no-stomp, profile-named failures, per-profile registration) andProfileSkillMigrationTests.swift(own file — copy-era→symlink byte-match migration incl. the.DS_Store-browsed case, diverged-stays-copy, untracked-untouched) share the harness;makeShippedPayload/shippedSkillNames/fakeHermesLogare internal there; everyperformcall injectsmasterRoot(the default writes the REAL Application Support). #48 failure-path tests live inProfileProvisionerFailureTests.swift(own file —registration only via the mcp add cli rail never hand-written yaml(config.yaml byte-identity through failed + nil-skip + CLI-registering passes — the #44 invariant as amended by #23, and per #134 only for adopted/engine-owned configs: fresh pass profiles ARE configured viaconfig set), state.json engine-gate-only, copy-phase catch branch, path-traversal rejection, orphaned-temp sweep). Shared helpers (makeFakeHermes,makePayload,defaultSkills,provTempDir,skillPath(profile:_:_:),readSkillBody) are internal inProfileProvisionerTests.swift.ProfileBackupTests.swift(own helpersbackupTempDir/makeProfileFixture(at:name:)) injects profile/backups roots, a fixed clock, and apsScanstub — a dev machine may run the real engine, so the ps scan is never trusted in tests.PostLibraryTests.swift(#17, #107) — throwaway Homes viamakeHome/writePiece/writePostin temp dirs: bare corpus posts (First Draft/writer defaults), lenient + quoted frontmatter (pass_state/origin/type), two-level scan acrossprojects/<name>/<id>/+archive/<name>/<id>/(project/isArchived stamped, noise at both levels), lazy folders / hidden dirs / symlinks not surfacing, localizedStandardCompare title sort,untitlededges (blank, marker-only, unterminated frontmatter), leading-blank-line frontmatter, default Home =~/Documents/Museion. #143: the scan-cache pins overPostScanCache's hit/miss observables — cold scan misses once per file, warm scan all hits with identical output, a changed file re-parses (title moves) while untouched files hit, a moved piece re-parses at its new path (path-keying — a folder move keeps bytes and mtime butisArchivedre-derives), and a late store carrying a stale pre-read stamp never pins stale content (the overlapping-rescan race's end-state, same-size rewrite so the mtime axis alone carries it).PostStoreTests.swift(#18, #107) — write side viastoreHome/readPost(same temp-dir pattern; #147: the shared helpers are internal — PostStorePassTests.swift reuses them): slug algorithm cases (diacritics, CJK, cap, punctuation-only → untitled), lazy first write intoprojects/<name>/<id>/+ #59 stamp (type first) round-trip throughPost.scan, untitled fallback, case-insensitive collision suffixes over the GLOBAL slug space (projects + archive; archived slugs never reused),writeNew(project:)routing, rename (retitle + move within the same project, archived stays archived, insert-title path, same-slug retitle-only, collision -2), trash removes from projects/ and archive/, overwrite preservation + bare-post normalization,readBodystripping, blocked-project failure path, writeNew outline stamping (#109:type: outlinefirst line,projects/<project>/<id>/post.mdplacement, scan round-trip; default.postpinned). #30: the New-Post-from-Session origin pins —writeNew origin ai stamps the session-born piece and scans back(the #30 scenario comment above it:origin: aistamped first-write, defaultposts/landing, exact frontmatter + scan round-trip) andwriteNew default origin stays writer for existing callers(the additive-default regression pin), anda session-born ai piece keeps origin ai through overwrite(the immutability AC pin — the save path never flips the ai stamp). #114: convert round-trip — verbatim keeps the body + flips type (scan reads post, stamp values kept), ladder shape, vanished-piece throw, archived piece converts in place (stays underarchive/). #108: project moves —readPiece(home:root:project:id:)path-aware helper; move (byte-identity, same-project no-op), archive/restore round-trip, archived-move refusal,unarchiveProjectfresh + merge cases (dot-entries skipped),createProjectvalidation matrix (duplicate case-insensitive + NFD twin, empty/slash/dot/:rejected), hidden user folders survive unarchive (source removed only when emptied),unarchiveProjectmodel test (dirty open piece flushes before the move). Fold pin: decomposed-jamo folder on disk vs a precomposed title →-2(Swift==/Set already fold canonical equivalence — the premise asserts byte inequality;foldedis the explicit, tested contract).PostStorePassTests.swift(#147 split — PostStoreTests crossed its file-length ceiling; MicropubTests → MicropubModelTests precedent; shared helpers stay in PostStoreTests.swift) — the pass-adjacent write sides: #24 (S3.1) pass substrate:snapshotPass(body verbatim underpasses/pass-1.md, no frontmatter; re-run overwrites = latest per type; pass-1/pass-2 coexist; vanished id throws),advancePassState(First Draft + pass1 → Pass-1 Done with origin/type/body byte-preserved — through the in-placepass_statestamp since #31, formerly the block rewrite; First Draft + pass2 → Pass-2 Done order-free; Pass-2 Done + pass1 stays put — monotonic, never regresses; re-run idempotent; vanished id throws),PassContextstub shape (pass name + level, piece path, research line only when hasResearch, fix-card reminder — #29: renamed pin, the stub carries the research rail clause too) +estimateTokens(stub+body chars/4 rounded up, expected derived independently in the test). #29 (S8.2) research write side:writeResearchNotepins — the exact markdown shape (source/keptfrontmatter,# title, note, blockquote quote), absent note/quote sections omitted, same-day collision-2, the post.md file path form, vanished-piece throw, and the audit pin — a symlinkedresearch/refuses with nothing planted. #31 (S5.1) capture pins: fivestats_*keys stamp in place (foreign key + body byte-preserved,stats_capturedexactly 19 chars,%.3fshape via thethreeDecimalsregex helper), ai-origin / past-First-Draft / outline pieces refuse untouched, recapture while still First Draft overwrites (latest draft wins), a bare legacy post qualifies through the lenient defaults, and the #31 regression pin —advancePassStatepreserves the stats AND foreign keys in place (the old block rewrite erased them). #31 finish-audit pins:overwritepreserves stats + foreign keys while swapping the body (the mid-pass editor save no longer erases the capture) and still normalizes a bare post through the full #59 stamp; the apostrophe-joining ceiling pin now discriminates (writer's note writer→ 3/4, not the vacuous all-unique 1.0); the two never-firing NaN guards inDraftStats.computeare deleted (converged ponytail+general finding) andDraftStatslost its unusedEquatable.DraftStatsTests.swift(#31, S5.1) — the four metrics pinned over hand-derived expectations (the scenario header lives in the file top): sentences [3,2,1] → burstiness ≈ −0.4202 / variation ≈ 0.4082 / TTR 1 / trigram 0, regular sentences → burstiness −1 with trigram 0.25, empty body → all zeros, single sentence → −1, case folding (Dog dog DOG→ 1/3) + the no-apostrophe-joining ceiling pinned as TTR facts.WritingGoalTests.swift(#161, Cold Turkey S1 — scenario header at file top,@Suite("WritingGoalTests"); BARE@Suiteis stripped by this repo's swiftformat — always give the attribute its string argument) — the goal engine's 11 pins: arm baseline + zero net, exact-target completion (499 ≠ met), delete-below-baseline (net −2, progress clamps 0), 2000-word paste counts in full, undo-to-baseline nets zero, words-goal ignores the clock (secondsRemainingnil), minutes deadline boundary (−1 s not met, on-the-second met, remaining 60/0), minutes-goal ignores words + deadline immovable, an absurd.minutes(.max)never traps the countdown (the Int-seam clamp pin — flip-verified), tokenizer parity with DraftStats ("writer's" 2 / "writer's note" 3 / headings count / digits count / punctuation-only 0), and theprogress(now:)fractions for both goal kinds.MicropubTests.swift(#33, S6.1 — scenario header at file top,@Suite; shared helpersMicropubRequestLog/micropubHTTP/micropubCanned/micropubJSONinternal) — the wire contract pinned over canned transports (ProviderProbeTransportTests pattern): draft request = h=entry with name/content/post-status draft and Bearer auth; publish request = the post-status update; Location-then-body-url decode with preview, preview-only = requestFailed (display-only, never the publish target), an injection-carrying URL = requestFailed (trustworthyURL gate), a scan-side untrustworthymicropub_urlreads nil, no-URL create = requestFailed, 401/403 → authFailed with the error_description, non-2xx → requestFailed, transport throw → unreachable;MicropubTokenStoreround-trips the REAL login keychain against its OWN injected account slot (a live production token is never read, replaced, or deleted — the finish-audit #33 clobber fix);stampMicropubURLpins (in-place stamp: foreigncategory:key + body byte-preserved, scan readsmicropub_urlback, vanished throws); and the model flow overmakeModelHome(flush-first — the wire carries the edited text, Title publishes as name from the ONE disk read, refused-without-open-piece and refused-on-unsaved-draft and refused-on-whitespace-only-body send nothing, the AC pin: a piece carryingcategory:frontmatter drafts with NO category key on the wire, a failed draft stamps nothing, re-draft overwrites the remembered URL — the model pins live inMicropubModelTests.swift(own file, the decode suite crossed its type-body ceiling; finish-audit split)). #34 (S6.2):MicropubMediaTests.swift(own file —micropubPNG()/micropubMediaScriptedhelpers internal, the scripted transport routes config → upload → create by target URL) pins the media surface: illustration parse (plain + inline + quoted-title + empty-alt refs captured honestly; remote http(s) and non-assets/refs left alone), rewrite (each UPLOADED ref swaps in place with its uploaded URL — position and alt preserved, quoted titles drop, foreign images and unuploaded refs byte-identical, a URL carrying markdown-active chars rides the ANGLE form— a plain dest would close early and smuggle a live link), the mime matrix (all six formats + the refusal), the config request +media-endpointdecode (trust-gated — an injection-carrying endpoint is requestFailed), the multipartfilePOST asserted over BYTES (part head, payload, closing delimiter, per-request boundary),uploadMedia's create-mirroring decode (Location → body url → trust gate; authFailed on 403), the no-photo-keys-EVER create pin (images travel inline in content — a photo property renders wherever the theme decides, live-verified 2026-11-01), the boundary pin (empty map passes through verbatim, adjacent start/end refs rewrite with clean cursor math), and the multi-line-alt agreement pin (a ref whose alt spans lines doesn't parse at all — a parsed-but-unrewritten ref would ship a broken relative link); the #34 model pins live inMicropubModelTests.swift— the three-hop ORDER (q=config, multipart carrying the PNG bytes, create with the ref REWRITTEN to its uploaded URL exactly where placed while the disk body keeps the local ref — no photo property keys), the AC2 floor (WHITESPACE-empty alt — the #6 trimmed-emptiness class — refuses naming the destination with ZERO requests served, nothing stamped), missing-file + SYMLINKED-asset refusals pre-wire (containment resolves symlinks — never read through a planted link), DUPLICATE refs to one asset uploading once and sharing the URL, and a piece without illustrations sending exactly ONE request (#33's wire unchanged).TrendViewTests.swift(#32, S5.2 — scenario header at file top,@Suiteso suite filters run it) — the trend view's pure facts: scan reads a REAL capture back (writeNew+captureFirstDraftStats→firstDraftStatsvalues matchDraftStats.computeat %.3f grain; the parsed date round-trips through the exact stamp format viaFixCardStore.formatted— locale-independent proof), never-captured pieces scan nil BY CONSTRUCTION (an ai piece whose capture RAN and was refused at the gate + an outline + an untouched writer post — no filtering, the keys just never exist), partial/malformedstats_*keys never half-load,TrendMetric.verdictpins (improving/steady/slipping at ±0.01, trigram inverted), and the y-domain pins (burstiness −1…1 / TTR + trigram fixed 0…1 / sentenceVariation scales to 1.2× peak with floor 1), the explain pin (every metric carries a distinct, non-empty gloss naming its better-direction — a fifth metric without one fails), the finish-audit pins —non-finite stats values never load(nan/infin one key, all else valid, via thewriteStamped(id:overriding:home:)shared fixture whose per-key overrides keep each test's one varying fact visible),read-back gates on the immutable pair(imported ai/outline pieces carrying hand-stamped keys scan nil; a Pass-1-Done writer piece keeps its arc — pass_state never gates) — both flip-verified (each pin fails on its own guard) — and the exact-tolerance verdict boundary (delta == 0.01 reads steady, strict comparisons).MCPToolsTests.swift+MCPServerWireTests.swift(#23, S2.4) — the museion-tools store + wire: anchor matrix (exact substring, occurrence 2-of-2 valid / 3-of-2 stale / vanished quote / empty quote → stale), submit round-trip (snake_case card file in<piece>/cards/, stale lands flagged, vanished piece + malformed card throw),submit refuses a symlinked cards dir(#6 audit — throws with nothing written through the link, promote's posture), scan newest-first + junk skip, learnings per content type (learnings/posts|outlines) + missing dir → empty; the wire tests driveMCPServer.run(lines:write:)in-process — initialize protocolVersion echo, notifications silent, both tools with typed schemas, a full submit round-trip through real JSON-RPC lines, isError tool failures, -32601/-32700. #25 slice 1 pins: the ten-card pass ceiling (12-card submit → the ranked head P1–P10 lands, the malformed 12th never errors the call), rank stamped in submit order + pre-schema card decodes rank nil,appliedText(nth-occurrence replacement, empty fix cuts, beyond-count/vanished/empty quote + demonstration lane → nil),close(same file rewritten with the status flipped, all other fields intact, scan sees it, foreign id throws); #25 wire pin: an 11-card submit through the wire lands 10 on disk and the reply JSON carriesdropped_over_ceiling== 1. #29: all three tools listed with required arrays (research schema: piece_path+notes at top, title+url per note); a well-formedsubmit_research_notesround-trip replies{"received": N}with isError absent and lands NOTHING on disk (the candidates rail writes nothing); a note missingtitleanswers isError (the trust boundary). #26: promote pins live inMCPToolsPromoteTests.swift(own file — MCPToolsTests crossed its type-body ceiling;toolsHome/writePiece/card(provenance:)widened internal for it): one-confirm-writes-one-learning (pinned teaching shape — anchor + mechanical fix asserted ABSENT, filename + body pinned, card stampedpromotedAt, second confirm throws, missing piece throws), promoted learnings consultable vialearnings(piecePath:), content-type partition (learnings/outlines), same-day same-pattern-2collision, newline flattening + the demonstration example pin (demonstrationfixtravels asfix:+**Example.**, mechanical's drops), pre-#26 card JSON decodespromotedAtnil, and the audit pins — a stale unstamped copy cannot double-promote, a vanished card refuses BEFORE writing, a symlinked learnings dir refuses with nothing planted.LearningsPaneTests.swift—LearningsIndex.scanover hand-written fixtures: type-dir grouping + newest-first ordering (undated last), lenient edges (no frontmatter → filename pattern, non-md/hidden/loose ignored), missing learnings/ → empty. #27:Entry.resurfacesInpins (visible nil; remaining-count math at a given currentPass; scan carrying the clock from pass-counts.json; foreign unclocked dirs carry no verdict even with hand-edited decay state); itswriteLearninghelper is internal (shared with LearningDecayTests); date-stamp expectations call the prodFixCardStore.formatteddirectly (no test-side formatter copy, format literals pinned) and the blank-line-above-the-block preservation is pinned.LearningDecayTests.swift(own file) — the #27 decay pins: per-type pass clock (everyadvancePassStateticks its type, re-runs included, fresh home reads [:]), dismiss stamps in place (frontmatter keys + clock anchor pinned, every other key + the body byte-identical, hidden fromlearnings(piecePath:)), resurface at anchor+10 (hidden through +9), re-dismiss doubles to 20 + re-anchors at the current clock,resurface_after: 3override, lenient edges (garbage ints, huge hand-edits clamp so no arithmetic can trap, negative anchor counts from zero, corrupt clock → [:]), hostile-path/missing-file dismiss guards, and the audit pins — symlinked learning FILE and symlinked-dirrecordPasswrite-through refusals, re-dismiss-while-hidden refusal (double-click harmless) + negative-count clamp, foreign-dir refusal (isClocked), and the fresh-block prepend on frontmatter-less files.FixCardApplyTestsgains the model pins: promoteCard writes one learning + refuses repeats; no open piece refuses.FixCardApplyTests.swift(#25, S3.2/S3.3) — the apply/skip/done lifecycle overmakeModelHome+ directFixCardStore.submitseeding, scenario header first: apply on an open piece with a dirty buffer (flush-first, disk + card agree, saveState saved,loadGenerationmoved — theadoptTextrail), stale anchor at apply (.stale, post.md byte-identical, the card flags itself stale and stays open), demonstration card refused, unanswered #67 conflict refused (disk untouched), skip/done flip only the status (poll for the watcher rescan), and the store addenda pins (scan sorts submittedAt DESC → rank ASC with a slug-order-divergent batch + newest-submit-first;close's anchorStatus refresh/preserve).PostsModelTests.swift(#108 audits, #109) — the model-layer lifecycle the store tests can't see, viamakeModelHome(direct@MainActormodel over a temp home): archive-open-piece clears selection+session, moveToProject reopens the session at the newfolderURL, restore reopens off the archive path, New Project's draft lands in the named project, abandoning a draft for an external file dropspendingProject, unarchive of a dirty open piece flushes before the folder move,moveTargetslists empty projects from disk (default included); #109:newOutline()stages a"- "/.outlinedraft (selected project targeting waits for the bind rescan, default-project fallback),saveDraftof it materializes withtype: outlineand opens the session. #111 (S7): the guard lifecycle — mixed outline fires + holds (no session, file untouched), prose answer opens with the routing override + an edit/flush cycle drops nothing, outline answer = consented drop on save, cancel re-guards on next open, clean outline/prose pieces open untouched, reselect of the open guarded piece is a no-op, a draft staged during the ask displaces it and survives the answer, guard fires from the scan-known type too (poll-loop rescan wait);writeMixedOutlineis onewriteNewcall. #114 (S4): convert lifecycle — the open outline piece converts and REOPENS routed prose (proseOverridePostIDset, disktype: post, ladder applied); an unopened piece converts without touching the open session or selection;verbatim convert flips the posts list after the rescan(the live-report regression pin). #114 audit pins: dirty-session flushes before the transform, staging warns fromsession.text(piece open) vs disk (closed), Headings aborts when the body went lossy behind an unwarned ask (and the warned-consent path proceeds), unanswered #67 conflict aborts (alert stays answerable), failed flush aborts (piece vanished), convert dismisses a held #111 guard ask as a cancel. #23: the card-lifecycle pins — cards pre-seeded via a directFixCardStore.submitsurface after select, a card landing on disk AFTER open grows the list through the watcher-driven rescan (poll pattern, no reselect), closing the piece (newPost) clears to [], archive-open path covered.PassRunTests.swift(#24, S3.1) — the pass orchestration over the REAL client + fake ACP path, viamakePassRig(temp home + boundPostsModel+MentorSessionModelovermakeFakeACP, reusing the now-internal ACPClientTests helpers): end-to-end run (pre-pass snapshot inpasses/pass-1.md, disk stampPass-1 Done, label row "Pass 1 ·