reeval 0.23.0 → 0.24.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/CHANGELOG.md +26 -0
- package/README.md +16 -16
- package/THIRD_PARTY_NOTICES.md +14 -14
- package/dist/{adapter-Dlq3-4OS.js → adapter-dHdepWKb.js} +7 -7
- package/dist/{adapter-Dlq3-4OS.js.map → adapter-dHdepWKb.js.map} +1 -1
- package/dist/{agent-OsAfayRf.js → agent-CZpiwA_r.js} +8 -8
- package/dist/{agent-OsAfayRf.js.map → agent-CZpiwA_r.js.map} +1 -1
- package/dist/{agents-BztvTkfM.js → agents-CEapsHV-.js} +26 -19
- package/dist/agents-CEapsHV-.js.map +1 -0
- package/dist/app-files-Dsr3U1Q7.js +10 -0
- package/dist/app-files-Dsr3U1Q7.js.map +1 -0
- package/dist/{assemble-XrZskSNj.js → assemble-DUtbByvj.js} +1 -1
- package/dist/{assemble-Doa1m-HW.js → assemble-Dw1bF13I.js} +30 -17
- package/dist/{assemble-Doa1m-HW.js.map → assemble-Dw1bF13I.js.map} +1 -1
- package/dist/{attach-BH2HdwH_.js → attach-DvYiMu6w.js} +18 -10
- package/dist/attach-DvYiMu6w.js.map +1 -0
- package/dist/{attempt-_dUsblVx.js → attempt-DxR1agFo.js} +2 -2
- package/dist/{attempt-_dUsblVx.js.map → attempt-DxR1agFo.js.map} +1 -1
- package/dist/{attempt-host-8mQV8Uee.js → attempt-host-DgeJFSZw.js} +7 -7
- package/dist/{attempt-host-8mQV8Uee.js.map → attempt-host-DgeJFSZw.js.map} +1 -1
- package/dist/boat-BBPOc_bs.js +1 -0
- package/dist/{boat-DKjqo_ie.js → boat-CUNgSc75.js} +10 -9
- package/dist/boat-CUNgSc75.js.map +1 -0
- package/dist/{boat-images-CRN_U_eG.js → boat-images-BuFigiEb.js} +8 -8
- package/dist/{boat-images-CRN_U_eG.js.map → boat-images-BuFigiEb.js.map} +1 -1
- package/dist/{bundle-DU2aQVeq.js → bundle-yEgI3RsI.js} +21 -15
- package/dist/bundle-yEgI3RsI.js.map +1 -0
- package/dist/{capture-By1byHaX.js → capture-DdEKVrwk.js} +15 -15
- package/dist/{capture-By1byHaX.js.map → capture-DdEKVrwk.js.map} +1 -1
- package/dist/capture-DxxB3d7p.js +1 -0
- package/dist/{cases-CM-MQRQp.js → cases-B7QkvMGE.js} +2 -2
- package/dist/{cases-CM-MQRQp.js.map → cases-B7QkvMGE.js.map} +1 -1
- package/dist/cases-CA7gxxdr.js +1 -0
- package/dist/{cli-DMHOwdVr.js → cli-Z7aw8k25.js} +274 -165
- package/dist/cli-Z7aw8k25.js.map +1 -0
- package/dist/{cli-spec-D0wuUaj9.js → cli-spec-3zvLC9YW.js} +117 -15
- package/dist/cli-spec-3zvLC9YW.js.map +1 -0
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/{client-B41UK150.js → client-kUwtq-vt.js} +3 -3
- package/dist/{client-B41UK150.js.map → client-kUwtq-vt.js.map} +1 -1
- package/dist/{hosted-Co-waHe0.js → cloud-DuHcNQVV.js} +38 -38
- package/dist/cloud-DuHcNQVV.js.map +1 -0
- package/dist/cloud-files-BjinrTTe.js +301 -0
- package/dist/cloud-files-BjinrTTe.js.map +1 -0
- package/dist/{hosted-5Zz2peTR.js → cloud-owVBaSRt.js} +30 -30
- package/dist/cloud-owVBaSRt.js.map +1 -0
- package/dist/cloud-run-C08P_Uap.js +1 -0
- package/dist/cloud-run-DqMkSGYB.js +500 -0
- package/dist/cloud-run-DqMkSGYB.js.map +1 -0
- package/dist/cloud-secrets-Bak83tik.js +337 -0
- package/dist/cloud-secrets-Bak83tik.js.map +1 -0
- package/dist/{command-8GIHYGZf.js → command-Bs6Knfm4.js} +13 -13
- package/dist/{command-8GIHYGZf.js.map → command-Bs6Knfm4.js.map} +1 -1
- package/dist/{command-CAmnWLFL.js → command-CeygdoVe.js} +19 -19
- package/dist/{command-CAmnWLFL.js.map → command-CeygdoVe.js.map} +1 -1
- package/dist/command-CoHN1ibe.js +183 -0
- package/dist/command-CoHN1ibe.js.map +1 -0
- package/dist/{command-ao0NZ8h0.js → command-CtmSJzPC.js} +18 -18
- package/dist/{command-ao0NZ8h0.js.map → command-CtmSJzPC.js.map} +1 -1
- package/dist/{command-CXxckfsq.js → command-efTGfUYb.js} +18 -130
- package/dist/command-efTGfUYb.js.map +1 -0
- package/dist/{commands-B3lnIPj5.js → commands-B_cAs8nG.js} +1 -1
- package/dist/{commands-ttChCsAy.js → commands-DR-NolV2.js} +25 -20
- package/dist/{commands-ttChCsAy.js.map → commands-DR-NolV2.js.map} +1 -1
- package/dist/{config-myJT1Qjc.js → config-Bn2OhCN_.js} +40 -34
- package/dist/config-Bn2OhCN_.js.map +1 -0
- package/dist/{context-DnzR9TNK.js → context-Ba7PNMMe.js} +2 -2
- package/dist/{context-DnzR9TNK.js.map → context-Ba7PNMMe.js.map} +1 -1
- package/dist/{cost-C21gGrju.js → cost-Dp-xFGJ1.js} +2 -2
- package/dist/{cost-C21gGrju.js.map → cost-Dp-xFGJ1.js.map} +1 -1
- package/dist/{cost-CdRX1s2p.js → cost-a_rUSdsf.js} +1 -1
- package/dist/{cursor-catalog-CUQrabJ_.js → cursor-catalog-BYIDSsLn.js} +5 -5
- package/dist/{cursor-catalog-CUQrabJ_.js.map → cursor-catalog-BYIDSsLn.js.map} +1 -1
- package/dist/{daytona-Dfhwtr9P.js → daytona-CWs9j9mt.js} +18 -15
- package/dist/daytona-CWs9j9mt.js.map +1 -0
- package/dist/daytona-image-BjVpi3KS.js +1 -0
- package/dist/{daytona-image-CnG6G00x.js → daytona-image-DmGlFAyq.js} +6 -5
- package/dist/daytona-image-DmGlFAyq.js.map +1 -0
- package/dist/db-Bjq6qr6c.js +2 -0
- package/dist/{db-5H95sFii.js → db-D6yQib7M.js} +12 -12
- package/dist/{db-5H95sFii.js.map → db-D6yQib7M.js.map} +1 -1
- package/dist/{default-effort-DYpCkJRk.js → default-effort-Bpz5ULfC.js} +2 -2
- package/dist/{default-effort-DYpCkJRk.js.map → default-effort-Bpz5ULfC.js.map} +1 -1
- package/dist/{default-effort-CtNY9CGW.js → default-effort-Ck6ViSaI.js} +1 -1
- package/dist/{dist-DeqeCUZe.js → dist-CZtW7eI5.js} +4 -4
- package/dist/{dist-DeqeCUZe.js.map → dist-CZtW7eI5.js.map} +1 -1
- package/dist/{docker-kpudeSxV.js → docker-Bbi4kmFj.js} +1 -1
- package/dist/{docker-CR0JZ1FE.js → docker-Dgw4aaRk.js} +4 -4
- package/dist/{docker-CR0JZ1FE.js.map → docker-Dgw4aaRk.js.map} +1 -1
- package/dist/{doctor-aE-RMbB_.js → doctor-BfS6jswW.js} +30 -30
- package/dist/{doctor-aE-RMbB_.js.map → doctor-BfS6jswW.js.map} +1 -1
- package/dist/{environment-C8pUCD_A.js → environment-BY8lVFFK.js} +9 -9
- package/dist/{environment-C8pUCD_A.js.map → environment-BY8lVFFK.js.map} +1 -1
- package/dist/{errors-DPUoUTdK.js → errors-P8oHhNzy.js} +2 -2
- package/dist/{errors-DPUoUTdK.js.map → errors-P8oHhNzy.js.map} +1 -1
- package/dist/{eval-source-CaLIGH3U.js → eval-source-BB8In3xo.js} +6 -6
- package/dist/{eval-source-CaLIGH3U.js.map → eval-source-BB8In3xo.js.map} +1 -1
- package/dist/{evaluate-4kBVtwZZ.js → evaluate-B8I9AKgw.js} +50 -40
- package/dist/evaluate-B8I9AKgw.js.map +1 -0
- package/dist/{evaluate-DHaNtgVf.d.ts → evaluate-B9_nukrc.d.ts} +2 -3
- package/dist/{events-CXxFvVMK.js → events-D97ZzAeq.js} +5 -5
- package/dist/{events-CXxFvVMK.js.map → events-D97ZzAeq.js.map} +1 -1
- package/dist/{fake-bootstrap-CzxrCqO3.js → fake-bootstrap-4DFtzib0.js} +2 -2
- package/dist/{fake-bootstrap-CzxrCqO3.js.map → fake-bootstrap-4DFtzib0.js.map} +1 -1
- package/dist/files-5HsFIpxw.js +1 -0
- package/dist/{files-CDfG8swM.js → files-B0DbptiO.js} +25 -16
- package/dist/files-B0DbptiO.js.map +1 -0
- package/dist/{files-BkvxIqfI.js → files-B4K1k__s.js} +5 -5
- package/dist/{files-BkvxIqfI.js.map → files-B4K1k__s.js.map} +1 -1
- package/dist/files-BNg3wgw_.js +1 -0
- package/dist/files-BesexM88.js +1477 -0
- package/dist/files-BesexM88.js.map +1 -0
- package/dist/{files-Cs2dtb7-.js → files-DE13BqBC.js} +2 -2
- package/dist/{files-Cs2dtb7-.js.map → files-DE13BqBC.js.map} +1 -1
- package/dist/files-DNgQwgA0.js +1 -0
- package/dist/files-DvDUSrWL.js +1 -0
- package/dist/{files-DpwJW3w6.js → files-GBTUBAek.js} +3 -3
- package/dist/{files-DpwJW3w6.js.map → files-GBTUBAek.js.map} +1 -1
- package/dist/{files-DgHeTdCZ.js → files-TwSVeWwM.js} +6 -6
- package/dist/{files-DgHeTdCZ.js.map → files-TwSVeWwM.js.map} +1 -1
- package/dist/gateway.d.ts +2 -3
- package/dist/{git-BnnNEXqh.js → git-DatgUcnf.js} +3 -3
- package/dist/{git-BnnNEXqh.js.map → git-DatgUcnf.js.map} +1 -1
- package/dist/{harness-nwnyghJZ.js → harness-EZNoeUBf.js} +2 -2
- package/dist/{harness-nwnyghJZ.js.map → harness-EZNoeUBf.js.map} +1 -1
- package/dist/{harness-install-BfMBYDfP.js → harness-install-HgR73tpF.js} +4 -3
- package/dist/harness-install-HgR73tpF.js.map +1 -0
- package/dist/harness.d.ts +2 -3
- package/dist/harness.js +1 -1
- package/dist/{ids-a6cr243_.js → ids-DqEvrBFZ.js} +2 -2
- package/dist/{ids-a6cr243_.js.map → ids-DqEvrBFZ.js.map} +1 -1
- package/dist/{images-DtXwj2wL.js → images-SRE4f3SM.js} +13 -13
- package/dist/{images-DtXwj2wL.js.map → images-SRE4f3SM.js.map} +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +5 -5
- package/dist/init-CS5kEaVg.js +1 -0
- package/dist/{init-Ci_IAp8p.js → init-D5F9MYPC.js} +6 -6
- package/dist/{init-Ci_IAp8p.js.map → init-D5F9MYPC.js.map} +1 -1
- package/dist/{ink-list-Dnh6XD3C.js → ink-list-CLq6YVB8.js} +3 -3
- package/dist/{ink-list-Dnh6XD3C.js.map → ink-list-CLq6YVB8.js.map} +1 -1
- package/dist/{inputs-z4JqnQ5g.js → inputs-B_FsOD2N.js} +6 -6
- package/dist/{inputs-z4JqnQ5g.js.map → inputs-B_FsOD2N.js.map} +1 -1
- package/dist/{inputs-load-DPUP_IFL.js → inputs-load-B4MFkp0Q.js} +3 -3
- package/dist/{inputs-load-DPUP_IFL.js.map → inputs-load-B4MFkp0Q.js.map} +1 -1
- package/dist/inputs-load-D4IsEjq3.js +1 -0
- package/dist/internal/vm.d.ts +7 -8
- package/dist/internal/vm.js +6 -6
- package/dist/internal/vm.js.map +1 -1
- package/dist/{invocations-C1gY3E0J.js → invocations-BxQqe5GU.js} +5 -5
- package/dist/{invocations-C1gY3E0J.js.map → invocations-BxQqe5GU.js.map} +1 -1
- package/dist/issue-DmSorsTF.js +1 -0
- package/dist/issue-iErT9KkK.js +120 -0
- package/dist/issue-iErT9KkK.js.map +1 -0
- package/dist/{jiti-ILwyxt93.js → jiti-CtahaHaY.js} +2 -2
- package/dist/{jiti-ILwyxt93.js.map → jiti-CtahaHaY.js.map} +1 -1
- package/dist/{judge-DwzqucLS.js → judge-MOKPsr6R.js} +7 -4
- package/dist/judge-MOKPsr6R.js.map +1 -0
- package/dist/judge.d.ts +5 -6
- package/dist/judge.js +1 -1
- package/dist/{judgments-Cj8bFaDG.js → judgments-Dur4D2pj.js} +2 -2
- package/dist/{judgments-Cj8bFaDG.js.map → judgments-Dur4D2pj.js.map} +1 -1
- package/dist/{kinds-DEKXOWVJ.js → kinds-Dohijzi-.js} +11 -10
- package/dist/kinds-Dohijzi-.js.map +1 -0
- package/dist/{layout-nCnU9Vu2.js → layout-BhhJAEgf.js} +3 -3
- package/dist/{layout-nCnU9Vu2.js.map → layout-BhhJAEgf.js.map} +1 -1
- package/dist/{list-MK4L8tfW.js → list-ClDb8qiX.js} +9 -7
- package/dist/list-ClDb8qiX.js.map +1 -0
- package/dist/{live-BkPNXVmN.js → live-C7iGaDCA.js} +9 -9
- package/dist/{live-BkPNXVmN.js.map → live-C7iGaDCA.js.map} +1 -1
- package/dist/live-C7kN5v2P.js +1 -0
- package/dist/{live-Dlq-S2yy.js → live-QFILMmql.js} +2 -2
- package/dist/{live-Dlq-S2yy.js.map → live-QFILMmql.js.map} +1 -1
- package/dist/{machine-service-Byl0BlcT.js → machine-service-DpJScNtA.js} +1 -1
- package/dist/{machine-service-CZiXiVsS.js → machine-service-xFhakTs5.js} +3 -3
- package/dist/{machine-service-CZiXiVsS.js.map → machine-service-xFhakTs5.js.map} +1 -1
- package/dist/{machines-Ch5bhgvk.js → machines-Cm-rU7jp.js} +36 -36
- package/dist/{machines-Ch5bhgvk.js.map → machines-Cm-rU7jp.js.map} +1 -1
- package/dist/{model-DRa7yv6K.js → model-CcvSrrq9.js} +5 -5
- package/dist/{model-DRa7yv6K.js.map → model-CcvSrrq9.js.map} +1 -1
- package/dist/model-Colu5mEp.js +1 -0
- package/dist/{model-CRh8aiYS.js → model-D9WMMEWD.js} +4 -4
- package/dist/{model-CRh8aiYS.js.map → model-D9WMMEWD.js.map} +1 -1
- package/dist/{model-lLaUxxno.js → model-Rmv-L9Jb.js} +1 -1
- package/dist/{model-LoLnq9y1.js → model-mTaaEkeQ.js} +6 -6
- package/dist/{model-LoLnq9y1.js.map → model-mTaaEkeQ.js.map} +1 -1
- package/dist/{node-BQjSQw0d.js → node-Bl2CtSjB.js} +8 -8
- package/dist/{node-BQjSQw0d.js.map → node-Bl2CtSjB.js.map} +1 -1
- package/dist/options-CmRy82gl.js +1 -0
- package/dist/{patch-D8X6VB-e.js → patch-DhJDHRFs.js} +2 -2
- package/dist/{patch-D8X6VB-e.js.map → patch-DhJDHRFs.js.map} +1 -1
- package/dist/{plan-DgIVIrXJ.js → plan-CC0bKbm9.js} +11 -11
- package/dist/{plan-DgIVIrXJ.js.map → plan-CC0bKbm9.js.map} +1 -1
- package/dist/{plugins-DvEbow6a.js → plugins-PwEtW8GH.js} +6 -6
- package/dist/{plugins-DvEbow6a.js.map → plugins-PwEtW8GH.js.map} +1 -1
- package/dist/{preflight-Qm4wE094.js → preflight-BHUEfA4m.js} +3 -3
- package/dist/{preflight-Qm4wE094.js.map → preflight-BHUEfA4m.js.map} +1 -1
- package/dist/{preflight-BKGbxN67.js → preflight-BzvLYQ70.js} +8 -8
- package/dist/{preflight-BKGbxN67.js.map → preflight-BzvLYQ70.js.map} +1 -1
- package/dist/{preflight-dJqs5x3r.js → preflight-DEV_vrdB.js} +1 -1
- package/dist/preflight-xa8_eGOW.js +1 -0
- package/dist/{prepare-BAjRSoku.js → prepare-D7hPrh7Q.js} +7 -7
- package/dist/{prepare-BAjRSoku.js.map → prepare-D7hPrh7Q.js.map} +1 -1
- package/dist/{prepare-CRPPfRJf.js → prepare-DS42k409.js} +2 -2
- package/dist/prices-C_mbZa5a.js +1 -0
- package/dist/{prices-DCokI_Ka.js → prices-DXJsP2Ha.js} +3 -3
- package/dist/{prices-DCokI_Ka.js.map → prices-DXJsP2Ha.js.map} +1 -1
- package/dist/process-RPlEhpHz.js +118 -0
- package/dist/process-RPlEhpHz.js.map +1 -0
- package/dist/{provenance-CSyRCc9B.js → provenance-DgQJ-dq7.js} +5 -5
- package/dist/{provenance-CSyRCc9B.js.map → provenance-DgQJ-dq7.js.map} +1 -1
- package/dist/{providers-DkaEJvF5.js → providers-B5Vr0hKH.js} +32 -32
- package/dist/{providers-DkaEJvF5.js.map → providers-B5Vr0hKH.js.map} +1 -1
- package/dist/{providers-DxZ26YoG.js → providers-N4HDMeeo.js} +1 -1
- package/dist/query-BXV6pRyI.js +1 -0
- package/dist/{query-BL66BOqL.js → query-CmTjYbqh.js} +2 -2
- package/dist/{query-BL66BOqL.js.map → query-CmTjYbqh.js.map} +1 -1
- package/dist/{questions-boVPzGoC.js → questions-DnqkJga0.js} +7 -7
- package/dist/{questions-boVPzGoC.js.map → questions-DnqkJga0.js.map} +1 -1
- package/dist/{recipe-qyIpP96r.js → recipe-B0NeT_Sn.js} +3 -3
- package/dist/{recipe-qyIpP96r.js.map → recipe-B0NeT_Sn.js.map} +1 -1
- package/dist/{record-D1_D1KFY.js → record-2liAelrB.js} +11 -5
- package/dist/record-2liAelrB.js.map +1 -0
- package/dist/{redact-t-L3VGy8.js → redact-DMueYS-v.js} +28 -6
- package/dist/redact-DMueYS-v.js.map +1 -0
- package/dist/{remarks-DEvk5f8v.js → remarks-D-9f1y1B.js} +10 -10
- package/dist/{remarks-DEvk5f8v.js.map → remarks-D-9f1y1B.js.map} +1 -1
- package/dist/{remarks-DqriPKxm.js → remarks-D5qOZzcX.js} +2 -2
- package/dist/{remarks-DqriPKxm.js.map → remarks-D5qOZzcX.js.map} +1 -1
- package/dist/{remote-CQoBRpOv.js → remote-B7BIRUTK.js} +6 -6
- package/dist/{remote-CQoBRpOv.js.map → remote-B7BIRUTK.js.map} +1 -1
- package/dist/{resolve-Bfo8sjd-.js → resolve-B60w6DcB.js} +20 -5
- package/dist/resolve-B60w6DcB.js.map +1 -0
- package/dist/resolve-CCLiJX4i.js +1 -0
- package/dist/{resolve-D2RqmybX.js → resolve-t9sOkGGS.js} +50 -17
- package/dist/resolve-t9sOkGGS.js.map +1 -0
- package/dist/{results-BpxzyoMd.js → results-Df910ONm.js} +6 -6
- package/dist/{results-BpxzyoMd.js.map → results-Df910ONm.js.map} +1 -1
- package/dist/{resume-2ekm_9OB.js → resume-4Q9q8AcE.js} +6 -6
- package/dist/{resume-2ekm_9OB.js.map → resume-4Q9q8AcE.js.map} +1 -1
- package/dist/{retry-CAhpW1hH.js → retry-C15f5yyy.js} +4 -4
- package/dist/{retry-CAhpW1hH.js.map → retry-C15f5yyy.js.map} +1 -1
- package/dist/{root-BzeoyfGd.js → root-Cm93-6ix.js} +3 -3
- package/dist/{root-BzeoyfGd.js.map → root-Cm93-6ix.js.map} +1 -1
- package/dist/{runtime-C5fKSFCz.js → runtime-CIsljVBy.js} +5 -5
- package/dist/{runtime-C5fKSFCz.js.map → runtime-CIsljVBy.js.map} +1 -1
- package/dist/sandbox/boat.d.ts +4 -5
- package/dist/sandbox/boat.js +2 -2
- package/dist/sandbox/daytona.d.ts +4 -5
- package/dist/sandbox/daytona.js +1 -1
- package/dist/{sandbox-t-Q-8lA_.js → sandbox-BffNervX.js} +3 -3
- package/dist/{sandbox-t-Q-8lA_.js.map → sandbox-BffNervX.js.map} +1 -1
- package/dist/sandbox.d.ts +4 -5
- package/dist/sandbox.js +1 -1
- package/dist/secrets-file-Dtd3h3kY.js +100 -0
- package/dist/secrets-file-Dtd3h3kY.js.map +1 -0
- package/dist/secrets-file-take-BXfYMTM-.js +33 -0
- package/dist/secrets-file-take-BXfYMTM-.js.map +1 -0
- package/dist/server-CeYUmuuu.js +1 -0
- package/dist/{server-BcLg9WzE.js → server-fSNuT3Z4.js} +12 -12
- package/dist/{server-BcLg9WzE.js.map → server-fSNuT3Z4.js.map} +1 -1
- package/dist/shared-B3iLKAiu.d.ts +1 -0
- package/dist/source-n7nUVm9p.js +1 -0
- package/dist/{source-CrXM19HD.js → source-zoRWRMql.js} +2 -2
- package/dist/{source-CrXM19HD.js.map → source-zoRWRMql.js.map} +1 -1
- package/dist/{src-DrLbG1HM.js → src-9V3C6A7C.js} +1 -1
- package/dist/{src-Bf5RZlPi.js → src-BQWAxhKD.js} +3 -3
- package/dist/{src-Bf5RZlPi.js.map → src-BQWAxhKD.js.map} +1 -1
- package/dist/{src-io_SKoZ5.js → src-Bj3WJs3t.js} +2 -2
- package/dist/{src-5dCrqbFd.js → src-CB5cZhaN.js} +1 -1
- package/dist/{src-C-ChdnG6.js → src-CDoAEO4u.js} +2 -2
- package/dist/{src-C-ChdnG6.js.map → src-CDoAEO4u.js.map} +1 -1
- package/dist/{src-Cf4vRyea.js → src-CFBg2ecq.js} +1 -1
- package/dist/{src-DNWiU__5.js → src-CGBwMZgM.js} +2 -2
- package/dist/{src-DNWiU__5.js.map → src-CGBwMZgM.js.map} +1 -1
- package/dist/{src-C6MsGyD6.js → src-CUrcaZ91.js} +1 -1
- package/dist/{src-DwcCKsV0.js → src-CcbV6VpV.js} +2 -2
- package/dist/{src-DEbNp-rx.js → src-DB0vml0O.js} +1 -1
- package/dist/{src-VG2IRoT4.js → src-DiS13D_q.js} +2 -2
- package/dist/{src-C5rrQlt8.js → src-OC89dAjO.js} +65 -129
- package/dist/src-OC89dAjO.js.map +1 -0
- package/dist/{src-Ds1pmXTg.js → src-TMKittwH.js} +1 -1
- package/dist/ssh-pool-ChpT-fDU.js +1 -0
- package/dist/{ssh-pool-Dvfx5GuV.js → ssh-pool-DwboLN9O.js} +10 -9
- package/dist/ssh-pool-DwboLN9O.js.map +1 -0
- package/dist/{start-COB07NpH.js → start-BwMyDneA.js} +27 -7
- package/dist/start-BwMyDneA.js.map +1 -0
- package/dist/{state-B319V1p8.js → state-CXTaT0t8.js} +10 -10
- package/dist/{state-B319V1p8.js.map → state-CXTaT0t8.js.map} +1 -1
- package/dist/state-CltRWlCu.js +1 -0
- package/dist/store/local.d.ts +2 -3
- package/dist/store/s3.d.ts +2 -3
- package/dist/{suite-D1tgXZxM.js → suite-C4XSg6Ls.js} +6 -6
- package/dist/{suite-D1tgXZxM.js.map → suite-C4XSg6Ls.js.map} +1 -1
- package/dist/suite-CIsyPqPA.js +2 -0
- package/dist/{summary-ClLns_wv.js → summary-DeeQJAR5.js} +8 -8
- package/dist/{summary-ClLns_wv.js.map → summary-DeeQJAR5.js.map} +1 -1
- package/dist/{sync-mOG74RXH.js → sync-bnI6WWaL.js} +6 -6
- package/dist/{sync-mOG74RXH.js.map → sync-bnI6WWaL.js.map} +1 -1
- package/dist/{tart-DMppfbEm.js → tart-CSP5Q0qV.js} +9 -8
- package/dist/tart-CSP5Q0qV.js.map +1 -0
- package/dist/{tart-bake-Cva_qdir.js → tart-bake-BCKRfyKm.js} +9 -8
- package/dist/tart-bake-BCKRfyKm.js.map +1 -0
- package/dist/{tart-bake-DVIoXWr_.js → tart-bake-d9UvIfe3.js} +1 -1
- package/dist/{tart-cli-D88c5YYJ.js → tart-cli-C4d5FXG1.js} +1 -1
- package/dist/{tart-cli-LzDud2Z6.js → tart-cli-CqSpUYGV.js} +3 -2
- package/dist/tart-cli-CqSpUYGV.js.map +1 -0
- package/dist/{tart-hosts-8N6Tt7Yb.js → tart-hosts-Du7SZM4w.js} +1 -1
- package/dist/{tart-hosts-CTRY5kQ2.js → tart-hosts-G0EUDt07.js} +5 -4
- package/dist/tart-hosts-G0EUDt07.js.map +1 -0
- package/dist/{tart-images-JfHirU8W.js → tart-images-De0-ib7R.js} +4 -4
- package/dist/{tart-images-JfHirU8W.js.map → tart-images-De0-ib7R.js.map} +1 -1
- package/dist/testing.d.ts +4 -5
- package/dist/testing.js +4 -4
- package/dist/{tool-class-CncfCw03.js → tool-class-B3ZFTSOw.js} +2 -2
- package/dist/{tool-class-CncfCw03.js.map → tool-class-B3ZFTSOw.js.map} +1 -1
- package/dist/{trace-BpXByD7W.js → trace-CfppUzD9.js} +2 -2
- package/dist/{trace-BpXByD7W.js.map → trace-CfppUzD9.js.map} +1 -1
- package/dist/{traits-CCD8XsmI.js → traits-Bj1PM5F7.js} +2 -2
- package/dist/{traits-CCD8XsmI.js.map → traits-Bj1PM5F7.js.map} +1 -1
- package/dist/{transcript-BXWZiMuC.js → transcript-CW02A4s9.js} +3 -3
- package/dist/{transcript-BXWZiMuC.js.map → transcript-CW02A4s9.js.map} +1 -1
- package/dist/types-CbcnJxCy.js.map +1 -1
- package/dist/{types-BDo8ttQo.d.ts → types-D4WEnzhY.d.ts} +51 -16
- package/dist/{ui-DUiVPbQ2.js → ui-DfvPNmPP.js} +7 -7
- package/dist/{ui-DUiVPbQ2.js.map → ui-DfvPNmPP.js.map} +1 -1
- package/dist/{vertex-BEWxHoxH.js → vertex-BLxYasfw.js} +2 -2
- package/dist/{vertex-BEWxHoxH.js.map → vertex-BLxYasfw.js.map} +1 -1
- package/dist/vertex-D4H9bKHD.d.ts +2 -0
- package/dist/vertex-DZDUpp0W.js +1 -0
- package/dist/view/index.d.ts +2 -3
- package/dist/view/index.js +10 -10
- package/dist/{views-CiZGh3ws.js → views-ChoSQxfF.js} +6 -6
- package/dist/{views-CiZGh3ws.js.map → views-ChoSQxfF.js.map} +1 -1
- package/dist/views-DU0PM0UW.js +2 -0
- package/dist/{vm-container-BVn7pXfD.js → vm-container-DOtIi_rd.js} +9 -8
- package/dist/vm-container-DOtIi_rd.js.map +1 -0
- package/dist/{vm-images-CNk-Zl2a.js → vm-images-CHutQVml.js} +13 -13
- package/dist/{vm-images-CNk-Zl2a.js.map → vm-images-CHutQVml.js.map} +1 -1
- package/dist/{worker-entry-DmXQ2Znu.js → worker-entry-CKBfEt0h.js} +7 -7
- package/dist/{worker-entry-DmXQ2Znu.js.map → worker-entry-CKBfEt0h.js.map} +1 -1
- package/dist/workspace-BKcNJAPb.js +1 -0
- package/dist/{workspace-wwvwEHzP.js → workspace-Cip2dVwU.js} +9 -8
- package/dist/workspace-Cip2dVwU.js.map +1 -0
- package/package.json +9 -9
- package/skills/reeval/SKILL.md +2 -2
- package/skills/setup/SKILL.md +1 -1
- package/dist/agents-BztvTkfM.js.map +0 -1
- package/dist/app-files-6NHzghym.js +0 -10
- package/dist/app-files-6NHzghym.js.map +0 -1
- package/dist/attach-BH2HdwH_.js.map +0 -1
- package/dist/boat-DKRH0Gv7.js +0 -1
- package/dist/boat-DKjqo_ie.js.map +0 -1
- package/dist/bundle-DU2aQVeq.js.map +0 -1
- package/dist/capture-BzjNv0qP.js +0 -1
- package/dist/cases-FvhbM8M5.js +0 -1
- package/dist/cli-DMHOwdVr.js.map +0 -1
- package/dist/cli-spec-D0wuUaj9.js.map +0 -1
- package/dist/command-CXxckfsq.js.map +0 -1
- package/dist/config-myJT1Qjc.js.map +0 -1
- package/dist/daytona-Dfhwtr9P.js.map +0 -1
- package/dist/daytona-image-CnG6G00x.js.map +0 -1
- package/dist/daytona-image-yJK3c4EV.js +0 -1
- package/dist/db-Bbg1n_2M.js +0 -2
- package/dist/evaluate-4kBVtwZZ.js.map +0 -1
- package/dist/files-BFnkOAhn.js +0 -1
- package/dist/files-BgQxoDlN.js +0 -1
- package/dist/files-CDfG8swM.js.map +0 -1
- package/dist/files-CSe4VaMj.js +0 -1
- package/dist/files-CX_mmvCc.js +0 -775
- package/dist/files-CX_mmvCc.js.map +0 -1
- package/dist/files-D6M7J3iX.js +0 -1
- package/dist/harness-install-BfMBYDfP.js.map +0 -1
- package/dist/hosted-5Zz2peTR.js.map +0 -1
- package/dist/hosted-Co-waHe0.js.map +0 -1
- package/dist/hosted-run-202QicZ-.js +0 -1
- package/dist/hosted-run-BfAPIMyT.js +0 -230
- package/dist/hosted-run-BfAPIMyT.js.map +0 -1
- package/dist/init-BiL6B3S4.js +0 -1
- package/dist/inputs-load-M-BGe7gd.js +0 -1
- package/dist/judge-DwzqucLS.js.map +0 -1
- package/dist/kinds-DEKXOWVJ.js.map +0 -1
- package/dist/list-MK4L8tfW.js.map +0 -1
- package/dist/live-gZtkBwuo.js +0 -1
- package/dist/model-C6aoJLg_.js +0 -1
- package/dist/options-I9I3FwMl.js +0 -1
- package/dist/preflight-fyV5nnea.js +0 -1
- package/dist/prices-C0gKS_8G.js +0 -1
- package/dist/query-C9OKU1Vz.js +0 -1
- package/dist/record-D1_D1KFY.js.map +0 -1
- package/dist/redact-t-L3VGy8.js.map +0 -1
- package/dist/resolve-BdpO8BN1.js +0 -1
- package/dist/resolve-Bfo8sjd-.js.map +0 -1
- package/dist/resolve-D2RqmybX.js.map +0 -1
- package/dist/server-Buav2-CG.js +0 -1
- package/dist/shared-CHvO7eLi.d.ts +0 -1
- package/dist/source-dvxkqYvk.js +0 -1
- package/dist/src-C5rrQlt8.js.map +0 -1
- package/dist/ssh-pool-BorCizYw.js +0 -1
- package/dist/ssh-pool-Dvfx5GuV.js.map +0 -1
- package/dist/start-COB07NpH.js.map +0 -1
- package/dist/state-C5oBvmoZ.js +0 -1
- package/dist/suite-BwJGOhCZ.js +0 -2
- package/dist/tart-DMppfbEm.js.map +0 -1
- package/dist/tart-bake-Cva_qdir.js.map +0 -1
- package/dist/tart-cli-LzDud2Z6.js.map +0 -1
- package/dist/tart-hosts-CTRY5kQ2.js.map +0 -1
- package/dist/vertex-C7PI-WPc.d.ts +0 -3
- package/dist/vertex-DXfcXYKn.js +0 -1
- package/dist/views-B0qZR5Ef.js +0 -2
- package/dist/vm-container-BVn7pXfD.js.map +0 -1
- package/dist/workspace-CRgFdmgW.js +0 -1
- package/dist/workspace-wwvwEHzP.js.map +0 -1
package/dist/files-CX_mmvCc.js
DELETED
|
@@ -1,775 +0,0 @@
|
|
|
1
|
-
import { t as BUILD_ID } from "./root-BzeoyfGd.js";
|
|
2
|
-
import { t as RUN_ID } from "./paths-Dwmi7L4X.js";
|
|
3
|
-
import { a as fromCwd, l as relativeFile, u as sha256 } from "./ids-a6cr243_.js";
|
|
4
|
-
import { o as findSecrets, s as findSecretsInJson, u as maskedMatch } from "./redact-t-L3VGy8.js";
|
|
5
|
-
import { i as TRACE_FILE, r as REQUESTS_FILE, t as DEBUG_LOG } from "./debug-CIXzB4wK.js";
|
|
6
|
-
import { n as debugRoot } from "./files-CDfG8swM.js";
|
|
7
|
-
import { r as repoTop, t as git } from "./git-BnnNEXqh.js";
|
|
8
|
-
import { t as patchPath } from "./patch-C7yBztZj.js";
|
|
9
|
-
import { r as runHeader, t as REMARKS_FILE } from "./remarks-DqriPKxm.js";
|
|
10
|
-
import { d as readableRemarks, t as NewerSchemaError, u as readableRecord } from "./record-D1_D1KFY.js";
|
|
11
|
-
import { n as renderSummary } from "./summary-ClLns_wv.js";
|
|
12
|
-
import { dirname, isAbsolute, join } from "node:path";
|
|
13
|
-
import { randomBytes } from "node:crypto";
|
|
14
|
-
import { hostname } from "node:os";
|
|
15
|
-
import { link, mkdir, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
16
|
-
import { isDeepStrictEqual } from "node:util";
|
|
17
|
-
// src/history/ignore.ts
|
|
18
|
-
/**
|
|
19
|
-
* Un-ignores recorded artifacts. A parent `*.log` would otherwise drop `setup.log` and
|
|
20
|
-
* `checks/<n>.log` when someone `git add`s the history folder. Ignores the `.tmp-*` files a
|
|
21
|
-
* write keeps there while it runs, such as a claim a crashed write left.
|
|
22
|
-
*/
|
|
23
|
-
const HISTORY_GITIGNORE = `# Un-ignore recorded files. A parent *.log drops setup.log and checks/*.log.
|
|
24
|
-
!*.json
|
|
25
|
-
!*.jsonl
|
|
26
|
-
!*.md
|
|
27
|
-
!*.patch
|
|
28
|
-
!*.log
|
|
29
|
-
# A write in progress, or one cut short: never part of history.
|
|
30
|
-
.tmp-*
|
|
31
|
-
`;
|
|
32
|
-
/**
|
|
33
|
-
* Marks recorded runs generated, so GitHub collapses them in a pull request's diff. Matches run
|
|
34
|
-
* ids (`RUN_ID`) only: `history.dir` may be a folder that holds other files too.
|
|
35
|
-
*/
|
|
36
|
-
const HISTORY_GITATTRIBUTES = `# Recorded runs: GitHub collapses them in a pull request's diff.
|
|
37
|
-
/[0-9]*T[0-9]*Z_*.json linguist-generated=true
|
|
38
|
-
/[0-9]*T[0-9]*Z_*/** linguist-generated=true
|
|
39
|
-
`;
|
|
40
|
-
const historyGitignorePath = (historyDir) => join(historyDir, ".gitignore");
|
|
41
|
-
const historyGitattributesPath = (historyDir) => join(historyDir, ".gitattributes");
|
|
42
|
-
async function ensureFile(historyDir, path, content) {
|
|
43
|
-
try {
|
|
44
|
-
await readFile(path);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
if (error.code !== "ENOENT") throw error;
|
|
47
|
-
await mkdir(historyDir, { recursive: true });
|
|
48
|
-
await writeFile(path, content);
|
|
49
|
-
}
|
|
50
|
-
return path;
|
|
51
|
-
}
|
|
52
|
-
/** Writes the history-folder `.gitignore` when it's missing; leaves a file that's already there. */
|
|
53
|
-
const ensureHistoryGitignore = (historyDir) => ensureFile(historyDir, historyGitignorePath(historyDir), HISTORY_GITIGNORE);
|
|
54
|
-
/**
|
|
55
|
-
* Writes the history-folder `.gitattributes`, or appends `HISTORY_GITATTRIBUTES` to one that
|
|
56
|
-
* lacks any of its rules, keeping what's there.
|
|
57
|
-
*/
|
|
58
|
-
async function ensureHistoryGitattributes(historyDir) {
|
|
59
|
-
const path = historyGitattributesPath(historyDir);
|
|
60
|
-
let existing;
|
|
61
|
-
try {
|
|
62
|
-
existing = await readFile(path, "utf8");
|
|
63
|
-
} catch (error) {
|
|
64
|
-
if (error.code !== "ENOENT") throw error;
|
|
65
|
-
return ensureFile(historyDir, path, HISTORY_GITATTRIBUTES);
|
|
66
|
-
}
|
|
67
|
-
const lines = new Set(existing.split(/\r?\n/).map((l) => l.trim()));
|
|
68
|
-
if ("# Recorded runs: GitHub collapses them in a pull request's diff.\n/[0-9]*T[0-9]*Z_*.json linguist-generated=true\n/[0-9]*T[0-9]*Z_*/** linguist-generated=true\n".split("\n").filter((l) => l && !l.startsWith("#")).every((r) => lines.has(r))) return path;
|
|
69
|
-
const gap = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
70
|
-
await writeFile(path, `${existing}${gap}${HISTORY_GITATTRIBUTES}`);
|
|
71
|
-
return path;
|
|
72
|
-
}
|
|
73
|
-
/** `git check-ignore -v` one line: `<source>:<line>:<pattern><TAB><pathname>`. */
|
|
74
|
-
function parseCheckIgnore(line) {
|
|
75
|
-
const tab = line.indexOf(" ");
|
|
76
|
-
if (tab < 0) return null;
|
|
77
|
-
const meta = line.slice(0, tab);
|
|
78
|
-
const pathname = line.slice(tab + 1);
|
|
79
|
-
const match = meta.match(/^(.*):(\d+):(.*)$/);
|
|
80
|
-
if (!match) return null;
|
|
81
|
-
const [, source, lineNo, rule] = match;
|
|
82
|
-
if (!source || !rule) return null;
|
|
83
|
-
if (rule.startsWith("!")) return null;
|
|
84
|
-
return {
|
|
85
|
-
path: pathname,
|
|
86
|
-
rule,
|
|
87
|
-
source: `${source}:${lineNo}`
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Files among `files` that git would ignore (so `git add` of the history folder would drop them).
|
|
92
|
-
* Empty when this isn't a git repo or git can't tell.
|
|
93
|
-
*/
|
|
94
|
-
async function ignoredRecordedFiles(root, files) {
|
|
95
|
-
if (files.length === 0) return [];
|
|
96
|
-
const top = await repoTop(root);
|
|
97
|
-
if (!top) return [];
|
|
98
|
-
const r = await git(top, [
|
|
99
|
-
"check-ignore",
|
|
100
|
-
"-v",
|
|
101
|
-
"--no-index",
|
|
102
|
-
"--stdin"
|
|
103
|
-
], { input: `${files.map((f) => relativeFile(top, f)).join("\n")}\n` });
|
|
104
|
-
if (r.code !== 0) return [];
|
|
105
|
-
return r.stdout.toString("utf8").split("\n").filter(Boolean).flatMap((line) => {
|
|
106
|
-
const parsed = parseCheckIgnore(line);
|
|
107
|
-
if (!parsed) return [];
|
|
108
|
-
const abs = isAbsolute(parsed.path) ? parsed.path : join(top, parsed.path);
|
|
109
|
-
return [{
|
|
110
|
-
...parsed,
|
|
111
|
-
path: fromCwd(abs)
|
|
112
|
-
}];
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
// src/history/secret-scan.ts
|
|
116
|
-
/** Findings shown per file; the rest are counted. */
|
|
117
|
-
const SHOWN = 5;
|
|
118
|
-
const HUNK = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/;
|
|
119
|
-
/** Where line `lineIndex` of a `git diff` falls: the file it changes, and its line in the new version. */
|
|
120
|
-
function inPatch(lines, lineIndex) {
|
|
121
|
-
let file = null;
|
|
122
|
-
let next = null;
|
|
123
|
-
for (let i = 0; i <= lineIndex; i++) {
|
|
124
|
-
const text = lines[i];
|
|
125
|
-
if (text.startsWith("diff --git ")) {
|
|
126
|
-
let end = i + 1;
|
|
127
|
-
while (end < lines.length && !/^(@@|diff --git )/.test(lines[end])) end++;
|
|
128
|
-
file = patchPath(lines.slice(i, end).join("\n"));
|
|
129
|
-
next = null;
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
const hunk = HUNK.exec(text);
|
|
133
|
-
if (hunk) {
|
|
134
|
-
next = Number(hunk[1]);
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
if (next === null) continue;
|
|
138
|
-
if (i === lineIndex) return {
|
|
139
|
-
file,
|
|
140
|
-
line: text.startsWith("-") ? null : next
|
|
141
|
-
};
|
|
142
|
-
if (!text.startsWith("-") && !text.startsWith("\\")) next++;
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
file,
|
|
146
|
-
line: null
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
const JSON_FILE = /\.(?:json|jsonl|ndjson)$/;
|
|
150
|
-
/**
|
|
151
|
-
* Every secret-looking stretch of `text`, placed: by file and line inside a patch, else by line.
|
|
152
|
-
* In a JSON file, only what redaction masks: its strings.
|
|
153
|
-
*/
|
|
154
|
-
function scanText(path, text) {
|
|
155
|
-
const matches = JSON_FILE.test(path) ? findSecretsInJson(text) : findSecrets(text);
|
|
156
|
-
if (matches.length === 0) return [];
|
|
157
|
-
const lines = text.split("\n");
|
|
158
|
-
const starts = [];
|
|
159
|
-
let at = 0;
|
|
160
|
-
for (const line of lines) {
|
|
161
|
-
starts.push(at);
|
|
162
|
-
at += line.length + 1;
|
|
163
|
-
}
|
|
164
|
-
const lineOf = (offset) => {
|
|
165
|
-
let lo = 0;
|
|
166
|
-
let hi = starts.length - 1;
|
|
167
|
-
while (lo < hi) {
|
|
168
|
-
const mid = lo + hi + 1 >> 1;
|
|
169
|
-
if (starts[mid] <= offset) lo = mid;
|
|
170
|
-
else hi = mid - 1;
|
|
171
|
-
}
|
|
172
|
-
return lo;
|
|
173
|
-
};
|
|
174
|
-
const patch = path.endsWith(".patch");
|
|
175
|
-
return matches.map((m) => {
|
|
176
|
-
const index = lineOf(m.start);
|
|
177
|
-
return {
|
|
178
|
-
...patch ? inPatch(lines, index) : {
|
|
179
|
-
file: null,
|
|
180
|
-
line: index + 1
|
|
181
|
-
},
|
|
182
|
-
what: maskedMatch(text, m),
|
|
183
|
-
rule: m.rule
|
|
184
|
-
};
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
const place = (f) => [f.file, f.line === null ? null : `line ${f.line}`].filter(Boolean).join(" ");
|
|
188
|
-
/** `<label> line <n>: <what>`, or `<label>: <file> line <n>: <what>` in a patch, a few per file. */
|
|
189
|
-
function findingLines(label, findings) {
|
|
190
|
-
const out = findings.slice(0, SHOWN).map((f) => {
|
|
191
|
-
const where = place(f);
|
|
192
|
-
if (!where) return `${label}: ${f.what}`;
|
|
193
|
-
return `${label}${f.file ? ": " : " "}${where}: ${f.what}`;
|
|
194
|
-
});
|
|
195
|
-
if (findings.length > SHOWN) out.push(`${label}: and ${findings.length - SHOWN} more`);
|
|
196
|
-
return out;
|
|
197
|
-
}
|
|
198
|
-
/** The findings as a recordable note: where, and which rule, never any part of the value. */
|
|
199
|
-
function findingSummary(findings) {
|
|
200
|
-
const shown = findings.slice(0, 3).map((f) => {
|
|
201
|
-
const where = place(f);
|
|
202
|
-
return `${where ? `${where}: ` : ""}${f.rule}`;
|
|
203
|
-
});
|
|
204
|
-
const more = findings.length > 3 ? `, and ${findings.length - 3} more` : "";
|
|
205
|
-
return `${shown.join("; ")}${more}`;
|
|
206
|
-
}
|
|
207
|
-
// src/history/files.ts
|
|
208
|
-
var HistoryError = class extends Error {
|
|
209
|
-
name = "HistoryError";
|
|
210
|
-
};
|
|
211
|
-
/** A record from a newer reeval: skipped with a warning to upgrade, never "restore or delete it". */
|
|
212
|
-
var NewerRecordError = class extends HistoryError {
|
|
213
|
-
reason;
|
|
214
|
-
constructor(error) {
|
|
215
|
-
super(error.message);
|
|
216
|
-
this.reason = error.reason;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
/** Where `reeval run` writes runs before they're recorded. Gitignored. */
|
|
220
|
-
const scratchDir = (root) => join(root, ".reeval", "runs");
|
|
221
|
-
const cacheFile = (root) => join(root, ".reeval", "history-cache.json");
|
|
222
|
-
const TEXT_FILE = /\.(json|jsonl|md|patch|log|txt)$/;
|
|
223
|
-
const isMissing = (error) => error.code === "ENOENT";
|
|
224
|
-
/**
|
|
225
|
-
* A file another process is writing, renaming or removing right now: Windows refuses to open or
|
|
226
|
-
* replace one that's open elsewhere (EPERM, EBUSY). It reads fine on a later try.
|
|
227
|
-
*/
|
|
228
|
-
const inFlux = (error) => [
|
|
229
|
-
"ENOENT",
|
|
230
|
-
"EPERM",
|
|
231
|
-
"EBUSY"
|
|
232
|
-
].includes(error.code ?? "");
|
|
233
|
-
const tmpName = () => `${process.pid}-${randomBytes(6).toString("hex")}`;
|
|
234
|
-
const encodeRecord = (record) => Buffer.from(`${JSON.stringify(record, null, 2)}\n`);
|
|
235
|
-
function parseRecord(bytes, where) {
|
|
236
|
-
const value = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
237
|
-
if (value?.kind !== "reeval-run") throw new HistoryError(`${where} is not a reeval run record`);
|
|
238
|
-
try {
|
|
239
|
-
return readableRecord(value, where);
|
|
240
|
-
} catch (error) {
|
|
241
|
-
if (error instanceof NewerSchemaError) throw new NewerRecordError(error);
|
|
242
|
-
throw error;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
async function readRecord(path) {
|
|
246
|
-
return parseRecord(await readFile(path), path);
|
|
247
|
-
}
|
|
248
|
-
const warnedUnreadable = /* @__PURE__ */ new Set();
|
|
249
|
-
/**
|
|
250
|
-
* Says once per process that a run-named file isn't a readable record, so a run lost to a bad
|
|
251
|
-
* merge or a cut-short copy doesn't silently drop out of history, compare's base and queries.
|
|
252
|
-
*/
|
|
253
|
-
function warnUnreadable(path, error) {
|
|
254
|
-
if (warnedUnreadable.has(path)) return;
|
|
255
|
-
warnedUnreadable.add(path);
|
|
256
|
-
if (error instanceof NewerRecordError) {
|
|
257
|
-
process.stderr.write(`warning: skipped ${fromCwd(path)}: ${error.reason}\n`);
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
const why = error instanceof Error ? error.message : String(error);
|
|
261
|
-
process.stderr.write(`warning: skipped ${fromCwd(path)}: not a readable reeval run record (${why}). Restore it from git, or delete it.\n`);
|
|
262
|
-
}
|
|
263
|
-
/** A run's record file in a history or scratch folder. */
|
|
264
|
-
const recordFile = (dir, runId) => join(dir, `${runId}.json`);
|
|
265
|
-
/** A run's artifact directory in a history or scratch folder. */
|
|
266
|
-
const runDir = (dir, runId) => join(dir, runId);
|
|
267
|
-
/** The top-level `.json` names in `dir` (records land last and whole), sorted; null if it's missing. */
|
|
268
|
-
async function recordNames(dir) {
|
|
269
|
-
try {
|
|
270
|
-
return (await readdir(dir)).filter((n) => n.endsWith(".json") && !n.startsWith(".")).sort();
|
|
271
|
-
} catch (error) {
|
|
272
|
-
if (isMissing(error)) return null;
|
|
273
|
-
throw error;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* The newest `limit` records across `dirs`, by file name (= start time), oldest first. Files that
|
|
278
|
-
* aren't readable records are skipped: these feed estimates, not results.
|
|
279
|
-
*/
|
|
280
|
-
async function recentRecords(dirs, limit) {
|
|
281
|
-
const paths = [];
|
|
282
|
-
for (const dir of dirs) {
|
|
283
|
-
const names = await recordNames(dir).catch(() => null) ?? [];
|
|
284
|
-
paths.push(...names.map((n) => join(dir, n)));
|
|
285
|
-
}
|
|
286
|
-
const recent = paths.sort((a, b) => (a.split("/").at(-1) ?? "").localeCompare(b.split("/").at(-1) ?? "")).slice(-limit);
|
|
287
|
-
const records = [];
|
|
288
|
-
for (const path of recent) try {
|
|
289
|
-
records.push(await readRecord(path));
|
|
290
|
-
} catch {}
|
|
291
|
-
return records;
|
|
292
|
-
}
|
|
293
|
-
const BUILD = BUILD_ID;
|
|
294
|
-
async function readCache(root) {
|
|
295
|
-
try {
|
|
296
|
-
const parsed = JSON.parse(await readFile(cacheFile(root), "utf8"));
|
|
297
|
-
if (parsed.build === BUILD && parsed.files) return parsed;
|
|
298
|
-
} catch {}
|
|
299
|
-
return {
|
|
300
|
-
build: BUILD,
|
|
301
|
-
files: {}
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Every run in `dir`, sorted by file name (= start time). Derived from the folder listing on
|
|
306
|
-
* every read; parsed records are cached in `.reeval/` by size and mtime, and never committed.
|
|
307
|
-
*/
|
|
308
|
-
async function listRuns(root, dir, recorded) {
|
|
309
|
-
const names = (await recordNames(dir) ?? []).filter((n) => RUN_ID.test(n.slice(0, -5)));
|
|
310
|
-
if (names.length === 0) return [];
|
|
311
|
-
const cache = await readCache(root);
|
|
312
|
-
let changed = false;
|
|
313
|
-
const entries = [];
|
|
314
|
-
for (const name of names) {
|
|
315
|
-
const path = join(dir, name);
|
|
316
|
-
const key = relativeFile(root, path);
|
|
317
|
-
try {
|
|
318
|
-
const info = await stat(path);
|
|
319
|
-
const hit = cache.files[key];
|
|
320
|
-
if (hit && hit.size === info.size && hit.mtimeMs === info.mtimeMs) {
|
|
321
|
-
entries.push(hit.entry);
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
const entry = runHeader(await readRecord(path), recorded);
|
|
325
|
-
cache.files[key] = {
|
|
326
|
-
size: info.size,
|
|
327
|
-
mtimeMs: info.mtimeMs,
|
|
328
|
-
entry
|
|
329
|
-
};
|
|
330
|
-
entries.push(entry);
|
|
331
|
-
changed = true;
|
|
332
|
-
} catch (error) {
|
|
333
|
-
if (inFlux(error)) continue;
|
|
334
|
-
if (!(error instanceof HistoryError) && !(error instanceof SyntaxError)) throw error;
|
|
335
|
-
warnUnreadable(path, error);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
if (changed) await writeCache(root, cache);
|
|
339
|
-
return entries;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Best-effort: another reader (a studio serving parallel requests, a second `reeval`) may be
|
|
343
|
-
* replacing the same file, which Windows refuses. The cache is only a speed-up.
|
|
344
|
-
*/
|
|
345
|
-
async function writeCache(root, cache) {
|
|
346
|
-
const tmp = `${cacheFile(root)}.${tmpName()}`;
|
|
347
|
-
try {
|
|
348
|
-
await mkdir(dirname(cacheFile(root)), { recursive: true });
|
|
349
|
-
await writeFile(tmp, JSON.stringify(cache));
|
|
350
|
-
await rename(tmp, cacheFile(root));
|
|
351
|
-
} catch {
|
|
352
|
-
await rm(tmp, { force: true }).catch(() => {});
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* `<dir>/.tmp-<runId>.claim`: whoever creates it owns `<dir>/<runId>/` and `<dir>/<runId>.json`
|
|
357
|
-
* until it's removed. It holds `<pid>\n<host>\n<token>\n`, linked into place whole.
|
|
358
|
-
*/
|
|
359
|
-
const claimFile = (dir, runId) => join(dir, `.tmp-${runId}.claim`);
|
|
360
|
-
const busy = (runId, file) => new HistoryError(`${runId} is being recorded by another process right now. Try again once it finishes; if no reeval is running, delete ${fromCwd(file)}.`);
|
|
361
|
-
/** A claim whose process is gone on this host. Another host's can't be probed, so it holds. */
|
|
362
|
-
function claimGone(held) {
|
|
363
|
-
const [pidLine, host] = held.split("\n");
|
|
364
|
-
const pid = Number(pidLine);
|
|
365
|
-
if (!Number.isInteger(pid) || pid <= 0 || !host) return true;
|
|
366
|
-
if (host !== hostname()) return false;
|
|
367
|
-
try {
|
|
368
|
-
process.kill(pid, 0);
|
|
369
|
-
return false;
|
|
370
|
-
} catch (error) {
|
|
371
|
-
return error.code === "ESRCH";
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Removes the stale claim `held`, and only it. Breakers of one claim take
|
|
376
|
-
* `<claim>.<hash of held>.break` first, so only one at a time may unlink it; while `held` is in
|
|
377
|
-
* place nobody else can remove or replace it, so reading it then unlinking it is safe.
|
|
378
|
-
*/
|
|
379
|
-
async function breakClaim(file, held, runId) {
|
|
380
|
-
const lock = `${file}.${sha256(held).slice(0, 12)}.break`;
|
|
381
|
-
try {
|
|
382
|
-
await writeFile(lock, "", { flag: "wx" });
|
|
383
|
-
} catch (error) {
|
|
384
|
-
if (error.code === "EEXIST" || inFlux(error)) throw busy(runId, file);
|
|
385
|
-
throw error;
|
|
386
|
-
}
|
|
387
|
-
try {
|
|
388
|
-
let now;
|
|
389
|
-
try {
|
|
390
|
-
now = await readFile(file, "utf8");
|
|
391
|
-
} catch (error) {
|
|
392
|
-
if (isMissing(error)) return;
|
|
393
|
-
if (inFlux(error)) throw busy(runId, file);
|
|
394
|
-
throw error;
|
|
395
|
-
}
|
|
396
|
-
if (now === held) await unlink(file);
|
|
397
|
-
} finally {
|
|
398
|
-
await unlink(lock).catch(() => {});
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/** Takes `runId`'s claim in `dir`, breaking one a dead process left; returns its release. */
|
|
402
|
-
async function claimRun(dir, runId) {
|
|
403
|
-
const file = claimFile(dir, runId);
|
|
404
|
-
const body = `${process.pid}\n${hostname()}\n${randomBytes(6).toString("hex")}\n`;
|
|
405
|
-
const tmp = `${file}.${tmpName()}`;
|
|
406
|
-
await writeFile(tmp, body);
|
|
407
|
-
try {
|
|
408
|
-
for (let tries = 0; tries < 3; tries++) {
|
|
409
|
-
try {
|
|
410
|
-
await link(tmp, file);
|
|
411
|
-
return async () => {
|
|
412
|
-
if (await readFile(file, "utf8").catch(() => null) === body) await unlink(file).catch(() => {});
|
|
413
|
-
};
|
|
414
|
-
} catch (error) {
|
|
415
|
-
if (![
|
|
416
|
-
"EEXIST",
|
|
417
|
-
"EPERM",
|
|
418
|
-
"EBUSY"
|
|
419
|
-
].includes(error.code ?? "")) throw error;
|
|
420
|
-
}
|
|
421
|
-
let held;
|
|
422
|
-
try {
|
|
423
|
-
held = await readFile(file, "utf8");
|
|
424
|
-
} catch (error) {
|
|
425
|
-
if (isMissing(error)) continue;
|
|
426
|
-
if (inFlux(error)) throw busy(runId, file);
|
|
427
|
-
throw error;
|
|
428
|
-
}
|
|
429
|
-
if (!claimGone(held)) throw busy(runId, file);
|
|
430
|
-
await breakClaim(file, held, runId);
|
|
431
|
-
}
|
|
432
|
-
throw busy(runId, file);
|
|
433
|
-
} finally {
|
|
434
|
-
await unlink(tmp).catch(() => {});
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* A record its continuation replaces: the run stopped before it finished, or `next` ran one of
|
|
439
|
-
* its infra errors again and keeps that error in the attempt's `retries`.
|
|
440
|
-
*/
|
|
441
|
-
const replaceable = (bytes, where, next) => {
|
|
442
|
-
try {
|
|
443
|
-
const was = parseRecord(bytes, where);
|
|
444
|
-
if (was.status === "interrupted" || was.status === "budget") return true;
|
|
445
|
-
const now = parseRecord(next, where);
|
|
446
|
-
const retried = new Map(now.evals.flatMap((e) => e.attempts).map((a) => [a.key, a.retries ?? []]));
|
|
447
|
-
return was.evals.flatMap((e) => e.attempts).some((a) => a.outcome === "infra_error" && retried.get(a.key)?.some((r) => r.at === a.startedAt && r.error.message === a.error?.message));
|
|
448
|
-
} catch {
|
|
449
|
-
return false;
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
const readIfThere = (path) => readFile(path).catch((error) => {
|
|
453
|
-
if (isMissing(error)) return null;
|
|
454
|
-
throw error;
|
|
455
|
-
});
|
|
456
|
-
/**
|
|
457
|
-
* Claims the run, then writes `<dir>/<runId>/` (artifacts, and the snapshots `moves` brings in
|
|
458
|
-
* by renaming), then `<dir>/<runId>.json` (the record). The record lands last and create-only, so a reader never sees a half-written run, and
|
|
459
|
-
* a run is never rewritten, except an interrupted or budget-stopped one by its resumed run, and a
|
|
460
|
-
* finished one by its `--retry-errors`.
|
|
461
|
-
*/
|
|
462
|
-
async function writeRun(dir, record, artifacts, moves = /* @__PURE__ */ new Map()) {
|
|
463
|
-
const recordPath = recordFile(dir, record.runId);
|
|
464
|
-
const artifactDir = artifacts.size > 0 ? runDir(dir, record.runId) : null;
|
|
465
|
-
const bytes = encodeRecord(record);
|
|
466
|
-
if ((await readIfThere(recordPath))?.equals(bytes)) return {
|
|
467
|
-
recordPath,
|
|
468
|
-
artifactDir,
|
|
469
|
-
created: false
|
|
470
|
-
};
|
|
471
|
-
await mkdir(dir, { recursive: true });
|
|
472
|
-
const release = await claimRun(dir, record.runId);
|
|
473
|
-
try {
|
|
474
|
-
return await writeClaimed(dir, record.runId, bytes, artifacts, moves);
|
|
475
|
-
} finally {
|
|
476
|
-
await release();
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
/** What most likely makes a run's new record differ from the recorded one, for the refusal. */
|
|
480
|
-
function likelyChange(existing, bytes, runId) {
|
|
481
|
-
const parse = (b) => {
|
|
482
|
-
try {
|
|
483
|
-
return JSON.parse(b.toString());
|
|
484
|
-
} catch {
|
|
485
|
-
return null;
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
const [was, now] = [parse(existing), parse(bytes)];
|
|
489
|
-
if (was && now && !isDeepStrictEqual(was.debug, now.debug)) {
|
|
490
|
-
const { debug: _was, ...before } = was;
|
|
491
|
-
const { debug: _now, ...after } = now;
|
|
492
|
-
if (isDeepStrictEqual(before, after)) return `its debug data differs: .reeval/debug/${runId} was pruned or changed since it was recorded, or history.debug is another level`;
|
|
493
|
-
}
|
|
494
|
-
return "another --artifacts level?";
|
|
495
|
-
}
|
|
496
|
-
async function writeClaimed(dir, runId, bytes, artifacts, moves) {
|
|
497
|
-
const recordPath = recordFile(dir, runId);
|
|
498
|
-
const artifactDir = artifacts.size > 0 ? runDir(dir, runId) : null;
|
|
499
|
-
const existing = await readIfThere(recordPath);
|
|
500
|
-
if (existing?.equals(bytes)) return {
|
|
501
|
-
recordPath,
|
|
502
|
-
artifactDir,
|
|
503
|
-
created: false
|
|
504
|
-
};
|
|
505
|
-
if (existing && !replaceable(existing, recordPath, bytes)) throw new HistoryError(`${runId} is already recorded with different content (${likelyChange(existing, bytes, runId)}). Recorded runs are never rewritten.`);
|
|
506
|
-
const staging = artifactDir ? join(dir, `.tmp-${tmpName()}`) : null;
|
|
507
|
-
try {
|
|
508
|
-
if (staging) {
|
|
509
|
-
for (const [path, content] of artifacts) {
|
|
510
|
-
const file = join(staging, ...path.split("/"));
|
|
511
|
-
await mkdir(dirname(file), { recursive: true });
|
|
512
|
-
await writeFile(file, content);
|
|
513
|
-
}
|
|
514
|
-
for (const [path, source] of moves) {
|
|
515
|
-
const target = join(staging, ...path.split("/"));
|
|
516
|
-
await mkdir(dirname(target), { recursive: true });
|
|
517
|
-
await rename(source, target);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
if (existing) {
|
|
521
|
-
const old = join(dir, `.tmp-${tmpName()}`);
|
|
522
|
-
const tmp = join(dir, `.tmp-${tmpName()}.json`);
|
|
523
|
-
await writeFile(tmp, bytes);
|
|
524
|
-
let moved = false;
|
|
525
|
-
try {
|
|
526
|
-
await rename(runDir(dir, runId), old).then(() => {
|
|
527
|
-
moved = true;
|
|
528
|
-
}, (error) => {
|
|
529
|
-
if (error.code !== "ENOENT") throw error;
|
|
530
|
-
});
|
|
531
|
-
if (staging && artifactDir) await rename(staging, artifactDir);
|
|
532
|
-
await rename(tmp, recordPath);
|
|
533
|
-
} catch (error) {
|
|
534
|
-
if (moved) {
|
|
535
|
-
await rm(runDir(dir, runId), {
|
|
536
|
-
recursive: true,
|
|
537
|
-
force: true
|
|
538
|
-
});
|
|
539
|
-
await rename(old, runDir(dir, runId));
|
|
540
|
-
}
|
|
541
|
-
throw error;
|
|
542
|
-
} finally {
|
|
543
|
-
await rm(tmp, { force: true });
|
|
544
|
-
}
|
|
545
|
-
await rm(old, {
|
|
546
|
-
recursive: true,
|
|
547
|
-
force: true
|
|
548
|
-
});
|
|
549
|
-
return {
|
|
550
|
-
recordPath,
|
|
551
|
-
artifactDir,
|
|
552
|
-
created: true
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
await rm(runDir(dir, runId), {
|
|
556
|
-
recursive: true,
|
|
557
|
-
force: true
|
|
558
|
-
});
|
|
559
|
-
if (staging && artifactDir) await rename(staging, artifactDir);
|
|
560
|
-
} finally {
|
|
561
|
-
if (staging) await rm(staging, {
|
|
562
|
-
recursive: true,
|
|
563
|
-
force: true
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
const tmp = join(dir, `.tmp-${tmpName()}.json`);
|
|
567
|
-
await writeFile(tmp, bytes);
|
|
568
|
-
try {
|
|
569
|
-
await link(tmp, recordPath);
|
|
570
|
-
} catch (error) {
|
|
571
|
-
if (error.code === "EEXIST") throw new HistoryError(`${recordPath} was written by another process meanwhile`);
|
|
572
|
-
throw error;
|
|
573
|
-
} finally {
|
|
574
|
-
await unlink(tmp).catch(() => {});
|
|
575
|
-
}
|
|
576
|
-
return {
|
|
577
|
-
recordPath,
|
|
578
|
-
artifactDir,
|
|
579
|
-
created: true
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
const failed = (x) => x.outcome === "fail" || x.outcome === "infra_error";
|
|
583
|
-
const keeps = (x, level) => level === "all" || level === "failures" && failed(x);
|
|
584
|
-
/** Each capture's PNG, then the page facts beside it. */
|
|
585
|
-
const withPages = (refs) => refs.flatMap((r) => r.capture?.page ? [r, r.capture.page] : [r]);
|
|
586
|
-
const attemptRefs = (a) => [
|
|
587
|
-
...Object.values(a.files).flatMap((v) => Array.isArray(v) ? withPages(v) : v ? [v] : []),
|
|
588
|
-
...a.checks.flatMap((c) => c.log ? [c.log] : []),
|
|
589
|
-
...(a.answers ?? []).flatMap((q) => q.input ? [q.input] : [])
|
|
590
|
-
];
|
|
591
|
-
/** Every file under `dir`, by posix path, with its bytes. */
|
|
592
|
-
async function filesUnder(dir, at = "") {
|
|
593
|
-
const entries = await readdir(join(dir, at), { withFileTypes: true }).catch(() => []);
|
|
594
|
-
const out = [];
|
|
595
|
-
for (const entry of entries) {
|
|
596
|
-
const path = at ? `${at}/${entry.name}` : entry.name;
|
|
597
|
-
if (entry.isDirectory()) out.push(...await filesUnder(dir, path));
|
|
598
|
-
else if (entry.isFile()) out.push([path, await readFile(join(dir, path))]);
|
|
599
|
-
}
|
|
600
|
-
return out;
|
|
601
|
-
}
|
|
602
|
-
const DEBUG_FILES = {
|
|
603
|
-
requests: [REQUESTS_FILE],
|
|
604
|
-
all: [
|
|
605
|
-
REQUESTS_FILE,
|
|
606
|
-
DEBUG_LOG,
|
|
607
|
-
TRACE_FILE
|
|
608
|
-
]
|
|
609
|
-
};
|
|
610
|
-
/**
|
|
611
|
-
* The run's debug data `level` names, from `.reeval/debug/<run>`, written to `staging` for the
|
|
612
|
-
* upload; a file the secret scan finds something in is left out and named in `dropped`.
|
|
613
|
-
*/
|
|
614
|
-
async function stageDebug(root, runId, options) {
|
|
615
|
-
const wanted = DEBUG_FILES[options.level];
|
|
616
|
-
const debug = {
|
|
617
|
-
level: options.level,
|
|
618
|
-
files: []
|
|
619
|
-
};
|
|
620
|
-
const dropped = [];
|
|
621
|
-
await rm(options.staging, {
|
|
622
|
-
recursive: true,
|
|
623
|
-
force: true
|
|
624
|
-
});
|
|
625
|
-
for (const [path, bytes] of await filesUnder(join(debugRoot(root), runId))) {
|
|
626
|
-
if (!wanted.includes(path.slice(path.lastIndexOf("/") + 1))) continue;
|
|
627
|
-
const findings = scanText(path, Buffer.from(bytes).toString());
|
|
628
|
-
if (findings.length > 0) {
|
|
629
|
-
dropped.push({
|
|
630
|
-
path,
|
|
631
|
-
note: `${SECRET_NOTE} (${findingSummary(findings)})`
|
|
632
|
-
});
|
|
633
|
-
continue;
|
|
634
|
-
}
|
|
635
|
-
const file = join(options.staging, ...path.split("/"));
|
|
636
|
-
await mkdir(dirname(file), { recursive: true });
|
|
637
|
-
await writeFile(file, bytes);
|
|
638
|
-
debug.files.push({
|
|
639
|
-
path,
|
|
640
|
-
sha256: sha256(bytes),
|
|
641
|
-
bytes: bytes.length
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
if (dropped.length) debug.dropped = dropped;
|
|
645
|
-
return debug.files.length || dropped.length ? debug : void 0;
|
|
646
|
-
}
|
|
647
|
-
/** Why a patch that looked like it held a secret isn't in the record. Starts with `SECRET_NOTE`. */
|
|
648
|
-
const SECRET_NOTE = "not kept: it looked like it held a secret";
|
|
649
|
-
/** Promotes a scratch run into the committed history folder. reeval never commits it. */
|
|
650
|
-
async function recordRun(options) {
|
|
651
|
-
const { runId, artifacts: level } = options;
|
|
652
|
-
const source = scratchDir(options.root);
|
|
653
|
-
let scratch;
|
|
654
|
-
try {
|
|
655
|
-
scratch = await readRecord(join(source, `${runId}.json`));
|
|
656
|
-
} catch (error) {
|
|
657
|
-
if (isMissing(error)) throw new HistoryError(`No run ${runId} in .reeval/runs`);
|
|
658
|
-
throw error;
|
|
659
|
-
}
|
|
660
|
-
if (scratch.status !== "complete" && !options.allowIncomplete) throw new HistoryError(`Run ${runId} was ${scratch.status}; pass --allow-incomplete to record it`);
|
|
661
|
-
const record = structuredClone(scratch);
|
|
662
|
-
record.artifacts = level;
|
|
663
|
-
const files = /* @__PURE__ */ new Map();
|
|
664
|
-
const keep = async (ref) => {
|
|
665
|
-
const bytes = await readFile(join(source, runId, ...ref.path.split("/")));
|
|
666
|
-
if (sha256(bytes) !== ref.sha256) throw new HistoryError(`${runId}/${ref.path} changed since the run wrote it`);
|
|
667
|
-
files.set(ref.path, bytes);
|
|
668
|
-
return bytes;
|
|
669
|
-
};
|
|
670
|
-
for (const e of record.evals) {
|
|
671
|
-
const shown = /* @__PURE__ */ new Set();
|
|
672
|
-
for (const q of e.answers ?? []) {
|
|
673
|
-
if (!q.input) continue;
|
|
674
|
-
if (level === "none" || !keeps(e, level)) {
|
|
675
|
-
delete q.input;
|
|
676
|
-
continue;
|
|
677
|
-
}
|
|
678
|
-
const input = JSON.parse(Buffer.from(await keep(q.input)).toString());
|
|
679
|
-
for (const s of input.calls.flatMap((c) => c.screenshots ?? [])) if ("path" in s && s.path) shown.add(s.path);
|
|
680
|
-
}
|
|
681
|
-
const whole = failed(e) && !e.attempts.some(failed);
|
|
682
|
-
for (const a of e.attempts) {
|
|
683
|
-
const cellFailed = e.attempts.some((b) => b.cell === a.cell && failed(b));
|
|
684
|
-
const cell = e.cells.find((c) => c.key === a.cell);
|
|
685
|
-
const all = whole || cell !== void 0 && failed(cell) && !cellFailed;
|
|
686
|
-
if (level !== "none" && (all || keeps(a, level))) {
|
|
687
|
-
for (const ref of attemptRefs(a)) await keep(ref);
|
|
688
|
-
continue;
|
|
689
|
-
}
|
|
690
|
-
const caseFailed = e.attempts.some((b) => b.cell === a.cell && b.case === a.case && failed(b));
|
|
691
|
-
const diff = level !== "none" && caseFailed ? a.files.diff : void 0;
|
|
692
|
-
const screenshots = (a.files.artifacts ?? []).filter((r) => shown.has(r.path));
|
|
693
|
-
a.files = {
|
|
694
|
-
...diff ? { diff } : {},
|
|
695
|
-
...screenshots.length ? { artifacts: screenshots } : {}
|
|
696
|
-
};
|
|
697
|
-
for (const ref of [...diff ? [diff] : [], ...withPages(screenshots)]) await keep(ref);
|
|
698
|
-
for (const c of a.checks) delete c.log;
|
|
699
|
-
for (const q of a.answers ?? []) delete q.input;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
const patch = record.git?.worktreePatch;
|
|
703
|
-
let droppedPatch = [];
|
|
704
|
-
if (patch && record.git && level !== "none") {
|
|
705
|
-
const bytes = await readFile(join(source, runId, patch.path));
|
|
706
|
-
if (sha256(bytes) !== patch.sha256) throw new HistoryError(`${runId}/${patch.path} changed since the run wrote it`);
|
|
707
|
-
const findings = options.skipSecretScan ? [] : scanText(patch.path, bytes.toString());
|
|
708
|
-
if (findings.length > 0) {
|
|
709
|
-
droppedPatch = findingLines(patch.path, findings);
|
|
710
|
-
record.git.worktreePatch = null;
|
|
711
|
-
record.git.worktreePatchNote = `${SECRET_NOTE} (${findingSummary(findings)})`;
|
|
712
|
-
} else files.set(patch.path, bytes);
|
|
713
|
-
} else if (patch && record.git) {
|
|
714
|
-
record.git.worktreePatch = null;
|
|
715
|
-
record.git.worktreePatchNote = "not kept: recorded with artifacts 'none'";
|
|
716
|
-
}
|
|
717
|
-
const remarkBytes = await readFile(join(source, runId, REMARKS_FILE)).catch(() => null);
|
|
718
|
-
let remarks = null;
|
|
719
|
-
if (remarkBytes) try {
|
|
720
|
-
remarks = readableRemarks(JSON.parse(remarkBytes.toString()), REMARKS_FILE);
|
|
721
|
-
files.set(REMARKS_FILE, remarkBytes);
|
|
722
|
-
} catch {}
|
|
723
|
-
if (level !== "none") files.set("summary.md", Buffer.from(renderSummary(record, { remarks })));
|
|
724
|
-
const debug = options.debug && await stageDebug(options.root, runId, options.debug);
|
|
725
|
-
if (debug) record.debug = debug;
|
|
726
|
-
if (!options.skipSecretScan) {
|
|
727
|
-
const found = [[`${runId}.json`, scanText(`${runId}.json`, encodeRecord(record).toString())], ...[...files].filter(([path]) => TEXT_FILE.test(path)).map(([path, bytes]) => [`${runId}/${path}`, scanText(path, Buffer.from(bytes).toString())])].filter(([, findings]) => findings.length > 0);
|
|
728
|
-
if (found.length > 0) {
|
|
729
|
-
const lines = found.flatMap(([path, findings]) => findingLines(path, findings));
|
|
730
|
-
throw new HistoryError(`Refusing to record ${runId}: ${found.length} file(s) look like they contain a secret:\n${lines.map((l) => ` ${l}`).join("\n")}\nCheck them, then pass --skip-secret-scan if these are false positives.`);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
const committed = options.committed ?? true;
|
|
734
|
-
if (committed) {
|
|
735
|
-
await ensureHistoryGitignore(options.historyDir);
|
|
736
|
-
await ensureHistoryGitattributes(options.historyDir);
|
|
737
|
-
}
|
|
738
|
-
const written = await writeRun(options.historyDir, record, files);
|
|
739
|
-
const bytes = [...files.values()].reduce((n, b) => n + b.length, encodeRecord(record).length);
|
|
740
|
-
if (!committed) return {
|
|
741
|
-
...written,
|
|
742
|
-
files: files.size,
|
|
743
|
-
bytes,
|
|
744
|
-
droppedPatch,
|
|
745
|
-
ignored: [],
|
|
746
|
-
...debug ? { debug } : {}
|
|
747
|
-
};
|
|
748
|
-
const folderFiles = [historyGitignorePath(options.historyDir), historyGitattributesPath(options.historyDir)];
|
|
749
|
-
if (!written.created) {
|
|
750
|
-
const ignored = await ignoredRecordedFiles(options.root, folderFiles);
|
|
751
|
-
return {
|
|
752
|
-
...written,
|
|
753
|
-
files: files.size,
|
|
754
|
-
bytes,
|
|
755
|
-
droppedPatch,
|
|
756
|
-
ignored
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
const writtenPaths = [
|
|
760
|
-
written.recordPath,
|
|
761
|
-
...folderFiles,
|
|
762
|
-
...[...files.keys()].map((path) => join(written.artifactDir ?? options.historyDir, ...path.split("/")))
|
|
763
|
-
];
|
|
764
|
-
const ignored = await ignoredRecordedFiles(options.root, writtenPaths);
|
|
765
|
-
return {
|
|
766
|
-
...written,
|
|
767
|
-
files: files.size,
|
|
768
|
-
bytes,
|
|
769
|
-
droppedPatch,
|
|
770
|
-
ignored
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
export { writeRun as _, filesUnder as a, readRecord as c, recordNames as d, recordRun as f, warnUnreadable as g, scratchDir as h, encodeRecord as i, recentRecords as l, runDir as m, NewerRecordError as n, listRuns as o, replaceable as p, SECRET_NOTE as r, parseRecord as s, HistoryError as t, recordFile as u, findingLines as v, scanText as y };
|
|
774
|
-
|
|
775
|
-
//# sourceMappingURL=files-CX_mmvCc.js.map
|