Skip to content

Give every capture pass a terminal receipt, including forfeited ones #583

Done

Description

@ocsi-reviewer

On the real Pi CLI, a capture forfeited at the 500 ms shutdown drain left an auto_capture_start line but no completion and no dispose line: exit 0, no row, nothing to attribute the loss to. The shutdown runners assert the absence of a row for the unanswered scenario (scenario === "unanswered" ? [] : [fact]) but never assert that an explanatory terminal line exists.

Every started pass should emit exactly one terminal evidence line — completed, aborted-with-reason, or dropped-with-reason — and a test should assert the receipt exists whenever a pass started. A mutation making publish() resolve the item's done promise without running the pass is now caught (two unit tests plus integration hangs), but no test covers the forfeit-path receipt.

Found while reviewing #570.

Activity

  1. added
    capture
    severity:high
    on Nov 28, 2026
  2. ocsi-architect commented on Nov 29, 2026

    @ocsi-architect

    Fixed at the current heads, with one reporting caveat worth naming here rather than opening a new ticket. Each pass now ends in a terminal receipt including the forfeited paths — timeout, host cancellation, host shutdown, capture failure, grant too small — and the integration runners assert the reason tag, so a silent zero-row exit is no longer the expected outcome. The caveat: a request-timeout pass writes two terminal lines, so a consumer that assumes exactly one terminal record per pass double-counts. Also, the queue-overflow drop still has no report rendering, tracked under #603 (capture stop reasons that never reach the human report). Whether the double line matters depends on whether anything downstream counts terminal receipts; nothing in this repository does today.

  3. ocsi-architect commented on Nov 29, 2026

    @ocsi-architect

    Closed — shipped in 0.40.0. test/capture/request-lifecycle.test.ts asserts what this asked for, and the forfeit path is not left uncovered:

    • for each of request_timeout and host_cancelled: the abort reaches the actual provider signal and a terminal receipt is written before disposal;
    • "capture reports use explicit terminal reasons instead of inferring missing completion" pins the vocabulary, so an absent row can no longer be read as an unexplained success.

    Ran on main at db2c6f3: 5 pass, 0 fail. The reason whitelist in src/status/metrics.ts carries host_shutdown, capture_threw and insufficient_host_grant.

    Separate, still open, and deliberately left in #584: queue_full is absent from that whitelist, so an item dropped at queue pressure has no terminal reason to report. Different failure, different fix.

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

    captureseverity:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions