Repository navigation
Closed
Labels
area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: testCoverage, harness or proof work with no behaviour change.
Milestone
Description
Context
Shard e3855-ui-server-02 of the #3855 test-health push: 107 packages/ui-server test files, audited in 57 clusters through all eight lenses (run th-20261110163713-d24921, batch branch test-health/e3855-ui-server-02). 56 test files change, plus one example added to rule S4 of docs/process/test-authoring.md. Of 355 findings, 101 are fixed, 6 filed, 17 deferred and 231 accepted. Two duplicate cases are removed, each with an obligation map and a killed mutation on the retained owner.
Fixed findings, one line each:
hygiene-media-effects.test.ts(nothing-to-observe): The title's identity-reuse claim was never exercised; the case now applies a persist plan under one identity and expects the delete plan under the same identity to be refused with nothing written, killed by disabling the guard at media-effects.ts:204.inbox-snapshot.test.ts(weak-matcher): Only the constant format literal was asserted; the case now checks version 1, that the image matches its declared sha256 and that the heartbeat row is in the deserialized image, killed by breaking the digest in encode().hygiene-media-effects.test.ts(opaque-failure): A boolean compared a 2 MiB string, so a failure said only 'false'; it now compares sha256 digests, and the duplicated comment at the tamper table is gone.hygiene-media-effects.test.ts(giant-test): One case built four real repositories in a loop and timed out at 30 s in 2/2 runs of one baseline (29.1 s median in another); it is now one case per answer and path with every assertion kept and no deadline changed.governance-policy.test.ts(wrong-object): Without a writer the fixture recorded policy with its own copy of the INSERT (ui-server: the governance-policy tests record policy with their own copy of createApp's INSERT #2758), so a broken production recorder could not fail the policy-row assertions; the fixture now always calls the production governed-turn-writes recordPolicy procedure through procedureCaller, and dropping its errors column fails the invalid-edits test.governance-policy.test.ts(weak-matcher): manifest()?.ended_at not.toBeNull passed when the manifest row was gone (undefined is not null) and the checks sat behind an if; the test now asserts the exact policy row and the closed manifest row with a numeric ended_at, and a close that deletes the row fails it.governance-policy.test.ts(unawaited-async): Five governed-turn end() calls, which release the writer gate and can throw on reconciliation, were left unawaited so their work and errors could outlive the test and its db cleanup; each is now awaited.http-internal-mounts.test.ts(opaque-failure): Four route-table checks (lines 9, 26, 52, 73) asserted a .some() boolean, so a failure printed only true/false; they now compare the matching routes' method and classification (or the empty list), with the same pass condition.integration/real-socket.test.ts(leaked-resource): The static-root temp directory was removed only after the assertions passed; it is now registered with the afterEach cleanup so a failure no longer leaks it.integration/real-socket.test.ts(opaque-failure): A boolean .some() check printed only true/false; it now uses toContainEqual so a failure prints the received frames, and a control mutation of the PARSE_ERROR code is killed.integration/real-socket-answers.test.ts(opaque-failure): A boolean .some() check for stale events printed only true/false; it now asserts the filtered stale events equal [] so a failure prints them.integration/inbox-dispatch-recovery.test.ts(opaque-failure): An every() boolean printed only true/false and accepted any number of reservations; it now compares the purpose and charged turns of each reservation, killed by charging zero turns on recovery.integration/inbox-dispatch-recovery.test.ts(settling-sleep): resolve() relied on a 300 ms sleep for the decision to commit before the follow-up and kill assertions; it now polls the database until the Action is resolved, and keeps the 300 ms only as the negative-observation window for an error frame from the duplicate tap.inbox-runtime.test.ts(opaque-failure): every(destroyed) printed only false; the test now compares each candidate's destroyed flag, which also pins the count.inbox-runtime.test.ts(opaque-failure): Same boolean every() replaced by comparing the per-socket destroyed flags.inbox-runtime.test.ts(opaque-failure): Same boolean every() replaced by comparing the per-socket destroyed flags.inbox-budget.test.ts(weak-matcher): not.toBeNull accepted a claim returning pre-commit ready items; it now asserts the run id and the claimed item with one attempt.integration/inbox-bridge-host.test.ts(weak-matcher): inboxList was only asserted defined and never called; the turn now lists the queue and asserts the arrival and its untrusted thread (the other three tools were already called).inbox-dispatcher.test.ts(nothing-to-observe): The name claims an unconfigured selection but the harness always selected a profile; the fixture can now select none and the test asserts an exact clean tick, no turn and a triage-only attempt.host-fallback-gates.test.ts(weak-matcher): rejects.toBeDefined accepted any rejection, including a refusal before spawn; the failed launch now must surface its ENOENT spawn error (settled, not via expect().rejects).journal-index-metadata-only.test.ts(masked-assertion): await expect(journal promise).rejects stalled on the ui.db write worker when the metadata-only guard was broken (mutated run hung 19 min, receipts/c9-C5.json), so the named assertion never reported; both rejects in the file now settle with then() and assert the value, and the same mutation is killed.journal-index-metadata-only.test.ts(opaque-failure): wal.every(...) toBe(true) hid which refresh kept its stamp; it now asserts the list of unchanged-stamp changes is empty, so a failure prints them.inbox-resolve.test.ts(weak-matcher): toBeDefined on the first resolution's followUpId let a first resolution reported as a replay pass; it now asserts replay false and that the returned id names the ready execute follow-up carrying the operation.inbox-escalate.test.ts(weak-matcher): toBeDefined on the winning resolution's followUpId never checked it was the winner or the persisted follow-up; it now asserts replay false and that the single execute item carries that id.inbox-resolve.test.ts(opaque-failure): A boolean over every ready file printed only true/false; the assertion now lists the ready files still missing.inbox-stream.test.ts(opaque-failure): Four every(...).toBe(true) checks (lines 129, 161, 164, 272) printed only true/false; they now compare the offending changes, the append flags and the largest frame size, and a frame-cap mutation is killed on the size assertion.gpt-live-conversation.test.ts(opaque-failure): Boolean every/some checks at lines 162, 246, 248 and 259 now compare the delegation ids, the largest chunk and the frames themselves; a 500-to-600 byte chunk mutation is killed on the size assertion; the remaining negative some(...).toBe(false) checks are left as they are.gpt-live-conversation.test.ts(earlier-layer-answers): A pending expect(returning).rejects held the test until the 2 s acknowledgement timer rejected, so the connection-loss rejection in finish() was never exercised (deleting it survived, receipt overwritten by the kill); the result is now settled by hand, the replay is refused before the loss, and acceptance must be unknown as soon as the closed event arrives, which also removes the 2 s real-time wait.jobs-board-defaults-http.test.ts(opaque-failure): An every(...) boolean hid which board was not empty; the test now compares the per-board statuses to the expected list.governance-roadblocks.test.ts(conditional-assertion): The schema check ran only inside a loop over the episodes and the determinism checks hold for an empty result, so a classifier returning nothing stayed green; the test now counts validated payloads and requires at least one.governance-roadblock-report.test.ts(oversized-fixture): 501 separately committed event writes cost about 4 s on this machine; they now share one transaction with identical rows, and a one-page LIMIT mutant is still killed (receipts/c13-F4.json).host-publication-safety.test.ts(opaque-failure): Two some(...deny) booleans printed only true/false; they now filter the denying hook outputs and compare them with an empty list, so a failure prints the denial.host-publication-safety.test.ts(opaque-failure): The policy file was compared through a boolean that hid its content and let the refused case accept any non-proposed text; it now compares the file with the original or the proposal, and a mutant dropping the recorder-health fence is killed (receipts/c13-F3.json).inbox-triage.test.ts(opaque-failure): Nine.every(...)/.some(...)).toBe(true|false)assertions printed only a boolean (and two passed on an empty list); they now compare the mapped values with pinned counts, so a failure names the reservation, reason or span that differs.inbox-intake.test.ts(order-dependent): The test asserted absolute thread/item/staging counts on the file-shared app and failed in 4 of 10 shuffled baseline runs; it now asserts exactly what this share adds against a snapshot taken first.inbox-intake.test.ts(order-dependent): The redirect test left redirect-credential.json in the shared brain root, failing the real-CLI test's root listing whenever it ran first; it now removes its credential file in finally.inbox-intake.test.ts(leaked-resource): The test's own intake was closed only on success; it is now closed in finally.host-processes.test.ts(weak-matcher): ownedChild's two toBeDefined checks stayed green with the helper's argument filter deleted (every host process captured); it now asserts the capture set is exactly the wait owner and its child, and drops a dead number branch.host-processes.test.ts(opaque-failure): some(...).toBe(false) hid the captured PIDs; it now asserts the captured PID list does not contain this process.interactive-share.test.ts(weak-matcher): toBeDefined accepted any receipt id, so a wrong id surfaced only as a later completion rejection; it now names the persisted inbox_share_applications row id (control mutation on principal-scoped session recovery also killed, receipts/c16-control.json).interactive-share.test.ts(per-test-setup): Every fixture re-ran Bun.password.hashSync (about 100 ms) though no test signs in with the password; the hash is now computed once at module level.media-review-flow.test.ts(settling-sleep): A 500 ms sleep stood in for the server finishing the agent's decision, so on a loaded host the no-change assertions could run before the decision was handled; the test now waits for the INBOX_DECISION_REFUSED frame the server sends to the agent's socket, then asserts nothing changed.journal-database.test.ts(conditional-assertion): Every assertion sat in a loop over post-split migration files, so a moved split constant or an emptied directory passed by examining nothing; the test now asserts both journal and UI migrations exist after the split (mutating JOURNAL_SPLIT_MIGRATION to 999 is killed).journal-database.test.ts(leaked-resource): Ledger writes and the native fixture and backup setup ran before the try in three tests, so a failure there leaked an open database, the native fixture and the temp directory; setup now runs inside the try that owns teardown (tests at lines 99, 162 and 178).files-walker.test.ts(order-dependent): The slug-collision test left notes/README.md in the shared root, so shuffled runs failed 'maps lowercase basename' (3/10), and the scratch-area route test left .brain/scratch/trip.pdf for the exact scratch listing; both now clean up in finally, as do the manifest and big.txt tests.files-walker.test.ts(weak-matcher): resolves.toBeTruthy accepted any path; it now asserts the lexical path under the root's realpath.files-walker.test.ts(weak-matcher): resolves.toBeTruthy accepted any path; it now asserts the root's realpath.files-walker.test.ts(weak-matcher): resolves.toBeTruthy on an in-brain link could not tell the documented lexical answer from the canonical one; it now asserts the link's lexical path.files-walker.test.ts(opaque-failure): A per-name boolean loop hid which dot entry leaked and passed on an empty listing; it now pins README.md and compares the dot-named entries to [].files-walker.test.ts(opaque-failure): listing.some(...) booleans hid the listing; the names are now compared with toContain / not.toContain.files-walker.test.ts(leaked-resource): The symlink-escape target directory, named with Date.now in tmpdir, was never removed; it is now made with mktemp and removed in afterAll.inbox-store.test.ts(weak-matcher): A bare toThrow() accepted any error for the write_policy option; it now requires the v1 effect schema's rejection, and removing that parse fails it.inbox-store.test.ts(opaque-failure): An every(...) boolean hid which removal belonged to another thread; the removals' thread ids are now compared as a list.inbox-store.test.ts(opaque-failure): An every(...) boolean hid the stray file name; the test now asserts the list of non-database files is empty.inbox-notify.test.ts(opaque-failure): A some(...) boolean printed only false/true; the attempt outcomes are now compared as the exact three ambiguous attempts, which also states the 'no fourth attempt' claim (control mutation of the attempt limit is killed).journal-idle-maintenance.test.ts(earlier-layer-answers): The test called maintain() itself, so it stayed green with the journal's own post-ready idle pass deleted (receipts/c24-F1-before.json survived); it now awaits idle() after ready and the same mutant is killed.journal-index-purge.test.ts(opaque-failure): Compound && / || booleans and every() checks (lines 118, 210, 211, 300) hid which object or pin was wrong; they now compare the file list and the pin rows directly, and dropping the namedHashes guard still fails the rewritten test.journal-snapshot.test.ts(opaque-failure): A some() boolean hid which Git execution input was retained; it now lists the offending paths.http-discovery-voice.test.ts(opaque-failure): calls.every(...) toBe(true) hid which grant call carried the wrong Authorization header; it now compares the two header values directly.model-pricing.test.ts(weak-matcher): not.toBeNull also passed on the bundled snapshot (which carries claude-sonnet-4-5), so a burst that never landed remote data stayed green; it now asserts the litellm-sourced, non-estimate rate.model-pricing.test.ts(weak-matcher): not.toBeNull could not tell the stale remote table from the snapshot fallback; it now asserts the litellm-sourced, non-estimate rate, killing a mutant that drops to the snapshot once stale.model-pricing.test.ts(duplicate-case): Both assertions (glm-4.7 resolves at 6e-7 from openrouter despite the LiteLLM 9e-7 entry) are a subset of the string-rates toEqual and repeated by the unknown-route precedence test; removed.model-pricing.test.ts(duplicate-case): A ui-sdk helper unit test copied verbatim (same two inputs) from ui-backend-claude's model-discovery tests; the pricing path's own use is owned by the dated-id resolution test, so the copy and its import were removed.models-routes.test.ts(weak-matcher): toBeDefined accepted any backend object; the test now asserts the pinned profile resolves to the claude backend by id.models-routes.test.ts(empty-by-construction): The stored default was never on the roster, so an unconditional reset passed; the test now also proves a default whose profile is still listed survives the same write.models-routes.test.ts(opaque-failure): every(!hidden) toBe(true) hid which row was hidden; it now compares the hidden flags as values.maintenance-temp-boundary-diagnostics.test.ts(opaque-failure): The endsWith boolean printed only true/false on failure; it now uses toEndWith so the retained stderr tail is shown, and a mutation skipping the reservation release still kills the test.graph-routes.test.ts(unrestored-global): The test set process.env.BRAIN_PATH and never restored it, though the routes read only their injected brainRoot (which has no fixture here), so the dead, leaking write was removed.graph-routes.test.ts(opaque-failure): A some() boolean hid which ids survived the cap; the test now asserts the id list does not contain the dropped note.graph-routes.test.ts(opaque-failure): A some() boolean hid which node was virtual; the test now asserts the virtual nodes equal an empty list, so a failure prints them.index-directory.test.ts(leaked-resource): The reader's bwrap child blocks on stdin until read(), so a failure between ready() and read() left it alive for the rest of the shared Bun process; it is now killed in the file's afterEach cleanup.integration/brain-db-schema-contract.test.ts(weak-matcher): toBeTruthy accepted any non-empty computedAt (a mutant stamping String(Date.now()) passed); it now asserts the ISO-8601 UTC instant core writes and staleness parses.integration/brain-db-schema-contract.test.ts(weak-matcher): toBeDefined accepted any community id (a mutant offsetting every node's community by 1000 passed); the node's community must now be one the graph meta lists.maintenance-provider-relay.test.ts(shared-state): beforeAll's brain index --embeddings request landed in the shared seen list and afterEach only cleared it after the first test, so whichever seen-asserting case ran first failed (1 of 5 shuffled baseline runs; deterministic when run alone with -t); beforeAll now clears seen once the index has finished.live-history-track.test.ts(derived-expectation): The failure join was only compared live-vs-ordinary, so a prepareHistory that dropped the failure from both stayed green; the ordinary failure is now pinned to the turn's overloaded failure (old test survived the mutant, new one kills it).live-history-track.test.ts(opaque-failure): every(...).toBe(true) printed only a boolean; it now asserts the two assistant turn ids as values and that they are distinct.http-validation.test.ts(weak-matcher): The missing-q search error was only checked toBeString, so a generic 400 passed a test named for route-specific errors; it now asserts the exact error body.http-validation.test.ts(earlier-layer-answers): The missing-content case asserted only status 400, so an earlier invalid-body branch rejecting {} passed it; it now asserts the content-required error.http-validation.test.ts(opaque-failure): calls.some(...) toBe(false) hid which CLI commands ran; it now asserts the recorded command names do not contain add.http-validation.test.ts(opaque-failure): calls.every(...) toBe(true) hid the rendered HTML; it now compares each call's html with stringContaining, proven by a killed control mutation that blanks the PDF html.http-cli-errors.test.ts(opaque-failure): frames.some(...).toBe(true) printed only true/false; it now asserts toContainEqual on the progress frame so a failure prints the frames, and a mutant that rewrites the streamed progress text is killed.gemini-speech.test.ts(empty-by-construction): Only Gemini was configured, so 'no other provider is tried' held by construction; the app now also has a Deepgram key (VOICE_PROVIDER=gemini) and the double records and the test asserts no request to any other endpoint, killing a route fallback-to-Deepgram mutant.live-history-order.test.ts(conditional-assertion): write_gap was asserted only in the partial cell, so the complete cell passed with write_gap added for complete pages; both cells now pin the exact coverage envelope.live-history-order.test.ts(derived-expectation): The expected order was the sorted actual indexOf list, so a dropped first item (-1 sorts first) passed (probe receipts/c42-probe-order.json survived); it now asserts the native texts appear in native order.live-history-source.test.ts(weak-matcher): rejects.toThrow() accepted any error, including one from a broken fake, and the table carried an unreachable third branch; each cell now names its guard's message and the dead branch is gone.live-history-source.test.ts(nothing-to-observe): Every cell passed with the stored-conversation identity guard deleted (probe receipts/c42-probe-identity.json survived) because no receipt could change the output; a witnessed completed receipt now yields its fact only when conversation, principal and session match.live-history-source.test.ts(opaque-failure): items.some(...).toBe(false) hid the item texts; it now asserts the text list does not contain the carrier.frame-headers.test.ts(unclear-name): The title said the middleware appends frame protection, but the raw route supplies frame-ancestors itself and the middleware only refrains from overwriting it; renamed to state that, and deleting the guard still kills the test.geo-route.test.ts(leaked-resource): The config() helper created a mkdtemp cache directory for each of twelve route tests and nothing removed it; an afterEach now removes every directory it handed out, whatever the test's outcome.helpers/test-app.test.ts(order-dependent): The teardown case asserted the effects of another describe's afterAll and failed 3 of 10 shuffled baseline runs; it now boots and tears down its own app, snapshotting the env at its own start, and is stable over 10 shuffled runs.helpers/test-app.test.ts(empty-by-construction): The restore check walked a key list missing WEBAUTHN_ORIGINS, CLAUDE_CODE_PATH and the four native-broker keys the helper sets, so a teardown leaking them stayed green; the list now names every key, and dropping BRAIN_UI_NATIVE_BRAIN_SOCKET from the helper's restore list is killed.helpers/test-app.test.ts(nothing-to-observe): The suite passed a SOURCE_COMMIT override but nothing read its effect, so deleting the helper's options.env loop stayed green; the boot case now asserts config.sourceCommit and that mutation is killed.inbox-bin.test.ts(opaque-failure): The spawn helper JSON.parsed stdout unconditionally, so a crashing bin failed with a bare JSON parse error that hid stderr and the exit code; non-JSON stdout now stays raw text and the full-envelope toEqual diff shows the crash (mutant throwing before the try is killed with its message in the failure).governed-manifest.test.ts(weak-matcher): The 'identity and bytes' claim only matched a 64-hex hash format, so a manifest recording no inode survived (receipts/c49-F2-before.json); it now pins type, dev, ino and the sha256 of the known bytes.governed-manifest.test.ts(opaque-failure): The finally block chmodded a quarantine that exists only after line 104, so an earlier failure was replaced by ENOENT; it now restores the mode only when the directory exists.journal-objects-async.test.ts(earlier-layer-answers): Heartbeats counted over the whole capture were supplied by the async open/fsync/link steps, so synchronous source reads survived (receipts/c50-pre-yield.json); the test now samples heartbeats at ledger admission, after the read-only identity pass and before any other await.native-brain-leases.test.ts(nothing-to-observe): The negative check after one microtask gave a non-draining close no chance to act (the whole test survived deleting the drain); it now awaits the lease writer's idle barrier so a skipped drain has already committed its deletion intent.native-brain-leases.test.ts(earlier-layer-answers): The pre-lookup in-flight guard always answered first, so the post-lookup recheck survived deletion (receipts c53-control-settle*.json); a new case starts the newer release while the pool answers and kills that mutant.native-brain-leases.test.ts(opaque-failure): A boolean hid the lease row seen at RPC time (and a missing row threw inside the double instead of failing the named assertion); the row itself is now compared.frontmatter-data-only.test.ts(nothing-to-observe): The discovery step discarded manager.list() and only checked that no engine ran, so discovery that never parsed the SKILL.md stayed green; it now asserts the listed skill carries the data-only refusal warning.index-read-barrier.test.ts(nothing-to-observe): The harness mounted handlers only for search and graph/meta, so dropping list, stats, stats/history or briefing from INDEX_READ_ROUTES stayed green (receipts/c56-F1-before.json survived); a new case now probes each of those routes by literal path and asserts each read runs after its own queued update.
Acceptance criteria
- The batch pull request lands in
epic/3855-test-healthwithbun scripts/test-health.ts batch verifyreportingok: trueon its head. - Hosted
proofpasses on the pull request's current head.
Metadata
Metadata
Assignees
Labels
area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: testCoverage, harness or proof work with no behaviour change.
Activity
schlessera commentedon Nov 11, 2026
Delivered by #3961, which merged into
epic/3855-test-healthasef36102bf(the push in #3855). It landed in the combined merge without proof of its own; the gate, typecheck andcheck:prpassed on the combined branch. The epic's two exhaustive runs ondc2439551, 42996974186 and 42997012467, then passed. GitHub does not applyClosesfor a pull request into a non-default branch, so I'm closing this by hand. The change reachesmainwith the epic's single landing pull request.