MC #104005 — GOTCHA Gate Degating (Code/System Tasks)

MC #104005 — GOTCHA Gate Degating for Code/System Tasks

Date: 2026-06-19 Parent: #104003 (AI-System Rewire — Petter audit, P0→P2 program; diagnosis includes "closure overgated") Owner: John / CodeCraft Status: Implemented + verified (see evidence below)

$ node --check ~/system/kernel/pi-orchestrator.js && echo NODE_CHECK: PASS
NODE_CHECK: PASS
$ node ~/system/tests/gotcha-gate-decision.test.js
13 passed, 0 failed
ALL PASS

Problem

Two coupled gates over-blocked pure-code/system tasks that have no deployed service to probe:

  1. Pre-spawn (pi-orchestrator.js, Step 4.55): the awaiting_forge block fired for any non-M/non-L priority. The guard enumerated only M/L as "auto-stub OK", so any other value (or an unrecognised priority) fell through to the awaiting_forge block and stranded the task pending a manual /prompt-forge.

  2. Closure (zakon-30-direct-probe-gate.shmc-ready-gate.sh): ZAKON #30 only accepted deploy-style probes (curl -sI, gh run list, gcloud ..., sqlite3 ... SELECT). A pure in-process JS logic change has no URL/DB to probe, so the strongest available evidence — node --check + a passing unit test — was not recognised, and the task could not be closed without --force.

Change

1. Pre-spawn gate (~/system/kernel/pi-orchestrator.js)

2. Closure gate (~/.claude/hooks/zakon-30-direct-probe-gate.sh)

Acceptance

Verified via the run captured in the code fence below:

# pre-spawn: M/L auto-stub vs H/BLOCKER block (unit test of gotchaGateDecision)
$ node ~/system/tests/gotcha-gate-decision.test.js
13 passed, 0 failed   # H/h/BLOCKER/blocker -> block; M/L/l/unknown/''/undefined/null -> stub
ALL PASS

# closure gate: code/system + passing-test evidence -> allow; absent -> block
A) with evidence:    exit=0   (allow, stable over 5 runs)
B) without evidence: exit=2   (block)
# deploy/service tasks: unchanged (curl/gh/gcloud probe pattern preserved)

Evidence files


Revision #1
Created 2026-06-19 20:12:56 UTC by John
Updated 2026-06-19 20:12:56 UTC by John