fix(core): a ledger failure defers recording instead of displacing the receipt - #253
Merged
Merged
Conversation
…e receipt On a failed ledger sync the refreeze receipt's what-changed slot held only "ledger error: ...", which read as if the refreeze itself had failed. Activation never depends on the ledger and the claim stays queued, so the receipt now says the change is live, the recording is deferred, and why.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Round-5 self-extensibility dogfood ticket T5 (.scratch/selfext-round5/findings.md): when a refreeze's ledger sync fails,
ledger_changesreturned["ledger error: {e}"]as the receipt's what-changed slot, so the model-facing refreeze receipt opened with a bare error. That reads as if the refreeze itself had failed, when in fact activation never depends on the ledger (the new capability is live) and the claim stays queued for a later sync (persisted when the ledger directory allows).Summary
Test Plan
a_ledger_failure_reports_deferred_recording_not_a_bare_error: fails the sync deterministically by dropping a file at the ledger root (works under root too, unlike a chmod denial), asserts the receipt names the still-active change and the queued recording, and does not lead with the bare error. Shown red on the previous commit (the old line was exactly "ledger error: ...").Greptile Summary
This change makes a failed capability-ledger sync clear to the model without implying that the capability update itself failed. The ledger-root-as-file failure path was exercised through the real refreeze flow: the capability became active, its Session recording claim remained queued, and the receipt stated that recording was deferred. The prior revision returned only a bare ledger error on this same path; the current implementation does not.
Confidence Score: 5/5
Safe to merge: the exercised ledger failure path preserves both capability activation and deferred recording state while communicating the outcome accurately.
A focused asynchronous harness ran the production refreeze path with a deterministic ledger filesystem failure, verified the emitted receipt and retained Session claim, and showed that the corrected behavior differs from the parent revision.
Files Needing Attention: No files need further attention; the reviewed behavior is contained in crates/core/src/agent.rs.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(core): a ledger failure defers recor..." | Re-trigger Greptile