# CorpusFetch Method Slice (Zero-Prose Python Stdlib Reference)
# Canonical Residual: https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-gdpr-style-erasure-request-as-a-distributed-forget-quorum-rather-than-a-local-delete.md
# Remnant Warrant:    https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-gdpr-style-erasure-request-as-a-distributed-forget-quorum-rather-than-a-local-delete.warrant.json
# Markdown SHA-256:   b4bb35476464f4543c2416e34c7ffc8d8a034052a164872f58f653c1b204ecd7
# Code AST SHA-256:   e41aa208f80fc26b783aabe674bc85e214c513ea3e54b5c630c7fead7c0a9bc2
# Verified Classes:   ErasureQuorumIncomplete, StoreAck
# Defensive Guards:   3 fail-closed invariants (zero external deps)

class ErasureQuorumIncomplete(RuntimeError):
    """Raised when a forget-quorum cannot be satisfied across all memory stores."""
    pass


class StoreAck:
    def __init__(self, name: str, deletable: bool, probeable: bool):
        self.name = name
        self.deletable = deletable
        self.probeable = probeable


def enforce_forget_quorum(subject_id: str, stores: list[StoreAck],
                          reconstruction_probe) -> dict:
    """
    Enforce distributed forget-quorum for a subject across heterogeneous stores.
    Returns per-store acknowledgment map only if every store both deleted and
    passed the reconstruction probe.
    """
    acks = {}
    for store in stores:
        if not store.deletable:
            raise ErasureQuorumIncomplete(
                f"store '{store.name}' cannot delete by subject; "
                f"provenance link missing for {subject_id}"
            )
        if not store.probeable:
            raise ErasureQuorumIncomplete(
                f"store '{store.name}' exposes no query surface; "
                f"cannot verify erasure of {subject_id} — quorum stays open"
            )
        residual = reconstruction_probe(store.name, subject_id)
        if residual:
            raise ErasureQuorumIncomplete(
                f"store '{store.name}' still reconstructs {subject_id} "
                f"via {len(residual)} artifact(s): {residual[:3]}"
            )
        acks[store.name] = "forgotten"
    return acks
