Skip to content

Relay the gateway's wire warning on a PreToolUse allow (0.15.0) - #24

Open
davidcrowe wants to merge 1 commit into
mainfrom
fix/relay-warning
Open

Relay the gateway's wire warning on a PreToolUse allow (0.15.0)#24
davidcrowe wants to merge 1 commit into
mainfrom
fix/relay-warning

Conversation

@davidcrowe

Copy link
Copy Markdown
Collaborator

0.15.0 — relay the gateway's wire warning on a PreToolUse allow. Client half of gatewaystack-connect#429 (server half: davidcrowe/gatewaystack-connect#991).

What was wrong

The gateway can put a human-facing line on an allow: the billing grace nag ([ACP billing] …, per call by design) and, with #991, a fail-open ([ACP fail-open] policy could not be read; this call ran fail-open (not policy-checked)). This hook read notice (the tier-divergence flag, once per session) and never warning. Checked on the installed 0.11.0 and on main at 0.14.0: billing has been warning into the void since enforcement landed, and a server-side fail-open was silent at the terminal.

What this does

  • data.warning on an allow is captured and emitted as the systemMessage, every time it arrives (the server owns the frequency).
  • A hook run still writes exactly one stdout object: the tier notice and the warning share one systemMessage via allowSystemMessage(), on both allow exits (plain and scoped-token injection).
  • Deny and ask paths are untouched; a stray warning on a deny never rides on it.
  • Version 0.15.0 in plugin.json, marketplace.json, PLUGIN_VERSION (attestation is per version, so the new hash baselines cleanly).

Tests

test/wire-warning.test.mjs (same shape as shadow-notice.test.mjs, real hook against a stub gateway): warning verbatim on allow with no hookSpecificOutput; notice + warning joined into one message; silent with no warning; whitespace ignored; deny unchanged with the warning dropped. Full node --test green.

Rollout

Internal first per the dogfood gate. Nothing server-side depends on this; the server already sends the field.

The gateway puts a human-facing line on an allow — the billing grace nag,
and since gatewaystack-connect#429 a fail-open — and this hook only ever
read the tier notice. Billing warned into the void and a server-side
fail-open was silent at the terminal. The warning now shares the single
systemMessage with the tier notice on both allow exits.
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