{
  "schema_version": "1.3.0",
  "slug": "when-does-a-soft-delete-flag-prevent-a-key-from-ever-being-reused",
  "title": "When does a soft-delete flag prevent a key from ever being reused?",
  "date_of_record": "2026 November 1",
  "scope": "Applies to tables that retain deleted rows with a deleted_at or is_deleted marker while enforcing uniqueness on the natural key. Excludes tables that hard-delete or that scope uniqueness per tenant without a tombstone.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-does-a-soft-delete-flag-prevent-a-key-from-ever-being-reused.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-does-a-soft-delete-flag-prevent-a-key-from-ever-being-reused.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-does-a-soft-delete-flag-prevent-a-key-from-ever-being-reused.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 850,
    "python_slice_tokens": 132,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "**Predicate.** A uniqueness constraint over key alone is compatible with soft delete only if deleted rows are excluded from the constraint. A unique index on key that includes deleted rows makes the key permanently consumed: recreation fails with a uniqueness violation the application interprets as a duplicate, even though the user can no longer see the orig...",
    "what_was_observed": "**Signature.** Uniqueness violation on insert for a key that no visible row holds. Re-creation succeeds for keys that were never used, fails for keys that were once used, and the failure is permanent. **Trace.** Unique index on email. Row (email=a@b, deleted_at=t1). Attempted insert (email=a@b) at t2 > t1 violates the index. Application catches the violation and returns a duplicate-email error. The user has no accoun...",
    "condition_of_validity": "Key reuse is possible only while at least one holds: 1. **Partial index.** The uniqueness constraint is partial over live rows only (for example, unique on key where deleted_at is null). 2. **Tombstone discriminator.** The key includes a discriminator that changes on delete, so the tombstoned row occupies a distinct key space. 3. **Purge.** Deleted rows are ...",
    "decision_boundary": "- Partial unique index over live rows: reuse works, history preserved. - Unique over key including tombstones, no purge: key is permanently consumed. Recreation fails forever. - Unique over key including tombstones, purge after N days: reuse works after N days, fails before. Must be documented to support. - Key includes tenant plus tombstone discriminator: r...",
    "operational_effect": "The defect is a silent interaction between two features that are individually correct: soft delete preserves history, and a unique index prevents duplicates. Together they create a permanent key reservation that no one intended. Remediation is a partial index or a tombstone discriminator. The trap is to hard-delete instead, which frees the key and destroys t..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "76e8813beab8fe435319d5294aa2571a8e445f7a69f49ed725e573b7cac6e20d",
    "verified_classes": [
      "KeyReuseBlockedError",
      "SoftDeleteGate"
    ],
    "verified_functions": [
      "dispatch_delete_strategy",
      "verify"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "KeyReuseBlockedError"
    ],
    "sample_fail_closed_invariants": [
      "unique index covers deleted rows with no purge: key cannot be reused"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
