Skip to content

captureSignalSince requires success, so a pure failure is never captured #383

Open

Description

@abogartz

Problem

With captureOnSignal on, a session that fails and never recovers is not a signal, so the cost lever suppresses precisely the session whose knowledge is most valuable.

captureSignalSince (src/capture/policy.ts) admits a window on three grounds:

  • edited — a file was written
  • gateRecovered — a gate command went FAIL then PASS
  • newCommandPassed — a command passed that had never passed

All three require success. An agent that investigates thoroughly, goes down a dead end, and stops with the suite still red produces no signal.

Why this is the target class, not an edge case

The code comment is honest about the intent: "an unknown tool name or a trimmed ledger tail can only cause a MISSED capture, and a missed capture costs nothing the next signal-bearing turn cannot recover." That reasoning holds for malformed input. A pure failure is different: there is no next signal-bearing turn, because the session ends failed. The knowledge is gone.

The bench measured what that costs on 2026-11-10: a session that failed after 574 s and 33,287 tokens (benchmark-tests/ocsi/results-learn-t3-diag) is exactly the class that should be captured, and the cold controls that failed had run zero verification attempts, so not even edited was reliably present in the window.

Interaction with the attested-failure work

The lesson-capture change (the PR that adds attestedGateFailures) reads the ledger for gate failures with no later PASS. It is the right thing to capture. But captureOnSignal can still refuse to run the pass that would capture it, so the two features are only useful together.

Suggested change

Add one branch to captureSignalSince:

  • gateUnrecovered — a gate command FAILED in the window and no later PASS of the same family exists.

attestedGateFailures already computes exactly that set, so this is one call and one return.

Cost

captureOnSignal exists to stop paying for capture on windows with nothing durable in them. gateUnrecovered deliberately widens it for the one case where the durable content is a negative. Worth measuring against the #365 cost table before shipping, since the whole point of that switch was cost.

Activity

  1. added
    enhancement
    on Nov 10, 2026
  2. abogartz commented on Nov 11, 2026

    @abogartz
    OwnerAuthor

    The "574 s and 33,287 tokens" figure for the failed session is bad-metric. The wall seconds stand; the token figure does not.


    Cost retraction (#392). The token figure above came from runSession().tokens = input + output + reasoning, with cache excluded and capture excluded. On this provider input is only the uncached remainder: one run reported 13,393 of 187,856 tokens that actually moved — 7%. A metric that undercounts by 93% still produces a plausible number, and a plausible number gets quoted.

    Disposition: retracted as a cost claim. Do not quote it as tokens moved, saved, or spent. The stored wire logs for this run carry no provider usage object, so no recomputed figure exists.

    Corrected metric, in force: work = session generation + capture generation, with cache read/write reported separately and never folded in. Two results survive it, both with n and seat named on #386: transport 0/5 to 5/5 (leak-checked, one seat) and reuse median 0.98x (n=6, no measurable effect).

    Rules now written down where contributors hit them: no cost claim below n=6 pairs per arm; a ratio at 6 <= n < 21 is labelled "20% resolution"; the word "cheaper" does not appear without an n, a seat and a metric named on the same line; no dollar figure without a hosted-provider measurement.

  3. added
    capture
    severity:medium
    on Nov 14, 2026
  4. WhollyMindless commented on Nov 18, 2026

    @WhollyMindless
    Contributor

    Picking up #383. I will add unrecovered, ledger-attested gate failures as a captureOnSignal signal, reuse attestedGateFailures, and pin the policy and composed capture path with failure/recovery/window controls. Existing capture defaults and attestation protections will remain in place.

    I will report local functional validation separately from the requested live cost comparison against #365. The latter remains unmeasured until a suitable real-seat run; I will not reuse the retracted token figure or claim a cost benefit from scripted tests. Please flag overlapping work or scope changes.

  5. added
    tier:full
    on Nov 23, 2026
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

    captureenhancementseverity:mediumtier:full

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions