@tangle-network/agent-eval 0.203.1 → 0.203.4
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/CHANGELOG.md +15 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/analyst/index.d.ts +6 -6
- package/dist/analyst/index.js +1 -1
- package/dist/{benchmark-command-6OBcB0sG.js → benchmark-command-BpgCWzJm.js} +2 -2
- package/dist/{benchmark-command-6OBcB0sG.js.map → benchmark-command-BpgCWzJm.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +4 -4
- package/dist/benchmarks/index.js +2 -2
- package/dist/campaign/index.d.ts +4 -4
- package/dist/campaign/index.js +3 -3
- package/dist/{campaign-BbObY2c6.js → campaign-DYhg4SjN.js} +4 -4
- package/dist/{campaign-BbObY2c6.js.map → campaign-DYhg4SjN.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/contract/index.d.ts +7 -7
- package/dist/contract/index.js +3 -3
- package/dist/{default-registry-CxEBVA6W.d.ts → default-registry-BHEfZHQd.d.ts} +3 -3
- package/dist/{default-registry-CxEBVA6W.d.ts.map → default-registry-BHEfZHQd.d.ts.map} +1 -1
- package/dist/{define-agent-eval-Da8mHyc7.js → define-agent-eval-B25Cc3ki.js} +2 -2
- package/dist/{define-agent-eval-Da8mHyc7.js.map → define-agent-eval-B25Cc3ki.js.map} +1 -1
- package/dist/{define-agent-eval-BbEXdM3H.d.ts → define-agent-eval-D8bPoBM5.d.ts} +5 -5
- package/dist/{define-agent-eval-BbEXdM3H.d.ts.map → define-agent-eval-D8bPoBM5.d.ts.map} +1 -1
- package/dist/{engine-CaSqEVlL.d.ts → engine-F_PvwesR.d.ts} +2 -2
- package/dist/{engine-CaSqEVlL.d.ts.map → engine-F_PvwesR.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/experiment/index.d.ts +1 -1
- package/dist/{index-Ce2HACcP.d.ts → index-B8n12TR2.d.ts} +9 -11
- package/dist/index-B8n12TR2.d.ts.map +1 -0
- package/dist/{index-CIkxRsLS.d.ts → index-C9l_-23M.d.ts} +3 -3
- package/dist/{index-CIkxRsLS.d.ts.map → index-C9l_-23M.d.ts.map} +1 -1
- package/dist/{index-CGAwP9l3.d.ts → index-CG7mtu_G.d.ts} +6 -6
- package/dist/{index-CGAwP9l3.d.ts.map → index-CG7mtu_G.d.ts.map} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +5 -5
- package/dist/jev.d.ts +1 -1
- package/dist/judge-gate-B1qYnkpi.js +658 -0
- package/dist/judge-gate-B1qYnkpi.js.map +1 -0
- package/dist/judge-gate-BuQd7sSm.d.ts +454 -0
- package/dist/judge-gate-BuQd7sSm.d.ts.map +1 -0
- package/dist/{llm-judge-EUMHOZOQ.js → llm-judge-DyZdrp6I.js} +54 -12
- package/dist/llm-judge-DyZdrp6I.js.map +1 -0
- package/dist/{matrix-BqHiMKIj.d.ts → matrix-W1lbSx72.d.ts} +2 -2
- package/dist/{matrix-BqHiMKIj.d.ts.map → matrix-W1lbSx72.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +2 -132
- package/dist/meta-eval/index.d.ts.map +1 -1
- package/dist/meta-eval/index.js +2 -275
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{produced-state-g9BPgu4D.js → produced-state-DLToUXrD.js} +2 -2
- package/dist/{produced-state-g9BPgu4D.js.map → produced-state-DLToUXrD.js.map} +1 -1
- package/dist/rl.d.ts +2 -2
- package/dist/search/index.d.ts +2 -2
- package/dist/{search-kernel-C5jua_UB.d.ts → search-kernel-DNpsHb8P.d.ts} +2 -2
- package/dist/{search-kernel-C5jua_UB.d.ts.map → search-kernel-DNpsHb8P.d.ts.map} +1 -1
- package/dist/{skillopt-optimization-method-DZrdQGZl.js → skillopt-optimization-method-Dz5CGZb8.js} +2 -2
- package/dist/{skillopt-optimization-method-DZrdQGZl.js.map → skillopt-optimization-method-Dz5CGZb8.js.map} +1 -1
- package/dist/{statistical-heldout-CJYAO-4a.d.ts → statistical-heldout-Dq3pnmxd.d.ts} +2 -2
- package/dist/{statistical-heldout-CJYAO-4a.d.ts.map → statistical-heldout-Dq3pnmxd.d.ts.map} +1 -1
- package/dist/{store-tool-spans-fIE31bU8.d.ts → store-tool-spans-CAF3T-BS.d.ts} +3 -3
- package/dist/{store-tool-spans-fIE31bU8.d.ts.map → store-tool-spans-CAF3T-BS.d.ts.map} +1 -1
- package/dist/{tool-groups-DP8b5kjF.d.ts → tool-groups-B7_jUPHp.d.ts} +2 -2
- package/dist/tool-groups-B7_jUPHp.d.ts.map +1 -0
- package/dist/{trace-questions-Cd0Fyhbv.d.ts → trace-questions-Dd3AMf-U.d.ts} +2 -2
- package/dist/{trace-questions-Cd0Fyhbv.d.ts.map → trace-questions-Dd3AMf-U.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/traces.d.ts +2 -2
- package/dist/{types-hH9APahd.d.ts → types-DZQpUJse.d.ts} +2 -2
- package/dist/{types-hH9APahd.d.ts.map → types-DZQpUJse.d.ts.map} +1 -1
- package/dist/{types-Duc6xOoW.d.ts → types-ZUy5HGY5.d.ts} +9 -3
- package/dist/{types-Duc6xOoW.d.ts.map → types-ZUy5HGY5.d.ts.map} +1 -1
- package/docs/eval-surface-map.md +12 -2
- package/docs/proofs/campaign-attempt-retention-20261001/README.md +70 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/attempts/e7949644-3d60-4ab9-817e-f80d0a48f5d8/attempt-1/artifacts/capture.json +3 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/attempts/e7949644-3d60-4ab9-817e-f80d0a48f5d8/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/attempts/e7949644-3d60-4ab9-817e-f80d0a48f5d8/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/attempts/e7949644-3d60-4ab9-817e-f80d0a48f5d8/attempt-1/trace/spans.jsonl +0 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-judge-attribution/attribution_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/attempts/7c7718f6-c85e-4867-9e3a-13ef9513de80/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/attempts/7c7718f6-c85e-4867-9e3a-13ef9513de80/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/attempts/7c7718f6-c85e-4867-9e3a-13ef9513de80/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/attempts/7c7718f6-c85e-4867-9e3a-13ef9513de80/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/failure-receipt.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-legacy/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/attempts/3652118b-e1dc-4b17-bc15-6b802dc71eb1/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/attempts/3652118b-e1dc-4b17-bc15-6b802dc71eb1/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/attempts/3652118b-e1dc-4b17-bc15-6b802dc71eb1/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/attempts/3652118b-e1dc-4b17-bc15-6b802dc71eb1/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/baseline/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/attempts/40e411fe-ad12-4e6b-a279-2cf07c356a2f/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/attempts/40e411fe-ad12-4e6b-a279-2cf07c356a2f/attempt-1/failure-receipt.json +62 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/attempts/40e411fe-ad12-4e6b-a279-2cf07c356a2f/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/attempts/40e411fe-ad12-4e6b-a279-2cf07c356a2f/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/attempts/40e411fe-ad12-4e6b-a279-2cf07c356a2f/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/42b3fec6b7e55008/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/attempts/9e7da63e-2d19-4ec1-a5ec-ec804e2b0f40/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/attempts/9e7da63e-2d19-4ec1-a5ec-ec804e2b0f40/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/attempts/9e7da63e-2d19-4ec1-a5ec-ec804e2b0f40/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/attempts/9e7da63e-2d19-4ec1-a5ec-ec804e2b0f40/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/candidates/87740cc101602a08/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/first-interruption.json +38 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/19147243d263e55b1eaf1c940691947382a7cce17c5f49e4a4da765a473d2a55.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/5dd0d871d559d1c55b2ac04b3fbd26d62f7c9e25d7632d4542502cd292818fc0.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/5de45d632937e75ff90fec9f1f2ec425904d3632da71f6b26f83b1e1eb8cde5a.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/6caba627806e499aa3d9e156aec9d5a731a3ef30e29756d343b85b7217c77c11.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/ce2770851b3b7651f27cedcbad0372b9191e9a9b016665987e3ddd2ad53012b5.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/d8ac4ba8d9844afb4defa5cd277fe3cb944d99e58cf41c07d3ae199b6f467966.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/blobs/f59a02035fe96ea2f5582dd715d2e3ad8c184ae959310978962f1ac0780753bd.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/ledger.jsonl +23 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-optimization/search/ledger.jsonl.head +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/attempts/3c8272d6-d35b-477e-9d08-085261b8dc64/attempt-1/artifacts/capture.json +3 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/attempts/3c8272d6-d35b-477e-9d08-085261b8dc64/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/attempts/3c8272d6-d35b-477e-9d08-085261b8dc64/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/attempts/3c8272d6-d35b-477e-9d08-085261b8dc64/attempt-1/trace/spans.jsonl +0 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-path-guard/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/2b022ccb-adb3-4468-8c21-48ee82d0634a/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/2b022ccb-adb3-4468-8c21-48ee82d0634a/attempt-1/failure-receipt.json +81 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/2b022ccb-adb3-4468-8c21-48ee82d0634a/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/2b022ccb-adb3-4468-8c21-48ee82d0634a/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/2b022ccb-adb3-4468-8c21-48ee82d0634a/attempt-1/trace/spans.jsonl +2 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/c4859951-1e7c-4d23-b89a-0ca8fa79e2cf/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/c4859951-1e7c-4d23-b89a-0ca8fa79e2cf/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/c4859951-1e7c-4d23-b89a-0ca8fa79e2cf/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/attempts/c4859951-1e7c-4d23-b89a-0ca8fa79e2cf/attempt-1/trace/spans.jsonl +2 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-resume/observation.json +608 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-1/failure-receipt.json +81 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-1/trace/spans.jsonl +2 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-2/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-2/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-2/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/attempts/74c13884-d47e-4b6d-a823-5bd44ee0e6cb/attempt-2/trace/spans.jsonl +2 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-retry/observation.json +514 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/after-summary.json +1853 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/judge-attribution.json +140 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/qualification.log +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/qualify.mjs +165 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduce.mjs +39 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-resume/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-resume/capture-retention_0/captured-response.json +5 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-resume/capture-retention_0/failure-receipt.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-resume/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-resume/observer-retained-captures.json +20 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-retry/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-retry/capture-retention_0/captured-response.json +5 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-retry/capture-retention_0/failure-receipt.attempt-1.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-retry/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-retry/observer-retained-captures.json +20 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction-summary.json +315 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/reproduction.log +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/source-and-build.json +2409 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/typecheck.log +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/current/verify-package.log +340 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/attempts/33d57ccb-d4d8-4c23-92e3-c1ddf7db6058/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/attempts/33d57ccb-d4d8-4c23-92e3-c1ddf7db6058/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/attempts/33d57ccb-d4d8-4c23-92e3-c1ddf7db6058/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/attempts/33d57ccb-d4d8-4c23-92e3-c1ddf7db6058/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/failure-receipt.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-legacy/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/attempts/6b25a1d2-5324-445b-b59d-bdc7381cd4b4/attempt-1/artifacts/captured-response.json +4 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/attempts/6b25a1d2-5324-445b-b59d-bdc7381cd4b4/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/attempts/6b25a1d2-5324-445b-b59d-bdc7381cd4b4/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/attempts/6b25a1d2-5324-445b-b59d-bdc7381cd4b4/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/baseline/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/first-interruption.json +5 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/search/blobs/5de45d632937e75ff90fec9f1f2ec425904d3632da71f6b26f83b1e1eb8cde5a.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/search/ledger.jsonl +7 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-optimization/search/ledger.jsonl.head +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/attempts/723fa9c6-099e-437c-bddf-a4cbd28a8508/attempt-1/artifacts/capture.json +3 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/attempts/723fa9c6-099e-437c-bddf-a4cbd28a8508/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/attempts/723fa9c6-099e-437c-bddf-a4cbd28a8508/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/attempts/723fa9c6-099e-437c-bddf-a4cbd28a8508/attempt-1/trace/spans.jsonl +0 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-path-guard/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/06db3429-c5c6-42c1-8623-08e2da1f563e/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/06db3429-c5c6-42c1-8623-08e2da1f563e/attempt-1/failure-receipt.json +62 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/06db3429-c5c6-42c1-8623-08e2da1f563e/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/06db3429-c5c6-42c1-8623-08e2da1f563e/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/06db3429-c5c6-42c1-8623-08e2da1f563e/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/d49f7e40-c4d2-4cb6-98d1-5e49f45c6e2c/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/d49f7e40-c4d2-4cb6-98d1-5e49f45c6e2c/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/d49f7e40-c4d2-4cb6-98d1-5e49f45c6e2c/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/attempts/d49f7e40-c4d2-4cb6-98d1-5e49f45c6e2c/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-resume/observation.json +458 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-1/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-1/failure-receipt.json +62 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-1/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-1/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-1/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-2/artifacts/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-2/identity.json +10 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-2/result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/attempts/cf34f352-67e5-4e8b-a510-0e896bcc96fc/attempt-2/trace/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/capture-retention_0/latest-attempt.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/after-retry/observation.json +380 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-resume/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-resume/capture-retention_0/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-resume/capture-retention_0/failure-receipt.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-resume/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-resume/observation.json +198 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-retry/capture-retention_0/cached-result.json +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-retry/capture-retention_0/captured-response.json +6 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-retry/capture-retention_0/failure-receipt.attempt-1.json +58 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-retry/capture-retention_0/spans.jsonl +1 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-retry/observation.json +121 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/before-summary.json +321 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/build.attribution.log +491 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/build.final.log +491 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/build.log +495 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/qualification.log +18 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/qualification.wrong-root.log +9 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/qualify.mjs +148 -0
- package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/qualify.wrong-root.mjs +148 -0
- package/docs/proofs/campaign-attempt-retention-20261001/manifest.json +808 -0
- package/package.json +2 -2
- package/dist/index-Ce2HACcP.d.ts.map +0 -1
- package/dist/llm-judge-EUMHOZOQ.js.map +0 -1
- package/dist/series-convergence-CjO2QdRW.js +0 -43
- package/dist/series-convergence-CjO2QdRW.js.map +0 -1
- package/dist/series-convergence-DLy0bQMV.d.ts +0 -126
- package/dist/series-convergence-DLy0bQMV.d.ts.map +0 -1
- package/dist/tool-groups-DP8b5kjF.d.ts.map +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { readFileSync, writeFileSync, readdirSync, mkdirSync } from 'node:fs'
|
|
3
|
+
import { dirname, join, relative } from 'node:path'
|
|
4
|
+
import { pathToFileURL } from 'node:url'
|
|
5
|
+
import assert from 'node:assert/strict'
|
|
6
|
+
|
|
7
|
+
const root = process.env.PROOF_ROOT
|
|
8
|
+
const modulePath = process.env.EVAL_MODULE
|
|
9
|
+
if (!root || !modulePath) throw new Error('PROOF_ROOT and EVAL_MODULE are required')
|
|
10
|
+
const { runEval, runOptimization } = await import(pathToFileURL(modulePath).href)
|
|
11
|
+
const hash = data => createHash('sha256').update(data).digest('hex')
|
|
12
|
+
const json = path => JSON.parse(readFileSync(path, 'utf8'))
|
|
13
|
+
const save = (path, value) => writeFileSync(path, JSON.stringify(value, null, 2) + '\n')
|
|
14
|
+
const scenarios = [{ id: 'capture-retention', kind: 'operational', scenarioDigest: 'sha256:' + hash('attempt-artifact-retention') }]
|
|
15
|
+
const base = { scenarios, reps: 1, seed: 42, expectUsage: 'off', labeledStore: 'off', dispatchRef: 'operational-attempt-retention-v1', maxConcurrency: 1 }
|
|
16
|
+
const interruption = 'Operational interruption after native artifact capture'
|
|
17
|
+
|
|
18
|
+
async function qualify(mode) {
|
|
19
|
+
const runDir = join(root, 'after-' + mode)
|
|
20
|
+
const observed = []
|
|
21
|
+
let invocations = 0
|
|
22
|
+
const opts = { ...base, runDir, dispatch: async (_scenario, ctx) => {
|
|
23
|
+
const invocation = ++invocations
|
|
24
|
+
const value = { cellId: ctx.cellId, runAttemptId: ctx.runAttemptId, invocation, content: 'Actual filesystem capture from invocation ' + invocation }
|
|
25
|
+
ctx.trace.span('native.callback.capture', { invocation, runAttemptId: ctx.runAttemptId }).end()
|
|
26
|
+
const path = await ctx.artifacts.writeJson('captured-response.json', value)
|
|
27
|
+
observed.push({ invocation, path, sha256: hash(readFileSync(path)), value })
|
|
28
|
+
if (invocation === 1) throw new Error(interruption)
|
|
29
|
+
return value
|
|
30
|
+
}}
|
|
31
|
+
const reports = []
|
|
32
|
+
if (mode === 'retry') reports.push(await runEval({ ...opts, cellRetry: { attempts: 2, retryable: f => f.error.message === interruption } }))
|
|
33
|
+
else {
|
|
34
|
+
reports.push(await runEval(opts))
|
|
35
|
+
reports.push(await runEval(opts))
|
|
36
|
+
}
|
|
37
|
+
assert.equal(invocations, 2)
|
|
38
|
+
assert.notEqual(observed[0].path, observed[1].path)
|
|
39
|
+
const attempts = observed.map(item => {
|
|
40
|
+
assert.equal(hash(readFileSync(item.path)), item.sha256)
|
|
41
|
+
const attemptDir = dirname(dirname(item.path))
|
|
42
|
+
const identity = json(join(attemptDir, 'identity.json'))
|
|
43
|
+
const result = json(join(attemptDir, 'result.json'))
|
|
44
|
+
const trace = readFileSync(join(attemptDir, 'trace/spans.jsonl'), 'utf8').split('\n').filter(Boolean).map(JSON.parse)
|
|
45
|
+
assert.equal(identity.runAttemptId, item.value.runAttemptId)
|
|
46
|
+
assert.deepEqual(result.attempt, { runAttemptId: identity.runAttemptId, number: identity.number })
|
|
47
|
+
assert.equal(identity.cellId, item.value.cellId)
|
|
48
|
+
assert.equal(identity.manifestHash, result.manifestHash)
|
|
49
|
+
assert.equal(trace[0].invocation, item.invocation)
|
|
50
|
+
return { identity, result, trace, path: relative(root, attemptDir) }
|
|
51
|
+
})
|
|
52
|
+
const cellDir = dirname(dirname(dirname(dirname(dirname(observed[1].path)))))
|
|
53
|
+
const pointer = json(join(cellDir, 'latest-attempt.json'))
|
|
54
|
+
assert.deepEqual(pointer, reports.at(-1).cells[0].attempt)
|
|
55
|
+
assert.equal(attempts[0].identity.number, 1)
|
|
56
|
+
assert.equal(attempts[1].identity.number, mode === 'retry' ? 2 : 1)
|
|
57
|
+
assert.equal(attempts[0].identity.runAttemptId === attempts[1].identity.runAttemptId, mode === 'retry')
|
|
58
|
+
const receipt = json(join(root, attempts[0].path, 'failure-receipt.json'))
|
|
59
|
+
assert.equal(receipt.failure.error.message, interruption)
|
|
60
|
+
assert.deepEqual(receipt.cell.attempt, attempts[0].result.attempt)
|
|
61
|
+
const reused = await runEval(opts)
|
|
62
|
+
assert.equal(invocations, 2)
|
|
63
|
+
assert.equal(reused.cells[0].cached, true)
|
|
64
|
+
assert.deepEqual(reused.cells[0].attempt, pointer)
|
|
65
|
+
const result = { invocations, observed, attempts, receipt, pointer, reports, cacheReuse: reused, firstContentStillPresent: true, modelInference: false, researchUnits: 0 }
|
|
66
|
+
save(join(runDir, 'observation.json'), result)
|
|
67
|
+
return result
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const summary = { module: { path: modulePath, sha256: hash(readFileSync(modulePath)) }, retry: await qualify('retry'), resume: await qualify('resume') }
|
|
71
|
+
|
|
72
|
+
// Use a copied historical cell to prove new execution never writes its legacy capture paths.
|
|
73
|
+
const legacyRun = join(root, 'after-legacy')
|
|
74
|
+
const legacyCell = join(legacyRun, 'capture-retention_0')
|
|
75
|
+
mkdirSync(legacyCell, { recursive: true })
|
|
76
|
+
const originalCell = join(root, 'before-resume/capture-retention_0')
|
|
77
|
+
const legacySnapshot = {}
|
|
78
|
+
for (const name of readdirSync(originalCell)) {
|
|
79
|
+
const bytes = readFileSync(join(originalCell, name))
|
|
80
|
+
writeFileSync(join(legacyCell, name), bytes)
|
|
81
|
+
legacySnapshot[name] = hash(bytes)
|
|
82
|
+
}
|
|
83
|
+
const legacyReport = await runEval({ ...base, runDir: legacyRun, resumable: false, dispatch: async (_scenario, ctx) => {
|
|
84
|
+
await ctx.artifacts.writeJson('captured-response.json', { continuation: true, runAttemptId: ctx.runAttemptId })
|
|
85
|
+
ctx.trace.span('legacy.continuation').end()
|
|
86
|
+
return { continuation: true }
|
|
87
|
+
}})
|
|
88
|
+
for (const [name, sha] of Object.entries(legacySnapshot)) assert.equal(hash(readFileSync(join(legacyCell, name))), sha)
|
|
89
|
+
summary.legacy = { originalCell, legacySnapshot, report: legacyReport, allHistoricalCellFilesUnchanged: true }
|
|
90
|
+
|
|
91
|
+
// Exercise the public artifact scope while a real attempt identity exists.
|
|
92
|
+
const guardRun = join(root, 'after-path-guard')
|
|
93
|
+
let guard
|
|
94
|
+
const guardReport = await runEval({ ...base, runDir: guardRun, dispatch: async (_scenario, ctx) => {
|
|
95
|
+
const own = await ctx.artifacts.writeJson('capture.json', { own: true })
|
|
96
|
+
const identityPath = join(dirname(dirname(own)), 'identity.json')
|
|
97
|
+
const before = hash(readFileSync(identityPath))
|
|
98
|
+
let rejection
|
|
99
|
+
try { await ctx.artifacts.writeJson('../identity.json', { overwritten: true }) }
|
|
100
|
+
catch (error) { rejection = error.message }
|
|
101
|
+
const after = hash(readFileSync(identityPath))
|
|
102
|
+
assert.equal(rejection, 'Artifact path must remain inside this execution attempt')
|
|
103
|
+
assert.equal(before, after)
|
|
104
|
+
guard = { rejection, identityBefore: before, identityAfter: after }
|
|
105
|
+
return guard
|
|
106
|
+
}})
|
|
107
|
+
summary.pathGuard = { ...guard, report: guardReport }
|
|
108
|
+
|
|
109
|
+
// Interrupt after a failed candidate settles. Reopen the native search ledger,
|
|
110
|
+
// then observe its prior candidate through runOptimization's stored-cell reader.
|
|
111
|
+
const optimizationDir = join(root, 'after-optimization')
|
|
112
|
+
let proposals = 0
|
|
113
|
+
const histories = []
|
|
114
|
+
const optimizationOpts = {
|
|
115
|
+
...base, runDir: optimizationDir, baselineSurface: 'baseline', populationSize: 1, maxGenerations: 2,
|
|
116
|
+
dispatchWithSurface: async (surface, _scenario, ctx) => {
|
|
117
|
+
await ctx.artifacts.writeJson('captured-response.json', { surface, runAttemptId: ctx.runAttemptId })
|
|
118
|
+
ctx.trace.span('native.optimization.capture', { surface }).end()
|
|
119
|
+
if (surface === 'failed-candidate') throw new Error('Operational candidate interruption')
|
|
120
|
+
return { surface }
|
|
121
|
+
},
|
|
122
|
+
proposer: {
|
|
123
|
+
kind: 'operational-retention-qualification',
|
|
124
|
+
async propose(ctx) {
|
|
125
|
+
proposals++
|
|
126
|
+
histories.push({ proposal: proposals, history: ctx.history })
|
|
127
|
+
if (proposals === 1) return ['failed-candidate']
|
|
128
|
+
if (proposals === 2) throw new Error('Operational stop after candidate settlement')
|
|
129
|
+
return ['resumed-candidate']
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
let firstError
|
|
134
|
+
try { await runOptimization(optimizationOpts) }
|
|
135
|
+
catch (error) { firstError = error.message }
|
|
136
|
+
save(join(optimizationDir, 'first-interruption.json'), { firstError, proposals, histories })
|
|
137
|
+
assert.match(firstError ?? '', /Operational stop after candidate settlement/)
|
|
138
|
+
const optimized = await runOptimization(optimizationOpts)
|
|
139
|
+
const resumedHistory = histories.find(h => h.proposal === 3)?.history
|
|
140
|
+
assert.ok(resumedHistory)
|
|
141
|
+
const failed = resumedHistory.flatMap(g => g.candidates).find(c => c.coverage?.unscorableCells?.length)
|
|
142
|
+
assert.ok(failed, 'Reopened optimization must retain its failed candidate')
|
|
143
|
+
assert.equal(failed.coverage.expectedCells, 1)
|
|
144
|
+
assert.equal(failed.coverage.scorableCells, 0)
|
|
145
|
+
assert.match(JSON.stringify(failed.coverage.unscorableCells), /Operational candidate interruption/)
|
|
146
|
+
summary.optimization = { firstError, proposals, histories, failedCandidateRecovered: true, optimized }
|
|
147
|
+
save(join(root, 'after-summary.json'), summary)
|
|
148
|
+
console.log(JSON.stringify({ module: summary.module, retryRetained: summary.retry.firstContentStillPresent, resumeRetained: summary.resume.firstContentStillPresent, legacyFilesPreserved: Object.keys(legacySnapshot).length, pathGuard: guard.rejection, optimizationFailedCandidateRecovered: true, paidCalls: 0, researchUnits: 0 }))
|
package/docs/proofs/campaign-attempt-retention-20261001/artifacts/predecessor/qualify.wrong-root.mjs
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { readFileSync, writeFileSync, readdirSync, mkdirSync } from 'node:fs'
|
|
3
|
+
import { dirname, join, relative } from 'node:path'
|
|
4
|
+
import { pathToFileURL } from 'node:url'
|
|
5
|
+
import assert from 'node:assert/strict'
|
|
6
|
+
|
|
7
|
+
const root = process.env.PROOF_ROOT
|
|
8
|
+
const modulePath = process.env.EVAL_MODULE
|
|
9
|
+
if (!root || !modulePath) throw new Error('PROOF_ROOT and EVAL_MODULE are required')
|
|
10
|
+
const { runEval, runOptimization } = await import(pathToFileURL(modulePath).href)
|
|
11
|
+
const hash = data => createHash('sha256').update(data).digest('hex')
|
|
12
|
+
const json = path => JSON.parse(readFileSync(path, 'utf8'))
|
|
13
|
+
const save = (path, value) => writeFileSync(path, JSON.stringify(value, null, 2) + '\n')
|
|
14
|
+
const scenarios = [{ id: 'capture-retention', kind: 'operational', scenarioDigest: 'sha256:' + hash('attempt-artifact-retention') }]
|
|
15
|
+
const base = { scenarios, reps: 1, seed: 42, expectUsage: 'off', labeledStore: 'off', dispatchRef: 'operational-attempt-retention-v1', maxConcurrency: 1 }
|
|
16
|
+
const interruption = 'Operational interruption after native artifact capture'
|
|
17
|
+
|
|
18
|
+
async function qualify(mode) {
|
|
19
|
+
const runDir = join(root, 'after-' + mode)
|
|
20
|
+
const observed = []
|
|
21
|
+
let invocations = 0
|
|
22
|
+
const opts = { ...base, runDir, dispatch: async (_scenario, ctx) => {
|
|
23
|
+
const invocation = ++invocations
|
|
24
|
+
const value = { cellId: ctx.cellId, runAttemptId: ctx.runAttemptId, invocation, content: 'Actual filesystem capture from invocation ' + invocation }
|
|
25
|
+
ctx.trace.span('native.callback.capture', { invocation, runAttemptId: ctx.runAttemptId }).end()
|
|
26
|
+
const path = await ctx.artifacts.writeJson('captured-response.json', value)
|
|
27
|
+
observed.push({ invocation, path, sha256: hash(readFileSync(path)), value })
|
|
28
|
+
if (invocation === 1) throw new Error(interruption)
|
|
29
|
+
return value
|
|
30
|
+
}}
|
|
31
|
+
const reports = []
|
|
32
|
+
if (mode === 'retry') reports.push(await runEval({ ...opts, cellRetry: { attempts: 2, retryable: f => f.error.message === interruption } }))
|
|
33
|
+
else {
|
|
34
|
+
reports.push(await runEval(opts))
|
|
35
|
+
reports.push(await runEval(opts))
|
|
36
|
+
}
|
|
37
|
+
assert.equal(invocations, 2)
|
|
38
|
+
assert.notEqual(observed[0].path, observed[1].path)
|
|
39
|
+
const attempts = observed.map(item => {
|
|
40
|
+
assert.equal(hash(readFileSync(item.path)), item.sha256)
|
|
41
|
+
const attemptDir = dirname(dirname(item.path))
|
|
42
|
+
const identity = json(join(attemptDir, 'identity.json'))
|
|
43
|
+
const result = json(join(attemptDir, 'result.json'))
|
|
44
|
+
const trace = readFileSync(join(attemptDir, 'trace/spans.jsonl'), 'utf8').split('\n').filter(Boolean).map(JSON.parse)
|
|
45
|
+
assert.equal(identity.runAttemptId, item.value.runAttemptId)
|
|
46
|
+
assert.deepEqual(result.attempt, { runAttemptId: identity.runAttemptId, number: identity.number })
|
|
47
|
+
assert.equal(identity.cellId, item.value.cellId)
|
|
48
|
+
assert.equal(identity.manifestHash, result.manifestHash)
|
|
49
|
+
assert.equal(trace[0].invocation, item.invocation)
|
|
50
|
+
return { identity, result, trace, path: relative(root, attemptDir) }
|
|
51
|
+
})
|
|
52
|
+
const cellDir = dirname(dirname(dirname(dirname(observed[1].path))))
|
|
53
|
+
const pointer = json(join(cellDir, 'latest-attempt.json'))
|
|
54
|
+
assert.deepEqual(pointer, reports.at(-1).cells[0].attempt)
|
|
55
|
+
assert.equal(attempts[0].identity.number, 1)
|
|
56
|
+
assert.equal(attempts[1].identity.number, mode === 'retry' ? 2 : 1)
|
|
57
|
+
assert.equal(attempts[0].identity.runAttemptId === attempts[1].identity.runAttemptId, mode === 'retry')
|
|
58
|
+
const receipt = json(join(root, attempts[0].path, 'failure-receipt.json'))
|
|
59
|
+
assert.equal(receipt.failure.error.message, interruption)
|
|
60
|
+
assert.deepEqual(receipt.cell.attempt, attempts[0].result.attempt)
|
|
61
|
+
const reused = await runEval(opts)
|
|
62
|
+
assert.equal(invocations, 2)
|
|
63
|
+
assert.equal(reused.cells[0].cached, true)
|
|
64
|
+
assert.deepEqual(reused.cells[0].attempt, pointer)
|
|
65
|
+
const result = { invocations, observed, attempts, receipt, pointer, reports, cacheReuse: reused, firstContentStillPresent: true, modelInference: false, researchUnits: 0 }
|
|
66
|
+
save(join(runDir, 'observation.json'), result)
|
|
67
|
+
return result
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const summary = { module: { path: modulePath, sha256: hash(readFileSync(modulePath)) }, retry: await qualify('retry'), resume: await qualify('resume') }
|
|
71
|
+
|
|
72
|
+
// Use a copied historical cell to prove new execution never writes its legacy capture paths.
|
|
73
|
+
const legacyRun = join(root, 'after-legacy')
|
|
74
|
+
const legacyCell = join(legacyRun, 'capture-retention_0')
|
|
75
|
+
mkdirSync(legacyCell, { recursive: true })
|
|
76
|
+
const originalCell = join(root, 'before-resume/capture-retention_0')
|
|
77
|
+
const legacySnapshot = {}
|
|
78
|
+
for (const name of readdirSync(originalCell)) {
|
|
79
|
+
const bytes = readFileSync(join(originalCell, name))
|
|
80
|
+
writeFileSync(join(legacyCell, name), bytes)
|
|
81
|
+
legacySnapshot[name] = hash(bytes)
|
|
82
|
+
}
|
|
83
|
+
const legacyReport = await runEval({ ...base, runDir: legacyRun, resumable: false, dispatch: async (_scenario, ctx) => {
|
|
84
|
+
await ctx.artifacts.writeJson('captured-response.json', { continuation: true, runAttemptId: ctx.runAttemptId })
|
|
85
|
+
ctx.trace.span('legacy.continuation').end()
|
|
86
|
+
return { continuation: true }
|
|
87
|
+
}})
|
|
88
|
+
for (const [name, sha] of Object.entries(legacySnapshot)) assert.equal(hash(readFileSync(join(legacyCell, name))), sha)
|
|
89
|
+
summary.legacy = { originalCell, legacySnapshot, report: legacyReport, allHistoricalCellFilesUnchanged: true }
|
|
90
|
+
|
|
91
|
+
// Exercise the public artifact scope while a real attempt identity exists.
|
|
92
|
+
const guardRun = join(root, 'after-path-guard')
|
|
93
|
+
let guard
|
|
94
|
+
const guardReport = await runEval({ ...base, runDir: guardRun, dispatch: async (_scenario, ctx) => {
|
|
95
|
+
const own = await ctx.artifacts.writeJson('capture.json', { own: true })
|
|
96
|
+
const identityPath = join(dirname(dirname(own)), 'identity.json')
|
|
97
|
+
const before = hash(readFileSync(identityPath))
|
|
98
|
+
let rejection
|
|
99
|
+
try { await ctx.artifacts.writeJson('../identity.json', { overwritten: true }) }
|
|
100
|
+
catch (error) { rejection = error.message }
|
|
101
|
+
const after = hash(readFileSync(identityPath))
|
|
102
|
+
assert.equal(rejection, 'Artifact path must remain inside this execution attempt')
|
|
103
|
+
assert.equal(before, after)
|
|
104
|
+
guard = { rejection, identityBefore: before, identityAfter: after }
|
|
105
|
+
return guard
|
|
106
|
+
}})
|
|
107
|
+
summary.pathGuard = { ...guard, report: guardReport }
|
|
108
|
+
|
|
109
|
+
// Interrupt after a failed candidate settles. Reopen the native search ledger,
|
|
110
|
+
// then observe its prior candidate through runOptimization's stored-cell reader.
|
|
111
|
+
const optimizationDir = join(root, 'after-optimization')
|
|
112
|
+
let proposals = 0
|
|
113
|
+
const histories = []
|
|
114
|
+
const optimizationOpts = {
|
|
115
|
+
...base, runDir: optimizationDir, baselineSurface: 'baseline', populationSize: 1, maxGenerations: 2,
|
|
116
|
+
dispatchWithSurface: async (surface, _scenario, ctx) => {
|
|
117
|
+
await ctx.artifacts.writeJson('captured-response.json', { surface, runAttemptId: ctx.runAttemptId })
|
|
118
|
+
ctx.trace.span('native.optimization.capture', { surface }).end()
|
|
119
|
+
if (surface === 'failed-candidate') throw new Error('Operational candidate interruption')
|
|
120
|
+
return { surface }
|
|
121
|
+
},
|
|
122
|
+
proposer: {
|
|
123
|
+
kind: 'operational-retention-qualification',
|
|
124
|
+
async propose(ctx) {
|
|
125
|
+
proposals++
|
|
126
|
+
histories.push({ proposal: proposals, history: ctx.history })
|
|
127
|
+
if (proposals === 1) return ['failed-candidate']
|
|
128
|
+
if (proposals === 2) throw new Error('Operational stop after candidate settlement')
|
|
129
|
+
return ['resumed-candidate']
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
let firstError
|
|
134
|
+
try { await runOptimization(optimizationOpts) }
|
|
135
|
+
catch (error) { firstError = error.message }
|
|
136
|
+
save(join(optimizationDir, 'first-interruption.json'), { firstError, proposals, histories })
|
|
137
|
+
assert.match(firstError ?? '', /Operational stop after candidate settlement/)
|
|
138
|
+
const optimized = await runOptimization(optimizationOpts)
|
|
139
|
+
const resumedHistory = histories.find(h => h.proposal === 3)?.history
|
|
140
|
+
assert.ok(resumedHistory)
|
|
141
|
+
const failed = resumedHistory.flatMap(g => g.candidates).find(c => c.coverage?.unscorableCells?.length)
|
|
142
|
+
assert.ok(failed, 'Reopened optimization must retain its failed candidate')
|
|
143
|
+
assert.equal(failed.coverage.expectedCells, 1)
|
|
144
|
+
assert.equal(failed.coverage.scorableCells, 0)
|
|
145
|
+
assert.match(JSON.stringify(failed.coverage.unscorableCells), /Operational candidate interruption/)
|
|
146
|
+
summary.optimization = { firstError, proposals, histories, failedCandidateRecovered: true, optimized }
|
|
147
|
+
save(join(root, 'after-summary.json'), summary)
|
|
148
|
+
console.log(JSON.stringify({ module: summary.module, retryRetained: summary.retry.firstContentStillPresent, resumeRetained: summary.resume.firstContentStillPresent, legacyFilesPreserved: Object.keys(legacySnapshot).length, pathGuard: guard.rejection, optimizationFailedCandidateRecovered: true, paidCalls: 0, researchUnits: 0 }))
|