@tangle-network/agent-eval 0.172.1 → 0.173.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 +19 -0
- package/README.md +17 -2
- package/dist/adapters/http.d.ts +2 -2
- package/dist/analyst/index.d.ts +13 -13
- package/dist/analyst/index.js +7 -6
- package/dist/analyst/index.js.map +1 -1
- package/dist/{attestation-CJBGmMVh.d.ts → attestation-c1QvaBdX.d.ts} +2 -2
- package/dist/{attestation-CJBGmMVh.d.ts.map → attestation-c1QvaBdX.d.ts.map} +1 -1
- package/dist/{backend-integrity-e79K3UPD.d.ts → backend-integrity-CeuTgqsd.d.ts} +3 -4
- package/dist/backend-integrity-CeuTgqsd.d.ts.map +1 -0
- package/dist/{benchmark-h-h4bfqj.d.ts → benchmark-BjLGkfnN.d.ts} +3 -3
- package/dist/{benchmark-h-h4bfqj.d.ts.map → benchmark-BjLGkfnN.d.ts.map} +1 -1
- package/dist/{benchmark-command--qeZUHbu.js → benchmark-command-9S20PRel.js} +9 -9
- package/dist/{benchmark-command--qeZUHbu.js.map → benchmark-command-9S20PRel.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +5 -5
- package/dist/benchmarks/index.js +3 -3
- package/dist/{bounded-process-VIi0KSL2.js → bounded-process-BBZob7vl.js} +30 -7
- package/dist/bounded-process-BBZob7vl.js.map +1 -0
- package/dist/builder-eval/index.d.ts +3 -3
- package/dist/builder-eval/index.js +2 -2
- package/dist/campaign/index.d.ts +9 -9
- package/dist/campaign/index.js +6 -6
- package/dist/{campaign-Dp35pBbS.js → campaign-pxS0wmo4.js} +8 -8
- package/dist/{campaign-Dp35pBbS.js.map → campaign-pxS0wmo4.js.map} +1 -1
- package/dist/chat-client-Db4bqYfA.js +115 -0
- package/dist/chat-client-Db4bqYfA.js.map +1 -0
- package/dist/{chat-json-call-5Jxna-aV.js → chat-json-call-C26igCih.js} +16 -6
- package/dist/chat-json-call-C26igCih.js.map +1 -0
- package/dist/cli.js +31 -17
- package/dist/cli.js.map +1 -1
- package/dist/{client-BvwNkIRN.js → client-BlLY6o2w.js} +2 -2
- package/dist/{client-BvwNkIRN.js.map → client-BlLY6o2w.js.map} +1 -1
- package/dist/{client-Df7wdslk.d.ts → client-DlqdbM7n.d.ts} +4 -4
- package/dist/{client-Df7wdslk.d.ts.map → client-DlqdbM7n.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +13 -13
- package/dist/contract/index.js +202 -10
- package/dist/contract/index.js.map +1 -1
- package/dist/{counterfactual-Bee5_BIn.d.ts → counterfactual-CLgrwhkY.d.ts} +4 -4
- package/dist/{counterfactual-Bee5_BIn.d.ts.map → counterfactual-CLgrwhkY.d.ts.map} +1 -1
- package/dist/{chat-client-DI79OPye.js → default-registry-B0bKikCb.js} +3 -39
- package/dist/default-registry-B0bKikCb.js.map +1 -0
- package/dist/{default-registry-XxedTLwu.d.ts → default-registry-BKwc8bN5.d.ts} +6 -6
- package/dist/{default-registry-XxedTLwu.d.ts.map → default-registry-BKwc8bN5.d.ts.map} +1 -1
- package/dist/{define-agent-eval-0wW7gFhr.d.ts → define-agent-eval-CY6qdlGV.d.ts} +6 -6
- package/dist/{define-agent-eval-0wW7gFhr.d.ts.map → define-agent-eval-CY6qdlGV.d.ts.map} +1 -1
- package/dist/{define-agent-eval-jS8xj_Q_.js → define-agent-eval-D_i_s69h.js} +7 -7
- package/dist/{define-agent-eval-jS8xj_Q_.js.map → define-agent-eval-D_i_s69h.js.map} +1 -1
- package/dist/{dspy-rlm-engine-CS3qcCEk.js → dspy-rlm-engine-D5byiHn9.js} +5 -6
- package/dist/dspy-rlm-engine-D5byiHn9.js.map +1 -0
- package/dist/{emitter-Bvnu0VzL.d.ts → emitter-Cs0egaFd.d.ts} +3 -3
- package/dist/{emitter-Bvnu0VzL.d.ts.map → emitter-Cs0egaFd.d.ts.map} +1 -1
- package/dist/{engine-BfRay1qD.d.ts → engine-DhFir3Ys.d.ts} +23 -8
- package/dist/{engine-BfRay1qD.d.ts.map → engine-DhFir3Ys.d.ts.map} +1 -1
- package/dist/{eval-campaign-JDTeE6Pl.js → eval-campaign-BeAjdhzC.js} +2 -2
- package/dist/{eval-campaign-JDTeE6Pl.js.map → eval-campaign-BeAjdhzC.js.map} +1 -1
- package/dist/{exact-types-BEecmnWm.d.ts → exact-types-BKOEILRP.d.ts} +2 -2
- package/dist/{exact-types-BEecmnWm.d.ts.map → exact-types-BKOEILRP.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +4 -4
- package/dist/{external-optimizer-contracts-szBJ_1vh.d.ts → external-optimizer-contracts-CQCpyrIL.d.ts} +2 -2
- package/dist/{external-optimizer-contracts-szBJ_1vh.d.ts.map → external-optimizer-contracts-CQCpyrIL.d.ts.map} +1 -1
- package/dist/{external-optimizer-process-CQxylYeG.js → external-optimizer-process-Cq_Pg15r.js} +2 -2
- package/dist/{external-optimizer-process-CQxylYeG.js.map → external-optimizer-process-Cq_Pg15r.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-Cex8Da2i.js → external-optimizer-subprocess-DgNebftP.js} +2 -2
- package/dist/{external-optimizer-subprocess-Cex8Da2i.js.map → external-optimizer-subprocess-DgNebftP.js.map} +1 -1
- package/dist/failure-cluster-OldNRoAt.d.ts +154 -0
- package/dist/failure-cluster-OldNRoAt.d.ts.map +1 -0
- package/dist/{feedback-trajectory-DIqpCyF0.d.ts → feedback-trajectory-CMnv_uYs.d.ts} +6 -6
- package/dist/{feedback-trajectory-DIqpCyF0.d.ts.map → feedback-trajectory-CMnv_uYs.d.ts.map} +1 -1
- package/dist/{heldout-gate-JgNRDZwZ.d.ts → heldout-gate-Df5hsqmm.d.ts} +7 -7
- package/dist/{heldout-gate-JgNRDZwZ.d.ts.map → heldout-gate-Df5hsqmm.d.ts.map} +1 -1
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +1 -1
- package/dist/{index-DnglhM0A.d.ts → index-BQqOjerE.d.ts} +94 -13
- package/dist/index-BQqOjerE.d.ts.map +1 -0
- package/dist/{index-_vPrVMRX.d.ts → index-CFDffsKz.d.ts} +11 -11
- package/dist/{index-_vPrVMRX.d.ts.map → index-CFDffsKz.d.ts.map} +1 -1
- package/dist/{index-DDAPhUJJ.d.ts → index-D0Db5X-4.d.ts} +45 -9
- package/dist/index-D0Db5X-4.d.ts.map +1 -0
- package/dist/{index-DMoxLG8P.d.ts → index-e7LXeRVa.d.ts} +3 -3
- package/dist/{index-DMoxLG8P.d.ts.map → index-e7LXeRVa.d.ts.map} +1 -1
- package/dist/index.d.ts +130 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -41
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-08F022xN.d.ts → insight-report-DETqPc_A.d.ts} +4 -4
- package/dist/{insight-report-08F022xN.d.ts.map → insight-report-DETqPc_A.d.ts.map} +1 -1
- package/dist/{integrity-B_EDELom.d.ts → integrity-BKTcA-HP.d.ts} +3 -3
- package/dist/{integrity-B_EDELom.d.ts.map → integrity-BKTcA-HP.d.ts.map} +1 -1
- package/dist/{kind-factory-DMeEoMQZ.js → kind-factory-gP6lDySe.js} +164 -149
- package/dist/kind-factory-gP6lDySe.js.map +1 -0
- package/dist/{llm-client-BFMRpmqb.js → llm-client-CxQtdtd6.js} +12 -5
- package/dist/llm-client-CxQtdtd6.js.map +1 -0
- package/dist/{llm-judge-aQHIk5_-.js → llm-judge-B2YxbAJb.js} +81 -7
- package/dist/{llm-judge-aQHIk5_-.js.map → llm-judge-B2YxbAJb.js.map} +1 -1
- package/dist/{matrix-Ch8JO1pG.d.ts → matrix-DGu8KhSs.d.ts} +2 -2
- package/dist/{matrix-Ch8JO1pG.d.ts.map → matrix-DGu8KhSs.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +100 -5
- package/dist/meta-eval/index.d.ts.map +1 -1
- package/dist/meta-eval/index.js +200 -2
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/{mint-DjfDUMHr.js → mint-vWOdD8Ae.js} +2 -2
- package/dist/{mint-DjfDUMHr.js.map → mint-vWOdD8Ae.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/pipelines/index.d.ts +5 -5
- package/dist/pipelines/index.js +3 -3
- package/dist/{pre-registration-DHz6P_6f.d.ts → pre-registration-BoI4ucR3.d.ts} +2 -2
- package/dist/{pre-registration-DHz6P_6f.d.ts.map → pre-registration-BoI4ucR3.d.ts.map} +1 -1
- package/dist/{produced-state-CxmbFxFd.js → produced-state-7VYDwtkk.js} +3 -3
- package/dist/{produced-state-CxmbFxFd.js.map → produced-state-7VYDwtkk.js.map} +1 -1
- package/dist/{promotion-policy-BBBcz5_3.d.ts → promotion-policy-CvMda3kU.d.ts} +2 -2
- package/dist/{promotion-policy-BBBcz5_3.d.ts.map → promotion-policy-CvMda3kU.d.ts.map} +1 -1
- package/dist/{provenance-Dp-vvyrU.d.ts → provenance-CRY67X50.d.ts} +39 -165
- package/dist/provenance-CRY67X50.d.ts.map +1 -0
- package/dist/{query-BPGMVlbM.js → query-D1nLIKt7.js} +2 -2
- package/dist/{query-BPGMVlbM.js.map → query-D1nLIKt7.js.map} +1 -1
- package/dist/{query-Na5gEIGd.d.ts → query-D6W6MaGx.d.ts} +3 -3
- package/dist/{query-Na5gEIGd.d.ts.map → query-D6W6MaGx.d.ts.map} +1 -1
- package/dist/{registry-xEb_xfns.d.ts → registry-7pOUBrtX.d.ts} +4 -4
- package/dist/{registry-xEb_xfns.d.ts.map → registry-7pOUBrtX.d.ts.map} +1 -1
- package/dist/{release-confidence-D6lQw_o7.d.ts → release-confidence-BAcNYOf1.d.ts} +4 -4
- package/dist/{release-confidence-D6lQw_o7.d.ts.map → release-confidence-BAcNYOf1.d.ts.map} +1 -1
- package/dist/{release-confidence-CzUHc4z4.js → release-confidence-BsGEg_xg.js} +3 -3
- package/dist/{release-confidence-CzUHc4z4.js.map → release-confidence-BsGEg_xg.js.map} +1 -1
- package/dist/reporting.d.ts +3 -3
- package/dist/reporting.js +1 -1
- package/dist/{researcher-CMUTQXD7.d.ts → researcher-jsW1X94L.d.ts} +7 -8
- package/dist/researcher-jsW1X94L.d.ts.map +1 -0
- package/dist/{reward-hacking-SkxYgT0x.js → reward-hacking-CKW4teig.js} +2 -2
- package/dist/{reward-hacking-SkxYgT0x.js.map → reward-hacking-CKW4teig.js.map} +1 -1
- package/dist/{reward-hacking-CgPRUesA.d.ts → reward-hacking-ZXEi9VCq.d.ts} +2 -2
- package/dist/{reward-hacking-CgPRUesA.d.ts.map → reward-hacking-ZXEi9VCq.d.ts.map} +1 -1
- package/dist/rl.d.ts +7 -7
- package/dist/rl.js +4 -4
- package/dist/rollout/index.d.ts +1 -1
- package/dist/rollout/index.js +2 -2
- package/dist/{rollout-Crypdx8s.js → rollout-C-znbbYg.js} +2 -2
- package/dist/{rollout-Crypdx8s.js.map → rollout-C-znbbYg.js.map} +1 -1
- package/dist/{rubric-predictive-validity-DluJLCKQ.d.ts → rubric-predictive-validity-Dl1dvKCv.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-DluJLCKQ.d.ts.map → rubric-predictive-validity-Dl1dvKCv.d.ts.map} +1 -1
- package/dist/{run-record-DQjRcYwA.d.ts → run-record-DTv1MdjK.d.ts} +2 -2
- package/dist/{run-record-DQjRcYwA.d.ts.map → run-record-DTv1MdjK.d.ts.map} +1 -1
- package/dist/{run-record-DLORoL7t.js → run-record-ZIsR9Fif.js} +2 -2
- package/dist/{run-record-DLORoL7t.js.map → run-record-ZIsR9Fif.js.map} +1 -1
- package/dist/{schema-DID1Cqct.d.ts → schema-CR5cpjQ3.d.ts} +57 -2
- package/dist/{schema-DID1Cqct.d.ts.map → schema-CR5cpjQ3.d.ts.map} +1 -1
- package/dist/{schema-CdIX2aHu.js → schema-CSf6qWgZ.js} +35 -1
- package/dist/{schema-CdIX2aHu.js.map → schema-CSf6qWgZ.js.map} +1 -1
- package/dist/semantic-concept-judge-Ct3QU7t5.js +780 -0
- package/dist/semantic-concept-judge-Ct3QU7t5.js.map +1 -0
- package/dist/{series-convergence-D9WgpXGi.d.ts → series-convergence-DeG33RpC.d.ts} +2 -2
- package/dist/{series-convergence-D9WgpXGi.d.ts.map → series-convergence-DeG33RpC.d.ts.map} +1 -1
- package/dist/{server-CCEnywOR.js → server-BR6onwZB.js} +2 -2
- package/dist/{server-CCEnywOR.js.map → server-BR6onwZB.js.map} +1 -1
- package/dist/{skillopt-optimization-method-LHi02MzH.js → skillopt-optimization-method-BzdphODy.js} +6 -6
- package/dist/{skillopt-optimization-method-LHi02MzH.js.map → skillopt-optimization-method-BzdphODy.js.map} +1 -1
- package/dist/{statistical-heldout-Yldkntvy.d.ts → statistical-heldout-DTyB_6-1.d.ts} +3 -3
- package/dist/{statistical-heldout-Yldkntvy.d.ts.map → statistical-heldout-DTyB_6-1.d.ts.map} +1 -1
- package/dist/{store-Cq9oOrI1.d.ts → store-BErPvYBr.d.ts} +2 -2
- package/dist/{store-Cq9oOrI1.d.ts.map → store-BErPvYBr.d.ts.map} +1 -1
- package/dist/{store-otlp-CHjBvWQY.js → store-otlp-Dow0pk_5.js} +2 -2
- package/dist/{store-otlp-CHjBvWQY.js.map → store-otlp-Dow0pk_5.js.map} +1 -1
- package/dist/{store-tool-spans-BvdUbeOB.d.ts → store-tool-spans-CCZNsihA.d.ts} +8 -8
- package/dist/{store-tool-spans-BvdUbeOB.d.ts.map → store-tool-spans-CCZNsihA.d.ts.map} +1 -1
- package/dist/{store-tool-spans-B9o6tU8f.js → store-tool-spans-CeNj_m2L.js} +3 -3
- package/dist/{store-tool-spans-B9o6tU8f.js.map → store-tool-spans-CeNj_m2L.js.map} +1 -1
- package/dist/storyboard/index.d.ts +1 -1
- package/dist/{summary-report-DRstQNBX.d.ts → summary-report-gMrbYawB.d.ts} +3 -3
- package/dist/{summary-report-DRstQNBX.d.ts.map → summary-report-gMrbYawB.d.ts.map} +1 -1
- package/dist/{task-failure-attributes-CBGtLS_H.js → task-failure-attributes-CZjZeBsY.js} +3 -3
- package/dist/{task-failure-attributes-CBGtLS_H.js.map → task-failure-attributes-CZjZeBsY.js.map} +1 -1
- package/dist/{tool-groups-DjwlMBvW.d.ts → tool-groups-Cp4Xdzrp.d.ts} +3 -3
- package/dist/tool-groups-Cp4Xdzrp.d.ts.map +1 -0
- package/dist/{tool-waste-CwGHzBzX.js → tool-waste-B9tdWV6g.js} +253 -6
- package/dist/tool-waste-B9tdWV6g.js.map +1 -0
- package/dist/{tool-waste-BrmLKxMw.d.ts → tool-waste-D23I0zWm.d.ts} +4 -4
- package/dist/{tool-waste-BrmLKxMw.d.ts.map → tool-waste-D23I0zWm.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +2 -2
- package/dist/traces.d.ts +10 -10
- package/dist/traces.js +7 -7
- package/dist/{trajectory-r1bQqvBQ.d.ts → trajectory-D7qrNvaN.d.ts} +3 -3
- package/dist/{trajectory-r1bQqvBQ.d.ts.map → trajectory-D7qrNvaN.d.ts.map} +1 -1
- package/dist/trajectory-replay/index.d.ts +3 -3
- package/dist/{types-CCZ34qmV.d.ts → types-BDV4PiMR.d.ts} +3 -3
- package/dist/{types-CCZ34qmV.d.ts.map → types-BDV4PiMR.d.ts.map} +1 -1
- package/dist/{types-nokrtr7M.d.ts → types-Ba5UQyVD.d.ts} +4 -4
- package/dist/{types-nokrtr7M.d.ts.map → types-Ba5UQyVD.d.ts.map} +1 -1
- package/dist/{types-DMoNFDWi.d.ts → types-DN2WdT5S.d.ts} +3 -3
- package/dist/{types-DMoNFDWi.d.ts.map → types-DN2WdT5S.d.ts.map} +1 -1
- package/dist/types-gvRsyJLh.d.ts +831 -0
- package/dist/types-gvRsyJLh.d.ts.map +1 -0
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/plants.md +69 -1
- package/docs/public-api.md +6 -4
- package/docs/trace-analysis.md +55 -8
- package/package.json +1 -1
- package/dist/backend-integrity-e79K3UPD.d.ts.map +0 -1
- package/dist/bounded-process-VIi0KSL2.js.map +0 -1
- package/dist/chat-client-DI79OPye.js.map +0 -1
- package/dist/chat-json-call-5Jxna-aV.js.map +0 -1
- package/dist/dspy-rlm-engine-CS3qcCEk.js.map +0 -1
- package/dist/failure-cluster-6YSvsKlp.d.ts +0 -58
- package/dist/failure-cluster-6YSvsKlp.d.ts.map +0 -1
- package/dist/index-DDAPhUJJ.d.ts.map +0 -1
- package/dist/index-DnglhM0A.d.ts.map +0 -1
- package/dist/kind-factory-DMeEoMQZ.js.map +0 -1
- package/dist/llm-client-BFMRpmqb.js.map +0 -1
- package/dist/provenance-Dp-vvyrU.d.ts.map +0 -1
- package/dist/raw-provider-sink-BU29Sh8h.d.ts +0 -134
- package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +0 -1
- package/dist/researcher-CMUTQXD7.d.ts.map +0 -1
- package/dist/semantic-concept-judge-I36eejJx.js +0 -382
- package/dist/semantic-concept-judge-I36eejJx.js.map +0 -1
- package/dist/tool-groups-DjwlMBvW.d.ts.map +0 -1
- package/dist/tool-waste-CwGHzBzX.js.map +0 -1
- package/dist/types-Bfk0uxRj.d.ts +0 -443
- package/dist/types-Bfk0uxRj.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-gvRsyJLh.d.ts","names":[],"sources":["../src/judge-families.ts","../src/integrity/served-model.ts","../src/trace/raw-provider-sink.ts","../src/llm-client.ts","../src/analyst/chat-client.ts","../src/types.ts"],"mappings":";;;;;;;;;;;;;KAWY;;;;;;;iBAkEI,YAAY,kBAAkB;UAc7B;;EAEf;;;;EAIA;;cAGW,yBAAyB;WAGlB,UAAU;WACV;EAHlB,YACE,iBACgB,UAAU,eACV;;;;;;;;;;;;;;;iBAoBJ,kBACd,kBACA,OAAM,2BACL;;;;KCnFS;;;;;;;;;;;UAYK;;EAEf;;EAEA;EACA,iBAAiB;;EAEjB,cAAc;EACd,SAAS;;EAET;;;;;;;;;;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;EACV,OAAO;EACP,WAAW;;EAEX,aAAa;EACb;EACA,WAAW;EACX,SAAS;;KAGC,WAAW,MAAM,YAAY,OAAO,eAAe,QAAQ;UAYtD;EACf;EACA;EACA;EACA"}
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as CustomTokenPricing, c as CostLedgerHandle } from "../cost-ledger-DbQdN3nO.js";
|
|
2
|
-
import { p as ChatClient } from "../types-
|
|
3
|
-
import { s as TraceStore } from "../store-
|
|
4
|
-
import { m as FeedbackTrajectoryStore } from "../feedback-trajectory-
|
|
2
|
+
import { p as ChatClient } from "../types-gvRsyJLh.js";
|
|
3
|
+
import { s as TraceStore } from "../store-BErPvYBr.js";
|
|
4
|
+
import { m as FeedbackTrajectoryStore } from "../feedback-trajectory-CMnv_uYs.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { ServerType } from "@hono/node-server";
|
|
7
7
|
import { Hono } from "hono";
|
package/dist/wire/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as WIRE_VERSION, C as RUBRIC_VERSION_SCHEME, D as TracesIngestRequestSchema, E as TraceEventSchema, O as TracesIngestResponseSchema, S as ListRubricsResponseSchema, T as RubricSchema, _ as FeedbackIngestResponseSchema, a as runRpcBatch, b as JudgeRequestSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as ErrorResponseSchema, h as listBuiltinRubrics, i as dispatchRpc, j as hashRubric, k as VersionResponseSchema, l as handleFeedbackIngest, m as getBuiltinRubric, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FeedbackTrajectorySchema, w as RubricDimensionSchema, x as JudgeResultSchema, y as HealthResponseSchema } from "../server-
|
|
1
|
+
import { A as WIRE_VERSION, C as RUBRIC_VERSION_SCHEME, D as TracesIngestRequestSchema, E as TraceEventSchema, O as TracesIngestResponseSchema, S as ListRubricsResponseSchema, T as RubricSchema, _ as FeedbackIngestResponseSchema, a as runRpcBatch, b as JudgeRequestSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as ErrorResponseSchema, h as listBuiltinRubrics, i as dispatchRpc, j as hashRubric, k as VersionResponseSchema, l as handleFeedbackIngest, m as getBuiltinRubric, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FeedbackTrajectorySchema, w as RubricDimensionSchema, x as JudgeResultSchema, y as HealthResponseSchema } from "../server-BR6onwZB.js";
|
|
2
2
|
export { ErrorResponseSchema, FeedbackIngestResponseSchema, FeedbackTrajectorySchema, HealthResponseSchema, JudgeRequestSchema, JudgeResultSchema, ListRubricsResponseSchema, RUBRIC_VERSION_SCHEME, RubricDimensionSchema, RubricSchema, TraceEventSchema, TracesIngestRequestSchema, TracesIngestResponseSchema, VersionResponseSchema, WIRE_VERSION, WireError, buildOpenApi, createApp, dispatchRpc, getBuiltinRubric, handleFeedbackIngest, handleJudge, handleListRubrics, handleTracesIngest, handleVersion, hashRubric, listBuiltinRubrics, runRpcBatch, runRpcOnce, startServer, startServerAsync };
|
package/docs/plants.md
CHANGED
|
@@ -49,6 +49,74 @@ const report = catchRate(results, manifest)
|
|
|
49
49
|
| `missingIds` | Every plant id with no result at all. |
|
|
50
50
|
| `unseeded` | How the same grader treated the rest of the set. |
|
|
51
51
|
|
|
52
|
+
## Authoring the wrong item
|
|
53
|
+
|
|
54
|
+
`definePlant` takes an item that is already wrong.
|
|
55
|
+
It never derives a wrong item from a right one, so every caller used to hand-roll the perturbation.
|
|
56
|
+
That is where the measurement breaks quietly.
|
|
57
|
+
|
|
58
|
+
`plantByPerturbation` is the authoring step.
|
|
59
|
+
Give it a claim a grader **verified** and it alters exactly one load-bearing value in the claim's evidence, so the grader is asked a question it must fail.
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { catchRate, plantByPerturbation, seedPlants } from '@tangle-network/agent-eval/meta-eval'
|
|
63
|
+
|
|
64
|
+
const derived = plantByPerturbation({
|
|
65
|
+
id: 'plant-throughput',
|
|
66
|
+
itemId: 'claim-118-plant',
|
|
67
|
+
evidence: { check: 'test "$rows" -ge 100', expect: 'rows=42' },
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// derived.plant — a `wrong-value` plant the grader owes a `reject`
|
|
71
|
+
// derived.evidence — { check: 'test "$rows" -ge 100', expect: 'rows=43' }
|
|
72
|
+
// derived.field — 'expect'
|
|
73
|
+
// derived.how — 'number-off-by-one'
|
|
74
|
+
// derived.original — '42'
|
|
75
|
+
// derived.perturbed — '43'
|
|
76
|
+
|
|
77
|
+
const { items, manifest } = seedPlants(dataset, [derived.plant], { seed: 7 })
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Write `derived.evidence` into the item the grader is handed; `derived.plant` goes into the manifest and nowhere the grader can read.
|
|
81
|
+
`humanScore` defaults to 0 and must sit below the run's accept threshold, or `definePlant` refuses the record.
|
|
82
|
+
The call returns `null` when nothing in the evidence can be perturbed — a claim with no executable evidence cannot be made wrong in a way a grader could execute, and seeding it would measure prose.
|
|
83
|
+
|
|
84
|
+
`perturbEvidence` is the same rule without the plant record, for callers that already own their item type.
|
|
85
|
+
|
|
86
|
+
### One value changes, and which one is a safety order
|
|
87
|
+
|
|
88
|
+
A perturbation that moves two values does not name the defect it seeded, so exactly one changes or the call returns `null`.
|
|
89
|
+
The order below is the order of preference, and it is ranked by how likely the change is to keep the check **executing**.
|
|
90
|
+
|
|
91
|
+
| Rank | Change | Why it sits here |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| 1 | The last standalone number in `expect` | It falsifies the claim while the command runs exactly as it did. |
|
|
94
|
+
| 2 | A flipped comparison in `check` | It inverts a test that was passing. |
|
|
95
|
+
| 3 | The last standalone number in `check` | Last: a number in a command can name an input — a port, a width, a version — rather than a threshold, and renaming an input breaks execution, not the claim. |
|
|
96
|
+
|
|
97
|
+
The **last** match is taken because a measured value trails its label (`count=42`, `n>=5 OK cells=8`), and because the choice must be deterministic: the same claim has to yield the same plant, or two runs of the authoring step seed two different answer keys for one item.
|
|
98
|
+
|
|
99
|
+
### The identity-number defect
|
|
100
|
+
|
|
101
|
+
"Standalone" excludes a digit run glued to a word, a dot, a slash, or a hyphen.
|
|
102
|
+
|
|
103
|
+
| Not perturbed | What a bump would do |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `python3` | Names a program that is not installed. |
|
|
106
|
+
| `file42.txt` | Names a file that does not exist. |
|
|
107
|
+
| `1.5` | Rewrites one side of a decimal into a different literal. |
|
|
108
|
+
| `utf-8` | Names an encoding that does not exist. |
|
|
109
|
+
|
|
110
|
+
Each of those stops the check **executing**.
|
|
111
|
+
The plant then measures the environment rather than the grader: it reads as caught, for a reason that has nothing to do with the seeded defect.
|
|
112
|
+
That is the failure this helper exists to prevent, and it is asserted directly in `src/meta-eval/plants.test.ts`.
|
|
113
|
+
|
|
114
|
+
Only unambiguous comparison tokens flip — ` -ge `/` -lt `, ` -gt `/` -le `, ` -le `/` -gt `, ` -lt `/` -ge `, ` -eq `/` -ne `, ` -ne `/` -eq `, `>=`/`<`, `<=`/`>`, `==`/`!=`, `!=`/`==`.
|
|
115
|
+
A bare `>` or `<` is a shell redirection, never a comparison, so flipping it would rewrite where output goes rather than what the test asks.
|
|
116
|
+
|
|
117
|
+
A number is bumped with `BigInt`, so a value wider than `Number.MAX_SAFE_INTEGER` moves by exactly one.
|
|
118
|
+
Bumped as a `number` it rounds back onto itself, and the plant is then a correct claim the grader is right to verify.
|
|
119
|
+
|
|
52
120
|
## What each call composes
|
|
53
121
|
|
|
54
122
|
Plants add no parallel calibration machinery.
|
|
@@ -73,7 +141,7 @@ It changes nothing about how the item is graded; it exists so `byKind` can show
|
|
|
73
141
|
|
|
74
142
|
| Kind | Authored by |
|
|
75
143
|
| --- | --- |
|
|
76
|
-
| `wrong-value` | Altering one load-bearing value: a number off by one, a comparison flipped. |
|
|
144
|
+
| `wrong-value` | Altering one load-bearing value: a number off by one, a comparison flipped. `plantByPerturbation` authors this kind. |
|
|
77
145
|
| `self-certifying` | Giving the item a check that passes without testing the claim. |
|
|
78
146
|
| `unreachable-input` | Pointing the check at an input that does not exist, so it cannot run at all. |
|
|
79
147
|
| `duplicate` | Copying an item already in the set, which is owed a duplicate flag rather than a second grade. |
|
package/docs/public-api.md
CHANGED
|
@@ -7,10 +7,10 @@ Generated by `pnpm api:census` on demand — this is a dated reading, not a gate
|
|
|
7
7
|
| measure | count |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| export subpaths | 28 |
|
|
10
|
-
| published value exports (subpath x symbol) |
|
|
11
|
-
| distinct symbols |
|
|
10
|
+
| published value exports (subpath x symbol) | 1380 |
|
|
11
|
+
| distinct symbols | 1211 |
|
|
12
12
|
| production | 931 |
|
|
13
|
-
| planned |
|
|
13
|
+
| planned | 218 |
|
|
14
14
|
| none | 231 |
|
|
15
15
|
|
|
16
16
|
Type-only exports are not listed: a type binds no runtime surface, and removing one cannot break a caller at run time.
|
|
@@ -974,7 +974,7 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
|
|
|
974
974
|
|
|
975
975
|
### `./meta-eval`
|
|
976
976
|
|
|
977
|
-
|
|
977
|
+
18 value exports — 10 production, 6 planned, 2 none.
|
|
978
978
|
|
|
979
979
|
| symbol | consumer | evidence |
|
|
980
980
|
| --- | --- | --- |
|
|
@@ -988,6 +988,8 @@ The `none` set was reviewed symbol by symbol on 2026-08-21. Four rules decided m
|
|
|
988
988
|
| `InMemoryOutcomeStore` | planned | consumer tests: phony:products/builder/api/src/eval/outcomes-correlate.test.ts |
|
|
989
989
|
| `inMemorySentinelStore` | none | only this package's tests: tests/judge-sentinel.test.ts:7 |
|
|
990
990
|
| `judgeSentinelReport` | production | creative-agent:eval/lib/judge-sentinel.ts |
|
|
991
|
+
| `perturbEvidence` | planned | doc: docs/plants.md |
|
|
992
|
+
| `plantByPerturbation` | planned | doc: README.md |
|
|
991
993
|
| `rubricPredictiveValidity` | production | physim:apps/server/src/scripts/agent-eval/validate-rubrics.ts |
|
|
992
994
|
| `seedPlants` | planned | doc: README.md |
|
|
993
995
|
| `snapshotFromAgreement` | production | physim:apps/server/src/scripts/agent-eval/judge-sentinel.ts |
|
package/docs/trace-analysis.md
CHANGED
|
@@ -13,28 +13,71 @@ Agent Eval separates five concerns:
|
|
|
13
13
|
| Finding | Records one structured claim with exact evidence |
|
|
14
14
|
| Analysis result | Returns the prose answer, findings, investigation steps, model calls, tool calls, and runtime |
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
Two engines ship, and an analyst definition runs on either without change.
|
|
17
|
+
`createChatTraceEngine` runs the research loop in Node over a caller-owned `ChatClient`.
|
|
18
|
+
`createDspyRlmTraceEngine` runs it in the official DSPy `RLM`, which brings a sandboxed Python interpreter.
|
|
19
|
+
Choose the Node engine unless the question needs the interpreter; it needs no Python install.
|
|
20
|
+
Agent Eval owns trace access, cancellation, cost accounting, and output validation in both.
|
|
21
|
+
The calling application owns model execution, credentials, retries, and provider policy in both.
|
|
20
22
|
|
|
21
23
|
`createPublicBenchmarkDirectRunner()` is the direct-call baseline; it runs through the loopback model proxy against a caller-owned execution owner, so agent-eval issues no provider request.
|
|
22
24
|
They are not trace analysts.
|
|
23
25
|
|
|
24
26
|
## Install
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
The Node engine needs the TypeScript package alone:
|
|
27
29
|
|
|
28
30
|
```sh
|
|
29
31
|
pnpm add @tangle-network/agent-eval
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The DSPy engine also needs the matching Python package:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
30
37
|
python -m venv .venv
|
|
31
38
|
.venv/bin/pip install "agent-eval-rpc[dspy]"
|
|
32
39
|
```
|
|
33
40
|
|
|
34
41
|
The Python extra pins the tested stable DSPy and Deno versions.
|
|
35
42
|
|
|
43
|
+
## Build An Engine Without Python
|
|
44
|
+
|
|
45
|
+
`createChatTraceEngine` binds the transport the application already owns.
|
|
46
|
+
It offers the analyst's trace tools as native function calls, loops until the model answers with no tool call or a budget is spent, then takes one report turn that returns the answer and the findings.
|
|
47
|
+
Findings pass through the same decoder the DSPy engine uses, so both engines accept the same rows.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import {
|
|
51
|
+
createChatClient,
|
|
52
|
+
createChatTraceEngine,
|
|
53
|
+
} from '@tangle-network/agent-eval/analyst'
|
|
54
|
+
|
|
55
|
+
const engine = createChatTraceEngine({
|
|
56
|
+
chat: createChatClient({
|
|
57
|
+
transport: 'custom',
|
|
58
|
+
// The application reaches the provider. Agent Eval never holds the key.
|
|
59
|
+
chat: (request, options) => callMyProvider(request, options),
|
|
60
|
+
defaultModel: 'deepseek-v4-flash',
|
|
61
|
+
maximumAttempts: 3,
|
|
62
|
+
}),
|
|
63
|
+
pricing: {
|
|
64
|
+
inputUsdPerMillion: 3,
|
|
65
|
+
outputUsdPerMillion: 15,
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`maximumAttempts` states how many provider attempts one call can make.
|
|
71
|
+
A capped cost ledger reserves for all of them before the call runs, so an omitted value under-reserves.
|
|
72
|
+
|
|
73
|
+
Every call is metered on the shared cost ledger.
|
|
74
|
+
The result's `runtime.served_models` carries the model ids the provider echoed, because a gateway can accept one model id and answer from another on HTTP 200.
|
|
75
|
+
An analyst's `maxLlmCalls` must be at least 2, because this engine spends one call on the report turn.
|
|
76
|
+
|
|
36
77
|
## Answer One Question
|
|
37
78
|
|
|
79
|
+
This example uses the DSPy engine; substitute the engine above to drop Python.
|
|
80
|
+
|
|
38
81
|
```ts
|
|
39
82
|
import {
|
|
40
83
|
createDspyRlmTraceEngine,
|
|
@@ -92,7 +135,7 @@ Each trace read also crosses an authenticated loopback callback and counts again
|
|
|
92
135
|
## Define A Reusable Analyst
|
|
93
136
|
|
|
94
137
|
An analyst definition contains no model, credentials, or execution state.
|
|
95
|
-
The same definition
|
|
138
|
+
The same definition runs on either shipped engine, or on any other that implements `TraceAnalysisEngine`.
|
|
96
139
|
|
|
97
140
|
```ts
|
|
98
141
|
import {
|
|
@@ -141,13 +184,17 @@ Keep exact trace facts in deterministic tools or checks.
|
|
|
141
184
|
## Run The Built-In Set
|
|
142
185
|
|
|
143
186
|
The default registry always includes deterministic behavior checks.
|
|
144
|
-
It adds the
|
|
187
|
+
It adds the five recursive analysts only when an engine is supplied:
|
|
145
188
|
|
|
146
189
|
- `failure-mode`
|
|
190
|
+
- `intent-divergence`
|
|
147
191
|
- `knowledge-gap`
|
|
148
192
|
- `knowledge-poisoning`
|
|
149
193
|
- `improvement`
|
|
150
194
|
|
|
195
|
+
Either engine satisfies this.
|
|
196
|
+
`agent-runtime`'s `analystsFromRegistry` refuses a registry that is missing one of the five, so a registry built with no engine cannot reach a supervised run.
|
|
197
|
+
|
|
151
198
|
```ts
|
|
152
199
|
import {
|
|
153
200
|
buildDefaultAnalystRegistry,
|
|
@@ -164,7 +211,7 @@ for (const finding of run.findings) {
|
|
|
164
211
|
`run.per_analyst` records each analyst's status, latency, calls, tokens, and cost.
|
|
165
212
|
One analyst failure does not become an agent failure.
|
|
166
213
|
|
|
167
|
-
Pass `definitions` to replace the
|
|
214
|
+
Pass `definitions` to replace the five built-ins.
|
|
168
215
|
Omit `engine` for deterministic-only analysis.
|
|
169
216
|
|
|
170
217
|
## Trace Tools
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-eval",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.173.0",
|
|
4
4
|
"description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-eval#readme",
|
|
6
6
|
"repository": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend-integrity-e79K3UPD.d.ts","names":[],"sources":["../src/artifact-validator.ts","../src/completion-verifier.ts","../src/produced-state.ts","../src/integrity/backend-integrity.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAaiB;;EAEf;;EAEA;;EAEA;;EAEA,QAAQ;;EAER,WAAW;;;;;KCsBD;UAEK;;EAEf;;EAEA;;EAEA;;EAEA,cAAc;;UAGC;EACf;EACA,cAAc;;UAGC;EACf;EACA;EACA;;EAEA;;;UAIe;;EAEf,WAAW;;EAEX,WAAW;;EAEX;;UAGe;EACf;EACA;;EAEA;;;;;;EAMA;;EAEA;;;;;;;;;EASA;;EAEA;;EAEA;;;;;UAMe,0BAA0B;EACzC;EACA,cAAc;;EAEd;;EAEA;;EAEA;;;;;;;;;iBAUc,kBAAkB;EAChC;EACA,cAAc;;;EAGd,gBAAgB;IACd;;;;;;UAqCa;EACf,UAAU;EACV,SAAS;EACT;;;;;;;;;;;;UAae;GAEb,aAAa,uBACb,kBACC;IAAU;IAAkB;;EAC/B,cAAc;;;;;;;;;iBAsLM,iBACpB,MAAM,UACN,OAAO,eACP,kBAAkB,qBACjB,QAAQ;UAyGM;EACf;;EAEA,aAAa;EACb;EACA,WAAW;EACX,SAAS;;EAET;;;;;;EAMA;;;;;;EAMA,UAAU;;;;;;;;iBA2CI,4BACd,MAAM,YACN,OAAM,4BACL;;;;UCnhBc;EACf;EACA;;;;;;;UAQe;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EAIA;;;;;;;;KASU,mBACR,oBACA,oBACA;EACE;;;;;;;;;;;;iBAmBU,qBAAqB,iBAAiB,qBAAqB;;;UCpD1D;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;cAQW,8BAA8B;WAGvB,QAAQ;EAF1B,YACE,iBACgB,QAAQ;;;;;;;iBAWZ,0BACd,SAAS,cAAc,aACtB;;;;;;;;iBAuHa,kBACd,SAAS,cAAc,YACvB;EAAQ;IACP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-process-VIi0KSL2.js","names":[],"sources":["../src/bounded-process.ts"],"sourcesContent":["/**\n * `runBoundedProcess` — run one command under a wall-clock bound and return\n * what it produced, leaving no descendant behind.\n *\n * The child leads its own process group (`detached` on every non-win32\n * platform), so a deadline or an abort kills the group with\n * `process.kill(-pid, 'SIGKILL')` rather than only the shell that was\n * spawned. That distinction is the whole point of this module: `sh -c\n * 'solver & wait'` puts the real work in a grandchild, and a kill aimed at\n * the shell alone leaves that grandchild running, holding the stdout and\n * stderr pipes open. `close` then never fires, so the deadline produces no\n * result the caller can observe and the descendant outlives the run.\n *\n * Two further guarantees the caller depends on:\n *\n * - A killed run never reports success. A SIGKILLed child can still close\n * with exit code 0, so a run killed by the deadline or by an abort has\n * its exit code forced non-zero.\n * - A run always resolves. If a grandchild escaped the group and still\n * holds the pipes, the result is delivered {@link KILL_DRAIN_MS} after\n * the kill instead of waiting on a `close` that will not come.\n *\n * The captured output is bounded. Once the cap is reached the streams are\n * still drained — the child needs its pipes read to reach `close` — but the\n * bytes are discarded and `outputTruncated` is set.\n */\n\nimport { spawn } from 'node:child_process'\n\n/** Wall-clock bound applied when the caller names none. */\nconst DEFAULT_TIMEOUT_MS = 10 * 60_000\n\n/** Cap on captured stdout+stderr applied when the caller names none. */\nconst DEFAULT_MAX_OUTPUT_BYTES = 16 * 1024 * 1024\n\n/**\n * Window `close` is given after the process group is killed. A grandchild\n * that escaped the group can hold the pipes open indefinitely; the caller\n * receives its result at the end of this window rather than hanging.\n */\nconst KILL_DRAIN_MS = 2000\n\n/** Exit code reported for a run the wall-clock bound killed (GNU `timeout`). */\nconst TIMEOUT_EXIT_CODE = 124\n\n/** Exit code reported for a run an `AbortSignal` killed (128 + SIGKILL). */\nconst ABORT_EXIT_CODE = 137\n\n/** Exit code reported when the process could not be spawned at all. */\nconst SPAWN_FAILURE_EXIT_CODE = 127\n\n/** Exit code reported when a process closed with no code and was not killed. */\nconst UNKNOWN_EXIT_CODE = 1\n\nexport interface BoundedProcessInput {\n /**\n * The command line, interpreted by a shell unless `shell` is `false`. When\n * {@link BoundedProcessInput.args} is present this is a program path\n * instead, and no shell reads it.\n */\n command: string\n /**\n * Argument vector for `command`, delivered to the program as separate\n * argv entries with no shell between them.\n *\n * This is the form to use whenever an argument carries text the caller did\n * not author — a script body, a path, a pattern. Without it, `interpreter\n * -flag <script>` can only be expressed by quoting the script into a\n * shell string, and a quoting bug there is a command injection rather than\n * a wrong answer. Each entry arrives verbatim, so there is nothing to\n * quote: `{ command: 'bash', args: ['-n', '-c', body] }` parses `body`\n * whatever shell metacharacters it holds.\n *\n * Two limits are the platform's, not this module's. A NUL byte in an entry\n * cannot be passed to a process at all, and is reported as a `runnerError`\n * rather than thrown. A lone surrogate is encoded to UTF-8 as U+FFFD, and a\n * non-string entry from an untypechecked caller is coerced with `String()`,\n * so an entry is verbatim exactly when it is a string a UTF-8 argv can hold.\n *\n * A shell cannot interpret an argument vector, so `args` and a truthy\n * `shell` are contradictory. Passing both spawns nothing and reports\n * `runnerError`.\n */\n args?: string[]\n /**\n * Shell that interprets `command`. `true` (the default) uses the platform\n * default — `/bin/sh` on POSIX, `cmd.exe` on Windows. A string names the\n * shell binary, e.g. `'bash'`, which is required for a bash-only construct\n * such as `[[ ]]` or `$BASH_VERSION`. `false` executes `command` directly\n * as a program path with no arguments. Ignored — and refused when truthy —\n * once {@link BoundedProcessInput.args} is present.\n */\n shell?: boolean | string\n /** Working directory. The parent's cwd is inherited when omitted. */\n cwd?: string\n /**\n * Environment for the child. How it combines with the parent environment\n * is decided by {@link BoundedProcessInput.envMode}.\n */\n env?: NodeJS.ProcessEnv\n /**\n * `'merge'` (the default) layers `env` on top of `process.env`, so the\n * child sees every variable this process has plus the named ones.\n * `'replace'` passes exactly `env` and nothing else, which is what a\n * grader needs when the claim under test is about the variables the\n * command could read. `PATH` is not re-added under `'replace'`, and a\n * command that must find a binary on `PATH` names `PATH` itself.\n *\n * With no `PATH` in the child environment the two forms do NOT search the\n * same directories, so a caller under `'replace'` that names no `PATH` gets\n * a resolution that depends on which form it picked. The shell form execs\n * the shell, which applies its own compiled-in default; the argv form\n * reaches `execvp`, which falls back to `confstr(_CS_PATH)`. Measured on\n * Linux/glibc: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`\n * against `/bin:/usr/bin`, so a binary in `/usr/local/bin` resolves on the\n * shell form and reports ENOENT on the argv form. Name `PATH` and both\n * forms search exactly what was named.\n */\n envMode?: 'merge' | 'replace'\n /** Wall-clock bound in ms. Defaults to 10 minutes. */\n timeoutMs?: number\n /**\n * Cap on captured stdout+stderr. Reaching it truncates the captured text\n * and sets `outputTruncated`; it never kills the process. Defaults to\n * 16 MiB.\n */\n maxOutputBytes?: number\n /**\n * Kills the process group when it aborts, the same way the deadline does.\n * A signal that is already aborted when `runBoundedProcess` is called\n * prevents the spawn entirely — nothing runs.\n */\n signal?: AbortSignal\n}\n\nexport interface BoundedProcessResult {\n /**\n * Exit code. Forced non-zero whenever `killedByTimeout` or\n * `killedBySignal` is set, because a SIGKILLed child can close with 0 and\n * a killed run must never read as a pass.\n */\n exitCode: number\n /** Captured stdout, truncated at `maxOutputBytes`. */\n stdout: string\n /**\n * Captured stderr, truncated at `maxOutputBytes`. A runner-side failure is\n * reported in `runnerError`, not appended here; the caller decides whether\n * the command's own stderr and the runner's diagnosis belong together.\n */\n stderr: string\n /** Wall-clock duration in ms, measured across the whole call. */\n wallMs: number\n /** The wall-clock bound was reached and the process group was killed. */\n killedByTimeout: boolean\n /** `signal` aborted and the process group was killed. */\n killedBySignal: boolean\n /** `maxOutputBytes` was reached and later output was discarded. */\n outputTruncated: boolean\n /**\n * Runner-side failure: the process could not be spawned, or the signal was\n * already aborted so nothing was spawned. Absent when the command itself\n * ran, however it exited.\n */\n runnerError?: string\n}\n\nexport async function runBoundedProcess(input: BoundedProcessInput): Promise<BoundedProcessResult> {\n const start = Date.now()\n const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES\n const timeoutMs = input.timeoutMs ?? DEFAULT_TIMEOUT_MS\n const envMode = input.envMode ?? 'merge'\n const env =\n input.env === undefined && envMode === 'merge'\n ? undefined\n : envMode === 'replace'\n ? { ...input.env }\n : { ...process.env, ...input.env }\n\n if (input.signal?.aborted) {\n return {\n exitCode: ABORT_EXIT_CODE,\n stdout: '',\n stderr: '',\n wallMs: Date.now() - start,\n killedByTimeout: false,\n killedBySignal: true,\n outputTruncated: false,\n runnerError: 'aborted before spawn: the AbortSignal was already aborted',\n }\n }\n\n // Reported rather than thrown, because this module's contract is that a\n // call always resolves. A caller bug still reads as a failure and never as\n // a pass: the exit code is non-zero and `runnerError` names the cause.\n if (input.args !== undefined && input.shell) {\n return {\n exitCode: SPAWN_FAILURE_EXIT_CODE,\n stdout: '',\n stderr: '',\n wallMs: Date.now() - start,\n killedByTimeout: false,\n killedBySignal: false,\n outputTruncated: false,\n // Shares `SPAWN_FAILURE_EXIT_CODE` with a program that does not exist,\n // because both mean nothing ran. The `not spawned:` prefix is the stable\n // discriminator: it marks the caller's own bug, which no retry fixes.\n runnerError:\n 'not spawned: `args` passes an argument vector directly to the program, so a shell ' +\n 'cannot interpret it — pass `args` or a truthy `shell`, never both',\n }\n }\n\n return await new Promise<BoundedProcessResult>((resolve) => {\n const spawnOptions = {\n cwd: input.cwd,\n env,\n // Own process group so a kill reaches the whole tree, not just the\n // shell — otherwise a runaway grandchild keeps the pipes open and\n // `close` never fires.\n detached: process.platform !== 'win32',\n }\n // The argv form takes the same bounds, the same group and the same kill\n // path. Two things differ, and both are stated where they are decided:\n // no shell reads the command, and executable lookup falls back to a\n // different default `PATH` when the caller names none (see `envMode`).\n //\n // `spawn` validates its arguments and THROWS synchronously — a NUL byte in\n // `command` or in an `args` entry, or an `args` that is not an array from\n // an untypechecked caller. A throw inside this executor would reject, and\n // this module's contract is that a call always resolves. A caller that\n // grades untrusted text must be able to score that text as failed rather\n // than die on it.\n let child: ReturnType<typeof spawn>\n try {\n child =\n input.args === undefined\n ? spawn(input.command, { ...spawnOptions, shell: input.shell ?? true })\n : spawn(input.command, input.args, { ...spawnOptions, shell: false })\n } catch (err) {\n resolve({\n exitCode: SPAWN_FAILURE_EXIT_CODE,\n stdout: '',\n stderr: '',\n wallMs: Date.now() - start,\n killedByTimeout: false,\n killedBySignal: false,\n outputTruncated: false,\n runnerError: String(err),\n })\n return\n }\n let stdout = ''\n let stderr = ''\n let outputBytes = 0\n let outputTruncated = false\n let killedByTimeout = false\n let killedBySignal = false\n let settled = false\n\n // Bound the in-memory buffer so a runaway process can't OOM the caller.\n // Once the cap is hit the streams are still drained (the child needs them\n // read to reach `close`) but the bytes are discarded.\n function capture(s: string): string {\n if (outputBytes >= maxOutputBytes) {\n outputTruncated = true\n return ''\n }\n const room = maxOutputBytes - outputBytes\n if (s.length > room) {\n outputBytes = maxOutputBytes\n outputTruncated = true\n return s.slice(0, room)\n }\n outputBytes += s.length\n return s\n }\n\n const onStdout = (d: unknown) => {\n const chunk = capture(String(d))\n if (chunk) stdout += chunk\n }\n const onStderr = (d: unknown) => {\n const chunk = capture(String(d))\n if (chunk) stderr += chunk\n }\n\n child.stdout?.on('data', onStdout)\n child.stderr?.on('data', onStderr)\n\n let forceResolve: ReturnType<typeof setTimeout> | undefined\n\n const cleanup = () => {\n clearTimeout(timeout)\n if (forceResolve) clearTimeout(forceResolve)\n input.signal?.removeEventListener('abort', onAbort)\n child.stdout?.off('data', onStdout)\n child.stderr?.off('data', onStderr)\n child.removeAllListeners('close')\n child.removeAllListeners('error')\n }\n\n // Resolve exactly once. `code` comes from `close`; on a kill path the\n // exit code is forced non-zero so a SIGKILLed child that reports 0 can\n // never read as a clean pass downstream.\n const finish = (outcome: { code: number | null; runnerError?: string }) => {\n if (settled) return\n settled = true\n cleanup()\n resolve({\n exitCode: exitCodeFor(outcome.code, killedByTimeout, killedBySignal),\n stdout,\n stderr,\n wallMs: Date.now() - start,\n killedByTimeout,\n killedBySignal,\n outputTruncated,\n runnerError: outcome.runnerError,\n })\n }\n\n // SIGKILL the whole process group (we spawned detached). On a clean close\n // this never runs.\n const killTree = () => {\n try {\n if (process.platform !== 'win32' && typeof child.pid === 'number') {\n process.kill(-child.pid, 'SIGKILL')\n } else {\n child.kill('SIGKILL')\n }\n } catch (err) {\n // ESRCH means the group exited between the decision to kill and the\n // signal, which `close` reports on its own. Anything else means the\n // group may still be running, which the caller must hear about.\n if ((err as NodeJS.ErrnoException)?.code !== 'ESRCH') {\n console.warn('[bounded-process] SIGKILL of the process group failed:', err)\n }\n }\n }\n\n // Give `close` a brief window to fire (flushing any final output) after\n // the group dies; if an orphaned grandchild keeps the pipes open, resolve\n // anyway so the caller can't hang on a runaway. The deadline and an abort\n // can both fire, so the kill happens at most once and the drain window is\n // not restarted by the second one.\n let killed = false\n const killAndDrain = () => {\n if (killed) return\n killed = true\n killTree()\n forceResolve = setTimeout(() => finish({ code: null }), KILL_DRAIN_MS)\n }\n\n function onAbort() {\n if (settled) return\n killedBySignal = true\n killAndDrain()\n }\n\n const timeout = setTimeout(() => {\n killedByTimeout = true\n killAndDrain()\n }, timeoutMs)\n\n input.signal?.addEventListener('abort', onAbort, { once: true })\n\n child.on('close', (code) => {\n if (forceResolve) clearTimeout(forceResolve)\n finish({ code })\n })\n child.on('error', (err) => {\n if (forceResolve) clearTimeout(forceResolve)\n finish({ code: SPAWN_FAILURE_EXIT_CODE, runnerError: String(err) })\n })\n })\n}\n\n/**\n * A killed run reports the code the child closed with only when that code is\n * already non-zero; otherwise it reports the conventional code for the kind\n * of kill. A run that closed on its own with no code at all reports 1.\n */\nfunction exitCodeFor(\n code: number | null,\n killedByTimeout: boolean,\n killedBySignal: boolean,\n): number {\n if (code !== null && code !== 0) return code\n if (killedByTimeout) return TIMEOUT_EXIT_CODE\n if (killedBySignal) return ABORT_EXIT_CODE\n return code ?? UNKNOWN_EXIT_CODE\n}\n"],"mappings":";;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