Skip to content

Carry fail-open PreToolUse lapses to the gateway on the next PostToolUse (0.14.0) - #22

Merged
davidcrowe merged 1 commit into
mainfrom
feat/pre-lapse-report
Sep 1, 2026
Merged

Carry fail-open PreToolUse lapses to the gateway on the next PostToolUse (0.14.0)#22
davidcrowe merged 1 commit into
mainfrom
feat/pre-lapse-report

Conversation

@davidcrowe

Copy link
Copy Markdown
Collaborator

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 is feat/pre-lapse-row there.

What

  • failPostureOnOutage (interactive tier): in addition to the lapse.log line, 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, include pre_lapse: [...] in the /govern/tool-output body; delete the marker only after a 2xx. Existing 4s timeout untouched; a failed or unreachable report keeps the marker for the next call.
  • UNGOVERNED systemMessage now says the lapse is queued for the session's next governed call (it previously said ACP had no record).
  • Version bumped together in plugin.json, .claude-plugin/marketplace.json, and PLUGIN_VERSION → 0.14.0 (per gatewaystack-connect#888).

Tests

test/pre-lapse-report.test.mjs spawns the real hook against a closed port (outage) and a local stub gateway:

  • fail-open still allows the call and writes the marker
  • next PostToolUse carries pre_lapse, marker cleared on 2xx, following call is clean
  • 503 / unreachable at PostToolUse keeps the marker
  • repeated lapses append; cap at 20 holds
  • one session's lapse never rides on another session's PostToolUse
  • a corrupt marker is ignored and replaced

node --test: 105 passed, 0 failed · node scripts/validate-manifest.mjs: versions in sync (0.14.0).

Refs davidcrowe/gatewaystack-connect#902

…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
davidcrowe marked this pull request as ready for review September 1, 2026 20:58
@davidcrowe
davidcrowe merged commit a5edacd into main Sep 1, 2026
2 checks passed
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