Carry fail-open PreToolUse lapses to the gateway on the next PostToolUse (0.14.0) - #22
Merged
Conversation
…Use (0.14.0)
An interactive-tier PreToolUse that cannot reach the gateway fails open
(never-brick) and left its only record in ~/.acp/lapse.log — the gateway
never learned the call ran ungoverned. Now the lapse is also queued per
session under ~/.acp/lapse-pending/<session>.json ({ at, tool, detail },
capped at 20) and the session's next PostToolUse sends it as `pre_lapse`
in the /govern/tool-output body; the marker is deleted only after a 2xx,
so a failed report is retried on the following call. Every file
operation is best-effort and never touches the call path.
plugin.json, marketplace.json and PLUGIN_VERSION bumped together to
0.14.0 (shipping govern.mjs without a manifest bump broke attestation,
gatewaystack-connect#888).
Refs davidcrowe/gatewaystack-connect#902
davidcrowe
marked this pull request as ready for review
September 1, 2026 20:58
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.
Why
An interactive-tier PreToolUse that cannot reach the gateway fails open (never-brick) and left its only record in
~/.acp/lapse.log. The gateway never learned the call ran ungoverned, so the console could not show it. Plugin half of davidcrowe/gatewaystack-connect#902; the gateway half isfeat/pre-lapse-rowthere.What
failPostureOnOutage(interactive tier): in addition to thelapse.logline, append{ at, tool, detail }to~/.acp/lapse-pending/<session_id>.json(array, capped at the 20 most recent). Best-effort, never throws.handlePostToolUse: if a pending marker exists for this session, includepre_lapse: [...]in the/govern/tool-outputbody; delete the marker only after a 2xx. Existing 4s timeout untouched; a failed or unreachable report keeps the marker for the next call.plugin.json,.claude-plugin/marketplace.json, andPLUGIN_VERSION→ 0.14.0 (per gatewaystack-connect#888).Tests
test/pre-lapse-report.test.mjsspawns the real hook against a closed port (outage) and a local stub gateway:pre_lapse, marker cleared on 2xx, following call is cleannode --test: 105 passed, 0 failed ·node scripts/validate-manifest.mjs: versions in sync (0.14.0).Refs davidcrowe/gatewaystack-connect#902