Skip to content

feat: build stamps on ledger rows, a printed proposer trigger, and a cause per failure class - #856

Merged
dmmdea merged 5 commits into
mainfrom
feat/rsi-register-followups
Nov 12, 2026
Merged

dmmdea merged 5 commits into
mainfrom
feat/rsi-register-followups

Conversation

@dmmdea

@dmmdea dmmdea commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Intent

Three follow-ups from the 2026-11-12 audit of the self-improvement instruments: failure counts could not be split by the build that produced them, the proposer trigger of ADR 0036 was read off the wrong count, and no failure class had a recorded root cause.

Scope

In: the ledger's one write path (three new optional fields), the trace corpus rows, ledger --failures (a --by-build split and a cause per class), a trace-corpus trigger mode, read-time and write-time refiling of three misfiled failure sentences, ADR 0036 and 0091 text, docs.
Out: the wire defer classes, exit codes, any node or seat behaviour, the delegation log format.

What changed

  • Every ledger row records the build that wrote it. Ledger.Record stamps harness_build_sha256 on a row for work the process ran and delegator_build_sha256 on a delegator's row. A delegation row also carries the executing node's build and seat_config_sha256 from the node's result. All three are omitted when empty, so older rows read as before. trace-corpus harvest copies them into corpus rows.
  • ledger --failures --by-build adds a builds key and a short table on stderr. Without the flag the output is unchanged.
  • The proposer trigger is a printed number. trace-corpus trigger --corpus FILE prints needed / have / met; readout prints the same line on stderr. It counts runs with a measured pager report, not trace-bearing runs. ADR 0036 is amended to say so; ADR 0091 is Accepted with its release.
  • A cause per failure class. internal/ledger/rootcause.go holds kind, root cause, evidence and action for all 31 classes; ledger --failures prints them. 16 are established and 15 are marked not investigated with what would settle each.
  • Three sentences are filed under the class that names them, at write time and when older rows are read: a local seat held by a text lease (infrastructure to node_busy), an agent loop canceled by its parent context (budget to canceled), a node whose job folder cannot be created (dispatch_refused to config). Two sentences leave other.

The real run and its output

Built to a scratch folder; the real ledger and delegation log were read only.

ledger --failures --by-build           (real ledger)
  failures by build (10942 failed of 27908 job rows):  unstamped  10942 failed of 27908 job rows
  buckets add up to the unsplit totals; with the builds key removed the output equals the plain run

scratch ledger, one classify and one delegation (scratch config):
  classify row:            harness_build_sha256 set
  delegation marker row:   delegator_build_sha256 set
  node agent row:          harness_build_sha256 and seat_config_sha256 set
  ledger --failures --by-build: 1 failed of 3 job rows, one build bucket

trace-corpus harvest (real delegation log, scratch output): 12329 runs;
  12291 rows carry delegator_build_sha256, 11652 harness_build_sha256, 10645 seat_config_sha256 (none before)

trace-corpus trigger:
  proposer trigger (ADR 0036): needed 100 / have 31 / NOT MET; of 10766 trace-bearing runs and 12332 runs

ledger --failures --since 30, released build against this one, same ledger (2566 failure rows in both):
  infrastructure 195 -> 140   budget 250 -> 236   dispatch_refused 145 -> 115   other 55 -> 30
  node_busy 628 -> 704        canceled 29 -> 46   config 2 -> 32               contract 4 -> 5
  stack-fault share 0.1142 -> 0.1044

The one review, and what it changed

Verdict: concerns, one finding, fixed in 0daf6e70.

The lease-hold refile read only the opening sentence of the reason, so a local seat held by a lease could file a dead or misconfigured fleet under a capacity class. A row whose reason also says a remote failed its health probe, no remote is configured, none passed the capability gate, or one advertises no context ceiling now stays infrastructure. On the real ledger that keeps 17 of the 72 lease-hold rows in the window where they were stamped (each names one remote that failed its health probe beside remotes that were only full); 55 move to node_busy. The numbers above are from the fixed build. The fix was run, not reviewed a second time.

Gate: go build ./... and go vet clean; go test ok for ./internal/ledger, ./internal/delegate, ./internal/core, the root-package subset and the pipeline subset. The failure-register golden file was regenerated from the real verb; its diff is the new keys and catalogue text only.

Blast radius

Every process that writes a ledger row adds up to three short fields to it. Readers that ignore unknown fields are unaffected. Failure counts per class move for the three refiled sentences; the totals do not.

Risk

The ledger write path. One review of that path ran before merge (above). Rows written before this build stay unstamped and are reported as such.

