Mint a candidate /edit receipt after a passing bounded check - #116
Merged
Conversation
A successful apply that is not rolled back now calls an optional receipt sink. The kernel writes a candidate Golden Record (sector local-edit, source_type edit_receipt, skill_promote_eligible=false). Failures and missing verifiers do not mint. local_edit_test covers pass, rollback, and missing-check paths.
There was a problem hiding this comment.
🟢 Approval recommended
The receipt is minted only after a successful apply plus passing bounded verification, the new fields are persisted and surfaced consistently, and the new behavior is covered by updated local_edit tests.
Pull request overview
This PR adds a “local edit receipt” mechanism in the C++ kernel so that after a successful /edit apply and a passing bounded verifier check, the kernel mints a candidate Golden Record (via memory::save_thought) representing that verified local-edit outcome, and surfaces the receipt status via /last-edit.
Changes:
- Add receipt minting hooks to
local_edit(eligibility check + formatted receipt body + configurable sink) and persistreceipt_saved/receipt_idin the last-edit result JSON. - Wire the kernel (
main.cpp) to save eligible receipts throughmemory::save_thought(sector=local-edit, source_type=edit_receipt). - Extend
local_edit_testto validate that passing edits mint exactly one receipt and that rollbacks / missing verifier do not mint.
File summaries
| File | Description |
|---|---|
| godbrain_core/cpp_kernel/main.cpp | Adds /last-edit receipt display and installs the receipt sink that persists candidate receipts via memory::save_thought. |
| godbrain_core/cpp_kernel/local_edit.h | Extends Result with receipt fields and exposes receipt helpers + sink configuration. |
| godbrain_core/cpp_kernel/local_edit.cpp | Implements receipt eligibility/formatting, stores receipt status in last-edit JSON, and invokes the sink after passing bounded checks. |
| godbrain_core/cpp_kernel/local_edit_test.cpp | Adds unit coverage ensuring receipts are minted only for passing edits and never for rollback/missing-verifier cases. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Split from
wip/desk-cs2-local-edit(CS2 and Skill Lab catalog left on that branch).After
/editapplies and the bounded check passes (not rolled back), mint a candidate Golden Record viamemory::save_thought(sector=local-edit,source_type=edit_receipt,skill_promote_eligible=false)./last-editshowsreceipt=orreceipt=none. Rollback / missing verifier does not mint.Test plan
local_edit_test.exe→local_edit_test ok/editthat passes a bounded check writes a candidate (not auto-verified)Not in this PR: CS2 scripts, Skill Lab catalog, SRE fixture.