feat(kernel): owner-originated counterparty crypto-erasure (#172) - #268
Conversation
Counterparty crypto-erasure guards (AD-140) were production-wired and reconciled at startup, but the erasure set could only be populated by an accepted external terminal ledger on restore — there was no local owner origination surface. Add `openspine.counterparty.erase`, a non-delegable root-owner gate-mediated action modeled on `openspine.overlay.export`/ `restore`, that drives the existing `erase_counterparty` primitive: signed terminal-ledger entry first, then the local transactional erasure sweep and irreversible key deletion. - Activate the `erase_counterparty` primitive (drop `#[allow(dead_code)]`; keep a targeted allow on the test-only `invalidated_identities` field the handler deliberately does not surface). - Hoist the root-owner grant check into a shared `api::root_owner_grant` helper so overlay export/restore and erasure cannot diverge. - Register the catalog action (non-delegable, `None/None` egress, GatedShell effect path, tool descriptor) and wire the owner conversational path. - Add the gated handler with strict `deny_unknown_fields` payload parsing, ULID validation, and defense-in-depth SYSTEM_SCOPE rejection. - Caller-level test drives the generic reviewed-scope standing-rule sweep through the command with a different-counterparty control rule, plus the overlay-style authorization/payload negatives. The scoped-reservation transactional recheck stays proven by the #177 seam test (the pre-transaction guard refuses first), carried forward and inventoried. Closes #172
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 5 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds
openspine.counterparty.erase, an authenticated owner command to originate a counterparty crypto-erasure locally — signed ledger entry first, then the local transactional erasure sweep — closing the origination gap disclosed at #130's creation.Why
Counterparty crypto-erasure guards (AD-140) are production-wired and unconditionally reconciled at startup, but until now the erasure set could only be populated by an accepted external terminal ledger on restore. No production caller of
record_terminal_erasureexisted, so nothing on this terminal could begin an erasure. This is the missing local owner origination surface.How
openspine.overlay.export/restore(catalog entry,None/Noneegress,GatedShelleffect path, tool descriptor, owner pack/agent wiring). Dispatched through the handler registry.erase_counterpartyprimitive unchanged — durable signed terminal-ledger entry first, thenmark_learned_artifacts_erased(audit-before-effect, CI-enforced) and the irreversible key tombstone. Builds on the Whole-table erasure sweep makes one unparseable rule_json abort every erasure, and block boot #176 sweep isolation.effectively_allows). Hoisted into a sharedapi::root_owner_granthelper so overlay and erasure cannot diverge. NoOwnerVerifiedProofminted (mint gate honored).deny_unknown_fieldspayload, ULID validation, defense-in-depthSYSTEM_SCOPErejection; returns only non-sensitive fields (neverinvalidated_identities).Tests
owner_command_runs_generic_reviewed_scope_sweep_via_caller_pathdrives the generic reviewed-scope standing-rule sweep through the command (no learned-artifact provenance row), with a different-counterparty control rule that must survive; asserts audit-chain integrity and exactly onecounterparty.erasedevent.SYSTEM_SCOPE.is_counterparty_erasedguard refuses first, so a handler-first dispatch never reaches the reservation transaction) — carried forward and inventoried, not duplicated../scripts/check.shpasses.Implementation notes (five-line summary)
#[allow(dead_code)]onErasureReport::invalidated_identitiesif the handler ever surfaces it.initialize_terminal_ledger()before erasure; generic reviewed-scope sweep revokes with no learned-artifact provenance row.api/erase_counterparty.rshandler + the Ship recurring Gmail drafts as the first complete delegation proof #130 guard-test inventory.Closes #172
Summary by cubic
Adds
openspine.counterparty.erase, a non-delegable root-owner command to originate a counterparty crypto-erasure locally. Previously only an accepted external terminal ledger on restore could populate the erasure set; now the owner can initiate an erasure that writes a signed ledger entry first, then performs the local sweep and deletes the key.api::root_owner_grant(owner principal, true root grant, exacteffectively_allows).erase_counterpartyunchanged (ledger-first, thenmark_learned_artifacts_erasedand irreversible key tombstone); rejectsSYSTEM_SCOPE; strictdeny_unknown_fieldspayload with ULID validation; reply omitsinvalidated_identities.None/Noneegress;main_assistant_agentandowner_control_basic_packincludeopenspine.counterparty.erase.SYSTEM_SCOPE); audit chain verifies with onecounterparty.erasedevent.Written for commit d581c13. Summary will update on new commits.