🤖 Generated with Claude Code

dmmdea and others added 5 commits November 12, 2026 09:54
Ledger.Record, the one path every ledger row takes to disk, now stamps the
build of the writing process from the same self-hash the delegation log uses,
under the same field names: harness_build_sha256 on a row for work the process
ran, delegator_build_sha256 on a delegator's row. A delegation row also takes
the executing node's harness_build_sha256 and seat_config_sha256 from the
node's result, and the node's own agent row carries seat_config_sha256, only
when the seat served. All fields are omitted when empty, so older rows read as
before.

trace-corpus harvest copies the three fields from the delegation-log row into
the corpus row. None of the corpus rows kept the delegator build before.

ledger --failures --by-build adds a builds key and a stderr table: rows are
bucketed by the executing build, else delegator:<hash>, else unstamped, and the
buckets add up to the unsplit totals. Output without the flag is unchanged.

The failure-register, mcp-server and self-improvement pages now state exactly
which rows carry which stamp.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ecord a root cause per failure class

ADR 0036's trigger for building the recipe proposer read "trace-bearing
runs in the hundreds" and read as met on 10,766 runs, while 31 carry a
measured pager report, the measurement the proposer's design needs. A dated
amendment restates it on that count (needed 100), and `trace-corpus
trigger` (and a stderr line of `trace-corpus readout`) prints it as
needed / have / met. The readout report is unchanged, so frozen baselines
still reproduce. ADR 0091 is Accepted with its release and a status note
on what its data now shows.

`internal/ledger/rootcause.go` records, for each of the 31 failure
classes, a cause kind, a root cause, the evidence and an action, from the
emitting code and the real 30-day rows. `ledger --failures` prints them
with each class (JSON `cause`, text on stderr) and lists the classes still
not investigated (15 of 31; 4 of the 19 in the window). Existing fields
are unchanged; the fixture golden gains the new keys. The table is on the
failure-register page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r the class that names them

A delegation to a seat held by a text lease was filed infrastructure (now
node_busy), the agent loop's cancellation was filed budget (now canceled) and a
node's own pipeline-jobs folder failure was filed dispatch_refused (now config).
RefileStamped holds the three, applied by Record to new rows and by the failure
register to rows already written. A node's whole "a text lease holds its card; it
may take the call later" sentence and four of the browse door's typed errors get
read-time rules in DeferCode. Root-cause entries, the register page and its
fixture golden are updated; no class is renamed and the JSON shape is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ase hold and a loop cancellation

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… fault

The one review of this branch found that the lease-hold refile read only the
opening sentence, so a held local seat could file a dead or misconfigured fleet
under a capacity class. A row whose reason also says a remote failed its health
probe, no remote is configured, none passed the capability gate, or one
advertises no context ceiling now stays infrastructure.

Real ledger, 30 days, read only: 2,566 failure rows before and after;
infrastructure 195 to 140 and node_busy 628 to 704 (55 lease holds move, 17
that also name a failed health probe stay).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@dmmdea
dmmdea merged commit 9f09147 into main Nov 12, 2026
6 checks passed
@dmmdea
dmmdea deleted the feat/rsi-register-followups branch November 12, 2026 16:06
@dmmdea dmmdea mentioned this pull request Nov 12, 2026
dmmdea added a commit that referenced this pull request Nov 12, 2026
One change, merged to main through its own pull request (#856) after one
review (one finding, fixed) and green CI:

- Ledger and trace-corpus rows record the build that wrote them
  (harness_build_sha256, delegator_build_sha256, seat_config_sha256), and
  ledger --failures --by-build splits the failure counts by build. Rows
  written before this release read as unstamped.
- trace-corpus trigger prints the proposer trigger of ADR 0036 as
  needed / have / met, counted on runs with a measured pager report and
  not on trace-bearing runs. ADR 0036 is amended; ADR 0091 is Accepted.
- ledger --failures prints a kind, root cause, evidence and action for
  each of the 31 failure classes: 16 established, 15 marked not
  investigated with what would settle each.
- Three misfiled sentences are read under the class that names them, at
  write time and for rows already in the ledger: a local seat held by a
  text lease (infrastructure to node_busy, unless the same row names a
  fault in the remote fallback), an agent loop canceled by its parent
  context (budget to canceled), and a node whose job folder cannot be
  created (dispatch_refused to config). Totals do not change.

Deletes: changes/unreleased/feat-rsi-register-followups-2.md, changes/unreleased/feat-rsi-register-followups.md, changes/unreleased/feat-rsi-trigger-rootcause.md

Co-authored-by: dmmdea <dmmdea@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant