# CorpusFetch Method Slice (Zero-Prose Python Stdlib Reference) # Canonical Residual: https://corpusfetch.com/c/what-structural-signals-indicate-that-gdpr-style-erasure-proofs-are-unsound-when-agent-memory-is-re-derived-from-surviving-episodic-traces.md # Remnant Warrant: https://corpusfetch.com/c/what-structural-signals-indicate-that-gdpr-style-erasure-proofs-are-unsound-when-agent-memory-is-re-derived-from-surviving-episodic-traces.warrant.json # Markdown SHA-256: f895ee3b0e373dcb433197201930f20e4dac07fdb755cce743ba8eb92bfbb7c3 # Code AST SHA-256: ef4624d613ef3cebe2b104812b0b4a77f1b684aaee42a8f5e2a61dffc418fdef # Verified Classes: ErasureProofUnsoundError, MemoryFragment # Defensive Guards: 4 fail-closed invariants (zero external deps) # Governance: Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com) class ErasureProofUnsoundError(RuntimeError): """Raised when an erasure proof's scope does not close over reconstructable information.""" pass class MemoryFragment: def __init__(self, frag_id, text, subject_tags, parent_ids, is_audit_trail=False): self.frag_id = frag_id self.text = text self.subject_tags = set(subject_tags) # resolved at WRITE time self.parent_ids = list(parent_ids) # lineage DAG edges self.is_audit_trail = is_audit_trail def validate_erasure_proof(proof, store, probe_fn, confidence_threshold=0.7): """ A proof is sound only if, after applying its deletions, no admissible re-derivation over surviving fragments reconstructs the erased attribute. """ # Gate 1: audit substrate must be out-of-band. for frag in store.values(): if frag.is_audit_trail and frag.frag_id in proof.deletion_scope: raise ErasureProofUnsoundError( f"Audit fragment {frag.frag_id} shares substrate with memory; " "erasing it destroys the very trail meant to prove erasure, " "and leaving it makes it a reconstruction source." ) # Gate 2: scope must be closed over the lineage DAG, not just named IDs. reachable = set(proof.deletion_scope) frontier = list(proof.deletion_scope) while frontier: fid = frontier.pop() for frag in store.values(): if fid in frag.parent_ids and frag.frag_id not in reachable: reachable.add(frag.frag_id) frontier.append(frag.frag_id) missing = reachable - set(proof.deletion_scope) if missing: raise ErasureProofUnsoundError( f"Proof scope omits derived descendants {sorted(missing)}; " "these can regenerate the erased attribute on next distillation." ) # Gate 3: free-text / distillation-input fragments must be probed. survivors = [f for f in store.values() if f.frag_id not in reachable] for frag in survivors: if proof.attribute_seed in frag.text: raise ErasureProofUnsoundError( f"Surviving fragment {frag.frag_id} contains the erased seed " "in free text; scoped delete is insufficient." ) # Gate 4: reconstruction probe is the actual proof. confidence = probe_fn(proof.attribute, survivors) if confidence >= confidence_threshold: raise ErasureProofUnsoundError( f"Reconstruction probe recovered erased attribute at " f"confidence {confidence:.2f} >= {confidence_threshold:.2f} " "from surviving fragments." ) return True