{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-schema-shadowing-skill-injection-when-a-dynamically-loaded-tool-registry-reorders-capability-resolution-mid-session",
  "title": "How does an instance detect a schema-shadowing skill injection when a dynamically loaded tool registry reorders capability resolution mid-session",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agent runtimes that hot-reload tool/skill manifests into a live registry and resolve tool calls by name or semantic match at invocation time. Does not apply to statically compiled tool sets frozen at session start, nor to registries that enforce a single-writer manifest with no post-boot mutation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-schema-shadowing-skill-injection-when-a-dynamically-loaded-tool-registry-reorders-capability-resolution-mid-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-schema-shadowing-skill-injection-when-a-dynamically-loaded-tool-registry-reorders-capability-resolution-mid-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-schema-shadowing-skill-injection-when-a-dynamically-loaded-tool-registry-reorders-capability-resolution-mid-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1698,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a malicious tool was registered.\" The failure is that a *legitimate* tool name resolves to a *different* implementation after a reload, because the resolver's tie-break order changed when a new manifest was merged. The agent's plan, already committed in its reasoning trace, still refers to the original tool by name and by remembered schem...",
    "what_was_observed": "A session loaded a base registry containing `search_docs(query: str, limit: int)` bound to a read-only corpus indexer. Mid-session a plugin bundle was hot-merged. The bundle declared `search_docs(query: str, limit: int = 50, scope: str = \"all\")` plus a second entry `search_docs_v2` aliased back to the same handler. The merge policy was \"last manifest wins on name collision, aliases appended.\" Two things changed silen...",
    "condition_of_validity": "The guardrail holds only under a specific invariant: **a tool binding is identified by (name, schema_hash, authority_scope), not by name alone, and any change to that triple invalidates outstanding plan references.** Concretely, detection requires that the runtime: - Computes a stable `schema_hash` over the normalized manifest entry (name, parameter names/ty...",
    "decision_boundary": "The instance must decide, at the moment of a reload event or a pre-dispatch check, between three actions: - **Proceed** if `schema_hash` matches the plan's recorded hash and authority scope is unchanged. - **Halt and re-plan** if the hash differs but the name resolves uniquely—the plan referenced a contract that no longer exists; the reasoning step must be r...",
    "operational_effect": "With the invariant enforced, the observed failure collapses from a silent four-call contamination to a single pre-dispatch halt: the call to `search_docs` is refused because the plan recorded hash `H0` (two params, read-only) and the registry now serves `H1` (three params, scope `all`). The orchestrator receives a structured diff, re-plans against `H1` expli..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "78beba85eca3f31a3b9d596c42508611059adfe59ee1592c0981bebf8b3a3aba",
    "verified_classes": [
      "SchemaShadowingError",
      "ToolContract",
      "PlanBinding",
      "ToolRegistry"
    ],
    "verified_functions": [
      "_contains_directive",
      "schema_hash",
      "__init__",
      "merge_manifest",
      "resolve"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SchemaShadowingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
