Skip to content

Hypothesis ledger: show what each agent tried and ruled out #303

Closed

Description

@currentbits

Inspired by Datadog Bits AI's hypothesis ledger (every hypothesis classified validated / invalidated / inconclusive — you see what was ruled out, not just the winner).

For debugging threads and best-of-N runs, record and show the approaches each agent tried and rejected, with the reason. 'Ruled out' is information: it stops the next agent (or next run) from re-treading a dead end, and it feeds the failure-clustering and verification features.

Activity

  1. added
    enhancement
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 17, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Design (implementation under way):

    • Capture is agent-authored, never inferred. New hypothesis_record tool on the existing coder-threads MCP server: { threadId, projectId, claim, status: validated|invalidated|inconclusive, reason }. No transcript mining, no LLM pass, no scheduler.
    • Storage rides the thread: ThreadInfo.hypotheses (contract in src/shared/ipc.ts, capped 50 rows / 200-char claim / 500-char reason), written without bumping updatedAt — a ledger entry is not sidebar activity.
    • The ruled-out list feeds the next agent. hypothesisNoteFor joins planboardNoteFor / selfIdNoteFor as a standing note on every dispatched prompt, carrying the invalidated entries of the thread and its handoffFrom ancestors (10 lines max, deduped). That is what stops the next agent — or the next best-of-N fork — from re-treading a dead end, and it survives compaction because it rides every turn.
    • Surface: a read-only ledger card on the Agents tab, ruled-out group first, with claim, reason and age.

    Two workers in flight on disjoint halves (electron/ and src/) off a frozen type contract.

  3. added
    plan:done
    and removed
    plan:doing
    on Aug 17, 2026
  4. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Shipped on coder/hypothesis-ledger-show-what-each-agent-t-887a7e.

    • electron/services.js — recordHypothesis (validates status, trims/caps claim+reason, 50-row cap, no updatedAt bump) and hypothesisNoteFor (invalidated entries of the thread + up to 5 handoffFrom hops, deduped by claim, 10 lines).
    • electron/runner.js — the note joins planboardNoteFor/selfIdNoteFor on every dispatched prompt, so it survives compaction and resumed sessions.
    • electron/orchServer.js — hypothesis_record MCP tool behind the same assertSameProject guard, plus a line in the server INSTRUCTIONS telling agents to keep the ledger current.
    • src/hypothesisLedger.ts + Agents-tab card — ruled-out group first, claim / reason / age, rendered only when the thread has entries.
    • Tests: 19 new electron assertions (electron/test/hypotheses.test.js) + test/hypothesisLedger.test.ts. test:electron 992/993 (the one failure is the web-integration reconnect test that already fails on main), test:renderer 831/831, typecheck clean.
    • Dogfooded read-only against the live 304-thread store: no throws, no note on any existing thread, and a fabricated entry on a real handoff parent reaches its worker.

    Not built: cross-sibling rollup for best-of-N (siblings start simultaneously, so one's dead end cannot reach the others in time) and any UI to edit or delete entries.

  5. added a commit that references this issue on Aug 17, 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

    enhancementplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions