feat: charter-scar — reference implementation of the scar invariant#1
Merged
Conversation
The first invariant realized in code, and the one that was the original worry made into a mechanism: how an agent accumulates *metabolized failure* across time — wisdom it can persist. `ScarLog` is append-only and hash-chained: - record() is the only mutation — no edit, no delete (no Demiurgic forgetting). - a wound (Mistake/Refusal) with no lesson is an *open wound*; heal() closes it by APPENDING a Healing that names it — the wound is never mutated. - each entry is content-addressed (b3-…) and links to its parent; verify_chain() recomputes the ids and the links, so tampering is detectable (interlock with the `provenance` invariant). - Refusal is Scar-worthy: a declined action is recorded as ScarKind::Refusal (the keystone writes into the memory). Turns steward-charter into a Cargo workspace (doctrine + reference crates) and adds the governance the line requires now that there's code: .githooks/pre-push (fmt --check + clippy -D warnings + test) mirrored by .github/workflows/ci.yml and a justfile, cross-referenced for parity. 9 tests green (8 unit + 1 doctest), clippy -D warnings clean, fmt clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The first Charter invariant realized in code — and the one that was your original worry made into a mechanism: how an agent accumulates metabolized failure across time, i.e. wisdom it can persist.
ScarLogis append-only and hash-chained, straight from the doctrine:record()is the only mutation — no edit, no delete (no Demiurgic forgetting).Mistake/Refusal) with no lesson is an open wound;heal()closes it by appending aHealingthat names it — the wound is never mutated.b3-…) and links to its parent;verify_chain()recomputes ids + links so tampering is detectable (interlock withprovenance).ScarKind::Refusal(the keystone writes into the memory).Turns
steward-charterinto a Cargo workspace (doctrine + reference crates) and adds the governance now that there's code:.githooks/pre-push(fmt --check + clippy -D warnings + test) mirrored by.github/workflows/ci.yml+ a justfile, cross-referenced for parity.Verification
9 tests (8 unit + 1 doctest) green · clippy -D warnings clean · fmt clean · pre-push hook passed on push.
Next invariants
refusal(the dispatch dual, recorded into the scar) →novice(fresh-eyes quorum) →tether(operator gate).writ/provenancealready live (agent-bridle / kyln) and adopt by citation.risk: low (new crate, additive).