Skills 2026-10-13 06:29 UTC
claude-prompts-mcpv5.1.1
Version [v5.1.1] committed by minipuft. Update Category: Feature Addition & Enhancement. Commit details: fix(gates): gate requests are refused before script tools run, and a full registry makes room (#486). This update introduces new capabilities and module extensions.
CommitRaw commit message
fix(gates): gate requests are refused before script tools run, and a full registry makes room (#486) ## Summary After this merges, a gate request is refused before any script tool runs, a full gate registry makes room by releasing long-idle runs, and the server's log file keeps what it logs during shutdown. - A call whose gates are refused (blank criteria, a canonical gate id, `%clean` or a gates-off switch with gates requested) is refused before the prompt's script tools run; before, the script ran and the reply said "Nothing was executed". - A script-tool call that requests gates in any form (`::`, a workflow node gate, the `gates` parameter) gets those gates instead of a default `%clean` it never asked for. - When the temporary gate registry (100 gates) is full, it releases the gates of runs unused for an hour, oldest first, and admits the new gate; a released run gets its gates back when it resumes. - Lines logged during shutdown reach `logs/mcp-server.log` on both transports, and file writes are batched so sustained logging cannot exhaust memory. - In dual mode, a taken HTTP port leaves STDIO serving; HTTP-only mode refuses to start and names the port. ## Demonstration **Before** (main) ``` >>sr_tool go:"x" :: "" script ran (sentinel written) → ❌ Workflow rejected … Nothing was executed and no run was created. registry full of abandoned-run gates → every new gated call refused for up to 24 h SIGTERM, either transport logs/mcp-server.log: 0 lines after startup --transport=both, port taken process exits 1, STDIO gone ``` **After** ``` >>sr_tool go:"x" :: "" no script run → ❌ Workflow rejected … [gate-criteria-invalid] … Nothing was executed and no run was created. registry full, oldest run idle > 1 h → that run's gates released, new gate admitted SIGTERM, either transport logs/mcp-server.log: 15 shutdown lines, database closed --transport=both, port taken warning names the port; STDIO answers tools/list ``` ## How it was verified | Claim | Probe | Baseline → measured | Mutation that fails it | | --- | --- | --- | --- | | Refusal before any script runs | `script-tool-refusal-order.integration.test.ts` (sentinel file; ungated control runs the script) | script ran in 4 of 4 refused cases → 0 of 4 | stage 05 admission returning `[]` fails 4 | | Requested gates beat the default `%clean` | same file (`::` and workflow-node cases; ungated control keeps the default) | refused for "Drop %clean" → gate enforced | predicate forced `false` fails both | | Idle runs released at capacity, restored on resume | `temporary-gate-registry-eviction.test.ts`; composition-root test (clock +2 h, resume renders the gates, FAIL holds) | full registry refused → admits; resumed run enforces its gates | ignoring the threshold fails 5; no mark at resume start fails 1 | | Shutdown lines reach the log | `stdio-shutdown-triggers.e2e.test.ts`; live SIGTERM drive on both transports | 0 → 15 lines | source reverted: 3 of 3 fail | | Batched writes keep memory bounded | `file-write-flush.test.ts` (50 000-line burst); `chain-prompt-sources` e2e | one append per line; e2e server heap reached 2 GB and aborted → ≤ 10 appends; 168/168 | one append per line fails the burst test | | Dual mode survives a taken port | `http-port-taken.e2e.test.ts` | exited before `initialize` → answers `tools/list` | the old handler order fails it | | Local boundary | `typecheck`, `lint:ratchet`, `typecheck:tests:ratchet`, `validate:all` (85 steps), `verify:mcp` | lint 2365 → 2360 errors; knip exports 425 → 424 | n/a: ratchets fail on any increase | ## Notes for Reviewers - `05-inline-gate-stage.ts` now raises every refusal of the call's own gate requests through `RequestGateAdmission`; stage 11 keeps only a backstop for suppression. - A `%judge` call carrying a refused gate now gets the refusal rather than the judge menu. - The idle threshold (`idleRunReleaseMs`, 1 h) sits next to `maxMemoryGates` in `prompt-executor.ts`. ## Still open - A released run's request gate comes back under a new id on each resume, so the review's satisfied-reminder list keeps ids that no longer exist. - A `%judge` call runs a prompt's script tools before showing the menu, and again on the follow-up call. Plan: `plans/semantic-gate-review-remediation-2026-10-11.md`