Skip to content

Liberty Stack: 10-point deletion gate + LibertyContextRecord contract - #26

Merged
mdheller merged 2 commits into
mainfrom
wo/liberty-deletion-gate
Aug 3, 2026
Merged

Liberty Stack: 10-point deletion gate + LibertyContextRecord contract#26
mdheller merged 2 commits into
mainfrom
wo/liberty-deletion-gate

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Member

Fills the Agentic Liberty Stack gaps (from the spec-intake gap analysis)

exodus already had the zone-gate engine + ForensicBundle (the doc's evidence bundle — BLAKE3/SHA-256/Ed25519 sealed) + a DeletionEligibilityRecord data model. This adds the two genuine gaps.

1. Executable 10-point deletion gate (scripts/exodus_deletion_gate.py)

The doc's central invariant — deletion gated by restore proof, not "import succeeded". A source is deletion-eligible only when all ten preconditions hold, fail-closed (a missing boolean = NOT satisfied; any regression → BLOCKED):
raw captured · raw hashed/manifest · normalized import + destination parity · proof pack · dependency graph clean · downstream sign-in preserved · redaction review · cooldown elapsed · restore-to-staging passed · human DELETE_APPROVAL recorded · evidence bundle sealed + offsite.

  • deletion-eligibility-record.schema.json extended with optional restoreToStagingPassed / evidenceBundleSealed / evidenceBundleRef / approvals[] (the existing cooling-off example still validates; a new fully-eligible example is added).
  • Each of the 10 preconditions is proven load-bearing by tests.

2. LibertyContextRecord canonical contract (packages/contracts/liberty-context-record.schema.json)

The one shared internal contract — a multi-plane semantic cell: plane (RAW/EVENT/ENTITY/DERIVED/GLOBAL) × truth_class (OBSERVED/ASSERTED/INFERRED/REPUTED) × validity × merge × surfaces. validate_liberty_context_record.py enforces the load-bearing core rules: RAW plane ⇒ overwrite_allowed=false (raw evidence immutable); DERIVED ⇒ no OVERWRITE strategy.

CI

Both the deletion gate and the LibertyContextRecord validator are wired into ci.yml — enforced at merge, dependency-free (repo idiom) / jsonschema.

Verification

4 deletion-gate tests (fully-eligible passes; cooling-off blocked; each precondition load-bearing incl. cutover≠delete approval and sealed-flag-without-ref; missing-boolean fail-closed) + both validators green.

🤖 Generated with Claude Code

Fills the Agentic Liberty Stack gaps (from the spec-intake analysis) over exodus's existing
zone-gate + ForensicBundle (the evidence bundle already exists as exodus_bundle.py).

- scripts/exodus_deletion_gate.py: executable 10-point deletion gate over a
  DeletionEligibilityRecord. Fail-closed: a source is deletion-eligible ONLY when all ten
  preconditions hold (raw captured/hashed, normalized import + destination parity, proof pack,
  dependency graph clean, downstream sign-in preserved, redaction review, cooldown elapsed,
  restore-to-staging passed [restore-proof, not import-succeeded], human DELETE_APPROVAL
  recorded, evidence bundle sealed + offsite). Missing boolean => NOT satisfied (fail-closed).
- deletion-eligibility-record.schema.json extended with the (optional) restoreToStagingPassed,
  evidenceBundleSealed, evidenceBundleRef, approvals[] — existing cooling-off example still
  validates; new fully-eligible example added.
- packages/contracts/liberty-context-record.schema.json + validate_liberty_context_record.py +
  example: the canonical multi-plane semantic cell (plane RAW/EVENT/ENTITY/DERIVED/GLOBAL x
  truth_class x validity x merge x surfaces). Validator enforces core rules: RAW plane =>
  overwrite_allowed=false (raw immutable); DERIVED => no OVERWRITE strategy.
- ci.yml: both new gate/validator wired into CI (enforced at merge).

Dependency-free gate/test (repo idiom); jsonschema validator. 4 gate tests + validators green;
each of the 10 preconditions proven load-bearing.
…schema)

exodus CI is dependency-light and has no jsonschema; the validator now does a stdlib structural
check (required fields, enum membership, no-unexpected-keys, nested required/enum) plus the core
rules. Verified: valid example passes; RAW+overwrite_allowed=true and bad enums fail.
@mdheller

mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Copilot reviewer did not post (intermittent this session). Self-review: the deletion gate is fail-closed (missing boolean = NOT satisfied; each of the 10 preconditions proven load-bearing by tests incl. cutover≠delete-approval and sealed-flag-without-ref); the LibertyContextRecord validator (now stdlib, no jsonschema — matching the repo's dependency-light CI) enforces required/enum structure + the core rules (RAW⇒immutable, DERIVED⇒no-overwrite). Both wired into CI; validate green.

@mdheller
mdheller merged commit 3c98c8b into main Aug 3, 2026
6 checks passed
@mdheller
mdheller deleted the wo/liberty-deletion-gate branch August 3, 2026 02:37
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