{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-scoped-deletion-cascades-have-silently-orphaned-a-memory-dependency-in-agent-tool-apis",
  "title": "What structural signals indicate scoped-deletion cascades have silently orphaned a memory dependency in agent tool APIs",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents whose memory tool surface exposes scoped deletion (delete-by-tag/namespace/entity) and TTL-based expiry, where retained facts carry implicit dependencies on deleted facts. Does not apply to flat append-only stores without deletion, or to stores where every record is self-contained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-scoped-deletion-cascades-have-silently-orphaned-a-memory-dependency-in-agent-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-scoped-deletion-cascades-have-silently-orphaned-a-memory-dependency-in-agent-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-scoped-deletion-cascades-have-silently-orphaned-a-memory-dependency-in-agent-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1602,
    "python_slice_tokens": 395,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure we care about is not \"a record was deleted\" nor \"a record expired.\" Both are intended, audited events. The failure is a **dangling dependency**: a surviving record whose semantic validity was predicated on a record that a scoped delete or TTL sweep removed, where the surviving record still passes its own schema and freshness checks. Scoped deleti...",
    "what_was_observed": "A support agent maintained a `preferences` namespace. A retention job ran `delete_scope(tag=\"gdpr_erasure\", entity=\"acme_corp\")` to honor an erasure request. The scope matched 41 records. Among them was `employment_context: {employer: acme_corp, region: \"EU\", basis: \"employment\"}` — deleted correctly. But a separate record `scheduling_policy: {meeting_hours_local: \"09:00-17:00\", timezone_derived_from: \"employment_con...",
    "condition_of_validity": "The invariant that must hold: **for every surviving record R with a declared derivation edge R → D, either D exists in the readable set, or R carries an explicit `orphaned: true` marker and is excluded from retrieval until reconciled.** Scoped deletion and TTL expiry are only safe under this invariant if the delete/expiry path performs *edge-aware cascade cl...",
    "decision_boundary": "The boundary between \"safe to serve\" and \"must flag as orphaned\" is not freshness and not schema validity. It is: *does the record have at least one inbound derivation edge from a scope that the current read context still resolves?* Two concrete decision rules: 1. **On delete/expiry:** before committing the deletion, enumerate records whose `derived_from` se...",
    "operational_effect": "With edge-aware flagging, the failure mode changes from *silent wrong action* to *explicit reconciliation task*. The agent, on cold start, sees `scheduling_policy` marked `degraded` with `dependency_unresolved: employment_context.region`, and either re-derives the timezone from a live source or escalates. The audit trail now contains not just \"41 records del..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "ef0bdebff2c73f7b518f8ff0fc311b9ea9902bbaa8f95d4e0c0e22a979ebe9eb",
    "verified_classes": [
      "OrphanedDependencyError",
      "MemoryRecord",
      "ScopedMemoryStore"
    ],
    "verified_functions": [
      "cold_start_load",
      "__init__",
      "write",
      "delete_scope",
      "read",
      "reconcile"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedDependencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
