pi-session-mcp 0.8.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi-session-mcp-cli/client-adapters/command.js +33 -0
- package/.pi-session-mcp-cli/client-adapters/mcp-verifier.js +198 -0
- package/.pi-session-mcp-cli/client-adapters/types.js +1 -0
- package/.pi-session-mcp-cli/config.js +29 -3
- package/.pi-session-mcp-cli/container-runtime.js +18 -0
- package/.pi-session-mcp-cli/doctor.js +370 -4
- package/.pi-session-mcp-cli/execution-modes.js +83 -0
- package/.pi-session-mcp-cli/execution-profile.js +1 -0
- package/.pi-session-mcp-cli/override-lock.js +4 -4
- package/.pi-session-mcp-cli/session-tools.js +45 -0
- package/.pi-session-mcp-cli/setup-platform.js +64 -36
- package/.pi-session-mcp-cli/setup-process.js +455 -0
- package/.pi-session-mcp-cli/skill-library.js +8 -4
- package/.pi-session-mcp-cli/turn-events.js +97 -0
- package/.pi-session-mcp-cli/writer-boundary.js +321 -0
- package/.pi-session-mcp-cli/writer-fence.js +50 -0
- package/.pi-session-mcp-cli/writer-lease.js +140 -0
- package/.pi-session-mcp-cli/writer-lifecycle.js +567 -0
- package/.pi-session-mcp-cli/writer-state.js +199 -0
- package/.pi-session-mcp-cli/writer-wrapper.js +14 -0
- package/CHANGELOG.md +527 -0
- package/README.md +8 -2
- package/dist/capabilities.d.ts +9 -1
- package/dist/capabilities.js +8 -3
- package/dist/child-stdio-transport.d.ts +21 -0
- package/dist/child-stdio-transport.js +88 -0
- package/dist/client-adapters/claude-code.js +3 -2
- package/dist/client-adapters/command.d.ts +8 -0
- package/dist/client-adapters/command.js +9 -1
- package/dist/client-adapters/mcp-verifier.d.ts +7 -0
- package/dist/client-adapters/mcp-verifier.js +21 -4
- package/dist/client-adapters/types.d.ts +5 -1
- package/dist/client-adapters/writer-registration.d.ts +16 -0
- package/dist/client-adapters/writer-registration.js +156 -0
- package/dist/config.d.ts +12 -1
- package/dist/config.js +29 -3
- package/dist/container-runtime.d.ts +2 -0
- package/dist/container-runtime.js +18 -0
- package/dist/doctor.d.ts +36 -2
- package/dist/doctor.js +370 -4
- package/dist/event-spool.d.ts +70 -0
- package/dist/event-spool.js +180 -0
- package/dist/execution-modes.d.ts +60 -0
- package/dist/execution-modes.js +83 -0
- package/dist/execution-profile.d.ts +2 -0
- package/dist/execution-profile.js +1 -0
- package/dist/main.js +63 -8
- package/dist/override-lock.d.ts +2 -0
- package/dist/override-lock.js +4 -4
- package/dist/pi-adapter.d.ts +31 -1
- package/dist/pi-adapter.js +12 -0
- package/dist/process-diagnostics.d.ts +1 -1
- package/dist/process-diagnostics.js +2 -1
- package/dist/refusal-server.d.ts +6 -0
- package/dist/refusal-server.js +46 -0
- package/dist/sdk-pi-adapter.js +16 -9
- package/dist/server.d.ts +3 -2
- package/dist/server.js +27 -53
- package/dist/session-registry.d.ts +32 -2
- package/dist/session-registry.js +61 -11
- package/dist/session-tools.d.ts +14 -5
- package/dist/session-tools.js +13 -9
- package/dist/setup-cli.d.ts +14 -0
- package/dist/setup-cli.js +132 -0
- package/dist/setup-command-guardian.js +9 -3
- package/dist/setup-hooks.d.ts +158 -0
- package/dist/setup-hooks.js +657 -0
- package/dist/setup-main.d.ts +1 -1
- package/dist/setup-main.js +18 -2
- package/dist/setup-modes.d.ts +18 -0
- package/dist/setup-modes.js +131 -0
- package/dist/setup-ownership.d.ts +1 -0
- package/dist/setup-ownership.js +11 -3
- package/dist/setup-platform.d.ts +9 -1
- package/dist/setup-platform.js +64 -36
- package/dist/setup-process.d.ts +23 -1
- package/dist/setup-process.js +88 -10
- package/dist/setup-writers.d.ts +42 -0
- package/dist/setup-writers.js +510 -0
- package/dist/setup.d.ts +4 -1
- package/dist/setup.js +23 -10
- package/dist/skill-library.d.ts +2 -0
- package/dist/skill-library.js +8 -4
- package/dist/tool-schemas.d.ts +339 -0
- package/dist/tool-schemas.js +49 -0
- package/dist/turn-events.d.ts +45 -0
- package/dist/turn-events.js +97 -0
- package/dist/wake-hook.d.ts +180 -0
- package/dist/wake-hook.js +638 -0
- package/dist/wake-main.d.ts +8 -0
- package/dist/wake-main.js +111 -0
- package/dist/writer-acceptance.d.ts +10 -0
- package/dist/writer-acceptance.js +192 -0
- package/dist/writer-boundary.d.ts +52 -0
- package/dist/writer-boundary.js +321 -0
- package/dist/writer-credentials.d.ts +29 -0
- package/dist/writer-credentials.js +85 -0
- package/dist/writer-fence.d.ts +12 -0
- package/dist/writer-fence.js +50 -0
- package/dist/writer-guard.d.ts +13 -0
- package/dist/writer-guard.js +54 -0
- package/dist/writer-launch.d.ts +29 -0
- package/dist/writer-launch.js +232 -0
- package/dist/writer-lease.d.ts +28 -0
- package/dist/writer-lease.js +140 -0
- package/dist/writer-lifecycle.d.ts +96 -0
- package/dist/writer-lifecycle.js +567 -0
- package/dist/writer-relay.d.ts +33 -0
- package/dist/writer-relay.js +359 -0
- package/dist/writer-state.d.ts +111 -0
- package/dist/writer-state.js +199 -0
- package/dist/writer-wrapper.d.ts +3 -0
- package/dist/writer-wrapper.js +14 -0
- package/docs/acceptance.md +1694 -1
- package/docs/adr/0003-post-mvp-maintenance.md +2 -2
- package/docs/adr/0006-pi-extension-allowlist.md +3 -1
- package/docs/adr/0008-coding-profile-isolation.md +295 -0
- package/docs/adr/0009-execution-modes.md +131 -0
- package/docs/adr/0010-read-only-extension-tools.md +68 -0
- package/docs/adr/0011-turn-events-and-controller-wake.md +173 -0
- package/docs/adr/0012-leased-writer-pool.md +357 -0
- package/docs/architecture.md +96 -8
- package/docs/client-setup-design.md +12 -8
- package/docs/client-setup.md +84 -2
- package/docs/doctor-design.md +48 -0
- package/docs/evaluation/2026-10-17-live-screening.md +121 -0
- package/docs/evaluation/2026-10-17-node-runtime-followup.md +33 -0
- package/docs/evaluation/2026-10-17-profile-evaluation-evidence.md +155 -0
- package/docs/evaluation/2026-10-17-test-coverage.md +127 -0
- package/docs/evaluation/README.md +123 -0
- package/docs/evaluation/client-reconnect-2026-10-17/README.md +41 -0
- package/docs/evaluation/client-reconnect-2026-10-17/checks.json +38 -0
- package/docs/evaluation/client-reconnect-2026-10-17/integrity.json +30 -0
- package/docs/evaluation/client-reconnect-2026-10-17/reconnect.json +57 -0
- package/docs/evaluation/client-reconnect-2026-10-17/registration-verification.json +389 -0
- package/docs/evaluation/client-reconnect-2026-10-17/review.json +10 -0
- package/docs/evaluation/controller-ledger-hooks-2026-10-26/README.md +115 -0
- package/docs/evaluation/evidence-2026-10-17/budget.proposed.json +13 -0
- package/docs/evaluation/evidence-2026-10-17/changed-files.txt +82 -0
- package/docs/evaluation/evidence-2026-10-17/checks.json +103 -0
- package/docs/evaluation/evidence-2026-10-17/comparison.json +247 -0
- package/docs/evaluation/evidence-2026-10-17/development-collection-failure.json +15 -0
- package/docs/evaluation/evidence-2026-10-17/full-attempt-default.json +19 -0
- package/docs/evaluation/evidence-2026-10-17/full-tests.json +17 -0
- package/docs/evaluation/evidence-2026-10-17/inventory.json +239 -0
- package/docs/evaluation/evidence-2026-10-17/manifest.json +359 -0
- package/docs/evaluation/evidence-2026-10-17/offline.json +1020 -0
- package/docs/evaluation/evidence-2026-10-17/ui-reference/T3-1280.png +0 -0
- package/docs/evaluation/evidence-2026-10-17/ui-reference/T3-375.png +0 -0
- package/docs/evaluation/evidence-2026-10-17/ui-reference/result.json +141 -0
- package/docs/evaluation/extension-ablation-2026-10-20/README.md +414 -0
- package/docs/evaluation/extension-ablation-2026-10-20/setup.md +140 -0
- package/docs/evaluation/extension-ablation-repeat-2026-10-21/README.md +142 -0
- package/docs/evaluation/extension-ablation-repeat-2026-10-21/setup.md +69 -0
- package/docs/evaluation/extension-audit-2026-10-17/README.md +149 -0
- package/docs/evaluation/extension-audit-2026-10-17/checks.json +38 -0
- package/docs/evaluation/extension-audit-2026-10-17/cursor-static-evidence.json +93 -0
- package/docs/evaluation/extension-audit-2026-10-17/installed-artifact-comparison.json +85 -0
- package/docs/evaluation/extension-audit-2026-10-17/installed-packages.json +100 -0
- package/docs/evaluation/extension-audit-2026-10-17/integrity.json +108 -0
- package/docs/evaluation/extension-audit-2026-10-17/navigation-cursor-registry.json +290 -0
- package/docs/evaluation/extension-audit-2026-10-17/navigation-static-evidence.json +185 -0
- package/docs/evaluation/extension-audit-2026-10-17/openwiki-headless-bindings.json +25 -0
- package/docs/evaluation/extension-audit-2026-10-17/openwiki-headless-cleanup.json +12 -0
- package/docs/evaluation/extension-audit-2026-10-17/openwiki-headless-probe.mjs +63 -0
- package/docs/evaluation/extension-audit-2026-10-17/openwiki-headless-reproduction.json +91 -0
- package/docs/evaluation/extension-audit-2026-10-17/openwiki-headless-result.json +83 -0
- package/docs/evaluation/extension-audit-2026-10-17/permission-cache-artifact-verification.json +24 -0
- package/docs/evaluation/extension-audit-2026-10-17/permission-cache-evidence.json +133 -0
- package/docs/evaluation/extension-audit-2026-10-17/permission-cache-report.md +64 -0
- package/docs/evaluation/extension-audit-2026-10-17/publication-export.json +10 -0
- package/docs/evaluation/extension-audit-2026-10-17/resolver-gates.json +51 -0
- package/docs/evaluation/extension-audit-2026-10-17/review.json +28 -0
- package/docs/evaluation/extension-audit-2026-10-17/run-openwiki-headless-probe.mjs +29 -0
- package/docs/evaluation/extension-audit-2026-10-17/summary.json +123 -0
- package/docs/evaluation/extension-audit-2026-10-17/web-openwiki-artifacts.json +29 -0
- package/docs/evaluation/extension-audit-2026-10-17/web-openwiki-evidence.json +116 -0
- package/docs/evaluation/extension-audit-2026-10-17/web-openwiki-report.md +113 -0
- package/docs/evaluation/extension-functions-2026-10-17/README.md +33 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/README.md +39 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-03dc1dad-9959-40df-b51c-7820991bf7e3.json +79 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-0c43651e-8c7d-4c7c-aa9b-5b5761141e3b.json +54 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-51247b13-87c1-4ec6-886b-82d922b0585a.json +89 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-5337f6bf-503f-4c45-aac0-43b142385a87.json +47 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-60285194-b1d1-4335-b616-6614941585df.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-6d2fbaa9-a720-4582-9be1-a95f4764786d.json +69 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-6fbb576c-d87d-478d-9c05-4b5ef3563598.json +125 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-730926d1-ef20-4b2d-ab74-7e542f1065e9.json +48 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-a1baa47a-5bbe-4a16-ade8-a350599eb911.json +48 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-bc1d69c7-784f-4ddb-9335-0d905330d568.json +91 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-d582757d-2859-4683-8310-ec158bf6d551.json +99 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts/extension-functions-bridges-e6533a23-4933-4d6e-a250-b1b27f010d18.json +60 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/attempts.json +138 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/guard.mjs +74 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/integrity.json +86 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/openwiki-final.json +125 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/run.mjs +36 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/web-final.json +99 -0
- package/docs/evaluation/extension-functions-2026-10-17/bridges/worker.mjs +102 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/README.md +21 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-30-31-440Z-b1a47f88-8d86-4238-9ef8-af890d9ba74b.json +129 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-31-04-505Z-a3736add-73b8-4d77-8ea6-084ce8aa4599.json +129 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-31-15-654Z-b0197bff-8363-4d46-b84b-46d9ed67fc39.json +248 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-31-39-137Z-e373f24d-8a8c-46b0-86aa-9f687cfadb9b.json +278 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-32-05-324Z-f63095f1-755e-43fc-9d28-3cd1a9ff4f4d.json +251 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-32-25-191Z-fc9a83af-ceae-40d7-a737-8ef861ba7946.json +282 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-33-14-993Z-5e7eae34-09f0-4c80-9210-b8cc4d1acb5f.json +282 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-38-39-010Z-57cf6a26-f091-45de-8849-b616b303a46c.json +283 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-40-32-118Z-54528e43-ac07-4f9c-8f12-10c041130983.json +283 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-41-49-525Z-48195b6e-f20d-49a5-bd53-a732a0af10c1.json +324 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/cache-function-evidence-2026-10-17T13-42-18-175Z-215330e7-06a6-4666-af9c-2ecb214d8d71.json +324 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/integrity.json +165 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/probe.mjs +161 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipt-archive.json +150 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/commands-headless-3feeffc5-97bf-4079-8505-8119fab7956a.json +54 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/commands-headless-42e5eace-ad87-480a-94d9-448c1dd167b8.json +49 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/commands-headless-50f39f1c-8b48-442b-8d15-1f9c8f63bd81.json +49 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/commands-headless-8482b2b0-f600-488b-9f36-905e0125177a.json +54 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-codex-bypass-128ffdce-6fd5-431b-8019-32b40ba4174d.json +42 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-codex-bypass-3b572182-a737-471f-b9cb-b01d5da1752a.json +42 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-codex-bypass-6c225370-2f47-4a0a-80d5-87d12f6c6fdc.json +37 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-codex-bypass-b48399db-cbed-43de-9071-ac27c34e3757.json +37 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-openai-3a8f52b6-c8d6-4d1c-844c-782a6624a29e.json +45 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-openai-6fcdbc20-b14b-4b80-a4da-bf24078da8d2.json +50 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-openai-a8d6f628-40e1-437e-b192-f7232a051a44.json +50 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/payload-openai-c3c39463-a2d6-4ff8-b985-8f6d1fb1aa02.json +45 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/stats-synthetic-a23c264f-151d-4ff0-aab4-bdbb2f6560d8.json +53 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/stats-synthetic-d8178bd3-6530-4915-9cf1-056a975bfbcd.json +53 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/stats-synthetic-e3985119-e101-459e-91cd-21a0905287ba.json +48 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/stats-synthetic-e7a40382-2d27-4db5-a133-dbe346a5dc60.json +48 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-unknown-223d7adc-2dbc-4017-b1ec-0c38294320e2.json +41 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-unknown-347a8548-d2e0-4846-a08e-b0399f8fd3b4.json +41 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-unknown-49b45e2b-e2d2-456f-b73f-e6bc938b6378.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-unknown-aaf432f2-bb91-41a7-b951-2d4316389632.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-zero-204ab3e8-f1fe-4894-8fb0-08299deb4c21.json +41 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-zero-9388d2df-fa15-479c-a4ef-2a774c366c0f.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-zero-e0bb4742-214a-4b3f-88d2-44de54394e2f.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/receipts/warming-disabled-zero-f77e1e2d-742a-490f-9955-1dfb19f59c9c.json +41 -0
- package/docs/evaluation/extension-functions-2026-10-17/cache/runner.mjs +36 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/README.md +20 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-36-10-753Z-2bb4fff5-48cc-4f6b-ae1b-5cc1a07f610b.json +54 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-36-26-537Z-5adc4fb1-0008-4ef9-a106-aa372dabf061.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-36-32-362Z-30949c31-73a3-4dae-af81-68deded51543.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-36-38-494Z-8eec81b8-5576-48cb-b2fa-c279269db058.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-36-45-546Z-991647e5-7ea4-43c4-a90d-868e4ac38d83.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-37-02-277Z-2296fb35-e5cb-4bf1-9e83-7370bcb46bfe.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-37-28-390Z-e9c3d106-b4c9-4146-ae83-a2799c907fe5.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-37-37-371Z-8545c893-a8e3-4dc6-973b-81dfd97d798b.json +56 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-38-41-612Z-c57c4778-261d-4397-8a36-df9cc23ca629.json +58 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-38-51-661Z-0eb898de-7471-4f17-a308-5ef5d86421ff.json +58 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-38-55-412Z-8169d843-a9e7-48f4-88b1-3a90e1592df1.json +58 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-39-15-274Z-a5610333-e428-4cc6-9f5a-9206748ee512.json +58 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-39-39-506Z-d4c80a7b-76b4-4d11-bf0f-552d11b131b2.json +136 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-39-53-515Z-db409f47-8ee5-4354-b7f9-a258eb7e17d0.json +136 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/evidence-2026-10-17T13-42-04-909Z-01d70cb3-6897-46ca-b8aa-1c69d5b5c7fc.json +148 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/integrity.json +205 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/probe.mjs +151 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipt-archive.json +186 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-104e378f-8f82-4ae9-bffc-7f1d52e00e74.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-182a8009-c52a-4760-9768-9cba15fceb9c.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-1f07360d-046f-4f0c-b40f-6b57a027220c.json +65 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-256cb86e-40ae-4fec-a2d2-9b7f66cc4be8.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-2667d991-3133-44c3-b883-c401b3c14cb1.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-394fc425-ed51-408f-ab09-6d26aee0d48f.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-531d3f1d-c326-4914-b768-3d32103513b9.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-5c7d0d62-8290-494f-8729-5d60bc626ad7.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-64af1d94-ea73-481f-b827-dbf6755d8591.json +66 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-65fce696-864c-4247-960e-59f6d671cbf9.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-66acde31-19c7-4d3e-9814-ddeb2cffd373.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-79d220d0-fc0b-4cad-85cc-40b9e904fb97.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-a58f0281-71bc-4757-9d6f-e281f813135e.json +65 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-c2b61e4b-fd33-4969-ab29-118957ca5fbb.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/activation-and-resources-f61b5020-2c05-40ad-9cb8-590b22790186.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-0ee0df5a-299f-451c-96e3-5abcf8bfa999.json +45 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-169e5146-09a2-4231-8017-ebd8d4b75f0a.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-19d479f2-7162-463e-90de-2d89a13e59a3.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-1bd882bb-2403-4269-8335-90f9803f57b7.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-2ab9d418-68b2-4679-bf42-f31b6945ea5a.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-3a6aa7d7-b956-4fe5-9555-a2c63408c067.json +45 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-6333425f-0b46-4ced-a272-3d48895ee853.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-6eccb170-ff45-40e2-afc5-dfc0f77c229f.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-7f330c57-9c3f-4879-a1d0-67c4c5c36050.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-8d9de272-165c-4bb8-a147-d1b306388472.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-c1ffa69f-25fa-4f45-a691-af3bc422c089.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-c24ad0c8-5e7e-4d71-9b22-3e2708ce1626.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-c5a3140e-a28e-4264-9ee6-51b1310b3123.json +14 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-cdbb3dde-2441-46ae-9111-f2a299d45807.json +46 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/receipts/bridge-disabled-d68f774c-d1f0-4620-b334-301a20edffc3.json +15 -0
- package/docs/evaluation/extension-functions-2026-10-17/cursor/runner.mjs +147 -0
- package/docs/evaluation/extension-functions-2026-10-17/integrity.json +618 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/README.md +22 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/SHA256SUMS.txt +8 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempt.json +13 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-30-37-626Z-7ba0ce60-b805-4bf1-813f-80f0673c519d.json +50 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-31-06-997Z-0df6e689-b7f6-4daf-a730-724638c7e9bb.json +52 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-31-22-489Z-dfa50911-d117-400d-9ea3-76b224693c10.json +59 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-31-39-899Z-6792c0ef-c795-4136-98e2-b9a9b00489bd.json +59 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-31-58-555Z-e23d44fb-d2cb-42b6-b76b-f2ac53645401.json +59 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-32-18-734Z-3708117d-bca6-44a6-9f61-4339a67535ae.json +60 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-32-34-897Z-abbfb675-7120-46fc-8638-2dde943a3c51.json +114 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-33-30-753Z-f1965485-aa41-4a9a-b62e-267fc9d7686c.json +72 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-33-46-589Z-e3b46364-e0dd-4a95-91ce-c11f5192d83f.json +72 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-33-57-569Z-d296148e-2f64-4921-bad7-391d0f3cc61d.json +74 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-34-30-540Z-51791e8c-b2a7-4f93-bff6-9b0467aeba51.json +109 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-34-57-906Z-2c3e469c-6d89-4707-8bc6-e62dcfacdc7c.json +114 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-35-16-679Z-035260fc-f3d1-4c1c-9619-81f2aa2ced55.json +115 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-36-05-641Z-24ceb58d-441b-4ffe-9853-ef4d15eb8c81.json +73 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-37-00-445Z-1ca606b7-306f-41e9-8745-b53879c620bb.json +72 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-37-23-659Z-c958d5fc-5c17-46b9-abc0-87913f14fd4b.json +73 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-38-49-639Z-9e74ee3c-7cea-4d9e-832f-0b5068d161ec.json +112 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-39-53-463Z-5d834e9f-e247-4887-8200-dee41070567f.json +32 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-40-16-811Z-0be9d64c-a0d7-405c-b81a-12f8c6cfebac.json +33 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-40-36-020Z-412777d5-f352-4fa0-9a07-f017b5f04cbb.json +124 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-42-03-506Z-a0cca711-1300-4431-bfff-5814a409d0af.json +120 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-42-28-426Z-fb70da7e-4888-469a-b5cd-b74da52afa9f.json +112 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-42-41-596Z-c8e99863-70e2-40f1-a516-e9f41156ef44.json +71 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-44-06-279Z-39516e45-daf6-409b-b216-64179608cc2e.json +97 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-45-34-538Z-87ddef90-2fda-4211-a513-0516dec235f4.json +112 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-45-48-020Z-06f478f2-43c4-48a7-ac02-7e53d4df8aaf.json +112 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-46-00-807Z-a98cc49d-6cf6-4109-aa95-f2d36e8d35c3.json +97 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-46-34-183Z-77f75abc-9ec3-41b2-896f-b6f4a180dca8.json +160 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/attempts/isolated-extensions-results-2026-10-17T13-46-56-605Z-f46134c2-8523-4892-ab76-e88195d79ed2.json +163 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/child-guard.mjs +30 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/final-result.json +42 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/function-probe.mjs +521 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/function-runner.mjs +201 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/integrity.json +153 -0
- package/docs/evaluation/extension-functions-2026-10-17/navigation/receipt-archive.json +160 -0
- package/docs/evaluation/extension-functions-2026-10-17/review.json +27 -0
- package/docs/evaluation/extension-functions-2026-10-17/summary.json +102 -0
- package/docs/evaluation/extension-functions-2026-10-17/verification.json +103 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/README.md +106 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/auth-warmup.mjs +33 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/contained-agent-ro.json +433 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/contained.json +439 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/control.json +403 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/live.json +75 -0
- package/docs/evaluation/isolation-acceptance-2026-10-18/wrapper.sh +37 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/README.md +360 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/design.md +150 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/inventory.md +113 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/README.md +117 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/dry-run/dry-01-L1-A.json +202 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/dry-run/dry-02-L1-C.json +259 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run/01-L1-A.json +169 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run/02-L1-A.json +202 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run/03-L1-C.json +256 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run/approval.json +31 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run-2/01-L1-C.json +256 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run-2/02-L1-A.json +201 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live/run-2/approval.json +16 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/live-plan.md +87 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/pre-registration.md +117 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S1.json +361 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S2.json +544 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S3.json +470 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S4.json +271 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S5.json +271 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/S6.json +266 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/X6.json +29 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-1/summary.json +269 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S1.json +391 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S2.json +600 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S3.json +519 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S4.json +281 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S5.json +294 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S6.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/S8.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/X6.json +32 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-2/summary.json +307 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S1.json +391 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S2.json +600 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S3.json +519 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S4.json +281 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S5.json +294 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S6.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/S8.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/X6.json +32 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-3/summary.json +307 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S1.json +409 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S2.json +634 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S3.json +537 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S4.json +281 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S5.json +294 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S6.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/S8.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/X6.json +32 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-4/summary.json +307 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S1.json +409 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S2.json +634 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S3.json +537 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S4.json +281 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S5.json +294 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S6.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/S8.json +280 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/X6.json +32 -0
- package/docs/evaluation/ledger-event-bridge-2026-10-21/probe/attempt-5/summary.json +307 -0
- package/docs/evaluation/live-rescreen-2026-10-17/README.md +114 -0
- package/docs/evaluation/live-rescreen-2026-10-17/approval.json +18 -0
- package/docs/evaluation/live-rescreen-2026-10-17/approved-budget.json +13 -0
- package/docs/evaluation/live-rescreen-2026-10-17/approved-manifest.json +315 -0
- package/docs/evaluation/live-rescreen-2026-10-17/audit-rescreen.mjs +78 -0
- package/docs/evaluation/live-rescreen-2026-10-17/audit.json +152 -0
- package/docs/evaluation/live-rescreen-2026-10-17/backend-independent-checks.json +38 -0
- package/docs/evaluation/live-rescreen-2026-10-17/checks.json +54 -0
- package/docs/evaluation/live-rescreen-2026-10-17/execution.json +19 -0
- package/docs/evaluation/live-rescreen-2026-10-17/integrity.json +138 -0
- package/docs/evaluation/live-rescreen-2026-10-17/planning-ledger.json +26 -0
- package/docs/evaluation/live-rescreen-2026-10-17/review.json +16 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/comparison.json +177 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-1.claim +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-1.diagnostic.json +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-1.json +97 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-2.claim +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-2.json +104 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-2.patch +11 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-2.snapshot/contract.mjs +4 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-2.snapshot/package.json +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-3.claim +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-3.json +89 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-4.claim +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-4.json +104 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-4.patch +11 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-4.snapshot/contract.mjs +4 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-4.snapshot/package.json +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-5.claim +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-5.diagnostic.json +1 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-5.json +117 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runs/rescreen-6.json +53 -0
- package/docs/evaluation/live-rescreen-2026-10-17/runtime-observation.json +11 -0
- package/docs/evaluation/live-screening-2026-10-17/approval.json +13 -0
- package/docs/evaluation/live-screening-2026-10-17/approved-budget.json +13 -0
- package/docs/evaluation/live-screening-2026-10-17/approved-manifest.json +359 -0
- package/docs/evaluation/live-screening-2026-10-17/audit.json +143 -0
- package/docs/evaluation/live-screening-2026-10-17/integrity.json +148 -0
- package/docs/evaluation/live-screening-2026-10-17/inventory.json +239 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/comparison.json +247 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-1.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-1.diagnostic.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-1.json +98 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-2.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-2.json +104 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-2.patch +11 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-2.snapshot/contract.mjs +4 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-2.snapshot/package.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-3.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-3.diagnostic.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-3.json +97 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-4.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-4.json +104 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-4.patch +11 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-4.snapshot/contract.mjs +4 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-4.snapshot/package.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-5.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-5.diagnostic.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-5.json +97 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-6.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-6.json +104 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-6.patch +11 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-6.snapshot/contract.mjs +4 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-6.snapshot/package.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-7.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-7.json +108 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-8.claim +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-8.diagnostic.json +1 -0
- package/docs/evaluation/live-screening-2026-10-17/runs/screen-8.json +116 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/README.md +124 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/ab-proposal.json +135 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-1/README.md +25 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-1/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-1/approved-decision.json +79 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-1/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-1/token-live-result.json +546 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-2/README.md +22 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-2/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-2/approved-decision.json +80 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-2/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-2/token-live-result.json +1663 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-3/README.md +23 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-3/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-3/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-3/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-3/token-live-result.json +1748 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/README.md +25 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-A/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-A/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-A/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-A/token-live-result.json +3019 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-B/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-B/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-B/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/probe/attempt-4/arm-B/token-live-result.json +2859 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/README.md +67 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r1-pair1-A/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r1-pair1-A/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r1-pair1-A/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r1-pair1-A/token-live-result.json +3019 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r2-pair1-B/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r2-pair1-B/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r2-pair1-B/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r2-pair1-B/token-live-result.json +2981 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r3-pair2-B/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r3-pair2-B/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r3-pair2-B/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r3-pair2-B/token-live-result.json +2887 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r4-pair2-A/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r4-pair2-A/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r4-pair2-A/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r4-pair2-A/token-live-result.json +3189 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r5-pair3-B/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r5-pair3-B/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r5-pair3-B/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r5-pair3-B/token-live-result.json +2929 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r6-pair3-A/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r6-pair3-A/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r6-pair3-A/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r6-pair3-A/token-live-result.json +3085 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r7-pair4-A/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r7-pair4-A/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r7-pair4-A/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r7-pair4-A/token-live-result.json +3019 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r8-pair4-B/approved-budget.json +13 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r8-pair4-B/approved-decision.json +71 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r8-pair4-B/approved-manifest.json +271 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/r8-pair4-B/token-live-result.json +2925 -0
- package/docs/evaluation/m1-ab-proposal-2026-10-18/results/summary-rows.json +338 -0
- package/docs/evaluation/node24-followup-2026-10-17/README.md +55 -0
- package/docs/evaluation/node24-followup-2026-10-17/client-migration-review.json +20 -0
- package/docs/evaluation/node24-followup-2026-10-17/client-registration-migration.json +31 -0
- package/docs/evaluation/node24-followup-2026-10-17/client-registration-verification.json +389 -0
- package/docs/evaluation/node24-followup-2026-10-17/closure-checks.json +33 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-probe.mjs +259 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-report.md +39 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-result-attempt-2.json +49 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-result-attempt-3.json +76 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-result-attempt-4.json +108 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-result.json +12 -0
- package/docs/evaluation/node24-followup-2026-10-17/cursor-headless-run.mjs +96 -0
- package/docs/evaluation/node24-followup-2026-10-17/download.json +16 -0
- package/docs/evaluation/node24-followup-2026-10-17/extension-summary.json +97 -0
- package/docs/evaluation/node24-followup-2026-10-17/final-review.json +15 -0
- package/docs/evaluation/node24-followup-2026-10-17/install.json +10 -0
- package/docs/evaluation/node24-followup-2026-10-17/integrity.json +204 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-evidence.json +39 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-probe.mjs +277 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-report.md +35 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-19-48-378Z-b378dc9f-9ab8-4349-8892-78af8184f78f.json +151 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-20-22-821Z-85cfcba4-c05e-4c5a-9658-d8d70f5c8d1a.json +223 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-20-54-825Z-fd5d8373-6e29-4197-84bd-2e65251b4db8.json +207 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-21-44-636Z-488698ad-f8bf-4d7e-b85a-615275c32e5d.json +82 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-22-05-375Z-16f5d77c-32a2-4d0a-905a-e080b392316f.json +94 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-22-07-471Z-fcbe7c98-fed3-4120-a860-b2e3f9572836.json +63 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-22-17-638Z-45ec386d-3429-4a7c-a10e-8673c03861f0.json +63 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-22-22-485Z-1b08e134-667c-4416-8372-cb233939c48b.json +125 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-22-25-490Z-223fd05e-52f9-4996-88d7-3ec43a6ecdd9.json +125 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-23-42-291Z-f4af1e12-844e-4b2d-a090-9068e7626dd5.json +82 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-24-36-866Z-30770d13-c7ae-4309-921b-5c1b43050adb.json +52 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-25-05-378Z-2a5dffc1-3f3a-433a-823f-6e77964dcaee.json +53 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-25-15-842Z-798946f5-b9a5-4810-8a0c-35be6f40abb3.json +83 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-results-2026-10-17T09-25-19-099Z-89bd000d-bb51-4e3a-b713-51ff1ff4e38b.json +87 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-extensions-runner.mjs +172 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-install.json +121 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-package-lock.json +2321 -0
- package/docs/evaluation/node24-followup-2026-10-17/isolated-package.json +12 -0
- package/docs/evaluation/node24-followup-2026-10-17/launcher-review.json +17 -0
- package/docs/evaluation/node24-followup-2026-10-17/launcher-switch.json +28 -0
- package/docs/evaluation/node24-followup-2026-10-17/mcp-launcher-test.json +24 -0
- package/docs/evaluation/node24-followup-2026-10-17/migrate-client-node.mjs +129 -0
- package/docs/evaluation/node24-followup-2026-10-17/node-runtime-report.md +127 -0
- package/docs/evaluation/node24-followup-2026-10-17/node24-checks.json +44 -0
- package/docs/evaluation/node24-followup-2026-10-17/pi-launcher-test.json +13 -0
- package/docs/evaluation/node24-followup-2026-10-17/publication-export.json +11 -0
- package/docs/evaluation/node24-followup-2026-10-17/restore-launchers.mjs +26 -0
- package/docs/evaluation/node24-followup-2026-10-17/verify-client-node.mjs +36 -0
- package/docs/evaluation/permission-gates-2026-10-17/README.md +23 -0
- package/docs/evaluation/permission-gates-2026-10-17/attempts.json +53 -0
- package/docs/evaluation/permission-gates-2026-10-17/integrity.json +46 -0
- package/docs/evaluation/permission-gates-2026-10-17/permission-gate-probe.mjs +132 -0
- package/docs/evaluation/permission-gates-2026-10-17/permission-gate-worker.mjs +209 -0
- package/docs/evaluation/permission-gates-2026-10-17/permission-gates-result-final.json +53 -0
- package/docs/evaluation/permission-gates-2026-10-17/permission-gates-result-verified.json +54 -0
- package/docs/evaluation/permission-gates-2026-10-17/permission-gates-result.json +53 -0
- package/docs/evaluation/permission-gates-2026-10-17/review.json +19 -0
- package/docs/evaluation/permission-gates-2026-10-17/superseded-initial-receipt.json +40 -0
- package/docs/evaluation/pi-lens-registration-2026-10-19/README.md +90 -0
- package/docs/evaluation/pi-lens-registration-2026-10-19/probe.mjs +126 -0
- package/docs/evaluation/pi-lens-registration-2026-10-19/result.json +1 -0
- package/docs/evaluation/plan-continuation-2026-10-17/README.md +107 -0
- package/docs/evaluation/plan-continuation-2026-10-17/budget.proposed.json +13 -0
- package/docs/evaluation/plan-continuation-2026-10-17/checks.json +1048 -0
- package/docs/evaluation/plan-continuation-2026-10-17/integrity.json +58 -0
- package/docs/evaluation/plan-continuation-2026-10-17/inventory.json +239 -0
- package/docs/evaluation/plan-continuation-2026-10-17/manifest.proposed.json +315 -0
- package/docs/evaluation/plan-continuation-2026-10-17/next-stage-ledger.json +19 -0
- package/docs/evaluation/plan-continuation-2026-10-17/prepare-rescreen.mjs +30 -0
- package/docs/evaluation/plan-continuation-2026-10-17/prior-integrity.json +25 -0
- package/docs/evaluation/plan-continuation-2026-10-17/proposal-validation.json +14 -0
- package/docs/evaluation/plan-continuation-2026-10-17/receipt-contract-update.patch +40 -0
- package/docs/evaluation/plan-continuation-2026-10-17/review.json +8 -0
- package/docs/evaluation/plan-continuation-2026-10-17/source-delta.json +14 -0
- package/docs/evaluation/profile-evaluation.md +297 -0
- package/docs/evaluation/publication-2026-10-17/README.md +88 -0
- package/docs/evaluation/publication-2026-10-17/checks.json +117 -0
- package/docs/evaluation/publication-2026-10-17/integrity.json +21 -0
- package/docs/evaluation/publication-2026-10-17/publication-scan.json +63 -0
- package/docs/evaluation/publication-2026-10-17/review.json +21 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/README.md +16 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/bounded-wait.md +78 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/README.md +151 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/attempt-1/claude-projection.json +126 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/attempt-2/claude-projection.json +1895 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/attempt-3/claude-projection.json +1895 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/attempt-4/claude-projection.json +1797 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/claude-projection/attempt-5/claude-projection.json +1797 -0
- package/docs/evaluation/s5-decision-inputs-2026-10-18/worker-usage.md +63 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/README.md +212 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/binding.json +20 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/config-ev-off.json +43 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/config-ev-spool.json +43 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/config-l3.json +39 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/config-pre.json +31 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e-teardown-setup-remove.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-digest-ev-e1.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-leaks.json +131 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-oracle.json +74 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-setup-1-dryrun.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-setup-2-apply.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e1-setup-3-verify.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-digest-ev-e2l.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-digest-ev-e2s.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-leaks.json +205 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-oracle.json +110 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e2-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-digest-ev-e3.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-leaks.json +215 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-oracle.json +79 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e3b-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-digest-ev-e4a.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-digest-ev-e4b.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-late-a.json +16 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-late-b.json +16 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-leaks.json +167 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-oracle.json +70 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e4-run.json +37 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-digest-ev-e5.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-leaks.json +82 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-oracle.json +60 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e5-server-env-names.txt +14 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-digest-ev-e1.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-leaks.json +156 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-run.json +37 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-setup-apply.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/e6b-teardown-remove.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/final-e-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/kit.sha256 +23 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l2-packed-off.json +1185 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l2-packed-spool.json +1334 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l2-wt-off.json +1185 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l2-wt-spool.json +1334 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-digest-cc-analysis.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-leaks.json +80 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-oracle.json +61 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv1-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-leaks.json +80 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-oracle-stage1.json +34 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-oracle-stage2.json +35 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-snapshot-stage1.txt +4 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv2-snapshot-stage2.txt +5 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-digest-cc-abort.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-leaks.json +82 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-oracle-flow.json +61 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-oracle-late.json +16 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cc-inv3-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-controller-skill-remove.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-controller-skill-setup.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-digest-cx-analysis.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-leaks.json +93 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-oracle.json +61 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv1-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-leaks.json +93 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-oracle-stage1.json +34 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-oracle-stage2.json +35 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-snapshot-stage1.txt +4 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv2-snapshot-stage2.txt +5 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-digest-cx-abort.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-leaks.json +95 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-oracle-flow.json +61 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-oracle-late.json +16 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/l3-cx-inv3-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-digest-pre-analysis.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-digest-pre-code.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-leaks.json +86 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-oracle.json +39 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-clean-10s.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-clean.json +15 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-digest-pre-analysis.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-digest-pre-code.json +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-leaks.json +47 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-oracle.json +39 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/p0a-harness-fail-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/regdigest-after-cc.json +6 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/regdigest-after-cx.json +6 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/regdigest-after-e.json +6 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/regdigest-before.json +6 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-control-apply.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-control-dryrun.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-provision-apply-attempt1.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-provision-apply-attempt2.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-provision-dryrun.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w1-writer-verify.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2-leaks.json +130 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2-oracle.txt +14 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2b-oracle.txt +16 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2c-oracle.txt +8 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2d-oracle.txt +6 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2r-leaks.json +130 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2r-oracle.txt +3 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w2r-run.json +33 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w3-collect.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w3-finish.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w3r-collect.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w3r-finish.json +1 -0
- package/docs/evaluation/s7-live-acceptance-2026-10-24/evidence/w4-remove.json +1 -0
- package/docs/evaluation/subagent-probe-2026-10-26/README.md +132 -0
- package/docs/evaluation/subagent-probe-2026-10-26/results/K7.json +463 -0
- package/docs/evaluation/subagent-probe-2026-10-26/results/summary.json +50 -0
- package/docs/evaluation/test-coverage-2026-10-17.json +483 -0
- package/docs/evaluation/test-coverage-review-2026-10-17.json +22 -0
- package/docs/evaluation/test-coverage-verification-2026-10-17.json +31 -0
- package/docs/evaluation/token-footprint-2026-10-17/README.md +297 -0
- package/docs/evaluation/token-footprint-2026-10-17/baseline.json +25871 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/README.md +24 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/baseline.json +30346 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/client-projection.json +2538 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/live-approval/budget.json +13 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/live-approval/decision.json +69 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/live-approval/manifest.json +271 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/live-package.json +785 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/measurement.json +37956 -0
- package/docs/evaluation/token-footprint-2026-10-17/calibration-2/summary.json +119 -0
- package/docs/evaluation/token-footprint-2026-10-17/checks-final.json +273 -0
- package/docs/evaluation/token-footprint-2026-10-17/checks.json +190 -0
- package/docs/evaluation/token-footprint-2026-10-17/client-attempts/README.md +25 -0
- package/docs/evaluation/token-footprint-2026-10-17/client-attempts/attempt-4.json +2274 -0
- package/docs/evaluation/token-footprint-2026-10-17/client-attempts/pilot-1.json +77 -0
- package/docs/evaluation/token-footprint-2026-10-17/client-attempts/pilot-2.json +81 -0
- package/docs/evaluation/token-footprint-2026-10-17/client-attempts/pilot-3.json +121 -0
- package/docs/evaluation/token-footprint-2026-10-17/current-calibration/baseline.json +30346 -0
- package/docs/evaluation/token-footprint-2026-10-17/current-calibration/measurement.json +37956 -0
- package/docs/evaluation/token-footprint-2026-10-17/current-calibration/summary.json +119 -0
- package/docs/evaluation/token-footprint-2026-10-17/current-client-projection.json +2538 -0
- package/docs/evaluation/token-footprint-2026-10-17/follow-up.md +76 -0
- package/docs/evaluation/token-footprint-2026-10-17/integrity.json +171 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-approval/README.md +36 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-approval/budget.json +13 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-approval/decision.json +69 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-approval/manifest.json +271 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-package.json +795 -0
- package/docs/evaluation/token-footprint-2026-10-17/live-proposal.json +427 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/README.md +75 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-1/approved-budget.json +13 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-1/approved-decision.json +69 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-1/approved-manifest.json +271 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-1/token-live-result.json +837 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-2/approved-budget.json +13 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-2/approved-decision.json +69 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-2/approved-manifest.json +271 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-2/token-live-result.json +985 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-3/approved-budget.json +13 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-3/approved-decision.json +69 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-3/approved-manifest.json +271 -0
- package/docs/evaluation/token-footprint-2026-10-17/m1-pilot/attempt-3/token-live-result.json +3055 -0
- package/docs/evaluation/token-footprint-2026-10-17/measurement.json +32476 -0
- package/docs/evaluation/token-footprint-2026-10-17/prior-calibration/README.md +20 -0
- package/docs/evaluation/token-footprint-2026-10-17/prior-calibration/integrity.json +40 -0
- package/docs/evaluation/token-footprint-2026-10-17/summary.json +119 -0
- package/docs/evaluation/tool-definitions-2026-10-18/README.md +204 -0
- package/docs/evaluation/tool-definitions-2026-10-18/codex-projection/after/client-projection.json +2853 -0
- package/docs/evaluation/tool-definitions-2026-10-18/codex-projection/before/client-projection.json +2853 -0
- package/docs/evaluation/tool-definitions-2026-10-18/compare-validation.mjs +64 -0
- package/docs/evaluation/tool-definitions-2026-10-18/diff-validation.mjs +13 -0
- package/docs/evaluation/tool-definitions-2026-10-18/measure-wire.mjs +31 -0
- package/docs/evaluation/worker-system-prompt-2026-10-26/README.md +95 -0
- package/docs/evaluation/worker-system-prompt-2026-10-26/probe.mjs +155 -0
- package/docs/execution-modes.md +388 -0
- package/docs/installation.md +246 -12
- package/docs/isolation-setup.md +258 -0
- package/docs/macos-setup-design.md +2 -2
- package/docs/pi-extensions-design.md +71 -16
- package/docs/releasing.md +12 -6
- package/docs/reviews/2026-10-18-adr-0008-decision-brief.md +53 -0
- package/docs/roadmap.md +320 -9
- package/docs/session-mcp.md +5 -1
- package/docs/skills.md +23 -0
- package/docs/sprints/2026-10-15-s4-decision.md +73 -4
- package/docs/sprints/2026-10-17-token-footprint.md +130 -0
- package/docs/sprints/2026-10-18-s5-maintenance-orchestration.md +202 -0
- package/docs/sprints/2026-10-21-s6-ledger-event-bridge.md +120 -0
- package/docs/sprints/2026-10-24-s7-stabilization-live-acceptance.md +173 -0
- package/docs/sprints/2026-10-24-s8-writer-migration.md +235 -0
- package/docs/sprints/2026-10-26-s10-orchestration-reliability.md +250 -0
- package/docs/sprints/2026-10-26-s11-orchestration-gaps.md +173 -0
- package/docs/threat-model.md +37 -6
- package/docs/tool-contracts.md +91 -9
- package/package.json +17 -11
- package/scripts/isolation-acceptance.mjs +709 -0
- package/scripts/isolation-probe.cjs +213 -0
- package/skills/pi-session-implementation/SKILL.md +13 -3
- package/skills/pi-session-orchestration/SKILL.md +50 -13
- package/skills/pi-session-orchestration/references/start-errors.md +12 -0
- package/skills/pi-session-review/SKILL.md +13 -5
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { link, lstat, mkdir, open, readdir, readFile, realpath, rename, rm, stat } from "node:fs/promises";
|
|
4
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
5
|
+
import { readWriterState, writerEventDeliveryEnabled, writerPaths, writerRegistrationName, writersRoot, WRITER_NAME_PATTERN } from "./writer-state.js";
|
|
6
|
+
/**
|
|
7
|
+
* The wake hook of ADR 0011 in Claude Code settings.
|
|
8
|
+
*
|
|
9
|
+
* Contract, not version (ADR 0004): Claude Code has no command for hooks, so there is no client
|
|
10
|
+
* version gate and no command to inspect. The entry follows Claude Code's settings schema
|
|
11
|
+
* (`hooks.PostToolUse[]` with `matcher`, and `hooks[]` of `type: "command"` with `command`,
|
|
12
|
+
* `timeout` in seconds and `asyncRewake`). Setup writes that entry and verify checks the file
|
|
13
|
+
* content only; whether the running client honours it is the acceptance check of the release.
|
|
14
|
+
*
|
|
15
|
+
* Settings files by Claude Code scope (documented client behaviour):
|
|
16
|
+
* - user: `${CLAUDE_CONFIG_DIR ?? ~/.claude}/settings.json`
|
|
17
|
+
* - project: `<project>/.claude/settings.json`
|
|
18
|
+
* - local: `<project>/.claude/settings.local.json`
|
|
19
|
+
* A project is the canonical (realpath) working directory, like the project skill slot. An
|
|
20
|
+
* entry written while a session is running may need a session restart (or the client's own
|
|
21
|
+
* settings reload) before it fires; setup cannot observe that.
|
|
22
|
+
*
|
|
23
|
+
* Ownership is the same pending-before-write transaction as skills: the pending record names the
|
|
24
|
+
* entry about to be written (and, for an update, the owned entry it replaces) by fingerprint, so
|
|
25
|
+
* an interrupted run is settled from the file alone. Records hold fingerprints only, never paths
|
|
26
|
+
* or command strings.
|
|
27
|
+
*/
|
|
28
|
+
export const WAKE_HOOK_ALIAS = "hook:pi-session-mcp-wake";
|
|
29
|
+
/** Default wake budget; the hook timeout must cover it (ADR 0011, item 4). */
|
|
30
|
+
export const WAKE_BUDGET_MS = 1_800_000;
|
|
31
|
+
/** Seconds added to the budget so the hook timeout never fires before the program's own budget. */
|
|
32
|
+
export const WAKE_TIMEOUT_MARGIN_SECONDS = 60;
|
|
33
|
+
export const WAKE_MATCHER = [
|
|
34
|
+
"mcp__pi-session-mcp__pi_session_prompt",
|
|
35
|
+
"mcp__pi-session-mcp__pi_turn_get",
|
|
36
|
+
].join("|");
|
|
37
|
+
/** A command referencing this program path marks an entry as pi-session-mcp's. */
|
|
38
|
+
const WAKE_PROGRAM = /\/dist\/wake-main\.js(?=$|[\s"'])/;
|
|
39
|
+
/** Paths are embedded unquoted in a shell command: only characters that never need quoting. */
|
|
40
|
+
const SAFE_COMMAND_PATH = /^\/[A-Za-z0-9_@%+=:,./-]*$/;
|
|
41
|
+
const MAX_SETTINGS_BYTES = 4 * 1024 * 1024;
|
|
42
|
+
class HookError extends Error {
|
|
43
|
+
code;
|
|
44
|
+
constructor(code) {
|
|
45
|
+
super(code);
|
|
46
|
+
this.code = code;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** The settings file changed between read and rename. */
|
|
50
|
+
class SwapMismatch extends Error {
|
|
51
|
+
}
|
|
52
|
+
/** The canonical, deterministic entry. Throws `hook_path_unsafe` for a path that would need shell quoting. */
|
|
53
|
+
export function buildWakeEntry(roots) {
|
|
54
|
+
const nodePath = roots.nodePath ?? process.execPath;
|
|
55
|
+
const program = `${roots.packageRoot}/dist/wake-main.js`;
|
|
56
|
+
const budgetMs = roots.budgetMs ?? WAKE_BUDGET_MS;
|
|
57
|
+
if (!Number.isInteger(budgetMs) || budgetMs < 1)
|
|
58
|
+
throw new HookError("hook_budget_invalid");
|
|
59
|
+
if (!isAbsolute(roots.packageRoot) || !SAFE_COMMAND_PATH.test(nodePath) || !SAFE_COMMAND_PATH.test(program))
|
|
60
|
+
throw new HookError("hook_path_unsafe");
|
|
61
|
+
return {
|
|
62
|
+
matcher: WAKE_MATCHER,
|
|
63
|
+
hooks: [{ type: "command", command: `${nodePath} ${program} --budget-ms ${budgetMs}`, timeout: Math.ceil(budgetMs / 1000) + WAKE_TIMEOUT_MARGIN_SECONDS, asyncRewake: true }],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** The settings file of a scope. `projectRoot` must already be canonical. Pure. */
|
|
67
|
+
export function wakeSettingsPath(scope, input) {
|
|
68
|
+
if (scope === "user") {
|
|
69
|
+
const configured = input.env.CLAUDE_CONFIG_DIR;
|
|
70
|
+
const directory = configured !== undefined && configured !== "" ? configured : join(input.home, ".claude");
|
|
71
|
+
if (!isAbsolute(directory))
|
|
72
|
+
throw new HookError("settings_location_invalid");
|
|
73
|
+
return join(directory, "settings.json");
|
|
74
|
+
}
|
|
75
|
+
if (input.projectRoot === undefined || !isAbsolute(input.projectRoot))
|
|
76
|
+
throw new HookError("settings_location_invalid");
|
|
77
|
+
return join(input.projectRoot, ".claude", scope === "project" ? "settings.json" : "settings.local.json");
|
|
78
|
+
}
|
|
79
|
+
const sha256 = (value) => createHash("sha256").update(value).digest("hex");
|
|
80
|
+
/** The fingerprint of an entry: sha256 of its JSON text, which is also what setup wrote. */
|
|
81
|
+
export const wakeEntryFingerprint = (entry) => sha256(JSON.stringify(entry));
|
|
82
|
+
/**
|
|
83
|
+
* Where the scope's settings live and how its ownership is keyed. A project may be untrusted: a
|
|
84
|
+
* link at `.claude` or at the settings file there makes the slot invalid, so setup never writes
|
|
85
|
+
* outside the project. In the operator's own configuration directory a linked settings file (for
|
|
86
|
+
* example into a dotfiles checkout) is followed and written through. Project and local records
|
|
87
|
+
* are bound to an opaque identity of the project, so another project never shares them.
|
|
88
|
+
*/
|
|
89
|
+
/** The ownership key of a scope's hook. It looks at no settings file: only the project's canonical directory. */
|
|
90
|
+
async function recordTargetOf(scope, roots) {
|
|
91
|
+
if (scope === "user")
|
|
92
|
+
return { client: "claude-code", scope, alias: WAKE_HOOK_ALIAS };
|
|
93
|
+
return { client: "claude-code", scope, alias: `${WAKE_HOOK_ALIAS}@${sha256(await realpath(roots.cwd)).slice(0, 16)}` };
|
|
94
|
+
}
|
|
95
|
+
async function locate(scope, roots) {
|
|
96
|
+
if (scope === "user") {
|
|
97
|
+
const file = wakeSettingsPath("user", roots);
|
|
98
|
+
const resolved = await followUserLink(file);
|
|
99
|
+
return { file: resolved, recordTarget: { client: "claude-code", scope, alias: WAKE_HOOK_ALIAS }, guard: await guardOf(dirname(resolved), false) };
|
|
100
|
+
}
|
|
101
|
+
let projectRoot;
|
|
102
|
+
try {
|
|
103
|
+
projectRoot = await realpath(roots.cwd);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
throw new HookError("settings_location_invalid");
|
|
107
|
+
}
|
|
108
|
+
const file = wakeSettingsPath(scope, { ...roots, projectRoot });
|
|
109
|
+
for (const [path, directory] of [[dirname(file), true], [file, false]]) {
|
|
110
|
+
let entry;
|
|
111
|
+
try {
|
|
112
|
+
entry = await lstat(path);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (error.code === "ENOENT")
|
|
116
|
+
continue;
|
|
117
|
+
throw new HookError("settings_location_invalid");
|
|
118
|
+
}
|
|
119
|
+
if (entry.isSymbolicLink() || (directory ? !entry.isDirectory() : !entry.isFile()))
|
|
120
|
+
throw new HookError("settings_location_invalid");
|
|
121
|
+
}
|
|
122
|
+
const identity = sha256(projectRoot).slice(0, 16);
|
|
123
|
+
return { file, recordTarget: { client: "claude-code", scope, alias: `${WAKE_HOOK_ALIAS}@${identity}` }, guard: await guardOf(dirname(file), true) };
|
|
124
|
+
}
|
|
125
|
+
async function directoryIdentity(path, strict) {
|
|
126
|
+
let entry;
|
|
127
|
+
try {
|
|
128
|
+
entry = strict ? await lstat(path) : await stat(path);
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
throw new HookError("settings_location_invalid");
|
|
132
|
+
}
|
|
133
|
+
if (entry.isSymbolicLink() || !entry.isDirectory())
|
|
134
|
+
throw new HookError("settings_location_invalid");
|
|
135
|
+
return { dev: entry.dev, ino: entry.ino };
|
|
136
|
+
}
|
|
137
|
+
async function guardOf(path, strict) {
|
|
138
|
+
try {
|
|
139
|
+
return { path, strict, identity: await directoryIdentity(path, strict) };
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
// A directory that does not exist yet is created, and then recorded, by the commit.
|
|
143
|
+
try {
|
|
144
|
+
await lstat(path);
|
|
145
|
+
}
|
|
146
|
+
catch (inner) {
|
|
147
|
+
if (inner.code === "ENOENT")
|
|
148
|
+
return { path, strict };
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Re-checks the location right before it is written: the directory is still the one that was
|
|
155
|
+
* seen (and, for a project, not a link), and a project's settings file is not a link. A mismatch
|
|
156
|
+
* writes nothing.
|
|
157
|
+
*/
|
|
158
|
+
async function assertLocation(guard, file) {
|
|
159
|
+
const now = await directoryIdentity(guard.path, guard.strict);
|
|
160
|
+
if (guard.identity && (now.dev !== guard.identity.dev || now.ino !== guard.identity.ino))
|
|
161
|
+
throw new HookError("settings_changed");
|
|
162
|
+
if (!guard.strict)
|
|
163
|
+
return;
|
|
164
|
+
try {
|
|
165
|
+
const entry = await lstat(file);
|
|
166
|
+
if (entry.isSymbolicLink() || !entry.isFile())
|
|
167
|
+
throw new HookError("settings_location_invalid");
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (error instanceof HookError)
|
|
171
|
+
throw error;
|
|
172
|
+
if (error.code !== "ENOENT")
|
|
173
|
+
throw new HookError("settings_location_invalid");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async function followUserLink(file) {
|
|
177
|
+
let entry;
|
|
178
|
+
try {
|
|
179
|
+
entry = await lstat(file);
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
const code = error.code;
|
|
183
|
+
if (code === "ENOENT") {
|
|
184
|
+
// An absent file is fine; the directory, if it exists, must be one.
|
|
185
|
+
try {
|
|
186
|
+
if (!(await stat(dirname(file))).isDirectory())
|
|
187
|
+
throw new HookError("settings_location_invalid");
|
|
188
|
+
}
|
|
189
|
+
catch (inner) {
|
|
190
|
+
if (inner instanceof HookError)
|
|
191
|
+
throw inner;
|
|
192
|
+
if (inner.code !== "ENOENT")
|
|
193
|
+
throw new HookError("settings_location_invalid");
|
|
194
|
+
}
|
|
195
|
+
return file;
|
|
196
|
+
}
|
|
197
|
+
throw new HookError("settings_location_invalid");
|
|
198
|
+
}
|
|
199
|
+
if (entry.isFile())
|
|
200
|
+
return file;
|
|
201
|
+
if (!entry.isSymbolicLink())
|
|
202
|
+
throw new HookError("settings_location_invalid");
|
|
203
|
+
try {
|
|
204
|
+
const real = await realpath(file);
|
|
205
|
+
if (!(await lstat(real)).isFile())
|
|
206
|
+
throw new Error("not a file");
|
|
207
|
+
return real;
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
throw new HookError("settings_location_invalid");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async function readSnapshot(file) {
|
|
214
|
+
let handle;
|
|
215
|
+
try {
|
|
216
|
+
handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
const code = error.code;
|
|
220
|
+
if (code === "ENOENT")
|
|
221
|
+
return { exists: false, token: "absent", mode: 0o600, document: {} };
|
|
222
|
+
throw new HookError(code === "ELOOP" || code === "ENOTDIR" ? "settings_location_invalid" : "settings_unreadable");
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
const info = await handle.stat();
|
|
226
|
+
if (!info.isFile())
|
|
227
|
+
throw new HookError("settings_location_invalid");
|
|
228
|
+
if (info.size > MAX_SETTINGS_BYTES)
|
|
229
|
+
throw new HookError("settings_unparseable");
|
|
230
|
+
const bytes = await handle.readFile();
|
|
231
|
+
let parsed;
|
|
232
|
+
try {
|
|
233
|
+
parsed = JSON.parse(bytes.toString("utf8"));
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
throw new HookError("settings_unparseable");
|
|
237
|
+
}
|
|
238
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
239
|
+
throw new HookError("settings_unparseable");
|
|
240
|
+
return { exists: true, token: sha256(bytes), mode: info.mode & 0o7777, document: parsed };
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
throw error instanceof HookError ? error : new HookError("settings_unreadable");
|
|
244
|
+
}
|
|
245
|
+
finally {
|
|
246
|
+
await handle.close().catch(() => undefined);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
async function currentToken(file) {
|
|
250
|
+
try {
|
|
251
|
+
return sha256(await readFile(file));
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
if (error.code === "ENOENT")
|
|
255
|
+
return "absent";
|
|
256
|
+
throw new HookError("settings_unreadable");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Writes the document next to the file and swaps it in only while the file still has the bytes
|
|
261
|
+
* that were read. The final compare happens right before the rename; a creation uses a hard link
|
|
262
|
+
* so it can never replace a file that appeared meanwhile. The location is re-checked at the same
|
|
263
|
+
* point (`assertLocation`): the directory is the one that was seen and not a link, and a project's
|
|
264
|
+
* settings file is not a link.
|
|
265
|
+
*
|
|
266
|
+
* Residual race, by design: a write by the same user that lands between the final compare and the
|
|
267
|
+
* rename is lost, because a rename-based swap cannot be made atomic against it and Claude Code
|
|
268
|
+
* does not honor setup's ownership lock. The compare keeps the window to a few system calls; a
|
|
269
|
+
* mismatch before it retries the whole read-modify-write.
|
|
270
|
+
*/
|
|
271
|
+
async function commit(file, before, document, dependencies, seen) {
|
|
272
|
+
const directory = dirname(file);
|
|
273
|
+
// A directory swapped for a link after locate() must not be created through or written into.
|
|
274
|
+
if (seen.identity)
|
|
275
|
+
await assertLocation(seen, file);
|
|
276
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
277
|
+
const guard = seen.identity ? seen : { ...seen, identity: await directoryIdentity(directory, seen.strict) };
|
|
278
|
+
const temporary = join(directory, `.${randomUUID()}.pi-session-mcp.tmp`);
|
|
279
|
+
const mode = before.exists ? before.mode : 0o600;
|
|
280
|
+
let installed = false;
|
|
281
|
+
try {
|
|
282
|
+
const handle = await open(temporary, "wx", mode);
|
|
283
|
+
try {
|
|
284
|
+
await handle.chmod(mode);
|
|
285
|
+
await handle.writeFile(`${JSON.stringify(document, null, 2)}\n`);
|
|
286
|
+
await handle.sync();
|
|
287
|
+
}
|
|
288
|
+
finally {
|
|
289
|
+
await handle.close();
|
|
290
|
+
}
|
|
291
|
+
await dependencies.beforeCommit?.();
|
|
292
|
+
await assertLocation(guard, file);
|
|
293
|
+
if (await currentToken(file) !== before.token)
|
|
294
|
+
throw new SwapMismatch();
|
|
295
|
+
if (before.exists)
|
|
296
|
+
await rename(temporary, file);
|
|
297
|
+
else {
|
|
298
|
+
try {
|
|
299
|
+
await link(temporary, file);
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
if (error.code === "EEXIST")
|
|
303
|
+
throw new SwapMismatch();
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
installed = true;
|
|
308
|
+
await syncDirectory(directory);
|
|
309
|
+
}
|
|
310
|
+
finally {
|
|
311
|
+
if (!installed || !before.exists)
|
|
312
|
+
await rm(temporary, { force: true }).catch(() => undefined);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
async function syncDirectory(path) {
|
|
316
|
+
const handle = await open(path, "r");
|
|
317
|
+
try {
|
|
318
|
+
await handle.sync();
|
|
319
|
+
}
|
|
320
|
+
finally {
|
|
321
|
+
await handle.close();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function postToolUse(document) {
|
|
325
|
+
const hooks = document.hooks;
|
|
326
|
+
if (hooks === undefined)
|
|
327
|
+
return { document, entries: undefined };
|
|
328
|
+
if (!hooks || typeof hooks !== "object" || Array.isArray(hooks))
|
|
329
|
+
throw new HookError("settings_shape_invalid");
|
|
330
|
+
const entries = hooks.PostToolUse;
|
|
331
|
+
if (entries === undefined)
|
|
332
|
+
return { document, entries: undefined };
|
|
333
|
+
if (!Array.isArray(entries))
|
|
334
|
+
throw new HookError("settings_shape_invalid");
|
|
335
|
+
return { document, entries };
|
|
336
|
+
}
|
|
337
|
+
const referencesWake = (entry) => {
|
|
338
|
+
if (!entry || typeof entry !== "object")
|
|
339
|
+
return false;
|
|
340
|
+
const hooks = entry.hooks;
|
|
341
|
+
return Array.isArray(hooks) && hooks.some((hook) => !!hook && typeof hook === "object" && typeof hook.command === "string" && WAKE_PROGRAM.test(hook.command));
|
|
342
|
+
};
|
|
343
|
+
/** Indexes of pi-session-mcp's entries, and of those that setup's record names exactly. */
|
|
344
|
+
function classify(entries, record) {
|
|
345
|
+
const all = [];
|
|
346
|
+
const named = [];
|
|
347
|
+
(entries ?? []).forEach((entry, index) => {
|
|
348
|
+
if (!referencesWake(entry))
|
|
349
|
+
return;
|
|
350
|
+
all.push(index);
|
|
351
|
+
if (record && wakeEntryFingerprint(entry) === record.fingerprint)
|
|
352
|
+
named.push(index);
|
|
353
|
+
});
|
|
354
|
+
return { all, named };
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Settles a record from the file alone. A pending record whose entry is present becomes owned;
|
|
358
|
+
* one that still shows the entry it replaces returns to owning that entry; otherwise nothing of
|
|
359
|
+
* the transaction reached the file and the record is dropped.
|
|
360
|
+
*/
|
|
361
|
+
function settle(record, entries) {
|
|
362
|
+
if (!record || record.phase === "owned")
|
|
363
|
+
return record;
|
|
364
|
+
const present = (fingerprint) => (entries ?? []).some((entry) => referencesWake(entry) && wakeEntryFingerprint(entry) === fingerprint);
|
|
365
|
+
if (present(record.fingerprint))
|
|
366
|
+
return { target: record.target, fingerprint: record.fingerprint, previous: "absent", phase: "owned", transactionId: record.transactionId };
|
|
367
|
+
if (record.replaces !== undefined && present(record.replaces))
|
|
368
|
+
return { target: record.target, fingerprint: record.replaces, previous: "absent", phase: "owned", transactionId: record.transactionId };
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
const healthy = (ownership) => { ownership.assertHealthy?.(); };
|
|
372
|
+
function edited(document, change, cleanup) {
|
|
373
|
+
const next = JSON.parse(JSON.stringify(document));
|
|
374
|
+
const hooks = (next.hooks ??= {});
|
|
375
|
+
const entries = (hooks.PostToolUse ??= []);
|
|
376
|
+
change(entries);
|
|
377
|
+
// Only structures that setup's entry left empty and nothing else uses are removed; any other
|
|
378
|
+
// content keeps its (possibly empty) array.
|
|
379
|
+
if (cleanup && entries.length === 0 && Object.keys(hooks).length === 1 && Object.keys(next).length === 1)
|
|
380
|
+
delete next.hooks;
|
|
381
|
+
return next;
|
|
382
|
+
}
|
|
383
|
+
/** Install, update, verify or remove the wake hook of one Claude Code scope. Never throws. */
|
|
384
|
+
export async function runWakeHook(request) {
|
|
385
|
+
try {
|
|
386
|
+
return await reconcile(request);
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
// A ledger failure keeps its own stable code (`ownership_unreadable`, `operation_aborted`, ...).
|
|
390
|
+
const message = error instanceof Error ? error.message : "";
|
|
391
|
+
return { status: "failed", code: error instanceof HookError ? error.code : /^(ownership_[a-z_]+|operation_aborted)$/.test(message) ? message : "hook_install_failed" };
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
async function reconcile(request) {
|
|
395
|
+
// Delivery off and no record of ours: nothing to maintain, so the client's settings are not even looked at
|
|
396
|
+
// (an unparseable or linked file there is not setup's business). Removal follows the record and checks it itself.
|
|
397
|
+
if (!request.enabled && request.operation !== "remove" && request.operation !== "rollback" && !await ownsWakeHook(request.scope, request.roots, request.ownership)) {
|
|
398
|
+
return { status: "unchanged", code: "hook_not_enabled" };
|
|
399
|
+
}
|
|
400
|
+
const location = await locate(request.scope, request.roots);
|
|
401
|
+
const dependencies = request.dependencies ?? {};
|
|
402
|
+
// A changed file is re-read once from the start; the second change fails.
|
|
403
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
404
|
+
try {
|
|
405
|
+
return await step(request, location, dependencies);
|
|
406
|
+
}
|
|
407
|
+
catch (error) {
|
|
408
|
+
if (!(error instanceof SwapMismatch))
|
|
409
|
+
throw error;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
throw new HookError("settings_changed");
|
|
413
|
+
}
|
|
414
|
+
async function step(request, location, dependencies) {
|
|
415
|
+
const { operation, ownership, roots, enabled } = request;
|
|
416
|
+
const { recordTarget, file } = location;
|
|
417
|
+
const apply = operation === "apply";
|
|
418
|
+
const removing = operation === "remove" || operation === "rollback";
|
|
419
|
+
const mutating = apply || removing;
|
|
420
|
+
// The ledger first: when it cannot be read, nothing of the settings matters.
|
|
421
|
+
healthy(ownership);
|
|
422
|
+
const stored = await ownership.get(recordTarget);
|
|
423
|
+
const snapshot = await readSnapshot(file);
|
|
424
|
+
const { entries } = postToolUse(snapshot.document);
|
|
425
|
+
const record = settle(stored, entries);
|
|
426
|
+
// `recovered` is true when settling changed what the ledger says.
|
|
427
|
+
const recovered = stored !== undefined && (record === undefined || record.fingerprint !== stored.fingerprint || record.phase !== stored.phase);
|
|
428
|
+
const persistSettled = async () => {
|
|
429
|
+
if (!mutating || !recovered)
|
|
430
|
+
return;
|
|
431
|
+
healthy(ownership);
|
|
432
|
+
if (record)
|
|
433
|
+
await ownership.put(record);
|
|
434
|
+
else
|
|
435
|
+
await ownership.delete(recordTarget);
|
|
436
|
+
healthy(ownership);
|
|
437
|
+
};
|
|
438
|
+
// Settling comes first, so that a refusal below never leaves a transaction pending that the file already decided.
|
|
439
|
+
await persistSettled();
|
|
440
|
+
const { all, named } = classify(entries, record);
|
|
441
|
+
if (removing || (!enabled && operation !== "verify")) {
|
|
442
|
+
// Removal needs no configuration: it follows the record, and only an exactly owned entry goes.
|
|
443
|
+
if (!record)
|
|
444
|
+
return { status: "unchanged", code: removing ? "hook_not_owned" : "hook_not_enabled" };
|
|
445
|
+
if (named.length > 1 || (named.length === 0 && all.length > 0))
|
|
446
|
+
return { status: "divergent", code: "hook_divergent" };
|
|
447
|
+
if (named.length === 0) {
|
|
448
|
+
if (mutating) {
|
|
449
|
+
healthy(ownership);
|
|
450
|
+
await ownership.delete(recordTarget);
|
|
451
|
+
healthy(ownership);
|
|
452
|
+
}
|
|
453
|
+
return { status: mutating ? "ok" : "unchanged", code: mutating ? "hook_absent" : "hook_not_enabled" };
|
|
454
|
+
}
|
|
455
|
+
if (request.keep && await request.keep())
|
|
456
|
+
return { status: "unchanged", code: "hook_kept_shared" };
|
|
457
|
+
if (!mutating)
|
|
458
|
+
return { status: "planned", code: "hook_remove_planned" };
|
|
459
|
+
await commit(file, snapshot, edited(snapshot.document, (list) => { list.splice(named[0], 1); }, true), dependencies, location.guard);
|
|
460
|
+
await dependencies.checkpoint?.("written");
|
|
461
|
+
healthy(ownership);
|
|
462
|
+
await ownership.delete(recordTarget);
|
|
463
|
+
healthy(ownership);
|
|
464
|
+
return { status: "ok", code: "hook_removed" };
|
|
465
|
+
}
|
|
466
|
+
if (operation === "verify") {
|
|
467
|
+
if (!enabled)
|
|
468
|
+
return record && named.length > 0 ? { status: "failed", code: "hook_delivery_off" } : { status: "unchanged", code: "hook_not_enabled" };
|
|
469
|
+
const canonical = buildWakeEntry(roots);
|
|
470
|
+
const fingerprint = wakeEntryFingerprint(canonical);
|
|
471
|
+
const present = all.filter((index) => wakeEntryFingerprint(entries[index]) === fingerprint);
|
|
472
|
+
if (all.length === 0)
|
|
473
|
+
return { status: "failed", code: "hook_missing" };
|
|
474
|
+
if (all.length !== 1 || present.length !== 1)
|
|
475
|
+
return { status: "failed", code: "hook_not_equivalent" };
|
|
476
|
+
if (stored?.phase === "pending")
|
|
477
|
+
return { status: "failed", code: "hook_ownership_pending" };
|
|
478
|
+
if (!record || record.fingerprint !== fingerprint)
|
|
479
|
+
return { status: "failed", code: "hook_not_owned" };
|
|
480
|
+
try {
|
|
481
|
+
if (!(await lstat(`${roots.packageRoot}/dist/wake-main.js`)).isFile())
|
|
482
|
+
throw new Error("not a file");
|
|
483
|
+
}
|
|
484
|
+
catch {
|
|
485
|
+
return { status: "failed", code: "hook_program_missing" };
|
|
486
|
+
}
|
|
487
|
+
return { status: "ok", code: "hook_verified" };
|
|
488
|
+
}
|
|
489
|
+
const canonical = buildWakeEntry(roots);
|
|
490
|
+
const fingerprint = wakeEntryFingerprint(canonical);
|
|
491
|
+
let replaces;
|
|
492
|
+
let place;
|
|
493
|
+
let verb;
|
|
494
|
+
if (all.length === 0) {
|
|
495
|
+
verb = "add";
|
|
496
|
+
place = (list) => { list.push(canonical); };
|
|
497
|
+
}
|
|
498
|
+
else if (all.length === 1) {
|
|
499
|
+
const index = all[0];
|
|
500
|
+
const current = wakeEntryFingerprint(entries[index]);
|
|
501
|
+
if (current === fingerprint) {
|
|
502
|
+
return { status: apply && recovered ? "ok" : "unchanged", code: apply && recovered ? "hook_recovered" : "hook_already_equivalent" };
|
|
503
|
+
}
|
|
504
|
+
// Only an entry that setup's own record names exactly may be replaced; anything else is the operator's.
|
|
505
|
+
if (!record || record.fingerprint !== current)
|
|
506
|
+
return { status: "divergent", code: "hook_divergent" };
|
|
507
|
+
verb = "update";
|
|
508
|
+
replaces = current;
|
|
509
|
+
place = (list) => { list[index] = canonical; };
|
|
510
|
+
}
|
|
511
|
+
else
|
|
512
|
+
return { status: "divergent", code: "hook_divergent" };
|
|
513
|
+
if (!apply)
|
|
514
|
+
return { status: "planned", code: `hook_${verb}_planned` };
|
|
515
|
+
const pending = {
|
|
516
|
+
target: recordTarget, fingerprint, previous: "absent", phase: "pending", transactionId: randomUUID(),
|
|
517
|
+
...(replaces === undefined ? {} : { replaces }),
|
|
518
|
+
};
|
|
519
|
+
healthy(ownership);
|
|
520
|
+
await ownership.put(pending);
|
|
521
|
+
healthy(ownership);
|
|
522
|
+
await dependencies.checkpoint?.("pending-recorded");
|
|
523
|
+
await commit(file, snapshot, edited(snapshot.document, place, false), dependencies, location.guard);
|
|
524
|
+
await dependencies.checkpoint?.("written");
|
|
525
|
+
healthy(ownership);
|
|
526
|
+
await ownership.put({ target: recordTarget, fingerprint, previous: "absent", phase: "owned", transactionId: pending.transactionId });
|
|
527
|
+
healthy(ownership);
|
|
528
|
+
return { status: "ok", code: verb === "add" ? "hook_added" : "hook_updated" };
|
|
529
|
+
}
|
|
530
|
+
/** Reconcile the hook of one scope, for example a writer's local scope. Call under the ownership transaction. */
|
|
531
|
+
export async function installWakeHook(options) {
|
|
532
|
+
const outcome = await runWakeHook({
|
|
533
|
+
operation: options.apply ? "apply" : "dry-run", scope: options.scope, enabled: options.delivery, ownership: options.ownership,
|
|
534
|
+
roots: { packageRoot: options.packageRoot, home: options.home, cwd: options.cwd, env: options.env, ...(options.nodePath === undefined ? {} : { nodePath: options.nodePath }), ...(options.budgetMs === undefined ? {} : { budgetMs: options.budgetMs }) },
|
|
535
|
+
...(options.dependencies === undefined ? {} : { dependencies: options.dependencies }),
|
|
536
|
+
});
|
|
537
|
+
return { target: { client: "claude-code", scope: options.scope, alias: WAKE_HOOK_ALIAS }, ...outcome };
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Whether setup holds a record for the hook of this scope (and, for project and local, this
|
|
541
|
+
* project). Fails closed: a ledger that cannot be read answers `true`, so callers take the full
|
|
542
|
+
* path and fail with the ledger's own code instead of skipping an owned entry. A project that
|
|
543
|
+
* does not exist cannot have a record and answers `false`.
|
|
544
|
+
*/
|
|
545
|
+
export async function ownsWakeHook(scope, roots, ownership) {
|
|
546
|
+
let target;
|
|
547
|
+
try {
|
|
548
|
+
target = await recordTargetOf(scope, roots);
|
|
549
|
+
}
|
|
550
|
+
catch {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
try {
|
|
554
|
+
return (await ownership.get(target)) !== undefined;
|
|
555
|
+
}
|
|
556
|
+
catch {
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/** Unchanged outcomes that say nothing happened because nothing was wanted or owned; never part of a setup report. (Verify's failed `hook_not_owned` is news.) */
|
|
561
|
+
const NO_NEWS = new Set(["hook_not_enabled", "hook_not_owned"]);
|
|
562
|
+
export class FileSetupHookInstaller {
|
|
563
|
+
roots;
|
|
564
|
+
dependencies;
|
|
565
|
+
constructor(roots, dependencies = {}) {
|
|
566
|
+
this.roots = roots;
|
|
567
|
+
this.dependencies = dependencies;
|
|
568
|
+
}
|
|
569
|
+
async run(operation, target, ownership) {
|
|
570
|
+
const reported = { ...target, alias: WAKE_HOOK_ALIAS };
|
|
571
|
+
// Not applicable (a Codex target) is no news and is not reported, so a report without hooks keeps its 0.10 shape.
|
|
572
|
+
if (target.client !== "claude-code" || !["user", "project", "local"].includes(target.scope))
|
|
573
|
+
return [];
|
|
574
|
+
let enabled = false;
|
|
575
|
+
// Removal follows the record; only the other operations depend on the configuration.
|
|
576
|
+
if (operation !== "remove" && operation !== "rollback") {
|
|
577
|
+
try {
|
|
578
|
+
enabled = await this.roots.delivery();
|
|
579
|
+
}
|
|
580
|
+
catch {
|
|
581
|
+
return [{ target: reported, status: "failed", code: "hook_config_unreadable" }];
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
const { delivery: _delivery, configPath, ...roots } = this.roots;
|
|
585
|
+
const keep = configPath !== undefined && target.scope === "local"
|
|
586
|
+
? () => localHookNeededByOthers({ ownership, home: roots.home, cwd: roots.cwd, configPath, except: "host" })
|
|
587
|
+
: undefined;
|
|
588
|
+
const outcome = await runWakeHook({ operation, scope: target.scope, roots, enabled, ownership, dependencies: this.dependencies, ...(keep ? { keep } : {}) });
|
|
589
|
+
// No hook wanted and none owned is no news either: omitted, like the writer path does.
|
|
590
|
+
return outcome.status === "unchanged" && NO_NEWS.has(outcome.code) ? [] : [{ target: reported, ...outcome }];
|
|
591
|
+
}
|
|
592
|
+
async owns(target, ownership) {
|
|
593
|
+
if (target.client !== "claude-code" || !["user", "project", "local"].includes(target.scope))
|
|
594
|
+
return false;
|
|
595
|
+
return ownsWakeHook(target.scope, this.roots, ownership);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* The sharing rule of the local-scope entry. Claude Code's local settings file of a project holds
|
|
600
|
+
* one wake entry, and one ownership record stands for it, however many registrations need it.
|
|
601
|
+
* It is removed only when none of the others needs it any more. Another registration needs it
|
|
602
|
+
* when it is still owned in local scope and its server enables spool delivery:
|
|
603
|
+
*
|
|
604
|
+
* - a writer (`claude-code:local:pi-coding-<name>` owned) whose configured workspace resolves to
|
|
605
|
+
* this project and whose own configuration enables delivery; a writer whose project cannot be
|
|
606
|
+
* determined counts as needing it (the safe side: an entry too many, never one too few);
|
|
607
|
+
* - the host registration (`claude-code:local:pi-session-mcp` owned) while the host configuration
|
|
608
|
+
* enables delivery. Its project is not recorded, so it counts for every project.
|
|
609
|
+
*
|
|
610
|
+
* `except` names the registration that is going away: a writer by its name, or the host.
|
|
611
|
+
* Any error answers `true`, so a doubt never removes a shared entry.
|
|
612
|
+
*/
|
|
613
|
+
export async function localHookNeededByOthers(options) {
|
|
614
|
+
try {
|
|
615
|
+
const project = await realpath(options.cwd);
|
|
616
|
+
const { loadConfig } = await import("./config.js");
|
|
617
|
+
const config = await loadConfig(options.configPath);
|
|
618
|
+
if (options.except !== "host") {
|
|
619
|
+
const host = await options.ownership.get({ client: "claude-code", scope: "local", alias: "pi-session-mcp" });
|
|
620
|
+
if (host?.phase === "owned" && config.eventDelivery === "spool")
|
|
621
|
+
return true;
|
|
622
|
+
}
|
|
623
|
+
let names;
|
|
624
|
+
try {
|
|
625
|
+
names = await readdir(writersRoot(options.home));
|
|
626
|
+
}
|
|
627
|
+
catch (error) {
|
|
628
|
+
if (error.code === "ENOENT")
|
|
629
|
+
return false;
|
|
630
|
+
throw error;
|
|
631
|
+
}
|
|
632
|
+
for (const name of names.filter((candidate) => WRITER_NAME_PATTERN.test(candidate)).sort()) {
|
|
633
|
+
if (options.except !== "host" && options.except.writer === name)
|
|
634
|
+
continue;
|
|
635
|
+
const record = await options.ownership.get({ client: "claude-code", scope: "local", alias: writerRegistrationName(name) });
|
|
636
|
+
if (record?.phase !== "owned")
|
|
637
|
+
continue;
|
|
638
|
+
if (!await writerEventDeliveryEnabled(writerPaths(options.home, name).config))
|
|
639
|
+
continue;
|
|
640
|
+
const state = await readWriterState(options.home, name);
|
|
641
|
+
const workspace = state ? config.workspaces.get(state.alias) : undefined;
|
|
642
|
+
if (workspace === undefined)
|
|
643
|
+
return true;
|
|
644
|
+
try {
|
|
645
|
+
if (await realpath(workspace) === project)
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
648
|
+
catch {
|
|
649
|
+
return true;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
catch {
|
|
655
|
+
return true;
|
|
656
|
+
}
|
|
657
|
+
}
|
package/dist/setup-main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createProductionSetup } from "./setup.js";
|
|
3
|
-
/** Executable entry point
|
|
3
|
+
/** Executable entry point for client registrations, skill customization and `--repo <alias>` execution modes. */
|
|
4
4
|
export interface SetupMainDependencies {
|
|
5
5
|
readonly createSetup?: typeof createProductionSetup;
|
|
6
6
|
readonly packageRoot?: string;
|