Skip to content

fallback hook: ask surfaces to the harness, unknown verdicts fail closed - #14

Merged
davidcrowe merged 1 commit into
mainfrom
fix/fallback-hook-ask
Aug 17, 2026
Merged

fallback hook: ask surfaces to the harness, unknown verdicts fail closed#14
davidcrowe merged 1 commit into
mainfrom
fix/fallback-hook-ask

Conversation

@davidcrowe

Copy link
Copy Markdown
Contributor

What

The embedded govern.mjs fallback (written when the installer can't fetch the canonical plugin hook) handled deny only. An ask verdict — and any decision value it didn't recognize — silently allowed the tool call: the same fell-open class the gateway's step_up→deny change closed for the canonical hook.

  • ask → emits permissionDecision:"ask" with the approval reason; for ACP_CLIENT=codex (no ask primitive) it denies instead, matching the canonical hook's mapping
  • unknown decision values → deny with a "re-run the installer" reason (the server answered; the hook just can't obey it correctly — distinct from the outage posture, which is unchanged)

Tests

New test/govern-cloud-verdicts.test.mjs — the first coverage of the fallback's cloud path: extracts the exact heredoc bytes, runs them against a local stub gateway returning canned verdicts (async spawn so the stub can actually respond), asserts allow/deny/ask/codex-ask/unknown. Verified red on the unfixed heredoc (3/5 fail), 46/46 across the whole suite with the fix.

One meta-note for the backlog: writing this test through governed tooling PII-redacted the literal loopback IP (one-two-seven dot zero dot zero dot one) inside the file into an invalid host — the test now assembles it from octets. Loopback/RFC1918 addresses in code files are a transform false-positive class worth excluding.

Refs gatewaystack-connect#718, gatewaystack-connect#597.

🤖 Generated with Claude Code

The embedded govern.mjs fallback handled deny only — an ask verdict (or
any decision value it didn't recognize) silently allowed the call, the
same fell-open class the gateway's step_up→deny change closed for the
canonical hook. ask now emits permissionDecision:"ask" (deny for codex,
which has no ask primitive, matching the canonical hook's mapping);
unrecognized decisions deny with a re-run-the-installer reason. Cloud
verdict handling gets its first tests: a stub gateway drives the exact
heredoc bytes through allow/deny/ask/codex-ask/unknown.

Refs gatewaystack-connect#718, #597.
@davidcrowe
davidcrowe merged commit 9c4bbdb into main Aug 17, 2026
2 checks passed
@davidcrowe
davidcrowe deleted the fix/fallback-hook-ask branch August 17, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant