npm notice run @mosaic/conversation@0.1.0 test
npm notice run node --test tests/
✔ W1: two processes acquire the same pair at once; exactly one claim (146.235947ms)
✔ W1: two writers publish the same revision at once: one wins, the other gets null, the winner's record stays (10.591241ms)
✔ W1: a revision name appears only after its bytes are synced; before that, only a temp file exists (4.002129ms)
✔ W2: acquire while a claim is reserved or active refuses already-active (141.251948ms)
✔ W3: acquire while stopping, uncertain, or stopped without proof refuses unsafe-replacement (196.895467ms)
✔ W4: same session with another seat tuple, and the reverse, both refuse; a loser on the seat key closes it no-unit (171.077773ms)
✔ W4: a hard link of one session under another seat is the same session: the second controller refuses already-active and launches nothing (22.581458ms)
✔ W4: a copy of one session under another seat is the same session: the second controller refuses already-active and launches nothing (22.226419ms)
✔ W4: a session header ID that changes after construction refuses target; nothing is claimed or launched (3.601608ms)
✔ W5: SIGKILL between every publication barrier of acquire and transition; restart never finds two holders or a lost claim (6685.448329ms)
✔ W5: SIGKILL between every publication barrier of release; restart finishes or holds the release (25591.667609ms)
✔ W6: controller killed mid-turn while the engine lives; restart is uncertain, no launch, prompts refuse (157.289678ms)
✔ W12: a live owner paused with SIGSTOP; a second controller refuses already-active and changes nothing (94.193256ms)
✔ W13: crash after the engine spawns, before active; restart finds the live unit: uncertain, no second spawn, force stop only (281.259755ms)
✔ W14: crash after reservation, before the spawn marker: stopped with a no-unit observation; the pair is free (199.220124ms)
✔ W20: crash after the spawn marker, scope collected; uncertain in both runs, the marker is copied, no launch until a boot proof (213.682011ms)
✔ W15: crash between the two keys during release; restart finishes it under the same claim ID (34.175966ms)
✔ W7: recorded boot ID differs on the same machine: stopped with a boot proof; open tool calls become uncertain (110.559677ms)
✔ W8: resume after a proven stop with the same pins: new claim ID, generation +1, same conversation, branch and leaf (35.008179ms)
✔ W9: resume with a changed binary, argv digest, branch or leaf is refused and the claim is unchanged (94.503896ms)
✔ W11: the controller writes no session file; only the fake engine's own appends appear (26.325719ms)
✔ W16: a highest revision that won't parse holds the pair uncertain; the older stopped revision is not reused (59.347803ms)
✔ W17: a claim root copied from another host refuses foreign-host and promotes nothing (52.341508ms)
✔ G1: a session path or claim root under .pi/state, ~/.claude, the data root or a registration refuses at construction (3.623405ms)
✔ G2: a symlink inside the fixture root to a live session file is refused by the real-path check (1.210549ms)
✔ G3: a fixture path swapped for a live path after construction is refused at bind (2.033068ms)
✔ no shim from this file's tests is left running for the after hook (6.828596ms)
✔ K1: force stop kills a tool child that called setsid; stopped with a verified proof (353.123053ms)
✔ K2: K1 on the process-group fallback ends uncertain, never stopped (177.051374ms)
✔ K3: SIGTERM acknowledged while a member lives: stopping until the kill phase, never stopped from TERM (312.504868ms)
✔ K4: two engines; force stop one; the other survives by independent observation (2351.671966ms)
✔ K5: a stop during a tool call leaves the effect uncertain, and it is shown (243.308752ms)
✔ K12: a member forking in a loop: the freeze stops it, enumeration is complete, populated 0 after cgroup.kill (353.686244ms)
✔ K13: a member writing its pid into another cgroup is refused by the namespace; the kill is complete (196.010361ms)
✔ K15: the shim gone, engine/cgroup.events unreadable, or the engine cgroup missing: evidence unavailable, not empty; uncertain (4442.572079ms)
✔ K10: controller killed between the TERM and kill phases: restart checks the invocation ID and re-runs from TERM for the same stop (444.225222ms)
✔ K11: controller killed after the confirmation is recorded, before TERM: restart checks the invocation ID and re-runs from TERM for the same stop (372.580995ms)
✔ K14: a unit with the recorded name but another invocation ID: evidence unavailable, no signals, uncertain (284.915968ms)
✔ K6: recover without proof, without confirmation, or with changed pins is refused (69.62178ms)
✔ K7: recover after proof, then launch: new claim and execution, generation +1, same leaf; the cancelled prompt is not replayed (36.282045ms)
✔ K8: an engine that loads another leaf on resume is refused before admission; it stays claimed until a proven stop (44.832239ms)
✔ K9: an interrupt that never settles stays uncertain; force stop stays available; takeover is refused while fenced (3029.331616ms)
✔ K16: a claim from another machine ID refuses foreign-host; no boot proof is issued (5.195091ms)
✔ K17: two launcher calls with one eligibility record: one launch, the other refuses, no second engine (32.016031ms)
✔ K18: the leaf changes after eligibility: launch refused; the reservation stays until released with proof (27.901159ms)
✔ K19: a scope launched with only the engine environment still reaches the user manager; the engine sees no other names (84.133131ms)
✔ R1: after a proven force stop the controller releases the scope; the shim and the unit are gone (177.398812ms)
✔ R2: close releases the scope of a binding proven stopped, once, when the stop's own release hasn't run (301.802212ms)
✔ R3: no release after an unavailable stop or an unverified proof: the scope and its shim stay as evidence (743.48869ms)
✔ E1: a natural engine exit with no member left: an engine-exit stop, stopped on a proof naming the engine, and the scope released (206.758892ms)
✔ E2: an engine exit with a tool child alive: the stop ends uncertain and nothing is released; a force stop then ends it (2244.071832ms)
✔ E3: an engine exit and a force stop take one escalation slot, in either order (637.972176ms)
✔ E4: a shim that doesn't answer: the engine-exit stop misses its deadline, ends uncertain and frees the slot (700.449179ms)
✔ E5: an engine exit after a force stop ended uncertain starts no engine-exit stop; the force stop stays current (2448.582626ms)
✔ E6: the engine-exit observation refuses a reaped process that isn't the recorded engine: another PID or start ticks (205.026251ms)
✔ R5: the harness finds a running shim and reaps it, and never signals a shim outside a mosaic-chat- scope (Filbert N1 and N2 on #1533) (425.383569ms)
✔ R6: releaseCohort releases nothing while the engine runs, for another invocation ID, or for a cohort without a scope (138.183415ms)
✔ R7: controller killed after the claim is stopped, before the release: the restart releases the scope (2346.188478ms)
✔ R8: controller killed between the two keys' stopped revisions: the restart releases the scope (265.972562ms)
✔ R9: a release that ended unavailable is tried again on a confirmed recover, not a refused one (222.195752ms)
✔ R10: close releases and signals nothing for a stopped binding whose proof no longer verifies (Filbert N3 on #1536) (196.640701ms)
✔ R11: close({ killEngine: true }) after a proven stop sends no signal to the recorded engine PID; a restart releases nothing more (2275.439677ms)
✔ R12: a restart onto a claim stopped on a boot proof releases nothing, though its scope is listed (171.910989ms)
✔ no shim from this file's tests is left running for the after hook (5.055341ms)
✔ S1: `/goal x`, with leading spaces or a tab, refuses text-policy at admission; zero engine bytes (50.835831ms)
✔ S2: every prefix pinned Pi interprets is refused, from the list the code uses; the rest reach the engine exactly (37.070359ms)
✔ S3: `/goal` on the second line is pinned from the source: Pi checks only index 0, so it is admitted and sent exactly (23.716182ms)
✔ S4: a `/` left in the composer is cleared when control transfers and returns; the next submit sends only the new text (45.815835ms)
✔ S5: an observer terminal gets a paste then Enter, as send-message.sh does: not admitted: controller, nothing sent (22.213056ms)
✔ S6: a mediated-shaped registration (no tmux) passed to the board's replyToRow: 409 no tmux session; exec never runs (0.536078ms)
✔ S7: ESC, bracketed-paste markers and U+2028/U+2029 travel as one JSON string; the engine receives the exact text in one record (23.927279ms)
✔ P3: a Pi confirm, select, input or editor dialog is shown disabled with a reason and never answered (127.617325ms)
✔ E1: send, ack, user, toolCall, toolResult, final answer: shown once, no refresh, draft and reading position kept (36.853267ms)
✔ E2: U+2028, U+2029 inside JSON strings and CRLF line ends each parse as one record, on the splitter and through the controller (21.846988ms)
✔ E3: a multipart final, two blocks, null request correlation and duplicate delivery (36.043739ms)
✔ E4: a page read after message_end but before its entry is persisted: marker at the seam, re-read after run-settled, each message once (31.607639ms)
✔ E4: a gap or a new epoch also reconciles; nothing is concatenated across a gap (11.412161ms)
✔ E5: an unknown native event gives no client event; evidence records its type and bytes; the terminal count goes up (29.54465ms)
✔ E6: a tool result delayed across a pause and a reconnect is reconciled without a manual refresh (48.305476ms)
✔ E7: the terminal renders the same stream as the library client, as observer and then as controller, and submits only as controller (41.153052ms)
✔ terminal: engine control characters are made visible; a lost connection refuses submit (26.056138ms)
✔ terminal: outcome unknown is shown as such, with no resend offer, and nothing is resent (0.572457ms)
✔ terminal: text after Enter in the same input chunk starts the next message; it never joins the one submitted (0.353708ms)
✔ terminal: a paste-start marker split right after its ESC still opens the paste; the Enter inside it never submits (0.395444ms)
✔ terminal: Ctrl-T then Enter in one chunk is judged after the takeover, as if typed one key at a time (Filbert F2, #1507) (0.62377ms)
✔ terminal: input held behind Ctrl-T waits for that takeover while an earlier action is still pending (Darkwing T1 on #1522) (31.590355ms)
✔ terminal: a hold inside held input holds again, and once it is drained later input and Ctrl-C still reach the terminal (Darkwing note 1 on #1522) (0.863962ms)
✔ terminal: an action that throws still releases the input held behind it, in order, then rethrows (5.216669ms)
✔ terminal: after an action throws, later input still runs; input() puts the error in the status line (Filbert N1 on #1522) (0.666215ms)
✔ terminal: input() reports an error when it happens, so it never overwrites a later status; held input's promise doesn't carry the holder's error (Filbert N4 on #1522) (0.480942ms)
✔ terminal: invisible and bidi characters are made visible; head, status and notice lines stay one line (0.147372ms)
✔ every record these fixtures produced is a valid CHAT-01 record (E5: no record fails the schema) (324.112178ms)
✔ H1: two takeovers with the same expected generation: one wins, +1; the other refuses generation (63.570719ms)
✔ H2: the old controller's prompt after a takeover commits is refused with zero engine bytes (86.795467ms)
✔ H3: a takeover while a prompt holds the dispatch lock: written under the old actor, or refused; never both (144.931815ms)
✔ H4: self-takeover is refused (16.98933ms)
✔ H9: Interrupt racing a prompt's dispatch: before the write, dispatch-refused and no-turn; after, §3 rules (91.443467ms)
✔ H10: Interrupt and force stop together: one stop chain, force stop supersedes (96.421379ms)
✔ H10: an overlap during the pause before the abort: no abort, the stop ends uncertain (26.481451ms)
✔ H10: a no-turn Interrupt lifts only its own fence; admission stays closed under force stop, overlap or revocation (90.433223ms)
✔ H11: the controller disconnects mid-turn: work continues, the claim is unchanged, control stays put (136.785927ms)
✔ H12: an exact retry after reconnecting to the same incarnation returns the same receipt; one dispatch (18.760651ms)
✔ H13: a retry with the same request ID and different text is refused (21.066392ms)
✔ H14: late stdout from the old engine after a replacement is dropped by incarnation, counted, never rendered (140.367869ms)
✔ H15: a revoked connection's command is refused; the revocation fence holds (72.313081ms)
✔ H16: a second controller for the same session refuses already-active; the first is untouched (20.298869ms)
✔ H10: a second force stop while the first escalation runs refuses fenced; one escalation, and the claim records only the first stop's phases (69.212269ms)
✔ a force stop whose fence throws leaves no escalation flag behind, so the next force stop runs (Darkwing F2, #1507) (28.769638ms)
✔ H17: a confirmation reused, answered from another connection, or used after the stop changed is refused (68.239066ms)
✔ H18: two prompts before any native output: the second refuses busy; one engine write (17.540264ms)
✔ H19: the pipe fails mid-line under a large prompt: delivery-unknown transport-unknown, poisoned, no later write (126.228113ms)
✔ H19: the link itself never writes again after an unknown outcome, whoever calls it (0.813132ms)
✔ H19: the controller dies mid-write of a large line: after restart the outcome is unknown and nothing is resent (527.988326ms)
✔ H20: the line is written but the ack is lost when the controller dies: orphan, outcome unknown, nothing resent (382.623135ms)
✔ H21: a retry of the exact request with the old token after a crash is stale-incarnation; no second write (347.75623ms)
✔ H22: after H21 and a valid recovery, a new request with the new token is admitted (2458.519437ms)
✔ H23: requests pending at a restart are not resent; each shows outcome unknown (485.53284ms)
✔ no shim from this file's tests is left running for the after hook (6.967347ms)
✔ a plain conversation: catalogue row, one page, CHAT-01 records (7.108488ms)
✔ native entries map to blocks: tools, thinking, bash, notices, ids that do not fit (2.089177ms)
✔ F1: a malformed line is an unavailable part at its position, and reading continues (2.45418ms)
✔ F1: a missing parent stops the history with a notice that names the unreadable lines (3.181831ms)
✔ F1: an unreadable fork is never merged into another branch's history (1.773089ms)
✔ F1: a follow stays on its branch when the next entry's parent is unreadable (2.556519ms)
✔ F1: a file whose entries are all unreadable shows a notice per line (1.281022ms)
✔ F2: a truncated trailing line marks the view incomplete, not an error (2.381228ms)
✔ pagination: 100 parts, then the rest; parts concatenate to the whole branch (6.681199ms)
✔ F3: a replaced file (new inode) refuses old cursors with reconcile (8.423994ms)
✔ F4: a same-inode rewrite of the prefix refuses old cursors with reconcile (8.538834ms)
✔ F5: growth between pages keeps the epoch and the page stops at the pinned length (8.86463ms)
✔ F6: unknown, foreign and expired cursors refuse and leave the cursor usable (11.167479ms)
✔ F7: a symlinked file and a symlinked directory component are refused, never opened (11.10171ms)
✔ F8: a file swapped for a symlink after the catalogue is refused (2.667833ms)
✔ F9: registrations never add or redirect a root (1.940808ms)
✔ F10: a header cwd naming another project is refused (4.567552ms)
✔ F11: parentSession renders with a marker and the parent is never opened (1.054965ms)
✔ F12: two leaves: the default leaf is shown and the other branch reads alone (5.671856ms)
✔ F12: a follow refuses when an appended duplicate id changes the branch's earlier parts (3.59968ms)
✔ F12: a second root (Pi's resetLeaf) starts its own branch (1.535824ms)
✔ F13: compaction is a marker in place, then the retained content (0.934658ms)
✔ F14: long strings split into fragments and parts, reassemble exactly, and pages respect the byte cap (649.53992ms)
✔ fragments never cut a surrogate pair and keep an empty string (5.573806ms)
✔ F15: a Claude seat is an unsupported-harness placeholder whose directory is never read (1.829975ms)
✔ unknown conversations, empty files and non-Pi files refuse (2.532823ms)
✔ an unreadable file or root inside the roots is refused per row, not a failed catalogue (1.327761ms)
✔ a seat directory without search permission refuses that root, not the catalogue (2.229537ms)
✔ every page and cursor is a valid CHAT-01 record (967.036159ms)
✔ the engine pin holds for the installed package (2.103304ms)
✔ pinned Pi, sealed and without credentials, answers the controller's commands with the shapes the fake models (349.32061ms)
✔ sealed, pinned Pi ignores a trusted project's .pi resources; --approve past the seal would load them, and checkSeal refuses it (Filbert F2 on #1522) (646.496001ms)
✔ pinned Pi appends thinking_level_change at start when the branch lacks one, so the leaf moves (K8 then fails closed) (336.832985ms)
✔ N25: ordinary Interrupt reconciles; a non-empty queue_update in the window is O5 (101.6476ms)
✔ N1: an extension's follow-up queued after the fence is cleared before any abort; O5, Unknown (52.417843ms)
✔ N1: a follow-up queued before the fence is O5 at once; the Interrupt refuses fenced (27.828427ms)
✔ N2: with abort first, the fake runs the external item (the ordering guard has teeth) (23.190884ms)
✔ N3: the fence lands in preflight, preflight errors, no run: failed, No run, uncertain (34.7205ms)
✔ N4: the ack arrives after the first abort and a run starts: clear and abort again; Interrupted (27.417846ms)
✔ N5: an input handler takes the prompt: ack, no run, delivery-unknown handled-without-run (119.268734ms)
✔ N6: an extension queues between clear_queue and abort: O5 and O6, Unknown (51.137415ms)
✔ N7: clear_queue times out: no abort, nativeQueue unknown, force stop still ends it (1533.381965ms)
✔ N7: clear_queue answers an error: no abort, nativeQueue unknown, the link not poisoned (16.782735ms)
✔ N8: an extension prompt starts a run during Mosaic preflight; the losing settle is O3 (71.421517ms)
✔ N9: a run that started before the fence and ends aborted: failed interrupted, Interrupted (15.288563ms)
✔ N9: decision 34: a run that ends aborted with no stop in progress: aborted-without-stop, uncertain, outcome unknown (16.334105ms)
✔ N9: an aborted that lands after the fence but before any abort is written: aborted-without-stop, Unknown (33.303027ms)
✔ N10: fake conformance (32.826513ms)
✔ N11: the run fails before any user message_start: delivery-unknown ack-without-start, never failed (31.628515ms)
✔ N12: input that starts a run after the final empty clear is O1 and not part of the stop's proof (21.037684ms)
✔ N13: agent_start with no slot held is O1; a later prompt refuses with zero engine bytes (66.60242ms)
✔ N14: the run completes while clear_queue is in flight: finished, Completed first, uncertain (30.713462ms)
✔ N14: the run completes after the abort is written, before Pi applies it: finished, never relabelled (33.527209ms)
✔ N15: the fence lands in preflight, then an input handler takes it: handled-without-run, No run (27.189773ms)
✔ N16: Interrupt with no slot and no run refuses no-turn: no stop, no bytes, admission open (15.33246ms)
✔ N17: the run fails on its own during the exchange: failed, Failed on its own (28.957672ms)
✔ N18: no final assistant message_end, or a lost line: working stays working; before working, transport-unknown (112.47143ms)
✔ N19: a losing extension prompt settles inside the Mosaic run before its user message: O3, run-overlap (139.862639ms)
✔ N20: an extension triggerTurn during Mosaic preflight starts first; while streaming it queues with no signal (88.587651ms)
✔ N21: a losing settle after the receipt settled finished is O2; the receipt stays finished (20.363722ms)
✔ N22: an agent-level custom message is dropped by the clear with no signal; evidence names the seal (16.786595ms)
✔ N23: a nextTurn message survives clear and abort and attaches to the next prompt, with no signal (15.907397ms)
✔ N24: the seal is an allow-list: --extension, a missing --no-* flag, a second --mode or --session, a session or output flag, or a stray word refuses unsealed-engine; no engine starts (48.376245ms)
✔ N24b: the seal covers the engine command and environment: config can't name either, the env is built from names, and a mutated command is refused at bind (32.93676ms)
ℹ tests 182
ℹ suites 0
ℹ pass 182
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 36228.450031
