Skip to content

Epic: tests exercise the code paths production runs #2540

Open
0 of 6 issues completed
Open

Description

@schlessera

Outcome

Every test that claims to cover a behaviour drives the code path production runs for that behaviour. No suite passes against a component, helper or wiring that the shipped app does not use, and no test re-types production logic by hand in place of calling it.

Why now

A repository review on 2026-10-22 (main dcf5341aa) found suites that stay green whatever production does, because they exercise a sibling of the real path. These give false confidence: a regression in the shipped path cannot turn them red, which contradicts the repo's rule that "a green test is evidence only if it could have been red" (docs/process/testing.md). This epic closes those findings: #2522, #2523, #2524, #2525, #2526, #2758. The related dispatch-gate test gap (#2527) lives under #51, which owns that gate.

Shared context

Patterns the review found, with examples:

  • A test-only twin of a production component (ui-react: nine test files exercise ToolCallTimeline, which production never renders #2524). Production renders ToolCallTimelineCell (packages/ui-react/src/components/chat/message-bubble.tsx:16,425). ToolCallTimeline (packages/ui-react/src/components/chat/tool-call-timeline.tsx:43) has its own collapse state, and only tests render it: render-smoke, approval-effect, copy-control, registration-on-mount and four browser layout suites.
  • Production logic re-typed in the test (ui-server: the governance-policy tests record policy with their own copy of createApp's INSERT #2758). packages/ui-server/src/app.ts:604-608 records turn governance policy with an inline INSERT INTO turn_governance_policy. packages/ui-server/tests/governance-policy.test.ts:42-43 writes its own copy of that statement, so a change in app.ts cannot fail the test.
  • A retired path kept alive by its test (ui-react: helpers that only tests call are shipped in src #2525). inlineRenderedFences (packages/ui-react/src/lib/mermaid.ts:223) has been replaced in production by content-renderer-share.ts, but tests/mermaid-fences.test.ts still tests the old budget path.
    Supporting observation, not committed work in this epic: registerStaticRenderers is called only in tests (packages/ui-server/tests/render-routes.test.ts:70-85), while the render route consumes the registry through staticRendererFor (packages/ui-server/src/routes/render.ts:62). registerStaticRenderers is a public @schlessera/brain-ui-sdk/render export (packages/ui-sdk/src/render.ts:43), so a test registering through it may be exercising the supported host-registration path rather than a false twin. Whether in-tree production should populate that registry is a host-registration contract question that has to be stated first; it is not a finding of this epic and none of its children resolves it.

The fix pattern is the same in each case: point the test at the shipped entry (the component the app renders, the function createApp calls, the registry production populates), then delete the twin or move it out of src.

Constraints and non-goals

  • Do not lower assertion strength or delete a unique assertion. Each moved assertion must still be able to fail, proven by a mutation of the production path recorded in the PR (docs/process/testing.md, "Required proof for a PR").
  • Keyless and offline as always. No test may need an API key or the network.
  • Out: test speed and redundancy (Epic: tests give faster feedback with less redundant work #1849 owns those), and new coverage for untested behaviour that has no false twin.

Breakdown

One child per committed finding. Each names the production path, the test that misses it, and the mutation that proves the retargeted test can fail:

They are independent.

Definition of done

  • Each child's PR records a mutation to the production path that turns the retargeted test red, and the restore that turns it green.
  • No src export remains whose only importers are tests and whose production counterpart is a different symbol (re-checked with the grep each child names).

Found by a repository review on 2026-10-22.

2026-10-24: gave the copied governance-policy INSERT its own child (#2758), recorded static-renderer registration as a supporting observation outside this epic's committed work, named each child's finding, and moved the source-navigation notes to the comments (already recorded there).

2026-10-24 continued triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: Verified the production/test governance INSERT copies and static-renderer lookup and refreshed their moved anchors. The six committed false-twin findings retain their children; the supporting host-registration observation stays explicitly outside committed scope. No test or public renderer behavior changed.

2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Refreshed moved current-source pointers by inspecting their named anchors. Historical receipts retain their source identities; scope, rulings, priorities and outstanding prerequisites are preserved. No runtime result or readiness is inferred from this navigation repair.

2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Verified moved current-source anchors and refreshed their pointers after the reference-tool delivery. Historical failed receipts retain their source identities; scope, rulings and unresolved needs are unchanged. No runtime result or readiness is inferred.

2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Verified the test-side copied governance INSERT anchor moved by two lines after the peer-wait coverage. Refreshed that current-source pointer only; no false-twin finding, prerequisite or proof result is changed.

2026-10-25 triage at main 827861e1fa71cd4a26b52f1ef0f96b849381acdf: Verified moved current-source anchors and refreshed navigation; historical receipts and unresolved prerequisites retain their identities. No new runtime proof is claimed.

2026-10-25 triage at main 541b8d98328a760290ac6dd4a7f065af76153408: Verified the moved current-source anchors after the off-loop writer slices and refreshed their pointers; historical failed-source receipts, scope and unresolved prerequisites remain unchanged. No new runtime qualification is claimed.

Activity

  1. added
    type: testCoverage, harness or proof work with no behaviour change.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    area: backendsAgentBackend implementations and the seam they share.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    epicA tracking issue. The work lives in its sub-issues; this one is never coded directly.
    on Oct 21, 2026
  2. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 triage at 2ba99c607dec41f95be5901fc8f309611806ceb5: verified the actual inline turn-governance INSERT and corrected moved active source anchors after #2464. Preserve historical receipt attribution, scope, readiness and outstanding prerequisites; source navigation is not new runtime proof or activation.

  3. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 source navigation at main aeaaf7794b6be41fde4e01bef78ce3f1a5828ac6: verified and refreshed the moved active app-construction citation(s) after #2397. Historical source-bound receipts, scope, decisions and prerequisites are unchanged; no new runtime, activation or epic-completion evidence is claimed.

  4. schlessera commented on Oct 23, 2026

    @schlessera
    OwnerAuthor

    2026-10-23 source navigation at main f3c6fdc9f9c6321fda5a384cf8cfd8bf2e4846da: verified and refreshed moved active app-construction anchors after reference-source composition. Historical source-bound receipts, scope, decisions and prerequisites remain unchanged; no new runtime, autonomous activation or epic completion is claimed.

  5. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: Verified the production/test governance INSERT copies and static-renderer lookup and refreshed their moved anchors. The six committed false-twin findings retain their children; the supporting host-registration observation stays explicitly outside committed scope. No test or public renderer behavior changed.

  6. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Refreshed moved current-source pointers by inspecting their named anchors. Historical receipts retain their source identities; scope, rulings, priorities and outstanding prerequisites are preserved. No runtime result or readiness is inferred from this navigation repair.

  7. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Verified moved current-source anchors and refreshed their pointers after the reference-tool delivery. Historical failed receipts retain their source identities; scope, rulings and unresolved needs are unchanged. No runtime result or readiness is inferred.

  8. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Verified the test-side copied governance INSERT anchor moved by two lines after the peer-wait coverage. Refreshed that current-source pointer only; no false-twin finding, prerequisite or proof result is changed.

  9. schlessera commented on Oct 25, 2026

    @schlessera
    OwnerAuthor

    2026-10-25 triage at main 827861e1fa71cd4a26b52f1ef0f96b849381acdf: Verified moved current-source anchors and refreshed navigation; historical receipts and unresolved prerequisites retain their identities. No new runtime proof is claimed.

  10. schlessera commented on Oct 25, 2026

    @schlessera
    OwnerAuthor

    2026-10-25 triage at main 541b8d98328a760290ac6dd4a7f065af76153408: Verified the moved current-source anchors after the off-loop writer slices and refreshed their pointers; historical failed-source receipts, scope and unresolved prerequisites remain unchanged. No new runtime qualification is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendsAgentBackend implementations and the seam they share.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.epicA tracking issue. The work lives in its sub-issues; this one is never coded directly.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions