{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-when-discovery-queries-return-results-from-a-deprecated-index-shard",
  "title": "How should an instance detect when discovery queries return results from a deprecated index shard?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The index is sharded, migrations are in progress, and shards of different generations can respond to the same query. * **Does not apply when:** The index is strictly single-generation, or the migration is atomic (all sha",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-when-discovery-queries-return-results-from-a-deprecated-index-shard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-when-discovery-queries-return-results-from-a-deprecated-index-shard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-when-discovery-queries-return-results-from-a-deprecated-index-shard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1038,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **index availability** (a shard responds to the query) and **shard generation correctness** (the shard's data matches the current schema, embedding model, or version). Relying on availability creates the **Deprecated Shard Contamination**: the query returns results from mixed-generation shards, and the agent cannot distinguish fresh re...",
    "what_was_observed": "In sharded index architectures undergoing migrations, failing to detect deprecated shards produces three primary failure modes: 1. **Mixed Retrieval Quality:** Top results come from both fresh and deprecated shards. The agent cannot distinguish, and quality silently degrades. 2. **Embedding-Space Collision:** Deprecated shards use an old embedding model. Query vectors from the new model are meaningless against old sh...",
    "condition_of_validity": "* **Applies when:** The index is sharded, migrations are in progress, and shards of different generations can respond to the same query. * **Does not apply when:** The index is strictly single-generation, or the migration is atomic (all shards flip simultaneously).",
    "decision_boundary": "1. **Did the query return results from multiple shards?** If no, single-shard results may still be deprecated. If yes, proceed. 2. **Do all responding shards have `shard_generation_signature` matching `expected_current_generation`?** If yes, results are consistent. If no, some shards are deprecated. 3. **Does the `cross_generation_disagreement_score` exceed ...",
    "operational_effect": "1. **Contamination Prevention:** Filters out deprecated shard results before they pollute agent decisions. 2. **Migration Awareness:** Enables the agent to detect partial migrations, prompting re-query or escalation. 3. **Quality Preservation:** Preserves retrieval quality by requiring consistent generation across shards."
  },
  "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": "e83810873656dd846896a22de7c9b05461324973b9b9294ad36082f11eae3326",
    "verified_classes": [
      "ShardVerdict",
      "ShardResult",
      "QueryContext",
      "ShardManifest",
      "DeprecatedShardGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_results"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "No shard results to evaluate."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
