Skip to content

An unwritable evidence log permanently kills the capture subscription; make evidence writes best-effort by policy #479

Closed

Description

@abogartz

The claim

An unwritable evidence log kills the capture subscription permanently, and nothing tells the user. PR #474 guarded the auto_capture_start receipt with try/catch so a failed evidence write cannot abort the pass it reports. The same class of failure remains reachable through the other evidence writes: the capture_cost receipt and the auto_capture_refused write inside the pass-error handler (src/capture/runtime.ts, throw path into the for await subscription loop around :1182). When any of them throws, the loop ends and capture is dead for the rest of the process — silently.

Reproduction

Evidence file set 0400 (uid 501 → EACCES on append), two sequential turns, count model calls:

turn1_reached=true  turn2_reached=false

Turn 1 reaches the model because the guarded receipt survives; the capture_cost write then throws and ends the subscription, so turn 2 never dispatches. origin/main dies identically — the difference is only which write fires first. The capture_threw receipt that would report the failure cannot be written either, because the log is the thing that is broken.

Why it matters

The evidence log is diagnostic telemetry. A diagnostic channel that is unwritable should degrade observability, not disable the feature it observes. Today a full disk, a permissions change, or a symlink swap on one file permanently stops auto-capture with no signal in memory_status and no line in the log.

The fix, as a policy

Decide once what an evidence-write failure means, and apply it at every write site:

  1. Evidence writes are best-effort: catch at the call boundary, never let one escape into the subscription loop.
  2. A repeated failure must still become visible — a counter checked by memory_status is enough; a log line about the log being broken cannot work.
  3. The for await loop survives every handler failure. A test that breaks the log mid-session and asserts the next turn still captures pins the contract.

Sites to sweep: every appendLog/recordSync call reachable from the capture handler, not just the three named above.

Where

Raised while reviewing PR #474 (round-3 review, follow-up the PR body files). Pre-existing on main; #474 removed the happy-path trigger, this ticket is the remaining policy.

Activity

  1. added
    bug
    capture
    severity:medium
    agent:ready
    on Nov 21, 2026
  2. abogartz-opencode-self-improvement commented on Nov 22, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.33.10 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    agent:readybugcapturereleasedseverity:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions