Relay the gateway's wire warning on a PreToolUse allow (0.15.0) - #24
Open
davidcrowe wants to merge 1 commit into
Open
Relay the gateway's wire warning on a PreToolUse allow (0.15.0)#24davidcrowe wants to merge 1 commit into
davidcrowe wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.15.0 — relay the gateway's wire
warningon 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 readnotice(the tier-divergence flag, once per session) and neverwarning. 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.warningon an allow is captured and emitted as thesystemMessage, every time it arrives (the server owns the frequency).systemMessageviaallowSystemMessage(), on both allow exits (plain and scoped-token injection).warningon a deny never rides on it.plugin.json,marketplace.json,PLUGIN_VERSION(attestation is per version, so the new hash baselines cleanly).Tests
test/wire-warning.test.mjs(same shape asshadow-notice.test.mjs, real hook against a stub gateway): warning verbatim on allow with nohookSpecificOutput; notice + warning joined into one message; silent with no warning; whitespace ignored; deny unchanged with the warning dropped. Fullnode --testgreen.Rollout
Internal first per the dogfood gate. Nothing server-side depends on this; the server already sends the field.