openpond 0.2.69 → 0.2.71
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/dist/api/client-context.d.ts +4 -0
- package/dist/app-server.js +1 -1
- package/dist/chunks/{account-context-V3KLSNKS.js → account-context-LEZDNYMR.js} +1 -1
- package/dist/chunks/{acp-ER6CUXG2.js → acp-VWPJ2EL4.js} +1 -1
- package/dist/chunks/{acp-agent-AYJ5RPVF.js → acp-agent-OZHZMQ6R.js} +1 -1
- package/dist/chunks/{actions-command-BBUS3HDK.js → actions-command-AXGXBU75.js} +1 -1
- package/dist/chunks/{app-layer-JCEWGUDH.js → app-layer-OHPIYEOJ.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-ILXBFD3S.js → app-server-connected-apps-NH4667QJ.js} +1 -1
- package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-Y5UEF2Y7.js} +1 -1
- package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-GUHAIIPS.js} +1 -1
- package/dist/chunks/app-server-runtime-CH5STRJP.js +2 -0
- package/dist/chunks/apps-DNLT6P4J.js +2 -0
- package/dist/chunks/{chunk-MOXIGLN2.js → chunk-23YW5PAQ.js} +1 -1
- package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
- package/dist/chunks/{chunk-RY46UPBO.js → chunk-2ACX7IW5.js} +1 -1
- package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
- package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
- package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
- package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
- package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
- package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-33UVQ7DU.js} +1 -1
- package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-3JVZ7OCQ.js} +1 -1
- package/dist/chunks/{chunk-4BUM6JEC.js → chunk-3JYPUOK4.js} +1 -1
- package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
- package/dist/chunks/{chunk-Z33RVGP6.js → chunk-5LKEVB2P.js} +1 -1
- package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
- package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
- package/dist/chunks/{chunk-UMAVVMXL.js → chunk-6BTX66SV.js} +1 -1
- package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
- package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
- package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
- package/dist/chunks/{chunk-KDER7R45.js → chunk-7PDF2UX2.js} +1 -1
- package/dist/chunks/{chunk-SO4GMSNP.js → chunk-7SOHV5BH.js} +1 -1
- package/dist/chunks/{chunk-XOPHFUUY.js → chunk-ASMQTMQB.js} +1 -1
- package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-AT3ZYNX4.js} +1 -1
- package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-AVEHWUML.js} +1 -1
- package/dist/chunks/{chunk-M4A7G4S5.js → chunk-B7SCVTE6.js} +1 -1
- package/dist/chunks/{chunk-7EQLW2KM.js → chunk-BLNEHU62.js} +1 -1
- package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
- package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
- package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
- package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
- package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
- package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
- package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
- package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
- package/dist/chunks/{chunk-AQUZCWM3.js → chunk-D2V2Y3FB.js} +1 -1
- package/dist/chunks/chunk-DFZTRMTL.js +2 -0
- package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
- package/dist/chunks/{chunk-5G7BQAUA.js → chunk-DNNWMOMG.js} +1 -1
- package/dist/chunks/{chunk-M5X7XKXY.js → chunk-DNRC6TPJ.js} +7 -7
- package/dist/chunks/{chunk-HKVFU3B3.js → chunk-DUR32LJG.js} +1 -1
- package/dist/chunks/{chunk-XT4CSKHM.js → chunk-E57PUTV2.js} +1 -1
- package/dist/chunks/{chunk-4N4EH3RJ.js → chunk-EJOV6Z6F.js} +1 -1
- package/dist/chunks/{chunk-OUJ63LMU.js → chunk-ER2VONWQ.js} +1 -1
- package/dist/chunks/{chunk-PSY6IRJE.js → chunk-ESOIZG2G.js} +4 -4
- package/dist/chunks/{chunk-WNXUSELC.js → chunk-EXAJ2B4I.js} +1 -1
- package/dist/chunks/{chunk-CCZ276IA.js → chunk-F2EUZG2W.js} +1 -1
- package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
- package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
- package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
- package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
- package/dist/chunks/{chunk-TB5P3FWM.js → chunk-GUWNSMGH.js} +1 -1
- package/dist/chunks/{chunk-AYOMVI7J.js → chunk-HIMG7S5E.js} +1 -1
- package/dist/chunks/{chunk-2LJCJOJ7.js → chunk-HLJJAOI2.js} +1 -1
- package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
- package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-HUMNLSCV.js} +1 -1
- package/dist/chunks/{chunk-NZDLL6JN.js → chunk-HYUTDZ3N.js} +1 -1
- package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
- package/dist/chunks/{chunk-WZ35ICTE.js → chunk-IFMWAOBR.js} +1 -1
- package/dist/chunks/{chunk-R2FYCJL6.js → chunk-IJJ7FYZE.js} +1 -1
- package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
- package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
- package/dist/chunks/chunk-J7X72QUY.js +2 -0
- package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
- package/dist/chunks/chunk-JF7WWLNW.js +2 -0
- package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
- package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
- package/dist/chunks/{chunk-Z5CQXPIS.js → chunk-K3WM4NEC.js} +1 -1
- package/dist/chunks/{chunk-EGP6DF34.js → chunk-KASHK2U5.js} +2 -2
- package/dist/chunks/{chunk-JEMECEQH.js → chunk-KHDCMVEJ.js} +1 -1
- package/dist/chunks/{chunk-BDZDWHBJ.js → chunk-KURL76NW.js} +1 -1
- package/dist/chunks/{chunk-7OFD6TFD.js → chunk-LMLGEOKV.js} +1 -1
- package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
- package/dist/chunks/chunk-MZKCW6CB.js +2 -0
- package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
- package/dist/chunks/chunk-NK2L5HA2.js +2 -0
- package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
- package/dist/chunks/{chunk-RCQYEHHD.js → chunk-O5ZOW474.js} +1 -1
- package/dist/chunks/{chunk-IIT66347.js → chunk-OEAKX5TS.js} +1 -1
- package/dist/chunks/{chunk-LSKMALD6.js → chunk-OFV26C2U.js} +2 -2
- package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
- package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
- package/dist/chunks/{chunk-R6I623SZ.js → chunk-OKPV6MBX.js} +6 -6
- package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
- package/dist/chunks/{chunk-MIFVX5PK.js → chunk-OQ4RWCYI.js} +1 -1
- package/dist/chunks/{chunk-RCRZXHAI.js → chunk-OTG77H7U.js} +1 -1
- package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
- package/dist/chunks/{chunk-4KNPCJR4.js → chunk-PJJSQ4ZI.js} +1 -1
- package/dist/chunks/{chunk-7RSQOC5M.js → chunk-PXQZOVSV.js} +2 -2
- package/dist/chunks/chunk-QKGNAYSC.js +2 -0
- package/dist/chunks/{chunk-R4EEGWXB.js → chunk-QN4CFJQC.js} +1 -1
- package/dist/chunks/{chunk-V24VHT76.js → chunk-REGKOCDO.js} +1 -1
- package/dist/chunks/chunk-RJY4EI46.js +2 -0
- package/dist/chunks/{chunk-E2JB5OCO.js → chunk-RP4DPUN2.js} +1 -1
- package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-SNBFWBJI.js} +1 -1
- package/dist/chunks/{chunk-G4FRBT7G.js → chunk-SRJTQS2D.js} +3 -3
- package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
- package/dist/chunks/{chunk-NW6WGGSL.js → chunk-TCTBCAI6.js} +1 -1
- package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
- package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-TWLPZHH7.js} +1 -1
- package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
- package/dist/chunks/{chunk-JQOVC35K.js → chunk-UKTPX2EE.js} +1 -1
- package/dist/chunks/{chunk-CO23RRN7.js → chunk-UMRQKE3W.js} +1 -1
- package/dist/chunks/{chunk-B66QCXH2.js → chunk-USKCFST5.js} +1 -1
- package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-USTDWGR4.js} +1 -1
- package/dist/chunks/{chunk-EWDDDHJN.js → chunk-UZNRH6I3.js} +1 -1
- package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
- package/dist/chunks/{chunk-22RLEU3Q.js → chunk-VND53FAU.js} +1 -1
- package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
- package/dist/chunks/{chunk-KCLMA2IH.js → chunk-VV4K5YPD.js} +1 -1
- package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-WAUFXZ5B.js} +1 -1
- package/dist/chunks/{chunk-HG2YFMVU.js → chunk-WXG3G2O6.js} +1 -1
- package/dist/chunks/{chunk-PACLKDTN.js → chunk-XBAB3HMA.js} +1 -1
- package/dist/chunks/chunk-XJU47QS2.js +2 -0
- package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
- package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
- package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-XNPTLJ5Z.js} +1 -1
- package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
- package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
- package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
- package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
- package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
- package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
- package/dist/chunks/{chunk-2TGHZXJE.js → chunk-ZG3DBXQG.js} +1 -1
- package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
- package/dist/chunks/cli-5JARGJOD.js +2 -0
- package/dist/chunks/{command-LNOVZQSK.js → command-AI3SMEAH.js} +11 -11
- package/dist/chunks/{configuration-command-C3QBDFND.js → configuration-command-NPA46ZOT.js} +1 -1
- package/dist/chunks/connected-app-executor-DLC23O43.js +2 -0
- package/dist/chunks/connected-evidence-TVORI55Q.js +2 -0
- package/dist/chunks/{connected-starting-assets-5LAJ7CZY.js → connected-starting-assets-WGGBWH4K.js} +1 -1
- package/dist/chunks/{continual-FVOLGGOE.js → continual-UHQI2EQD.js} +1 -1
- package/dist/chunks/core-commands-QNZUBKOC.js +2 -0
- package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-OBMJLGA4.js} +1 -1
- package/dist/chunks/datasets-USJLJOEQ.js +2 -0
- package/dist/chunks/desktop-test-IYHAOR47.js +3 -0
- package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
- package/dist/chunks/evaluation-coordination-UJENK4WQ.js +2 -0
- package/dist/chunks/experiment-improvements-6GJMKIER.js +2 -0
- package/dist/chunks/experiments-FZHILSC6.js +2 -0
- package/dist/chunks/experiments-signal-E32CWBS4.js +2 -0
- package/dist/chunks/{help-PLQJOP4P.js → help-32DLAPJR.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-QAV2UGSB.js +2 -0
- package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-GZES7QXJ.js → hosted-app-server-composition-5DVBKNV3.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VG2WE7XZ.js → hosted-experiment-improvement-YQ24C54D.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-KLIORGWV.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-RCWFLOVJ.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-UDG4BCEW.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-4R3L4FTK.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-NA4SSY7N.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-B4BW6JTB.js} +1 -1
- package/dist/chunks/{hosted-tasksets-V24IBVJX.js → hosted-tasksets-IUK3VWSL.js} +1 -1
- package/dist/chunks/human-review-D6QCZLYN.js +2 -0
- package/dist/chunks/{import-SI24Z7EF.js → import-UCG75PN5.js} +1 -1
- package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
- package/dist/chunks/learning-OR4CYV4B.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-GZBMBZB2.js +2 -0
- package/dist/chunks/local-harness-taskset-review-YVP2ZQJG.js +2 -0
- package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
- package/dist/chunks/opchat-APJUUTT7.js +3 -0
- package/dist/chunks/opchat-bounded-chat-PBUSUAY2.js +2 -0
- package/dist/chunks/organizations-WK6EZ6L3.js +2 -0
- package/dist/chunks/{profile-TD5U3INY.js → profile-BQMS7ALQ.js} +1 -1
- package/dist/chunks/project-action-payload-CGV77JSA.js +2 -0
- package/dist/chunks/project-agent-XVFYTEUQ.js +2 -0
- package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-2CYFIRBL.js} +1 -1
- package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-OLJHA4DI.js} +1 -1
- package/dist/chunks/{runtime-Q7JUJO4D.js → runtime-32KYSVZR.js} +1 -1
- package/dist/chunks/sandbox-command-OY3VZXGG.js +2 -0
- package/dist/chunks/{sandbox-template-GOY7QQUY.js → sandbox-template-YOOSJ4FK.js} +1 -1
- package/dist/chunks/saved-work-L4KNWLZB.js +2 -0
- package/dist/chunks/setup-EU6CMRXQ.js +2 -0
- package/dist/chunks/{src-C3ZUESMK.js → src-3DJR7OAH.js} +1 -1
- package/dist/chunks/{src-MT4B43TD.js → src-HYOTHMRX.js} +111 -113
- package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
- package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-HISLEZZM.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-ORWHS57V.js} +1 -1
- package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-5UGYKEGJ.js} +1 -1
- package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-APLPTVYQ.js} +1 -1
- package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-HDW6IYBL.js} +1 -1
- package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-KB2UDCF3.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
- package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-IURNTX3C.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-TH2LKQWV.js} +1 -1
- package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
- package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-M4V5RLHJ.js} +1 -1
- package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-DDZLWVTG.js} +1 -1
- package/dist/chunks/{store-model-configuration-6L3OYXF4.js → store-model-configuration-ATOFA5OH.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-AAEKCF6V.js → store-model-project-preparation-ZRSCQEQR.js} +1 -1
- package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-YJIDUPVJ.js} +1 -1
- package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
- package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-L53OT6ZC.js} +1 -1
- package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-R2JJGAHW.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-FRFL6ITK.js → store-taskset-drafts-FPNJPFPO.js} +1 -1
- package/dist/chunks/{store-training-FYXZU2FE.js → store-training-DIBW7OMP.js} +1 -1
- package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-K7I4SXWW.js} +1 -1
- package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-LCSB37YY.js} +1 -1
- package/dist/chunks/{taskset-UDDLFYKV.js → taskset-XI5SJBJL.js} +1 -1
- package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
- package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
- package/dist/chunks/{teams-bot-YCUTDDDC.js → teams-bot-CYC5TR64.js} +1 -1
- package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-52QZIJIR.js} +1 -1
- package/dist/chunks/{training-5UMT45UL.js → training-GDLLLXSV.js} +1 -1
- package/dist/chunks/training-RL7UUBER.js +2 -0
- package/dist/chunks/training-UJ62NOJJ.js +2 -0
- package/dist/chunks/training-hardware-MR4FUC4U.js +3 -0
- package/dist/chunks/training-hosted-V5CHG3M3.js +2 -0
- package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-R5PVATV4.js} +1 -1
- package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-WNK5DE3M.js} +1 -1
- package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-ZQDOKXAV.js} +1 -1
- package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
- package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-KKI5CKOH.js} +1 -1
- package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-CFWEDRSR.js} +1 -1
- package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-N4NF5AVW.js} +1 -1
- package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-4MDUQ2YV.js} +1 -1
- package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NOA6TYQK.js} +1 -1
- package/dist/chunks/{web-search-ZEKJHZW4.js → web-search-FTVNZ7PH.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/skills/manifest.json +3 -3
- package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
- package/dist/web/assets/App-L7RV4D0A.js +54 -0
- package/dist/web/assets/{AppDialog-CxjDHVk9.js → AppDialog-B2V84J7f.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CKJIVpKa.js → AppTerminalPanel-DfYpUDKT.js} +2 -2
- package/dist/web/assets/{AppToastContext-EpiT1dHs.js → AppToastContext-DuiPouLz.js} +1 -1
- package/dist/web/assets/{AppsView-BsMyPX_3.js → AppsView-B20RHDCy.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BXvZy5gB.js → AttachmentTypeIcon-l-GRNxaz.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BIIV4aq4.js → BrowserSidebar-Ce0ToS2O.js} +1 -1
- package/dist/web/assets/{CartesianChart-brqLBqnF.js → CartesianChart-CtfMRAfp.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-CwZbn16X.js → ChatTimelineEntry-DzcucW20.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BU4uc4tZ.js → CollaborationTabs-BpmKjNAC.js} +1 -1
- package/dist/web/assets/{CommandMenu-DkWpXR55.js → CommandMenu-JXsoxijv.js} +1 -1
- package/dist/web/assets/{CommunityView-CsSxJZGn.js → CommunityView-ggdn8pcH.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-BdJGCYzI.js → ComposerAttachments-BMmALUs_.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-CWy0j1vv.js → ComposerCreateImproveStrip-DcM1bkfu.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-DCmiakbZ.js → ConversationImportsSettings-BKNeARHI.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-DEnF_pGu.js → DatasetReviewImport-DyFOE0Q0.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-WhwQ0QBi.js → ExperimentTrainingDataWorkspace-CfOyoMrq.js} +2 -2
- package/dist/web/assets/{FilePagePreview-BRhhz99q.js → FilePagePreview-B7bWObJN.js} +2 -2
- package/dist/web/assets/{GetStartedView-CLVD-qEi.js → GetStartedView-BYbFl93M.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-CMxaAMg-.js → GettingStartedDialog-UgreDozV.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-Cn-j-rDo.js → HostedModelLearningReview-C_kng2U_.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-aesD_ifF.js +1 -0
- package/dist/web/assets/{HtmlVisual-D5y2WG9L.js → HtmlVisual-nvl1x-jh.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BxRmYD6h.js → LabModelVersionDetailPage-DrdoNvI-.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-u2Ulm_z4.js → LabModelWorkspace-CHlhzG3q.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-C7IceJTJ.js → LabSkillSidebar-CqHeZzoj.js} +1 -1
- package/dist/web/assets/{LabsRoute-CbztQaEf.js → LabsRoute-DzEbPpMK.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-CJqgZNvM.js → LearningBatchesPage-A2dFQW2j.js} +1 -1
- package/dist/web/assets/{MainChatThread-DNMfrrRq.js → MainChatThread-BSvKu4e5.js} +2 -2
- package/dist/web/assets/{MainPane-CQQxSDPS.js → MainPane-DiWIAxMj.js} +6 -6
- package/dist/web/assets/{ModelProjectPageHeader-Dge19aE1.js → ModelProjectPageHeader-lu6iRXHK.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-D4JnbpyD.js → NativeSetupTerminal-kZ-nFPE8.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-Jzx1BeKV.js → NativeSkillSidebar-DkkD1uH2.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-DcnGzEd9.js → NewProjectDialog-Dg8dMEpc.js} +1 -1
- package/dist/web/assets/{OutputsPage-Cmk15Vt_.js → OutputsPage-Dz190U9t.js} +1 -1
- package/dist/web/assets/{PageChrome-Cz_fCqtn.js → PageChrome-Bncv-ps0.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BZ3Eo3Mz.js → ProjectsPage-DVkYvLtd.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-C6H2vU9N.js → RightChatPanelStack-CP4leenI.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-CAkSwM0T.js → ScheduledWorkPage-DI0mgt82.js} +1 -1
- package/dist/web/assets/{SettingsView-DvQXGw3_.js → SettingsView-cCtkr089.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-JuU1k8vr.js → TasksetDraftEditorPrimitives-DCQTuswJ.js} +1 -1
- package/dist/web/assets/{TeamChatView-DmHjr8W9.js → TeamChatView-BBEomfQ7.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-DlaM9d8F.js → TerminalOverlay-Dj5NUDMp.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-ClpylNsr.js → TrainingCreationPanel-Ds4PLfsd.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-6tH2xSDj.js → TrainingDraftPanel-BAuh_BF3.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CzDqxOYM.js → UsageSettingsSection-DbzeatcW.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-B4e0lyF7.js → WorkspaceDiffPanel-xk-ve1MO.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-D01ZkZZF.js → WorkspaceEnvironmentMenu-D8GSuoYz.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-C5s_njZb.js → WorkspaceFileLocation-Dl8M2ZKN.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-DjPZ6KIh.js → WorkspaceGitDialogs-9BhLjYx4.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-CC4sfOiU.js → WorkspaceMonacoEditor-DYPuC7pj.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-vszQqFa4.js → WorkspacePdfPreview-B7BI9tLR.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DQTvhaRD.js → WorkspacePresentationPreview-sP7JUT7m.js} +1 -1
- package/dist/web/assets/{bot-Doyx3T4j.js → bot-D7M8ZtE6.js} +1 -1
- package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-DhKAnljP.js} +1 -1
- package/dist/web/assets/chevron-down-BAEcJitl.js +1 -0
- package/dist/web/assets/chevron-right-3G9s2cQ9.js +1 -0
- package/dist/web/assets/chevron-up-DTYF52H1.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-ppRhs95p.js → chunk-C3TS766N-DENE60SE.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DitqKiIT.js → client-choice-storage-DYZsrVr9.js} +1 -1
- package/dist/web/assets/{client-DwZ92xtu.js → client-gy7zrd7a.js} +1 -1
- package/dist/web/assets/{cloud-upload-HdzNTgr2.js → cloud-upload-De-XSMUr.js} +1 -1
- package/dist/web/assets/{copy-DTQhoBNg.js → copy-DEK20zbZ.js} +1 -1
- package/dist/web/assets/{cssMode-BRTtfXxU.js → cssMode-Dau-Fhqf.js} +1 -1
- package/dist/web/assets/{external-link-H1629UU6.js → external-link-DwDry0Fb.js} +1 -1
- package/dist/web/assets/{folder-open-CAGdWOrr.js → folder-open-DOb4AjV6.js} +1 -1
- package/dist/web/assets/{folder-plus-C14cs2mE.js → folder-plus-BAouDaXv.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DFUfuVvF.js → git-commit-horizontal-DZbHXcai.js} +1 -1
- package/dist/web/assets/{htmlMode-BVaCcL76.js → htmlMode-DlNEe6hu.js} +1 -1
- package/dist/web/assets/{icons-Bk2b68aC.js → icons-OQhKVrDc.js} +1 -1
- package/dist/web/assets/{image-0DPVY6Ev.js → image-BkYJDChH.js} +1 -1
- package/dist/web/assets/{index-B6XX_0h3.js → index-M_h2Ok4V.js} +2 -2
- package/dist/web/assets/{info-C8b_tafZ.js → info-Mj5lp4Ic.js} +1 -1
- package/dist/web/assets/{jsonMode-BCKKQmmV.js → jsonMode-CyOEyonV.js} +1 -1
- package/dist/web/assets/loader-circle-DXVtGvuV.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DozmNUOx.js → lspLanguageFeatures-DAYPzatg.js} +1 -1
- package/dist/web/assets/{maximize-2-CByk9-zN.js → maximize-2-BwFXSX6b.js} +1 -1
- package/dist/web/assets/{message-square-C889vRqm.js → message-square-C2nqfNLn.js} +1 -1
- package/dist/web/assets/{monaco.contribution-BITdsRbn.js → monaco.contribution-BZcNCJER.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DxAV1oS5.js → monaco.contribution-BZkfRhss.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BqA-XZ44.js → monaco.contribution-D7_X8TXe.js} +2 -2
- package/dist/web/assets/{monaco.contribution-B9q6qbbo.js → monaco.contribution-KyLdVay7.js} +2 -2
- package/dist/web/assets/{monitor-BtxlcLuI.js → monitor-B0Qj5Wea.js} +1 -1
- package/dist/web/assets/{paperclip-BeIdaspf.js → paperclip-CmrRruxi.js} +1 -1
- package/dist/web/assets/{pdf-perlzwEB.js → pdf-BM-9_48p.js} +1 -1
- package/dist/web/assets/play-CkACZ6Zo.js +1 -0
- package/dist/web/assets/plus-CB258e62.js +1 -0
- package/dist/web/assets/{presentation-0bzvu6_u.js → presentation-BYxhoSIo.js} +1 -1
- package/dist/web/assets/{python-B9hOnkOI.js → python-B3Mj03I5.js} +1 -1
- package/dist/web/assets/{refresh-cw-D61-Ozk3.js → refresh-cw-CwEmO71D.js} +1 -1
- package/dist/web/assets/{save-iEMNZoPe.js → save-S--FOuce.js} +1 -1
- package/dist/web/assets/{settings-lists-C84qxFmP.js → settings-lists-ChqDppMP.js} +1 -1
- package/dist/web/assets/square-BmPfHjGU.js +1 -0
- package/dist/web/assets/{square-terminal-Djpzo2Qs.js → square-terminal-CawpQtCi.js} +1 -1
- package/dist/web/assets/{submit-issue-command-HfKzyxg5.js → submit-issue-command-CFitxxmO.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-ClsXu39R.js → toggleHighContrast-D-cMCvXx.js} +1 -1
- package/dist/web/assets/training-CzbWtx75.js +1 -0
- package/dist/web/assets/{training-model-data-CIysl8wH.js → training-model-data-G-D64935.js} +1 -1
- package/dist/web/assets/{tsMode-nbmaMc-D.js → tsMode-9kzS1ijG.js} +1 -1
- package/dist/web/assets/{upload-C6ug8RD-.js → upload-CtYsSYrM.js} +1 -1
- package/dist/web/assets/{useAccountSettings-Dr9h4Qz_.js → useAccountSettings-DYYa6puz.js} +1 -1
- package/dist/web/assets/{useAgentInventory-ByCk2JAv.js → useAgentInventory-c5B_Tszj.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-C0eMm2g6.js → useChatContextSelection-DOISZpTz.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-Do0y_leJ.js → useLocalAgentSchedules-QJ8RsMKm.js} +1 -1
- package/dist/web/assets/{useQuery-D2MQ7e5U.js → useQuery-DuTGOe2b.js} +1 -1
- package/dist/web/assets/{wifi-off-Dr-CapyW.js → wifi-off-BOfP4Vmg.js} +1 -1
- package/dist/web/assets/{workers-DKvM2NdM.js → workers-BwGpyrdj.js} +1 -1
- package/dist/web/assets/x-5_iy6IDd.js +1 -0
- package/dist/web/assets/{yaml-C02vq4ar.js → yaml-BU4IWV_7.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-43MCH5SY.js +0 -2
- package/dist/chunks/apps-VNFGMQFG.js +0 -2
- package/dist/chunks/chunk-6D3FI2XT.js +0 -2
- package/dist/chunks/chunk-APKXXAUF.js +0 -2
- package/dist/chunks/chunk-JCLTFDVW.js +0 -2
- package/dist/chunks/chunk-KTIBXRWQ.js +0 -2
- package/dist/chunks/chunk-VEBW7NKD.js +0 -2
- package/dist/chunks/chunk-YDZBX4XQ.js +0 -2
- package/dist/chunks/cli-R7TAP6Z2.js +0 -2
- package/dist/chunks/connected-app-executor-LAEAQUJS.js +0 -2
- package/dist/chunks/connected-evidence-VKY6O2JW.js +0 -2
- package/dist/chunks/core-commands-5TNBVR72.js +0 -2
- package/dist/chunks/datasets-BIDZJYDC.js +0 -2
- package/dist/chunks/desktop-test-BY2MS3UL.js +0 -3
- package/dist/chunks/evaluation-coordination-FXB4DXZA.js +0 -2
- package/dist/chunks/experiment-improvements-JPDLKZXD.js +0 -2
- package/dist/chunks/experiments-IEN7RXLX.js +0 -2
- package/dist/chunks/experiments-signal-L32D36NH.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
- package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
- package/dist/chunks/human-review-6V6EMNVN.js +0 -2
- package/dist/chunks/learning-LAXMGWSQ.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
- package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +0 -2
- package/dist/chunks/opchat-SV67HVMX.js +0 -3
- package/dist/chunks/opchat-bounded-chat-KLMIYSZZ.js +0 -2
- package/dist/chunks/organizations-OZZFX7RG.js +0 -2
- package/dist/chunks/project-action-payload-TK6G4VMC.js +0 -2
- package/dist/chunks/project-agent-FFXPNXCO.js +0 -2
- package/dist/chunks/sandbox-command-4BCUDAED.js +0 -2
- package/dist/chunks/saved-work-M6PUHKCC.js +0 -2
- package/dist/chunks/setup-RMZ2BHLM.js +0 -2
- package/dist/chunks/training-5NT2YB2L.js +0 -2
- package/dist/chunks/training-UY6KRG4M.js +0 -2
- package/dist/chunks/training-hardware-UWQCRDMV.js +0 -3
- package/dist/chunks/training-hosted-CKSDRVL6.js +0 -2
- package/dist/web/assets/App-CCuh99JW.js +0 -54
- package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +0 -1
- package/dist/web/assets/chevron-down-DX1hzujj.js +0 -1
- package/dist/web/assets/chevron-right-DHN0y3KC.js +0 -1
- package/dist/web/assets/chevron-up-_QrW88NF.js +0 -1
- package/dist/web/assets/loader-circle-y-SSPwpk.js +0 -1
- package/dist/web/assets/play-CHXXdkuO.js +0 -1
- package/dist/web/assets/plus-DFFWjhPw.js +0 -1
- package/dist/web/assets/square-BE_4JMR3.js +0 -1
- package/dist/web/assets/training-DWfghwfZ.js +0 -1
- package/dist/web/assets/x-Jx2jlP9u.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{k as W}from"./chunk-WD4KAKEX.js";import{d as U,e as Y}from"./chunk-JVMSN7LH.js";import{Ia as K,Ka as V,La as N,Y as v,_ as w,ka as q}from"./chunk-BU6MW65V.js";import{V as z,W as B,Xb as j,f as _,k as M,l as $,la as G,ma as D,ta as F,ua as L}from"./chunk-D6L6UNUQ.js";import{S as P}from"./chunk-4PUOWSDE.js";import{e as E,i as I}from"./chunk-OTDDXEQ6.js";import{i as x,l as C,n as u}from"./chunk-RCT3O3HQ.js";import{a as c}from"./chunk-FTQLQJQV.js";import{constants as b}from"node:fs";import{lstat as oe,open as ne,readdir as ie}from"node:fs/promises";import S from"node:path";function pe(e){let t=N(e.taskset),{agentSnapshot:a,harnessRelease:s}=e.releasedHarness?{agentSnapshot:E.parse(e.releasedHarness.agentSnapshot),harnessRelease:I.parse(e.releasedHarness.harnessRelease)}:Q(e.taskset,e.profile);if(s.agentSnapshot.id!==a.id||s.agentSnapshot.contentHash!==a.contentHash)throw new Error("Released Harness does not bind the supplied Agent snapshot.");let d=V(e.taskset),n=e.taskset.tasks.length?e.taskset.tasks:e.selectedTask?[e.selectedTask]:[];if(!n.length)throw new Error("A portable Taskset release requires at least one resolved task.");let{environmentRelease:i,verifierSetRelease:o,tasksetRelease:l}=K({taskset:e.taskset,selectedTasks:n,adapterId:e.adapterId??A(e.taskset),admittedTasksetRelease:e.tasksetRelease,rewardExecution:e.rewardExecution}),R=e.now??(()=>new Date().toISOString()),f=M({schemaVersion:"openpond.runManifest.v1",id:`run-manifest-${u([s.contentHash,l.contentHash,e.model]).slice(0,24)}`,harnessRelease:{id:s.id,contentHash:s.contentHash},tasksetRelease:{id:l.id,contentHash:l.contentHash},model:{provider:e.model.providerId,model:e.model.modelId,revision:null,artifactHash:null,tokenizerRevision:null,chatTemplateHash:null},runtimeTarget:{adapterId:e.adapterId??A(e.taskset),placement:"local",runtimeVersion:"desktop-v1",capabilityReceipt:u({environment:d,tools:t,capabilities:e.taskset.capabilities})},limits:{maxTurns:128,timeoutMs:e.taskset.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:null},approval:null,createdAt:R(),metadata:{sourceTasksetId:e.taskset.id,sourceTasksetRevision:e.taskset.revision,reasoningEffort:e.reasoningEffort??null}});return{agentSnapshot:a,harnessRelease:s,environmentRelease:i,verifierSetRelease:o,tasksetRelease:l,runManifest:f}}c(pe,"compileDesktopHarnessContext");function Q(e,t){let a=e.profileRelease?{id:e.profileRelease.id,contentHash:k(e.profileRelease.contentHash)}:t?.git?.head?{id:`source-${h(t.git.head)}`,contentHash:k(t.git.head)}:null;return W({sourceRelease:a,profileHead:t?.git?.head??null,skills:se(t),agents:re(t)})}c(Q,"compileTemporaryProfileHarness");function ee(e){let t=e.artifacts.map(T),a=e.artifacts.find(n=>n.kind==="environment_state")??e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),s=J(e.attempt,e.grade),d=e.grade.components.map(n=>({id:`grader-${h(n.graderId)}-${e.grade.id}`,contentHash:u(n),mediaType:"application/vnd.openpond.grader-evidence+json",sizeBytes:Buffer.byteLength(C(n))}));return _.parse($({schemaVersion:"openpond.attemptReceipt.v1",id:`receipt-${u([e.manifest.contentHash,e.attempt.id,e.grade.id]).slice(0,24)}`,runManifest:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:e.attempt.taskId,seed:String(e.attempt.seed),terminal:!["infrastructure_failure","timeout","cancelled"].includes(s??""),failureClass:s,outputHash:e.attempt.infrastructureError?null:u(e.attempt.output),traceHash:a?k(a.sha256):u({attemptId:e.attempt.id,output:e.attempt.output,runtimeEventRefs:e.attempt.runtimeEventRefs,artifactRefs:e.attempt.artifactRefs,metadata:e.attempt.metadata}),artifactRefs:t,graderEvidenceRefs:d,startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,latencyMs:e.attempt.latencyMs,costUsd:e.attempt.costUsd,legacyAttemptRef:e.attempt.id,metadata:{legacyGradeRef:e.grade.id,rewardEligible:e.grade.rewardEligible,score:e.grade.score,passed:e.grade.passed,usage:e.attempt.metadata.usage??[]}}))}c(ee,"projectDesktopAttemptReceipt");function ue(e){let t=ee({manifest:e.context.runManifest,attempt:e.attempt,grade:e.grade,artifacts:e.artifacts}),a=e.context.tasksetRelease.tasks.find(r=>r.id===e.attempt.taskId);if(!a)throw new Error(`Task ${e.attempt.taskId} is absent from the admitted Taskset Release.`);let s=a.requiredOutputs??[],d=e.artifacts.filter(r=>r.kind==="output_artifact").map(r=>({path:typeof r.metadata.requiredOutputPath=="string"?r.metadata.requiredOutputPath:r.path,artifact:T(r),detectedMediaType:r.mediaType??null,status:"collected",parseStatus:X(r.metadata.parseStatus),schemaStatus:X(r.metadata.schemaStatus),evidenceRefs:[T(r)],metadata:{sourceArtifactId:r.id}})),n=F({id:`artifact-manifest-${t.id}`,attemptRef:{id:t.id,contentHash:t.contentHash},requiredOutputs:s,collectedArtifacts:d,createdAt:e.attempt.completedAt,metadata:{legacyAttemptRef:e.attempt.id}}),i=e.grade.components.map((r,O)=>te({component:r,grader:e.context.verifierSetRelease.graders.find(g=>g.id===r.graderId),evidenceRef:t.graderEvidenceRefs[O]??null,gradeScored:e.grade.score!==null,boundResult:e.grade.rewardComposition?.results.find(g=>g.graderId===r.graderId)})),o=L({requiredOutputs:s,manifest:n}),l=ae(e.attempt,e.grade),R=o.some(r=>r.status==="unscorable"&&r.failureOwner==="collector"),f=o.some(r=>r.status==="scored"&&!r.passed),p=l.outcomeClass==="completed"&&R?{outcomeClass:"collector_failure",failureOwner:"collector"}:l.outcomeClass==="completed"&&f?{outcomeClass:"incomplete_output",failureOwner:"policy"}:l,m=D({id:`reward-${u([t.contentHash,e.context.verifierSetRelease.contentHash,n.contentHash,e.grade.id]).slice(0,24)}`,attemptRef:{id:t.id,contentHash:t.contentHash},verifierSet:e.context.verifierSetRelease,artifactManifest:n,...p,components:[...i,...o],createdAt:e.grade.createdAt,metadata:{legacyGradeRef:e.grade.id,legacyAttemptRef:e.attempt.id,...e.grade.rewardComposition?{rewardComposition:e.grade.rewardComposition}:{}}});return{attemptReceipt:t,artifactManifest:n,rewardReceipt:m}}c(ue,"projectDesktopCanonicalReceipts");function Re(e){let t=e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),a=t?T(t):{id:`trace-${e.canonical.attemptReceipt.id}`,contentHash:e.canonical.attemptReceipt.traceHash,mediaType:"application/vnd.openpond.attempt-trace+json",sizeBytes:null},s=e.canonical.rewardReceipt.outcomeClass==="task_deadline"||e.canonical.rewardReceipt.outcomeClass==="infrastructure_timeout",d=e.canonical.rewardReceipt.outcomeClass==="cancelled";return j({id:`rollout-${u([e.canonical.attemptReceipt.contentHash,e.canonical.rewardReceipt.contentHash,a.contentHash]).slice(0,24)}`,attemptReceipt:e.canonical.attemptReceipt,rewardReceipt:e.canonical.rewardReceipt,artifactManifestRef:{id:e.canonical.artifactManifest.id,contentHash:e.canonical.artifactManifest.contentHash},tasksetRelease:{id:e.context.tasksetRelease.id,contentHash:e.context.tasksetRelease.contentHash},environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},harnessRelease:{id:e.context.harnessRelease.id,contentHash:e.context.harnessRelease.contentHash},taskId:e.attempt.taskId,split:e.attempt.split,model:e.context.runManifest.model,seed:String(e.attempt.seed),traceRef:a,optimizerSample:e.optimizerSample??null,environmentExecutions:[{id:`environment-execution-${e.attempt.id}`,environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},status:d?"cancelled":s?"timed_out":e.canonical.rewardReceipt.status==="scored"?"completed":"failed",startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,traceRefs:[a],metadata:{legacyAttemptRef:e.attempt.id,runtimeEventCount:e.attempt.runtimeEventRefs.length}}],startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,metadata:{source:"openpond.desktop-local-runtime",optimizerSamplePresent:!!e.optimizerSample}})}c(Re,"projectDesktopCanonicalRollout");function te(e){if(!e.grader)throw new Error(`Grade component ${e.component.graderId} has no admitted Verifier definition.`);let t=(e.boundResult?e.boundResult.status==="scored":e.gradeScored)?"scored":"unscorable",a=t==="scored"&&e.component.rewardEligible,s=e.evidenceRef?[e.evidenceRef]:[];return{verifierId:e.component.graderId,verifierVersion:e.component.graderVersion,status:t,rawScore:t==="scored"?e.boundResult?.rawScore??e.component.score:null,normalizedScore:t==="scored"?e.boundResult?.normalizedScore??e.component.score:null,weight:e.grader.weight,passed:e.component.passed,hardGate:e.component.hardGate,rewardEligible:a,rewardContribution:a?e.component.score:null,failureOwner:e.component.passed?null:t==="scored"?"policy":"verifier",feedback:e.component.feedback?[e.component.feedback]:[],visibleEvidenceRefs:e.grader.privileged?[]:s,privilegedEvidenceRefs:e.grader.privileged?s:[],metadata:{judge:e.component.judge??null,calibrationStatus:e.component.calibrationStatus,legacyEvidenceRefs:e.component.evidenceRefs}}}c(te,"portableRewardComponent");function ae(e,t){let a=B.safeParse(e.metadata.outcomeClass);if(a.success){let d=e.metadata.failureOwner===null?null:z.safeParse(e.metadata.failureOwner);if(d!==null&&!d.success)throw new Error("Attempt has an invalid explicit failure owner.");return{outcomeClass:a.data,failureOwner:d===null?null:d.data}}let s=J(e,t);return s?G({failureClass:s,timeoutKind:e.metadata.timeoutKind==="task_deadline"?"task_deadline":"infrastructure_timeout"}):t.score===null?{outcomeClass:"verifier_failure",failureOwner:"verifier"}:t.passed?{outcomeClass:"completed",failureOwner:null}:{outcomeClass:"policy_failure",failureOwner:"policy"}}c(ae,"canonicalOutcome");function X(e){return e==="passed"||e==="failed"?e:"not_requested"}c(X,"artifactValidationStatus");function se(e){return(e?.skills??[]).filter(t=>t.enabled).map(t=>({id:`skill-${h(t.name)}`,path:`skills/${h(t.name)}/SKILL.md`,contentHash:k(t.sourceHash),sizeBytes:Math.max(0,t.charCount),mediaType:"text/markdown",visibility:"policy"}))}c(se,"portableSkills");function re(e){let t=new Map;for(let a of e?.agents??[])a.enabled&&t.set(a.id,u({name:a.name,path:a.path}));return[...t].map(([a,s])=>({id:`agent-${h(a)}`,path:`agents/${h(a)}/release.json`,contentHash:k(s),sizeBytes:0,mediaType:"application/vnd.openpond.agent-release+json",visibility:"policy"}))}c(re,"portableAgents");function A(e){let t=e.environment.metadata.runtimeAdapterId;if(typeof t=="string"&&t.trim())return t.trim();let a=e.environment.metadata.benchmark;if(a&&typeof a=="object"&&!Array.isArray(a)){let s=Reflect.get(a,"id");if(typeof s=="string"&&s.trim())return`conformance:${s.trim()}`}return e.environment.kind==="work"?"openpond:desktop-work":e.environment.kind==="chat"?"openpond:desktop-text":`openpond:${h(e.environment.entrypoint)}`}c(A,"desktopTasksetRuntimeAdapterId");function T(e){return{id:e.id,contentHash:k(e.sha256),mediaType:e.mediaType??null,sizeBytes:e.sizeBytes}}c(T,"portableArtifact");function J(e,t){if(e.infrastructureError)return"infrastructure_failure";if(t.failureClass)return t.failureClass;let a=e.metadata.failureClass;return a==="policy_failure"||a==="grader_failure"||a==="environment_failure"||a==="infrastructure_failure"||a==="timeout"||a==="cancelled"?a:null}c(J,"attemptFailureClass");function k(e){return/^[a-f0-9]{64}$/.test(e)?e:u(e)}c(k,"hash");function h(e){return e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"asset"}c(h,"segment");async function be(e,t){if(e.metadata.taskDefinition!==void 0||e.metadata.rewardBinding!==void 0)return{taskset:e,generatedFiles:[]};let a=await oe(t);if(!a.isDirectory()||a.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");let s=new Map,d=0;async function n(i=""){for(let o of await ie(S.join(t,i),{withFileTypes:!0})){let l=S.posix.join(i,o.name);if(o.isSymbolicLink())throw new Error("Taskset files cannot contain symbolic links.");if(o.name.startsWith(".env"))throw new Error("Environment files cannot be included in a Taskset package.");if(o.isDirectory()){await n(l);continue}if(!o.isFile())throw new Error("Taskset packages require regular files.");if(U(l))continue;if(s.size>=1e4)throw new Error("Taskset source exceeds the file inventory limit.");let R=await ne(S.join(t,l),b.O_RDONLY|b.O_NOFOLLOW|b.O_NONBLOCK);try{let f=await R.stat();if(d+=f.size,!f.isFile()||d>w*3/4)throw new Error("Taskset source exceeds the package byte limit.");let p=Buffer.alloc(f.size),m=0;for(;m<p.length;){let r=await R.read(p,m,p.length-m,m);if(!r.bytesRead)throw new Error("Taskset source changed during capture.");m+=r.bytesRead}if((await R.read(Buffer.alloc(1),0,1,m)).bytesRead)throw new Error("Taskset source changed during capture.");s.set(l,p)}finally{await R.close()}}}return c(n,"visit"),await n(),Y(e,s,A(e))}c(be,"prepareAuthoredTasksetFiles");import{constants as H}from"node:fs";import{open as ce,realpath as Z}from"node:fs/promises";import y from"node:path";function Me(e,t){return t?new Set:new Set([...(e.modelResources?.assets??[]).map(a=>a.asset.id),...(e.learningResources?.assets??[]).map(a=>a.asset.id),...e.learningResources?v(e.learningResources).map(a=>a.asset.id):[]])}c(Me,"tasksetPackageInlineAssetIds");async function $e(e){let t=e.sources.length?await Z(e.root):y.resolve(e.root),a=[],s=new Set,d=0,n=c((i,o)=>{if(s.has(i.id))throw new Error(`Duplicate local Taskset asset: ${i.id}.`);if(s.add(i.id),d+=4*Math.ceil(o.byteLength/3),d>w)throw new Error("Local Taskset files exceed the package envelope.");a.push({asset:i,base64:Buffer.from(o).toString("base64")})},"append");for(let i of e.sources){let o=x.parse(i.asset);if(!i.sourcePath||y.isAbsolute(i.sourcePath))throw new Error(`Taskset asset ${o.id} requires a relative source path.`);let l=y.resolve(t,i.sourcePath);if(!l.startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);if(!(await Z(l)).startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);let f=await ce(l,H.O_RDONLY|H.O_NOFOLLOW|H.O_NONBLOCK);try{let p=await f.stat();if(!p.isFile()||p.size!==o.sizeBytes)throw new Error(`Taskset asset ${o.id} differs from its immutable file size.`);if(4*Math.ceil(p.size/3)+d>w)throw new Error("Local Taskset files exceed the package envelope.");let m=Buffer.alloc(p.size),r=0;for(;r<m.length;){let g=await f.read(m,r,m.length-r,r);if(!g.bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);r+=g.bytesRead}if((await f.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);n(o,m)}finally{await f.close()}}for(let i of[...e.content.modelResources?.assets??[],...e.content.learningResources?.assets??[]])s.has(i.asset.id)||n(i.asset,Buffer.from(P(i,i.asset),"utf8"));if(e.content.learningResources)for(let i of v(e.content.learningResources))s.has(i.asset.id)||n(i.asset,Buffer.from(i.base64,"base64"));if(e.fileOrder){if(new Set(e.fileOrder).size!==a.length||e.fileOrder.length!==a.length||e.fileOrder.some(o=>!s.has(o)))throw new Error("Saved package file order differs from its inventory.");let i=new Map(e.fileOrder.map((o,l)=>[o,l]));a.sort((o,l)=>i.get(o.asset.id)-i.get(l.asset.id))}return q({...e.content,files:a})}c($e,"captureLocalTasksetPackage");export{pe as a,ue as b,Re as c,A as d,be as e,Me as f,$e as g};
|
|
2
|
+
import{k as W}from"./chunk-64EDQ7UV.js";import{d as U,e as Y}from"./chunk-GR4MJJCE.js";import{Ia as K,Ka as V,La as N,Y as v,_ as w,ka as q}from"./chunk-BYVE4TMU.js";import{V as z,W as B,Xb as j,f as _,k as M,l as $,la as G,ma as D,ta as F,ua as L}from"./chunk-D6L6UNUQ.js";import{S as P}from"./chunk-ZEOYNUHL.js";import{e as E,i as I}from"./chunk-OTDDXEQ6.js";import{i as x,l as C,n as u}from"./chunk-RCT3O3HQ.js";import{a as c}from"./chunk-FTQLQJQV.js";import{constants as b}from"node:fs";import{lstat as oe,open as ne,readdir as ie}from"node:fs/promises";import S from"node:path";function pe(e){let t=N(e.taskset),{agentSnapshot:a,harnessRelease:s}=e.releasedHarness?{agentSnapshot:E.parse(e.releasedHarness.agentSnapshot),harnessRelease:I.parse(e.releasedHarness.harnessRelease)}:Q(e.taskset,e.profile);if(s.agentSnapshot.id!==a.id||s.agentSnapshot.contentHash!==a.contentHash)throw new Error("Released Harness does not bind the supplied Agent snapshot.");let d=V(e.taskset),n=e.taskset.tasks.length?e.taskset.tasks:e.selectedTask?[e.selectedTask]:[];if(!n.length)throw new Error("A portable Taskset release requires at least one resolved task.");let{environmentRelease:i,verifierSetRelease:o,tasksetRelease:l}=K({taskset:e.taskset,selectedTasks:n,adapterId:e.adapterId??A(e.taskset),admittedTasksetRelease:e.tasksetRelease,rewardExecution:e.rewardExecution}),R=e.now??(()=>new Date().toISOString()),f=M({schemaVersion:"openpond.runManifest.v1",id:`run-manifest-${u([s.contentHash,l.contentHash,e.model]).slice(0,24)}`,harnessRelease:{id:s.id,contentHash:s.contentHash},tasksetRelease:{id:l.id,contentHash:l.contentHash},model:{provider:e.model.providerId,model:e.model.modelId,revision:null,artifactHash:null,tokenizerRevision:null,chatTemplateHash:null},runtimeTarget:{adapterId:e.adapterId??A(e.taskset),placement:"local",runtimeVersion:"desktop-v1",capabilityReceipt:u({environment:d,tools:t,capabilities:e.taskset.capabilities})},limits:{maxTurns:128,timeoutMs:e.taskset.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:null},approval:null,createdAt:R(),metadata:{sourceTasksetId:e.taskset.id,sourceTasksetRevision:e.taskset.revision,reasoningEffort:e.reasoningEffort??null}});return{agentSnapshot:a,harnessRelease:s,environmentRelease:i,verifierSetRelease:o,tasksetRelease:l,runManifest:f}}c(pe,"compileDesktopHarnessContext");function Q(e,t){let a=e.profileRelease?{id:e.profileRelease.id,contentHash:k(e.profileRelease.contentHash)}:t?.git?.head?{id:`source-${h(t.git.head)}`,contentHash:k(t.git.head)}:null;return W({sourceRelease:a,profileHead:t?.git?.head??null,skills:se(t),agents:re(t)})}c(Q,"compileTemporaryProfileHarness");function ee(e){let t=e.artifacts.map(T),a=e.artifacts.find(n=>n.kind==="environment_state")??e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),s=J(e.attempt,e.grade),d=e.grade.components.map(n=>({id:`grader-${h(n.graderId)}-${e.grade.id}`,contentHash:u(n),mediaType:"application/vnd.openpond.grader-evidence+json",sizeBytes:Buffer.byteLength(C(n))}));return _.parse($({schemaVersion:"openpond.attemptReceipt.v1",id:`receipt-${u([e.manifest.contentHash,e.attempt.id,e.grade.id]).slice(0,24)}`,runManifest:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:e.attempt.taskId,seed:String(e.attempt.seed),terminal:!["infrastructure_failure","timeout","cancelled"].includes(s??""),failureClass:s,outputHash:e.attempt.infrastructureError?null:u(e.attempt.output),traceHash:a?k(a.sha256):u({attemptId:e.attempt.id,output:e.attempt.output,runtimeEventRefs:e.attempt.runtimeEventRefs,artifactRefs:e.attempt.artifactRefs,metadata:e.attempt.metadata}),artifactRefs:t,graderEvidenceRefs:d,startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,latencyMs:e.attempt.latencyMs,costUsd:e.attempt.costUsd,legacyAttemptRef:e.attempt.id,metadata:{legacyGradeRef:e.grade.id,rewardEligible:e.grade.rewardEligible,score:e.grade.score,passed:e.grade.passed,usage:e.attempt.metadata.usage??[]}}))}c(ee,"projectDesktopAttemptReceipt");function ue(e){let t=ee({manifest:e.context.runManifest,attempt:e.attempt,grade:e.grade,artifacts:e.artifacts}),a=e.context.tasksetRelease.tasks.find(r=>r.id===e.attempt.taskId);if(!a)throw new Error(`Task ${e.attempt.taskId} is absent from the admitted Taskset Release.`);let s=a.requiredOutputs??[],d=e.artifacts.filter(r=>r.kind==="output_artifact").map(r=>({path:typeof r.metadata.requiredOutputPath=="string"?r.metadata.requiredOutputPath:r.path,artifact:T(r),detectedMediaType:r.mediaType??null,status:"collected",parseStatus:X(r.metadata.parseStatus),schemaStatus:X(r.metadata.schemaStatus),evidenceRefs:[T(r)],metadata:{sourceArtifactId:r.id}})),n=F({id:`artifact-manifest-${t.id}`,attemptRef:{id:t.id,contentHash:t.contentHash},requiredOutputs:s,collectedArtifacts:d,createdAt:e.attempt.completedAt,metadata:{legacyAttemptRef:e.attempt.id}}),i=e.grade.components.map((r,O)=>te({component:r,grader:e.context.verifierSetRelease.graders.find(g=>g.id===r.graderId),evidenceRef:t.graderEvidenceRefs[O]??null,gradeScored:e.grade.score!==null,boundResult:e.grade.rewardComposition?.results.find(g=>g.graderId===r.graderId)})),o=L({requiredOutputs:s,manifest:n}),l=ae(e.attempt,e.grade),R=o.some(r=>r.status==="unscorable"&&r.failureOwner==="collector"),f=o.some(r=>r.status==="scored"&&!r.passed),p=l.outcomeClass==="completed"&&R?{outcomeClass:"collector_failure",failureOwner:"collector"}:l.outcomeClass==="completed"&&f?{outcomeClass:"incomplete_output",failureOwner:"policy"}:l,m=D({id:`reward-${u([t.contentHash,e.context.verifierSetRelease.contentHash,n.contentHash,e.grade.id]).slice(0,24)}`,attemptRef:{id:t.id,contentHash:t.contentHash},verifierSet:e.context.verifierSetRelease,artifactManifest:n,...p,components:[...i,...o],createdAt:e.grade.createdAt,metadata:{legacyGradeRef:e.grade.id,legacyAttemptRef:e.attempt.id,...e.grade.rewardComposition?{rewardComposition:e.grade.rewardComposition}:{}}});return{attemptReceipt:t,artifactManifest:n,rewardReceipt:m}}c(ue,"projectDesktopCanonicalReceipts");function Re(e){let t=e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),a=t?T(t):{id:`trace-${e.canonical.attemptReceipt.id}`,contentHash:e.canonical.attemptReceipt.traceHash,mediaType:"application/vnd.openpond.attempt-trace+json",sizeBytes:null},s=e.canonical.rewardReceipt.outcomeClass==="task_deadline"||e.canonical.rewardReceipt.outcomeClass==="infrastructure_timeout",d=e.canonical.rewardReceipt.outcomeClass==="cancelled";return j({id:`rollout-${u([e.canonical.attemptReceipt.contentHash,e.canonical.rewardReceipt.contentHash,a.contentHash]).slice(0,24)}`,attemptReceipt:e.canonical.attemptReceipt,rewardReceipt:e.canonical.rewardReceipt,artifactManifestRef:{id:e.canonical.artifactManifest.id,contentHash:e.canonical.artifactManifest.contentHash},tasksetRelease:{id:e.context.tasksetRelease.id,contentHash:e.context.tasksetRelease.contentHash},environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},harnessRelease:{id:e.context.harnessRelease.id,contentHash:e.context.harnessRelease.contentHash},taskId:e.attempt.taskId,split:e.attempt.split,model:e.context.runManifest.model,seed:String(e.attempt.seed),traceRef:a,optimizerSample:e.optimizerSample??null,environmentExecutions:[{id:`environment-execution-${e.attempt.id}`,environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},status:d?"cancelled":s?"timed_out":e.canonical.rewardReceipt.status==="scored"?"completed":"failed",startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,traceRefs:[a],metadata:{legacyAttemptRef:e.attempt.id,runtimeEventCount:e.attempt.runtimeEventRefs.length}}],startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,metadata:{source:"openpond.desktop-local-runtime",optimizerSamplePresent:!!e.optimizerSample}})}c(Re,"projectDesktopCanonicalRollout");function te(e){if(!e.grader)throw new Error(`Grade component ${e.component.graderId} has no admitted Verifier definition.`);let t=(e.boundResult?e.boundResult.status==="scored":e.gradeScored)?"scored":"unscorable",a=t==="scored"&&e.component.rewardEligible,s=e.evidenceRef?[e.evidenceRef]:[];return{verifierId:e.component.graderId,verifierVersion:e.component.graderVersion,status:t,rawScore:t==="scored"?e.boundResult?.rawScore??e.component.score:null,normalizedScore:t==="scored"?e.boundResult?.normalizedScore??e.component.score:null,weight:e.grader.weight,passed:e.component.passed,hardGate:e.component.hardGate,rewardEligible:a,rewardContribution:a?e.component.score:null,failureOwner:e.component.passed?null:t==="scored"?"policy":"verifier",feedback:e.component.feedback?[e.component.feedback]:[],visibleEvidenceRefs:e.grader.privileged?[]:s,privilegedEvidenceRefs:e.grader.privileged?s:[],metadata:{judge:e.component.judge??null,calibrationStatus:e.component.calibrationStatus,legacyEvidenceRefs:e.component.evidenceRefs}}}c(te,"portableRewardComponent");function ae(e,t){let a=B.safeParse(e.metadata.outcomeClass);if(a.success){let d=e.metadata.failureOwner===null?null:z.safeParse(e.metadata.failureOwner);if(d!==null&&!d.success)throw new Error("Attempt has an invalid explicit failure owner.");return{outcomeClass:a.data,failureOwner:d===null?null:d.data}}let s=J(e,t);return s?G({failureClass:s,timeoutKind:e.metadata.timeoutKind==="task_deadline"?"task_deadline":"infrastructure_timeout"}):t.score===null?{outcomeClass:"verifier_failure",failureOwner:"verifier"}:t.passed?{outcomeClass:"completed",failureOwner:null}:{outcomeClass:"policy_failure",failureOwner:"policy"}}c(ae,"canonicalOutcome");function X(e){return e==="passed"||e==="failed"?e:"not_requested"}c(X,"artifactValidationStatus");function se(e){return(e?.skills??[]).filter(t=>t.enabled).map(t=>({id:`skill-${h(t.name)}`,path:`skills/${h(t.name)}/SKILL.md`,contentHash:k(t.sourceHash),sizeBytes:Math.max(0,t.charCount),mediaType:"text/markdown",visibility:"policy"}))}c(se,"portableSkills");function re(e){let t=new Map;for(let a of e?.agents??[])a.enabled&&t.set(a.id,u({name:a.name,path:a.path}));return[...t].map(([a,s])=>({id:`agent-${h(a)}`,path:`agents/${h(a)}/release.json`,contentHash:k(s),sizeBytes:0,mediaType:"application/vnd.openpond.agent-release+json",visibility:"policy"}))}c(re,"portableAgents");function A(e){let t=e.environment.metadata.runtimeAdapterId;if(typeof t=="string"&&t.trim())return t.trim();let a=e.environment.metadata.benchmark;if(a&&typeof a=="object"&&!Array.isArray(a)){let s=Reflect.get(a,"id");if(typeof s=="string"&&s.trim())return`conformance:${s.trim()}`}return e.environment.kind==="work"?"openpond:desktop-work":e.environment.kind==="chat"?"openpond:desktop-text":`openpond:${h(e.environment.entrypoint)}`}c(A,"desktopTasksetRuntimeAdapterId");function T(e){return{id:e.id,contentHash:k(e.sha256),mediaType:e.mediaType??null,sizeBytes:e.sizeBytes}}c(T,"portableArtifact");function J(e,t){if(e.infrastructureError)return"infrastructure_failure";if(t.failureClass)return t.failureClass;let a=e.metadata.failureClass;return a==="policy_failure"||a==="grader_failure"||a==="environment_failure"||a==="infrastructure_failure"||a==="timeout"||a==="cancelled"?a:null}c(J,"attemptFailureClass");function k(e){return/^[a-f0-9]{64}$/.test(e)?e:u(e)}c(k,"hash");function h(e){return e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"asset"}c(h,"segment");async function be(e,t){if(e.metadata.taskDefinition!==void 0||e.metadata.rewardBinding!==void 0)return{taskset:e,generatedFiles:[]};let a=await oe(t);if(!a.isDirectory()||a.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");let s=new Map,d=0;async function n(i=""){for(let o of await ie(S.join(t,i),{withFileTypes:!0})){let l=S.posix.join(i,o.name);if(o.isSymbolicLink())throw new Error("Taskset files cannot contain symbolic links.");if(o.name.startsWith(".env"))throw new Error("Environment files cannot be included in a Taskset package.");if(o.isDirectory()){await n(l);continue}if(!o.isFile())throw new Error("Taskset packages require regular files.");if(U(l))continue;if(s.size>=1e4)throw new Error("Taskset source exceeds the file inventory limit.");let R=await ne(S.join(t,l),b.O_RDONLY|b.O_NOFOLLOW|b.O_NONBLOCK);try{let f=await R.stat();if(d+=f.size,!f.isFile()||d>w*3/4)throw new Error("Taskset source exceeds the package byte limit.");let p=Buffer.alloc(f.size),m=0;for(;m<p.length;){let r=await R.read(p,m,p.length-m,m);if(!r.bytesRead)throw new Error("Taskset source changed during capture.");m+=r.bytesRead}if((await R.read(Buffer.alloc(1),0,1,m)).bytesRead)throw new Error("Taskset source changed during capture.");s.set(l,p)}finally{await R.close()}}}return c(n,"visit"),await n(),Y(e,s,A(e))}c(be,"prepareAuthoredTasksetFiles");import{constants as H}from"node:fs";import{open as ce,realpath as Z}from"node:fs/promises";import y from"node:path";function Me(e,t){return t?new Set:new Set([...(e.modelResources?.assets??[]).map(a=>a.asset.id),...(e.learningResources?.assets??[]).map(a=>a.asset.id),...e.learningResources?v(e.learningResources).map(a=>a.asset.id):[]])}c(Me,"tasksetPackageInlineAssetIds");async function $e(e){let t=e.sources.length?await Z(e.root):y.resolve(e.root),a=[],s=new Set,d=0,n=c((i,o)=>{if(s.has(i.id))throw new Error(`Duplicate local Taskset asset: ${i.id}.`);if(s.add(i.id),d+=4*Math.ceil(o.byteLength/3),d>w)throw new Error("Local Taskset files exceed the package envelope.");a.push({asset:i,base64:Buffer.from(o).toString("base64")})},"append");for(let i of e.sources){let o=x.parse(i.asset);if(!i.sourcePath||y.isAbsolute(i.sourcePath))throw new Error(`Taskset asset ${o.id} requires a relative source path.`);let l=y.resolve(t,i.sourcePath);if(!l.startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);if(!(await Z(l)).startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);let f=await ce(l,H.O_RDONLY|H.O_NOFOLLOW|H.O_NONBLOCK);try{let p=await f.stat();if(!p.isFile()||p.size!==o.sizeBytes)throw new Error(`Taskset asset ${o.id} differs from its immutable file size.`);if(4*Math.ceil(p.size/3)+d>w)throw new Error("Local Taskset files exceed the package envelope.");let m=Buffer.alloc(p.size),r=0;for(;r<m.length;){let g=await f.read(m,r,m.length-r,r);if(!g.bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);r+=g.bytesRead}if((await f.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);n(o,m)}finally{await f.close()}}for(let i of[...e.content.modelResources?.assets??[],...e.content.learningResources?.assets??[]])s.has(i.asset.id)||n(i.asset,Buffer.from(P(i,i.asset),"utf8"));if(e.content.learningResources)for(let i of v(e.content.learningResources))s.has(i.asset.id)||n(i.asset,Buffer.from(i.base64,"base64"));if(e.fileOrder){if(new Set(e.fileOrder).size!==a.length||e.fileOrder.length!==a.length||e.fileOrder.some(o=>!s.has(o)))throw new Error("Saved package file order differs from its inventory.");let i=new Map(e.fileOrder.map((o,l)=>[o,l]));a.sort((o,l)=>i.get(o.asset.id)-i.get(l.asset.id))}return q({...e.content,files:a})}c($e,"captureLocalTasksetPackage");export{pe as a,ue as b,Re as c,A as d,be as e,Me as f,$e as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as D}from"./chunk-IR3YJWPW.js";import{Wb as G}from"./chunk-HG2YFMVU.js";import{b as $,c as z,d as H,e as V,f as R,g as U}from"./chunk-I6VMRQF4.js";import{Q as P,S as Q}from"./chunk-4PUOWSDE.js";import{fb as q,v,x as T}from"./chunk-ZY32SZ2P.js";import{n as E}from"./chunk-RCT3O3HQ.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a}from"./chunk-FTQLQJQV.js";async function K(e){let t=F(await e),[o,c,{QuickJSWASMModule:w}]=await Promise.all([t.importModuleLoader().then(F),t.importFFI(),import("./module-ES6BEMUI-ZVL3F6NW.js").then(F)]),l=await o();l.type="sync";let s=new c(l);return new w(l,s)}a(K,"newQuickJSWASMModuleFromVariant");function F(e){return e&&"default"in e&&e.default?e.default&&"default"in e.default&&e.default.default?e.default.default:e.default:e}a(F,"smartUnwrap");var k=class extends Error{static{a(this,"JavaScriptIsolateExecutionError")}constructor(t){super(t),this.name="JavaScriptIsolateExecutionError"}};async function O(e,t){te(e),e.signal?.throwIfAborted();let o=a(s=>new Error(`${e.errorPrefix}_${s}`),"error"),c=Date.now()+e.timeoutMs,{default:w}=await import("./dist-SKYG5LZO.js");e.signal?.throwIfAborted();let l=await K(w);e.signal?.throwIfAborted();try{return D.withScope(s=>{let m=s.manage(l.newRuntime());m.setMemoryLimit(33554432),m.setMaxStackSize(262144),m.setInterruptHandler(()=>Date.now()>=c||e.signal?.aborted===!0);let i=s.manage(m.newContext());t&&(c=Date.now()+e.timeoutMs,t.onExecutionReady()),e.deterministic&&s.manage(i.unwrapResult(i.evalCode("globalThis.Date = undefined; Math.random = () => { throw new Error('environment_random_requires_explicit_seed'); };")));let r=s.manage(i.unwrapResult(i.evalCode("JSON.stringify"))),p=s.manage(i.unwrapResult(i.evalCode(`JSON.parse(${JSON.stringify(JSON.stringify(e.value))})`))),S=s.manage(i.unwrapResult(i.evalCode(e.source,`${e.errorPrefix}.mjs`,{type:"module"}))),M=s.manage(X(i,S,c,e.signal,o)),g=s.manage(i.getProp(M,e.exportName));if(i.typeof(g)!=="function")throw o("function_export_missing");let b=s.manage(i.unwrapResult(i.callFunction(g,i.undefined,p))),d=s.manage(X(i,b,c,e.signal,o)),h=s.manage(i.unwrapResult(i.callFunction(r,i.undefined,d)));if(i.typeof(h)!=="string")throw o("result_not_json");let y=i.getString(h);if(new TextEncoder().encode(y).byteLength>e.maxResultBytes)throw o("result_too_large");if(e.signal?.throwIfAborted(),Date.now()>=c)throw o("timeout");let f=JSON.parse(y);return v(f,e.maxResultBytes),f})}catch(s){throw e.signal?.throwIfAborted(),new k(s instanceof Error?s.message:"JavaScript execution failed.")}}a(O,"executeJavaScriptIsolate");function te(e){if(!Number.isInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e5)throw new Error(`${e.errorPrefix}_timeout_invalid`);if(!Number.isInteger(e.maxResultBytes)||e.maxResultBytes<1||e.maxResultBytes>4194304)throw new Error(`${e.errorPrefix}_result_limit_invalid`);if(new TextEncoder().encode(e.source).byteLength>524288)throw new Error(`${e.errorPrefix}_source_too_large`);v(e.value,4194304)}a(te,"validateJavaScriptIsolateInput");function X(e,t,o,c,w){for(;;){if(c?.throwIfAborted(),Date.now()>=o)throw w("timeout");let l=e.getPromiseState(t);if(l.type==="fulfilled")return l.notAPromise?l.value.dup():l.value;if(l.type==="rejected")return e.unwrapResult(l);if(e.runtime.executePendingJobs(1).unwrap()===0)throw w("unresolved_promise")}}a(X,"settle");function I(e,t){let o=t.scope==="arguments"?e.action?.arguments:e[t.scope];for(let c of t.path){if(!o||typeof o!="object"||!Object.hasOwn(o,c))throw new Error("environment_service_reference_missing");o=o[c]}return o}a(I,"resolveValue");async function Y(e,t){if(!e.executionServices?.length)return t.controller(e);if(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e4)throw new Error("environment_timeout_invalid");v(e.value,4194304);let o=e.executionServices.map(m=>z.parse(m));if(o.length>16)throw new Error("environment_service_limit");if(new Set(o.map(m=>m.id)).size!==o.length)throw new Error("environment_service_identity_collision");let c=Date.now(),w=new AbortController,l=e.signal?AbortSignal.any([e.signal,w.signal]):w.signal,s=setTimeout(()=>w.abort(new Error("environment_timeout")),e.timeoutMs);try{let m=Object.create(null);for(let r of o){if(l.throwIfAborted(),r.operation!==e.operation||r.operation==="step"&&r.toolName!==e.value.action?.name)throw new Error("environment_service_operation_mismatch");let p=Math.min(r.timeoutMs,e.timeoutMs-(Date.now()-c));if(p<1)throw new Error("environment_timeout");let S=new AbortController,M=AbortSignal.any([l,S.signal]),g=setTimeout(()=>S.abort(new Error("environment_service_timeout")),p),b=Date.now();try{if(r.kind==="sqlite.v1"){if(!t.sql)throw new Error("environment_sql_executor_required");let d=I(e.value,r.sql);if(typeof d!="string"||!d.length||new TextEncoder().encode(d).byteLength>65536||d.includes("\0")){m[r.id]={status:"rejected",code:"invalid_submission"};continue}let h=$({schemaVersion:"openpond.sqlExecution.v1",snapshot:I(e.value,r.snapshot),sql:d,maxRows:r.maxRows,maxResultBytes:r.maxResultBytes});m[r.id]=await t.sql({request:h,timeoutMs:e.timeoutMs,signal:M})}else{let d=I(e.value,r.source),h=I(e.value,r.cases);if(typeof d!="string"||new TextEncoder().encode(d).byteLength>524288){m[r.id]={status:"rejected",code:"invalid_submission"};continue}if(!Array.isArray(h)||!h.length||h.length>r.maxCases||h.some(f=>!f||typeof f!="object"||!Object.hasOwn(f,"input")))throw new Error("environment_service_cases_invalid");let y=[];for(let f of h){let u=p-(Date.now()-b);if(u<1&&(S.abort(new Error("environment_service_timeout")),M.throwIfAborted()),y.push(await t.candidate({source:d,exportName:r.exportName,value:structuredClone(f.input),timeoutMs:Math.max(1,u),maxResultBytes:r.maxResultBytes,deterministic:!0,errorPrefix:"candidate",signal:M})),new TextEncoder().encode(JSON.stringify({status:"completed",cases:y})).byteLength>r.maxResultBytes)throw new k("candidate_result_too_large")}m[r.id]={status:"completed",cases:y}}}catch(d){if(l.throwIfAborted(),S.signal.aborted)m[r.id]={status:"rejected",code:"timeout"};else if(d instanceof k)m[r.id]={status:"rejected",code:"execution_failed"};else throw d}finally{clearTimeout(g)}}l.throwIfAborted();let i=e.timeoutMs-(Date.now()-c);if(i<1)throw new Error("environment_timeout");return await t.controller({...e,executionServices:void 0,value:{...e.value,services:m},timeoutMs:i,signal:l})}finally{clearTimeout(s)}}a(Y,"executeEnvironmentWithServices");async function re(e){let t=V.parse(e.operation);return Y(e,{candidate:O,controller:a(async o=>R.parse(await O({...o,exportName:t,maxResultBytes:1572864,deterministic:!0,errorPrefix:"environment"})),"controller")})}a(re,"executeJavaScriptEnvironment");var J=class extends Error{static{a(this,"JavaScriptEnvironmentActionError")}code;constructor(t){super(`environment_${t}`),this.code=t,this.name="JavaScriptEnvironmentActionError"}};async function Qe(e){let t=U(e.definition),o=Q(e.asset,t.module);if(!Number.isSafeInteger(e.seed))throw new Error("environment_seed_invalid");let c=e.seed;v(e.input,1048576),v(e.initialState,t.maxStateBytes);let w=structuredClone(e.input),l=structuredClone(e.initialState),s=e.execute??re,m=new AbortController,i=e.signal?AbortSignal.any([e.signal,m.signal]):m.signal,r={},p=0,S=!1,M=!1,g=null,b=[],d=null;async function h(f,u){if(S||M)throw new Error("environment_closed");if(g)throw new Error("environment_operation_in_progress");i.throwIfAborted(),u&&(v(u,262144),u=structuredClone(u));let L=E(r),_=u?t.tools.find(x=>x.name===u.name):null;if(f==="step"){if(p>=t.maxSteps)throw new J("step_budget_exhausted");p++}let j=a((x,C)=>b.push({sequence:b.length,operation:f,toolName:u?.name??null,arguments:u?structuredClone(u.arguments):null,observation:x,beforeStateHash:L,afterStateHash:E(r),error:C}),"record");try{if(u&&!_)throw new J("unknown_tool");if(u&&_&&!T(_.inputSchema,u.arguments).valid)throw new J("invalid_arguments");let x=t.executionServices?.filter(N=>N.operation===f&&(f!=="step"||N.toolName===u?.name)),C=s({source:o,operation:f,value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:u?structuredClone(u):null},timeoutMs:Math.min(t.operationTimeoutMs,_?.timeoutMs??t.operationTimeoutMs),signal:i,...x?.length?{executionServices:x}:{}});g=C;let A=R.parse(await C);if(i.throwIfAborted(),v(A.state,t.maxStateBytes),v(A.observation,t.maxObservationBytes),(f==="collect"||_?.sideEffect==="read")&&E(A.state)!==L)throw new Error("environment_read_changed_state");r=structuredClone(A.state);let B=structuredClone(A.observation);return j(B,null),{state:structuredClone(r),observation:B}}catch(x){throw j(null,x instanceof Error?x.message:"environment_execution_failed"),x}finally{g=null}}a(h,"invoke");async function y(){return d||(M=!0,m.abort(new Error("environment_destroyed")),d=(async()=>{try{try{await g}catch{}await s({source:o,operation:"destroy",value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:null},timeoutMs:t.operationTimeoutMs})}finally{r={},S=!0}})(),d)}a(y,"destroy");try{await h("create");let f=await h("reset"),u=E(r),L=a(()=>{if(S)throw new Error("environment_closed");return{definition:{id:t.id,revision:t.revision,contentHash:t.contentHash},inputHash:E(w),seed:c,initialStateHash:u,finalStateHash:E(r),state:structuredClone(r),events:structuredClone(b)}},"snapshot");return{definition:structuredClone(t),observation:f.observation,async step(_){return(await h("step",_)).observation},async collect(){let _=await h("collect");return{...L(),observation:_.observation}},snapshot:L,destroy:y}}catch(f){try{await y()}catch{}throw f}}a(Qe,"createJavaScriptEnvironmentSession");var ne=n.string().trim().min(1).max(500),oe=n.string().regex(/^[a-f0-9]{64}$/),W=n.object({kind:n.literal("model"),id:n.string().trim().min(1).max(191),taskId:ne,admissionHash:oe,model:G,instructions:n.string().max(262144),harness:q.optional(),input:n.record(n.string(),n.unknown()),policyVisibleContext:n.record(n.string(),n.unknown()),timeoutMs:n.number().int().positive().max(36e5),environment:n.discriminatedUnion("kind",[n.object({kind:n.literal("text")}).strict(),n.object({kind:n.literal("javascript"),definition:H,asset:P,initialState:n.record(n.string(),n.unknown()),seed:n.number().int().safe()}).strict()])}).strict(),Ye=n.discriminatedUnion("kind",[W,n.object({kind:n.literal("profile"),request:n.unknown()}).strict()]);var Z=n.string().trim().min(1).max(200),mt=n.object({receiptId:Z,taskId:Z,seed:n.string(),request:W}).strict(),ee=class extends Error{constructor(o,c,w=409){super(c);this.code=o;this.status=w}code;status;static{a(this,"LocalExperimentError")}};export{k as a,te as b,Y as c,J as d,Qe as e,W as f,Ye as g,ee as h};
|
|
2
|
+
import{c as D}from"./chunk-IR3YJWPW.js";import{Wb as G}from"./chunk-WXG3G2O6.js";import{b as $,c as z,d as H,e as V,f as R,g as U}from"./chunk-I6VMRQF4.js";import{Q as P,S as Q}from"./chunk-ZEOYNUHL.js";import{fb as q,v,x as T}from"./chunk-ZY32SZ2P.js";import{n as E}from"./chunk-RCT3O3HQ.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a}from"./chunk-FTQLQJQV.js";async function K(e){let t=F(await e),[o,c,{QuickJSWASMModule:w}]=await Promise.all([t.importModuleLoader().then(F),t.importFFI(),import("./module-ES6BEMUI-ZVL3F6NW.js").then(F)]),l=await o();l.type="sync";let s=new c(l);return new w(l,s)}a(K,"newQuickJSWASMModuleFromVariant");function F(e){return e&&"default"in e&&e.default?e.default&&"default"in e.default&&e.default.default?e.default.default:e.default:e}a(F,"smartUnwrap");var k=class extends Error{static{a(this,"JavaScriptIsolateExecutionError")}constructor(t){super(t),this.name="JavaScriptIsolateExecutionError"}};async function O(e,t){te(e),e.signal?.throwIfAborted();let o=a(s=>new Error(`${e.errorPrefix}_${s}`),"error"),c=Date.now()+e.timeoutMs,{default:w}=await import("./dist-SKYG5LZO.js");e.signal?.throwIfAborted();let l=await K(w);e.signal?.throwIfAborted();try{return D.withScope(s=>{let m=s.manage(l.newRuntime());m.setMemoryLimit(33554432),m.setMaxStackSize(262144),m.setInterruptHandler(()=>Date.now()>=c||e.signal?.aborted===!0);let i=s.manage(m.newContext());t&&(c=Date.now()+e.timeoutMs,t.onExecutionReady()),e.deterministic&&s.manage(i.unwrapResult(i.evalCode("globalThis.Date = undefined; Math.random = () => { throw new Error('environment_random_requires_explicit_seed'); };")));let r=s.manage(i.unwrapResult(i.evalCode("JSON.stringify"))),p=s.manage(i.unwrapResult(i.evalCode(`JSON.parse(${JSON.stringify(JSON.stringify(e.value))})`))),S=s.manage(i.unwrapResult(i.evalCode(e.source,`${e.errorPrefix}.mjs`,{type:"module"}))),M=s.manage(X(i,S,c,e.signal,o)),g=s.manage(i.getProp(M,e.exportName));if(i.typeof(g)!=="function")throw o("function_export_missing");let b=s.manage(i.unwrapResult(i.callFunction(g,i.undefined,p))),d=s.manage(X(i,b,c,e.signal,o)),h=s.manage(i.unwrapResult(i.callFunction(r,i.undefined,d)));if(i.typeof(h)!=="string")throw o("result_not_json");let y=i.getString(h);if(new TextEncoder().encode(y).byteLength>e.maxResultBytes)throw o("result_too_large");if(e.signal?.throwIfAborted(),Date.now()>=c)throw o("timeout");let f=JSON.parse(y);return v(f,e.maxResultBytes),f})}catch(s){throw e.signal?.throwIfAborted(),new k(s instanceof Error?s.message:"JavaScript execution failed.")}}a(O,"executeJavaScriptIsolate");function te(e){if(!Number.isInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e5)throw new Error(`${e.errorPrefix}_timeout_invalid`);if(!Number.isInteger(e.maxResultBytes)||e.maxResultBytes<1||e.maxResultBytes>4194304)throw new Error(`${e.errorPrefix}_result_limit_invalid`);if(new TextEncoder().encode(e.source).byteLength>524288)throw new Error(`${e.errorPrefix}_source_too_large`);v(e.value,4194304)}a(te,"validateJavaScriptIsolateInput");function X(e,t,o,c,w){for(;;){if(c?.throwIfAborted(),Date.now()>=o)throw w("timeout");let l=e.getPromiseState(t);if(l.type==="fulfilled")return l.notAPromise?l.value.dup():l.value;if(l.type==="rejected")return e.unwrapResult(l);if(e.runtime.executePendingJobs(1).unwrap()===0)throw w("unresolved_promise")}}a(X,"settle");function I(e,t){let o=t.scope==="arguments"?e.action?.arguments:e[t.scope];for(let c of t.path){if(!o||typeof o!="object"||!Object.hasOwn(o,c))throw new Error("environment_service_reference_missing");o=o[c]}return o}a(I,"resolveValue");async function Y(e,t){if(!e.executionServices?.length)return t.controller(e);if(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e4)throw new Error("environment_timeout_invalid");v(e.value,4194304);let o=e.executionServices.map(m=>z.parse(m));if(o.length>16)throw new Error("environment_service_limit");if(new Set(o.map(m=>m.id)).size!==o.length)throw new Error("environment_service_identity_collision");let c=Date.now(),w=new AbortController,l=e.signal?AbortSignal.any([e.signal,w.signal]):w.signal,s=setTimeout(()=>w.abort(new Error("environment_timeout")),e.timeoutMs);try{let m=Object.create(null);for(let r of o){if(l.throwIfAborted(),r.operation!==e.operation||r.operation==="step"&&r.toolName!==e.value.action?.name)throw new Error("environment_service_operation_mismatch");let p=Math.min(r.timeoutMs,e.timeoutMs-(Date.now()-c));if(p<1)throw new Error("environment_timeout");let S=new AbortController,M=AbortSignal.any([l,S.signal]),g=setTimeout(()=>S.abort(new Error("environment_service_timeout")),p),b=Date.now();try{if(r.kind==="sqlite.v1"){if(!t.sql)throw new Error("environment_sql_executor_required");let d=I(e.value,r.sql);if(typeof d!="string"||!d.length||new TextEncoder().encode(d).byteLength>65536||d.includes("\0")){m[r.id]={status:"rejected",code:"invalid_submission"};continue}let h=$({schemaVersion:"openpond.sqlExecution.v1",snapshot:I(e.value,r.snapshot),sql:d,maxRows:r.maxRows,maxResultBytes:r.maxResultBytes});m[r.id]=await t.sql({request:h,timeoutMs:e.timeoutMs,signal:M})}else{let d=I(e.value,r.source),h=I(e.value,r.cases);if(typeof d!="string"||new TextEncoder().encode(d).byteLength>524288){m[r.id]={status:"rejected",code:"invalid_submission"};continue}if(!Array.isArray(h)||!h.length||h.length>r.maxCases||h.some(f=>!f||typeof f!="object"||!Object.hasOwn(f,"input")))throw new Error("environment_service_cases_invalid");let y=[];for(let f of h){let u=p-(Date.now()-b);if(u<1&&(S.abort(new Error("environment_service_timeout")),M.throwIfAborted()),y.push(await t.candidate({source:d,exportName:r.exportName,value:structuredClone(f.input),timeoutMs:Math.max(1,u),maxResultBytes:r.maxResultBytes,deterministic:!0,errorPrefix:"candidate",signal:M})),new TextEncoder().encode(JSON.stringify({status:"completed",cases:y})).byteLength>r.maxResultBytes)throw new k("candidate_result_too_large")}m[r.id]={status:"completed",cases:y}}}catch(d){if(l.throwIfAborted(),S.signal.aborted)m[r.id]={status:"rejected",code:"timeout"};else if(d instanceof k)m[r.id]={status:"rejected",code:"execution_failed"};else throw d}finally{clearTimeout(g)}}l.throwIfAborted();let i=e.timeoutMs-(Date.now()-c);if(i<1)throw new Error("environment_timeout");return await t.controller({...e,executionServices:void 0,value:{...e.value,services:m},timeoutMs:i,signal:l})}finally{clearTimeout(s)}}a(Y,"executeEnvironmentWithServices");async function re(e){let t=V.parse(e.operation);return Y(e,{candidate:O,controller:a(async o=>R.parse(await O({...o,exportName:t,maxResultBytes:1572864,deterministic:!0,errorPrefix:"environment"})),"controller")})}a(re,"executeJavaScriptEnvironment");var J=class extends Error{static{a(this,"JavaScriptEnvironmentActionError")}code;constructor(t){super(`environment_${t}`),this.code=t,this.name="JavaScriptEnvironmentActionError"}};async function Qe(e){let t=U(e.definition),o=Q(e.asset,t.module);if(!Number.isSafeInteger(e.seed))throw new Error("environment_seed_invalid");let c=e.seed;v(e.input,1048576),v(e.initialState,t.maxStateBytes);let w=structuredClone(e.input),l=structuredClone(e.initialState),s=e.execute??re,m=new AbortController,i=e.signal?AbortSignal.any([e.signal,m.signal]):m.signal,r={},p=0,S=!1,M=!1,g=null,b=[],d=null;async function h(f,u){if(S||M)throw new Error("environment_closed");if(g)throw new Error("environment_operation_in_progress");i.throwIfAborted(),u&&(v(u,262144),u=structuredClone(u));let L=E(r),_=u?t.tools.find(x=>x.name===u.name):null;if(f==="step"){if(p>=t.maxSteps)throw new J("step_budget_exhausted");p++}let j=a((x,C)=>b.push({sequence:b.length,operation:f,toolName:u?.name??null,arguments:u?structuredClone(u.arguments):null,observation:x,beforeStateHash:L,afterStateHash:E(r),error:C}),"record");try{if(u&&!_)throw new J("unknown_tool");if(u&&_&&!T(_.inputSchema,u.arguments).valid)throw new J("invalid_arguments");let x=t.executionServices?.filter(N=>N.operation===f&&(f!=="step"||N.toolName===u?.name)),C=s({source:o,operation:f,value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:u?structuredClone(u):null},timeoutMs:Math.min(t.operationTimeoutMs,_?.timeoutMs??t.operationTimeoutMs),signal:i,...x?.length?{executionServices:x}:{}});g=C;let A=R.parse(await C);if(i.throwIfAborted(),v(A.state,t.maxStateBytes),v(A.observation,t.maxObservationBytes),(f==="collect"||_?.sideEffect==="read")&&E(A.state)!==L)throw new Error("environment_read_changed_state");r=structuredClone(A.state);let B=structuredClone(A.observation);return j(B,null),{state:structuredClone(r),observation:B}}catch(x){throw j(null,x instanceof Error?x.message:"environment_execution_failed"),x}finally{g=null}}a(h,"invoke");async function y(){return d||(M=!0,m.abort(new Error("environment_destroyed")),d=(async()=>{try{try{await g}catch{}await s({source:o,operation:"destroy",value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:null},timeoutMs:t.operationTimeoutMs})}finally{r={},S=!0}})(),d)}a(y,"destroy");try{await h("create");let f=await h("reset"),u=E(r),L=a(()=>{if(S)throw new Error("environment_closed");return{definition:{id:t.id,revision:t.revision,contentHash:t.contentHash},inputHash:E(w),seed:c,initialStateHash:u,finalStateHash:E(r),state:structuredClone(r),events:structuredClone(b)}},"snapshot");return{definition:structuredClone(t),observation:f.observation,async step(_){return(await h("step",_)).observation},async collect(){let _=await h("collect");return{...L(),observation:_.observation}},snapshot:L,destroy:y}}catch(f){try{await y()}catch{}throw f}}a(Qe,"createJavaScriptEnvironmentSession");var ne=n.string().trim().min(1).max(500),oe=n.string().regex(/^[a-f0-9]{64}$/),W=n.object({kind:n.literal("model"),id:n.string().trim().min(1).max(191),taskId:ne,admissionHash:oe,model:G,instructions:n.string().max(262144),harness:q.optional(),input:n.record(n.string(),n.unknown()),policyVisibleContext:n.record(n.string(),n.unknown()),timeoutMs:n.number().int().positive().max(36e5),environment:n.discriminatedUnion("kind",[n.object({kind:n.literal("text")}).strict(),n.object({kind:n.literal("javascript"),definition:H,asset:P,initialState:n.record(n.string(),n.unknown()),seed:n.number().int().safe()}).strict()])}).strict(),Ye=n.discriminatedUnion("kind",[W,n.object({kind:n.literal("profile"),request:n.unknown()}).strict()]);var Z=n.string().trim().min(1).max(200),mt=n.object({receiptId:Z,taskId:Z,seed:n.string(),request:W}).strict(),ee=class extends Error{constructor(o,c,w=409){super(c);this.code=o;this.status=w}code;status;static{a(this,"LocalExperimentError")}};export{k as a,te as b,Y as c,J as d,Qe as e,W as f,Ye as g,ee as h};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as As,b as Ms}from"./chunk-CO23RRN7.js";import{a as Es,e as $e,f as Cs,g as Tt}from"./chunk-3Z4VM2LF.js";import{a as xs,c as Is}from"./chunk-XVDFJ3ZF.js";import{h as ne}from"./chunk-RCQYEHHD.js";import{a as ee,b as _s}from"./chunk-SDHG6CKU.js";import{b as ys,c as bs,d as yt}from"./chunk-GYYJ47GX.js";import{a as ws,b as vs,c as Ts,d as qe,e as Ss,g as vt}from"./chunk-WCNPGKST.js";import{a as wt,c as Rs}from"./chunk-AFH462DO.js";import{b as Kr,e as Xr,f as lt,g as ut}from"./chunk-CIZI6Z7D.js";import{F as gt,G as fs,H as ht,I as kt,J as gs,K as hs,N as ks,x as ps}from"./chunk-MOXIGLN2.js";import{a as ve}from"./chunk-7KWD2I6W.js";import{g as pt,i as ft}from"./chunk-RY46UPBO.js";import{s as br}from"./chunk-OFJPOTES.js";import{d as Ne}from"./chunk-U7D6Q744.js";import{ja as rs,qa as ss,sa as os,x as ts}from"./chunk-HG2YFMVU.js";import{M as V,N as as,O as ns,P as is,Q as mt,R as ds,S as q,T as cs,U as je,V as ls,X as us,Y as Vt,Z as ms}from"./chunk-7OKZCJHS.js";import{l as Ft}from"./chunk-7NCM6GBN.js";import{d as Zr,f as W,g as Qr,i as es}from"./chunk-JT5YQ52I.js";import{k as Nr}from"./chunk-WGQ3FMRF.js";import{c as ct}from"./chunk-JVMSN7LH.js";import{Ba as Gr,Ca as Re,Ha as Yr,Ia as De,K as qr,L as $r,M as Lr,N as Ur,P as Br,aa as Wr,ba as Fr,ia as Vr,ua as zr,wa as we,xa as Jr}from"./chunk-BU6MW65V.js";import{x as ae}from"./chunk-DXJC3QW7.js";import{C as Or,S as Hr,T as Dr,Tb as jr}from"./chunk-D6L6UNUQ.js";import{f as Rr}from"./chunk-AJXWJLZA.js";import{L,M as Ar,Ob as Pr,R as Wt,S as oe,X as dt,Y as Mr,ba as He,d as Er,g as Cr,pb as ke,qb as ye}from"./chunk-4PUOWSDE.js";import{bb as be,cb as Ir,ea as it,v as Ge}from"./chunk-ZY32SZ2P.js";import{l as _r,m as xr}from"./chunk-OTDDXEQ6.js";import{i as Tr,m as se,n as k}from"./chunk-RCT3O3HQ.js";import{m as Sr}from"./chunk-UGOK7VTC.js";import{A as P}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var zt={buildIntent:"verifiable_reward",methodHint:"grpo"};async function ii(e){let t=await aa(e.store,e.workspaceId,e.reviewRef),r=`harness-review-${k({review:t.contentHash,strategy:zt}).slice(0,24)}`,s=(await e.store.listTaskCreationSnapshots(e.profileId)).find(c=>c.request.candidateId===r);if(s)return s;let[a,o,n]=await Promise.all([e.store.listHarnessImprovementArtifacts(e.workspaceId,"route_decision",1e3),e.store.listHarnessImprovementArtifacts(e.workspaceId,"trigger_decision",1e3),e.store.listHarnessImprovementArtifacts(e.workspaceId,"observation",1e3)]),i=new Map(a.map(c=>[_e(c),c])),u=new Map(o.map(c=>[_e(c),c])),f=new Map(n.map(c=>[_e(c),c])),p=new Map;for(let c of t.selectedEvidence){if(c.kind!=="route_decision")continue;let m=i.get(_e(c.evidence)),g=m?u.get(_e(m.trigger)):null;if(!m||!g)throw new Error(`Harness review evidence ${c.evidence.id} cannot be reconstructed.`);let h=g.observations.map(y=>f.get(_e(y))??null).filter(y=>y?.runRef===c.sourceRef);if(!h.length)throw new Error(`Harness review source ${c.sourceRef} has no exact observation evidence.`);let w=p.get(c.sourceRef)??{turnIds:new Set,evidenceRefs:[],sourcePolicies:[]};for(let y of h)w.turnIds.add(y.turnId);w.evidenceRefs.push(c.evidence),w.sourcePolicies.push(c.sourcePolicy),p.set(c.sourceRef,w)}if(!p.size)throw new Error("Harness Taskset review has no reconstructable source runs.");let l=[];for(let[c,m]of[...p.entries()].sort(([g],[h])=>g.localeCompare(h))){let g=await e.taskCreator.addSessionSource({profileId:e.profileId,sessionId:c,turnIds:[...m.turnIds].sort(),consentScope:"selected_turns"}),h=Array.isArray(g.metadata.harnessEvaluationReviews)?g.metadata.harnessEvaluationReviews:[],w={...g,metadata:{...g.metadata,harnessEvaluationReviews:Gt([...h,{id:t.id,contentHash:t.contentHash,workspaceId:t.workspaceRef,harnessRelease:t.harnessRelease,claimFingerprint:t.claim?.fingerprint??null,evidenceRefs:m.evidenceRefs,sourcePolicies:m.sourcePolicies}])}};l.push(await e.store.upsertTrainingSource(w))}return e.startCreation({profileId:e.profileId,sourceIds:l.map(c=>c.id),surface:"task_candidate",mode:"customize",entryMode:"automated",resourceIntent:"workproduct",buildIntent:zt.buildIntent,buildSpecification:null,objective:t.claim?.statement??t.reason,methodHint:zt.methodHint,preferredBaseModelId:null,preferredBaseModel:null,candidateId:r,analysisModel:e.analysisModel??null,analysisReasoningEffort:e.analysisReasoningEffort??null,createImproveRunId:null,targetIntent:{kind:"model",id:null,displayName:null,operation:"create"}})}d(ii,"startHarnessReviewTasksetAuthoring");function di(e){let t=e.flatMap(o=>Array.isArray(o.metadata.harnessEvaluationReviews)?o.metadata.harnessEvaluationReviews.filter(Jt):[]);if(!t.length)return null;let r=`${String(t[0].id)}:${String(t[0].contentHash)}`,s=t.filter(o=>`${String(o.id)}:${String(o.contentHash)}`===r);if(s.length!==e.length)return null;let a=s[0];return{review:{id:String(a.id),contentHash:String(a.contentHash),workspaceId:String(a.workspaceId),harnessRelease:a.harnessRelease,claimFingerprint:typeof a.claimFingerprint=="string"?a.claimFingerprint:null},evidenceRefs:Gt(s.flatMap(o=>Array.isArray(o.evidenceRefs)?o.evidenceRefs:[])),sourcePolicies:Gt(s.flatMap(o=>Array.isArray(o.sourcePolicies)?o.sourcePolicies:[]))}}d(di,"harnessReviewLineageFromSources");async function Ps(e){let t=e.taskset.metadata.harnessEvaluationLineage;if(!Jt(t)||!Jt(t.review))return null;let r=String(t.review.workspaceId??""),s={id:String(t.review.id??""),contentHash:String(t.review.contentHash??"")};if(!r||!s.id||!s.contentHash)throw new Error("Taskset Harness Evaluation lineage is incomplete.");let a=await e.store.listHarnessImprovementArtifacts(r,"evaluation_review",1e3),o=a.find(c=>_e(c)===_e(s));if(!o)throw new Error("Originating Harness Evaluation review was not found.");let n=e.evaluationResult?{id:e.evaluationResult.id,contentHash:e.evaluationResult.contentHash}:null,i={id:e.taskset.id,contentHash:e.taskset.contentHash},u=k({originRef:s,tasksetRef:i,evaluationRef:n}),f=a.find(c=>c.metadata.downstreamLinkKey===u);if(f)return f;let p=(e.now??(()=>new Date().toISOString()))(),l=Rr({schemaVersion:"openpond.harnessEvaluationReviewReceipt.v1",id:`evaluation-review-link-${u.slice(0,24)}`,ownerScope:o.ownerScope,workspaceRef:o.workspaceRef,harnessRelease:o.harnessRelease,previousWatermark:o.nextWatermark,nextWatermark:{cursor:k({cursor:o.nextWatermark.cursor,tasksetRef:i,evaluationRef:n}),throughCreatedAt:p},selectedEvidence:o.selectedEvidence,excludedEvidence:o.excludedEvidence,claim:o.claim,classification:"taskset",triage:o.triage,reason:n?"The approved Taskset completed a real baseline Evaluation.":"The approved Harness review materialized one immutable Taskset.",nextAuthority:"human_review",maxEstimatedCostUsd:o.maxEstimatedCostUsd,tasksetProposal:i,evaluation:n,trainingQualification:null,policyVersion:o.policyVersion,createdAt:p,metadata:{originReview:s,downstreamLinkKey:u,tasksetRevision:e.taskset.revision}});return await e.store.saveHarnessImprovementArtifact(r,"evaluation_review",l),l}d(Ps,"linkHarnessReviewTaskset");async function aa(e,t,r){let s=await e.getHarnessWorkspace(t);if(!s)throw new Error(`Harness workspace ${t} was not found.`);let a=(await e.listHarnessImprovementArtifacts(t,"evaluation_review",1e3)).find(n=>n.id===r.id&&n.contentHash===r.contentHash);if(!a||a.schemaVersion!=="openpond.harnessEvaluationReviewReceipt.v1")throw new Error("Harness Evaluation review was not found.");let o=a;if(o.classification!=="taskset"||o.nextAuthority!=="human_review")throw new Error("Only a human-review Taskset recommendation can enter Taskset authoring.");if(o.tasksetProposal)throw new Error("Harness Evaluation review already has a materialized Taskset link.");if(o.ownerScope.kind!==s.ownerScope.kind||o.ownerScope.id!==s.ownerScope.id)throw new Error("Harness Evaluation review owner scope does not match its workspace.");return o}d(aa,"requireTasksetReview");function _e(e){return`${e.id}:${e.contentHash}`}d(_e,"artifactKey");function Jt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}d(Jt,"isRecord");function Gt(e){let t=new Set;return e.filter(r=>{let s=JSON.stringify(r);return t.has(s)?!1:(t.add(s),!0)})}d(Gt,"uniqueObjects");import{randomUUID as na}from"node:crypto";function bt(e){let t=St(St(St(e.metadata).billing).pricing);return{version:Le(t.version,"pricing version"),source:Le(t.source,"pricing source"),effectiveAt:Le(t.effectiveAt,"pricing effective date"),inputUsdPerMillionTokens:Ue(t.inputUsdPerMillionTokens,"input token rate"),cachedInputUsdPerMillionTokens:Ue(t.cachedInputUsdPerMillionTokens,"cached input token rate"),outputUsdPerMillionTokens:Ue(t.outputUsdPerMillionTokens,"output token rate")}}d(bt,"hostedTokenPricingFromCatalog");function mi(e){let t=St(e);try{return{version:Le(t.version,"pricing version"),source:Le(t.source,"pricing source"),effectiveAt:Le(t.effectiveAt,"pricing effective date"),inputUsdPerMillionTokens:Ue(t.inputUsdPerMillionTokens,"input token rate"),cachedInputUsdPerMillionTokens:Ue(t.cachedInputUsdPerMillionTokens,"cached input token rate"),outputUsdPerMillionTokens:Ue(t.outputUsdPerMillionTokens,"output token rate")}}catch{return null}}d(mi,"hostedTokenPricingFromValue");function xe(e,t){let r=ve(e);if(r.promptTokens===null&&r.completionTokens===null)return null;let s=r.cachedPromptTokens??0;return((r.uncachedPromptTokens??r.promptTokens??0)*t.inputUsdPerMillionTokens+s*t.cachedInputUsdPerMillionTokens+(r.completionTokens??0)*t.outputUsdPerMillionTokens)/1e6}d(xe,"hostedUsageCostUsd");function St(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(St,"record");function Le(e,t){if(typeof e=="string"&&e.trim())return e.trim();throw new Error(`Hosted model catalog is missing ${t}.`)}d(Le,"requiredString");function Ue(e,t){if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e;throw new Error(`Hosted model catalog is missing ${t}.`)}d(Ue,"requiredRate");function Ds(e={}){let t=e.catalog??pt,r=e.stream??ft;return{async prepare(s){if(s.providerId!=="openpond")throw new Error("The selected judge provider is not connected to the hosted judge transport.");if(s.revision!==null)throw new Error("This judge transport cannot enforce a model revision; select a provider with revision support.");let a=await t();if(a.error)throw new Error(`Judge model catalog unavailable: ${a.error}`);let o=a.models.find(l=>l.id===s.modelId);if(!o)throw new Error("The selected judge model is unavailable.");let n=Os(o.raw),i=bt(n),u=Hs(n.context_window,"context window"),f=Math.min(4096,Hs(n.output_limit,"output limit")),p=(u*Math.max(i.inputUsdPerMillionTokens,i.cachedInputUsdPerMillionTokens)+f*i.outputUsdPerMillionTokens)/1e6;if(!(p>0))throw new Error("The judge model must have a positive known charge ceiling.");return{maximumChargeUsd:p,async dispatch(l){l?.throwIfAborted();let c="",m=null,g=null,h=null,w=!1;for await(let _ of r({model:s.modelId,messages:[{role:"system",content:s.system},{role:"user",content:s.data}],requestId:`learning-judge-${na()}`,maxTokens:f,temperature:s.temperature,signal:l})){let x=Os(_.raw);if(typeof x.model=="string"){if(m!==null&&x.model!==m)throw new Error("Judge response model identity changed during streaming.");m=x.model}if(typeof x.id=="string"){if(g!==null&&g!==x.id)throw new Error("Judge response identity changed during streaming.");g=x.id}if(_.type==="text_delta"&&(c+=_.text),c.length>1e5)throw new Error("Judge response exceeds the retained response limit.");_.type==="usage"&&(h=_.usage),_.type==="finish"&&(w=!0)}if(!w||!m||!g)throw new Error("Judge response did not include a complete model receipt.");let y=ve(h),S=y.promptTokens!==null&&y.completionTokens!==null?xe(h,i):null;return{text:c,modelId:m,modelRevision:null,responseId:g,inputTokens:y.promptTokens,outputTokens:y.completionTokens,costUsd:S}}}},async cancel({run:s}){return!s.judgeCalls?.some(a=>a.status==="reserved")}}}d(Ds,"createLearningHostedJudgeProvider");function Os(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(Os,"record");function Hs(e,t){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new Error(`Judge catalog is missing its ${t}.`);return e}d(Hs,"positiveInteger");function xi(e,t=Ds()){return{execute(r){if(r.definition.execution.environment.entrypoint==="openpond.javascript-environment.v1")throw new Error("Tool Tasksets require grading an owner-recorded environment attempt.");let s=Pr({repository:e,scope:r.scope,run:r.run});return Ir({binding:r.binding,rewards:r.rewards,task:dt(r.evidence,r.definition),evidence:Mr(r.evidence,r.run.output),evaluatorContext:r.evidence.submission.evaluatorContext,signal:r.signal,modelJudge:Er({readRubric:d(a=>e.transaction(r.scope,async o=>oe(await ke(o,"asset",a.id,1),a)),"readRubric"),async executeBudgeted(a,o){let n=await t.prepare(a,{scope:r.scope,run:r.run});return Cr({store:s,maximumCharge:d(()=>n.maximumChargeUsd,"maximumCharge"),dispatch:d((u,f)=>n.dispatch(f),"dispatch")})(`grade-${k(a)}`,a,o)}}),customVerifier:d(async({grader:a,task:o,evidence:n})=>{let i=await Ye({repository:e,scope:r.scope,grader:a,task:o,evidence:n,evaluatorContext:r.evidence.submission.evaluatorContext,timeoutMs:r.run.timeoutMs,signal:r.signal});return{score:i.score,passed:i.passed,rewardEligible:a.rewardEligible,failureClass:null,feedback:[i.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:i.evidenceRefs}},"customVerifier")})},async cancel({scope:r,run:s}){let a=await e.transaction(r,o=>ke(o,"grade",s.id));return a.judgeCalls?.some(o=>o.status==="reserved")?!1:t.cancel({scope:r,run:a})}}}d(xi,"createLocalTaskGradeExecutor");async function Ye(e){let t=await e.repository.transaction(e.scope,async r=>oe(await ke(r,"asset",e.grader.verifierRef.id,1),e.grader.verifierRef));return $e({source:t,exportName:e.grader.exportName,runtime:e.grader.runtime,timeoutMs:Math.min(e.grader.timeoutMs,e.timeoutMs??e.grader.timeoutMs),signal:e.signal,value:{task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,expectedOutput:e.task.expectedOutput,evaluatorContext:e.evaluatorContext,infrastructureError:e.evidence.infrastructureError??null}})}d(Ye,"executeLocalLearningVerifier");import ia from"node:path";async function js(e,t,r){if(!r)throw new Error("Ordinary tool execution requires its owner's package directory.");let s=De({taskset:e,adapterId:qe(e)}),a=await vt({root:ia.join(r,"training","tasksets",ee(e)),content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:s.tasksetRelease,environment:s.environmentRelease,verifierSet:s.verifierSetRelease},sources:ct.parse(e.metadata.portableFileInventory)}),o=Fr(a);if(!o)throw new Error("The Taskset does not declare a JavaScript execution graph.");let n=a.taskset.tasks.find(f=>f.id===t.id);if(!n)throw new Error("The selected task is missing from its executable package.");let i=o.assets.find(f=>f.id===o.execution.javascript.module.id),u=o.assets.find(f=>f.id===n.privilegedContextRef);return{execution:o.execution,module:i,initialState:JSON.parse(u.text),definition:L(a.taskset),instructions:Vr(a),task:n}}d(js,"loadOrdinaryToolEnvironment");var J="openpond.javascript-environment.v1";async function Be(e,t,r,s){let a=t.tasks.find(o=>o.id===r.id);if(!a||k(a)!==k(r))throw new Error("Tool task differs from the selected immutable Taskset.");return t.metadata.taskDefinition===void 0?js(t,r,s):e.learningRepository().transaction(t.profileId,async o=>{let n=await ye(o,"definition",ae.parse(t.metadata.taskDefinition)),i=n.execution.environment;if(i.entrypoint!==J||t.environment.entrypoint!==J||t.environment.kind!=="agent"||t.environment.stateful!==i.stateful||t.environment.defaultTimeoutMs!==i.defaultTimeoutMs||t.environment.networkPolicy!==i.networkPolicy||t.environment.deterministicSeeds!==i.deterministicSeeds||k(t.environment.toolNames)!==k(n.execution.tools.map(v=>v.name))||k(t.environment.metadata.portableTools)!==k(n.execution.tools)||k(t.policy)!==k(n.execution.policy)||k(t.metadata.rewardBinding)!==k(n.rewardBinding))throw new Error("Tool Taskset context differs from its pinned task definition.");let u=await ye(o,"binding",n.rewardBinding),f=await Promise.all(u.sources.map(v=>ye(o,"reward",v.reward))),p=it.parse({id:r.id,clusterKey:r.clusterKey,split:r.split,input:r.input,expectedOutput:r.expectedOutput,policyVisibleContext:r.policyVisibleContext,privilegedContextRef:r.privilegedContextRef,artifactRefs:[],tags:r.tags}),l={...n.execution,graders:be(u,f),tasks:[p]},c=await ke(o,"asset",Ur(l),1),m=$r.parse(JSON.parse(oe(c,c.asset))),g=[m.javascript.module,m.environment.actionSchemaRef,m.environment.observationSchemaRef,m.environment.stateSchemaRef].filter(v=>v!==null),h=[...new Set([...g.map(v=>v.id),r.privilegedContextRef].filter(v=>v!==null))],w=await Promise.all(h.map(v=>ke(o,"asset",v,1))),y=Br(l,c,w);if(k(t.environment.metadata.portableExecutionResources)!==k({environment:y.environment,verifierSet:y.verifierSet}))throw new Error("Tool Taskset publication differs from its private execution resources.");let S=w.find(v=>v.id===y.javascript.module.id),_=w.find(v=>v.id===r.privilegedContextRef),x=JSON.parse(oe(_,_.asset));return{execution:y,module:S,initialState:x,definition:L(n),instructions:n.instructions,task:p}})}d(Be,"loadStarterToolEnvironment");function Ns(e){let t=Wt({text:e.instructions,path:"policy/instructions.txt",mediaType:"text/plain",visibility:"policy"}),r=Wt({text:JSON.stringify({environment:L(e.execution.environment),verifierSet:L(e.execution.verifierSet),javascript:L(e.execution.javascript)}),path:"environment/dependencies.json",mediaType:"application/json",visibility:"host_private"}),s=_r({schemaVersion:"openpond.agentSnapshot.v2",id:`starter-agent-${e.definition.contentHash}`,sourceRelease:{id:e.definition.id,contentHash:e.definition.contentHash},instructions:[t.asset],skills:[],agents:[],toolDeclarations:e.execution.javascript.tools,capabilityRequirements:[],dependencyLock:r.asset,portability:{portable:!0,blockers:[],localOnlyAssetRefs:[],hostPrivateAssetRefs:[e.module.id,r.id]},metadata:{execution:J}}),a=xr({schemaVersion:"openpond.harnessRelease.v2",id:`starter-harness-${s.contentHash}`,agentSnapshot:{id:s.id,contentHash:s.contentHash},program:e.module.asset,tools:e.execution.javascript.tools,lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output"],privilegedEvidence:["environment_state","private_verifier"],privateVerifierIsolation:!0},files:[t.asset,r.asset,e.module.asset],metadata:{execution:J}});return{agentSnapshot:s,harnessRelease:a,instructionContext:void 0}}d(Ns,"compileStarterToolHarness");import Rt from"node:path";import{constants as qs}from"node:fs";import{open as da,realpath as $s}from"node:fs/promises";var ca=P.string().regex(/^[a-f0-9]{64}$/),la=P.object({schemaVersion:P.literal("openpond.starterToolAttempt.v1"),requestId:P.string(),taskset:ae,taskHash:ca,model:P.unknown(),seed:P.number().int(),attempt:P.number().int(),definition:ae,policySource:P.enum(["model","fixture"]),environment:ae,verifierSet:ae,result:qr}).strict();async function _t(e){let{store:t,taskset:r,task:s,attempt:a}=e,o=await Be(t,r,s,e.storeDir),i=(await t.listTaskAttemptArtifacts({attemptId:a.id})).filter(S=>S.kind==="environment_state"&&S.tasksetId===r.id&&S.taskId===s.id&&S.attemptId===a.id&&a.artifactRefs.includes(S.id)&&a.privilegedOutcomeRef===S.id);if(i.length!==1)throw new Error("Tool grading requires exactly one owner-recorded environment artifact.");let u=i[0],f=await $s(Rt.join(e.storeDir,"training","evaluation-artifacts")),p=await $s(Rt.dirname(u.path)),l=Rt.relative(f,p);if(!l||l.startsWith("..")||Rt.isAbsolute(l))throw new Error("Tool evidence is outside the execution owner's artifact directory.");let c=await da(u.path,qs.O_RDONLY|qs.O_NOFOLLOW),m;try{let S=await c.stat();if(!S.isFile()||S.size>33554432||S.size!==u.sizeBytes)throw new Error("Tool evidence exceeds its declared byte boundary.");m=await c.readFile()}finally{await c.close()}if(m.byteLength!==u.sizeBytes||se(m)!==u.sha256)throw new Error("Owner-recorded tool evidence bytes changed.");let g=la.parse(JSON.parse(m.toString("utf8"))),{contentHash:h,...w}=g.result,y=g.result;if(k(w)!==h||!y.snapshot||!y.environmentCleanupComplete||!["completed","budget_exhausted","policy_failure"].includes(y.status)||k(g.taskset)!==k(L(r))||g.taskHash!==k(s)||k(g.model)!==k(a.modelRef)||g.seed!==a.seed||g.attempt!==a.attempt||a.tasksetId!==r.id||a.taskId!==s.id||a.split!==s.split||k(g.definition)!==k(o.definition)||k(g.environment)!==k(L(o.execution.environment))||k(g.verifierSet)!==k(L(o.execution.verifierSet))||y.taskId!==s.id||y.snapshot.seed!==a.seed||y.snapshot.inputHash!==k(s.input)||k(y.snapshot.definition)!==k(L(o.execution.javascript))||y.snapshot.finalStateHash!==k(y.snapshot.state)||k(a.output)!==k({text:y.output??""})||a.metadata.environmentAttemptHash!==h)throw new Error("Tool evidence differs from the selected task, model or recorded attempt.");if(a.metadata.policySource!==g.policySource)throw new Error("Tool evidence policy source changed.");return{environment:{status:y.status,collected:y.collected,definition:y.snapshot.definition,initialStateHash:y.snapshot.initialStateHash,finalStateHash:y.snapshot.finalStateHash,finalState:y.snapshot.state,events:y.snapshot.events}}}d(_t,"readStarterToolEvidence");async function Te(e,t){if(t.metadata.learning!==void 0)return He.parse(t.metadata.learning);if(t.metadata.rewardBinding===void 0)return;let r=ae.parse(t.metadata.rewardBinding);return e.learningRepository().transaction(t.profileId,async s=>{let a=await ye(s,"binding",r),o=[...new Map(a.sources.map(i=>[`${i.reward.id}:${i.reward.revision}:${i.reward.contentHash}`,i.reward])).values()],n=await Promise.all(o.map(i=>ye(s,"reward",i)));return{binding:a,rewards:n}})}d(Te,"resolveTasksetRewardBinding");async function ua(e,t,r){let s=await Te(e,t);if(!s)return{rewardExecution:void 0,verifierAssets:[]};let a=[...s.rewards.flatMap(i=>i.assets),...be(s.binding,s.rewards).flatMap(i=>i.kind==="custom_verifier"?[i.verifierRef]:i.kind==="model_judge"?[i.rubricRef]:[])],o=t.metadata.learning===void 0?void 0:await wt(r,t);if(o){let i=[...new Map(a.map(u=>{let f=o.learningResources.assets.find(p=>p.id===u.id);if(!f)throw new Error("Imported batch verifier is missing from its package.");return oe(f,u),[f.id,f]})).values()];return{rewardExecution:s,verifierAssets:i}}let n=await e.learningRepository().transaction(t.profileId,async i=>{let u=new Map;for(let f of a){let p=await ke(i,"asset",f.id,1);oe(p,f),u.set(p.id,p)}return[...u.values()]});return{rewardExecution:s,verifierAssets:n}}d(ua,"resolveTasksetTrainingReward");async function gd(e,t,r){let s=await ua(e,t,r.storeDir);if(!s.rewardExecution)return s;let a=be(s.rewardExecution.binding,s.rewardExecution.rewards);if(!s.rewardExecution.binding.sources.some(o=>o.role==="evaluation"&&o.weight>0))throw new Error("Managed training requires a positively weighted evaluation Reward source for retained validation.");if(a.some(o=>o.kind==="custom_verifier"&&o.runtime==="sandbox_process"))throw new Error("Managed preparation requires a qualified isolated sandbox for process verifiers.");if(r.placement!=="remote"||t.environment.kind==="work"||t.capabilities.requiresState||t.capabilities.requiresTools||a.some(o=>o.kind==="human"||o.kind==="model_judge"&&(!o.model||o.calibrationStatus!=="passed"))||t.tasks.some(o=>o.privilegedContextRef!==null)||!s.rewardExecution.binding.sources.some(o=>o.role==="training"&&o.weight>0)||r.hasLearnedPreferenceReward)throw new Error("This Reward binding requires an additional managed execution adapter.");return s}d(gd,"resolveManagedTasksetReward");async function Ls(e,t,r){let s=await Te(e,t);if(!s)throw new Error("The Taskset has no published Reward binding.");let a=be(s.binding,s.rewards);return async({grader:o,task:n,attempt:i,signal:u})=>{let f=t.tasks.find(m=>m.id===n.id);if(!f||k(f)!==k(n))throw new Error("Task differs from the selected immutable Taskset.");let p=null;if(t.environment.entrypoint===J){if(!r)throw new Error("Tool grading requires the execution owner's artifact directory.");p=await _t({store:e,storeDir:r,taskset:t,task:n,attempt:i})}else if(n.privilegedContextRef!==null)throw new Error("This authored Taskset requires a private evaluator-context resolver.");let l=a.find(m=>m.id===o.id);if(l?.kind!=="custom_verifier")throw new Error("The verifier is absent from the published Reward binding.");let c=it.parse({id:n.id,clusterKey:n.clusterKey,split:n.split,input:n.input,expectedOutput:n.expectedOutput,policyVisibleContext:n.policyVisibleContext,privilegedContextRef:n.privilegedContextRef,artifactRefs:[],tags:n.tags});return Ye({repository:e.learningRepository(),scope:t.profileId,grader:l,task:c,evidence:{output:i.output,artifactRefs:i.artifactRefs,runtimeEventRefs:i.runtimeEventRefs,infrastructureError:i.infrastructureError},evaluatorContext:p,signal:u})}}d(Ls,"createTasksetBindingVerifier");async function Ie(e,t,r){let s=r?ae.parse(r):null;if(s&&s.id!==t)throw new Error("Taskset execution reference differs from the requested Taskset.");let a=s?await e.getTasksetRevision(s.id,s.revision):await e.getTaskset(t);if(!a||s&&(a.contentHash!==s.contentHash||Re(a)!==s.contentHash))throw new Error("Taskset execution revision is unavailable or differs from its immutable hash.");return a}d(Ie,"requireLocalTasksetRevision");async function Sd(e,t,r){let s=await e.releaseForTaskset(t);return s||De({taskset:t,rewardExecution:r?await Te(r,t):void 0,adapterId:qe(t)}).tasksetRelease}d(Sd,"requireReleasedTaskset");import{createHash as ma}from"node:crypto";function Us(e,t,r){if(t.metadata.importedPackageHash!==e.contentHash)throw new Error("The Work projection differs from the admitted published package.");let s=e.taskset.tasks.find(n=>n.id===r.id);if(!s||s.split!==r.split||k(r.metadata.portableTaskRecord)!==k(s))throw new Error("The Work task differs from its exact released population.");let a=0,o=(r.assets??[]).map(n=>{let i=s.artifactRefs.find(l=>l.id===n.id&&l.contentHash===n.sha256&&l.path===n.artifactRef),u=i&&e.files.find(l=>k(l.asset)===k(i));if(!i||!u||i.visibility!=="policy")throw new Error("The Work task requests an unavailable or private evaluator file.");let f=Buffer.from(Wr(u));if(ma("sha256").update(f).digest("hex")!==n.sha256||f.length!==n.sizeBytes||n.split!==r.split)throw new Error("The published Work input manifest changed.");if(a+=f.length,a>25e7)throw new Error("Published Work inputs exceed the admitted 250 MB ceiling.");return{...n,assetId:n.id,storageName:n.stagingPath??n.fileName,bytes:f,sizeBytes:f.length}});if(o.length!==s.artifactRefs.length)throw new Error("The exact policy-visible Work asset population is incomplete.");return o}d(Us,"advancedPublishedWorkAssets");async function Yt(e,t=pt,r=!1){if(e.kind==="hosted_harness")return Yt({kind:"hosted_chat",modelId:e.modelId,...Nr(e)},t);if(e.kind!=="hosted_chat")throw new ne("local_target_not_qualified","Select an explicit model target for local execution.",422);if(e.harness&&!r)throw new ne("local_harness_not_qualified","This released Harness requires its native turn executor; it cannot run as a model-only case.",422);let s=await t();if(s.error)throw new ne("local_model_catalog_unavailable",s.error,422);let a=s.models.find(c=>c.id===e.modelId);if(!a)throw new ne("local_model_unavailable","The selected model is unavailable.",422);let o=Bs(a.raw),n=bt(o),i=Bs(o.capabilities).samplingParameters===!0;if(!i&&(e.temperature!==0||e.topP!==1))throw new ne("local_sampling_unsupported","This model uses provider-managed sampling. Custom temperature or top P requires an explicit supported capability.",422);let u=Ws(o.context_window),f=Ws(o.output_limit);if(e.maxOutputTokens>f)throw new ne("local_model_output_limit","The model cannot accept the configured output limit.",422);let p={providerId:"openpond",modelId:e.modelId,maxOutputTokens:e.maxOutputTokens,...i?{temperature:e.temperature,topP:e.topP}:{},messages:e.messages??[]},l=(u*Math.max(n.inputUsdPerMillionTokens,n.cachedInputUsdPerMillionTokens)+e.maxOutputTokens*n.outputUsdPerMillionTokens)/1e6;if(!(l>0))throw new ne("local_model_charge_unknown","The model must publish an enforceable positive request ceiling.",422);return{model:{...p,configurationHash:k({configuration:p,contextWindow:u,outputLimit:f,pricing:n})},pricing:n,maximumChargeUsd:l}}d(Yt,"prepareLocalExperimentModel");function Nd(e){let t=e.admission.streamFactory?.(e)??e.admission.stream??e.stream??ft;return async function*(r){if(!r.requestId)throw new ne("local_request_identity_missing","Every local model dispatch requires a stable request identity.");let s=e.admission.model;if(r.model!==s.modelId||r.maxTokens!==s.maxOutputTokens||r.temperature!==s.temperature||r.topP!==s.topP)throw new ne("local_model_configuration_conflict","The native model request changed its admitted model, output limit or sampling configuration.",422);let a=xs();a?.assertExecution(e.executionId);let o={teamId:e.teamId,id:e.executionId,ownerId:e.ownerId,requestId:r.requestId};await e.store.reserveLocalCharge({...o,caseId:e.caseId,maximumUsd:e.admission.maximumChargeUsd}),r.signal?.aborted&&(await e.store.settleLocalCharge({...o,costUsd:null,usage:null,notDispatched:!0}),r.signal.throwIfAborted());try{await e.store.markLocalChargeDispatched(o.teamId,o.id,o.requestId,o.ownerId)}catch(p){throw a&&await e.store.settleLocalCharge({...o,costUsd:null,usage:null,notDispatched:!0}),p}await e.store.appendLocalExperimentEvent({...o,caseId:e.caseId,type:"model.dispatch",payload:{requestId:o.requestId,model:r.model,messages:r.messages}});let n=null,i=!1,u=!1,f;try{for await(let p of t(r)){u=!0,p.type==="usage"&&(n=p.usage),p.type==="finish"&&(i=!0);let l=p.type==="text_delta"?{requestId:o.requestId,text:p.text}:p.type==="tool_call_delta"?{requestId:o.requestId,toolCalls:p.toolCalls}:p.type==="usage"?{requestId:o.requestId,usage:ve(p.usage)}:p.type==="finish"?{requestId:o.requestId,finishReason:p.finishReason}:null;l&&await e.store.appendLocalExperimentEvent({...o,caseId:e.caseId,type:`model.${p.type}`,payload:l}),yield p}}catch(p){throw!u&&p instanceof Is&&p.executionId===o.id&&p.requestId===o.requestId&&(f=p),p}finally{let p=ve(n),l=e.admission.pricing&&i&&p.promptTokens!==null&&p.completionTokens!==null?xe(n,e.admission.pricing):null;await e.store.settleLocalCharge({...o,costUsd:l,confirmedTransportNotInvoked:f,usage:n===null?null:{promptTokens:p.promptTokens,completionTokens:p.completionTokens,cachedPromptTokens:p.cachedPromptTokens,uncachedPromptTokens:p.uncachedPromptTokens}})}}}d(Nd,"createLocalBudgetedModelStream");function Bs(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(Bs,"record");function Ws(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new ne("local_model_bound_unknown","The model catalog is missing an enforceable context/output bound.",422);return e}d(Ws,"positive");import{AsyncLocalStorage as pa}from"node:async_hooks";import fa from"node:path";var Fs=new pa;function Vs(){return Fs.getStore()}d(Vs,"currentAdvancedRefinerBoundary");function Jd(e){let t=Sr(fa.join(e.storeDir,"library","harnesses","advanced-refiner-paid-calls.sqlite"));t.exec(`CREATE TABLE IF NOT EXISTS advanced_refiner_budgets(id TEXT PRIMARY KEY,actor_id TEXT NOT NULL,team_id TEXT NOT NULL,pin_hash TEXT NOT NULL,maximum_spend REAL NOT NULL,maximum_steps INTEGER NOT NULL,expires_at TEXT NOT NULL);
|
|
2
|
+
import{a as As,b as Ms}from"./chunk-UMRQKE3W.js";import{a as Es,e as $e,f as Cs,g as Tt}from"./chunk-HUMNLSCV.js";import{a as xs,c as Is}from"./chunk-XVDFJ3ZF.js";import{h as ne}from"./chunk-O5ZOW474.js";import{a as ee,b as _s}from"./chunk-NDNSLCPE.js";import{b as ys,c as bs,d as yt}from"./chunk-CWE2N3JI.js";import{a as ws,b as vs,c as Ts,d as qe,e as Ss,g as vt}from"./chunk-O4YHISU2.js";import{a as wt,c as Rs}from"./chunk-HT6ILPD6.js";import{b as Kr,e as Xr,f as lt,g as ut}from"./chunk-VMW23TIZ.js";import{F as gt,G as fs,H as ht,I as kt,J as gs,K as hs,N as ks,x as ps}from"./chunk-23YW5PAQ.js";import{a as ve}from"./chunk-7KWD2I6W.js";import{g as pt,i as ft}from"./chunk-2ACX7IW5.js";import{s as br}from"./chunk-OFJPOTES.js";import{d as Ne}from"./chunk-U7D6Q744.js";import{ja as rs,qa as ss,sa as os,x as ts}from"./chunk-WXG3G2O6.js";import{M as V,N as as,O as ns,P as is,Q as mt,R as ds,S as q,T as cs,U as je,V as ls,X as us,Y as Vt,Z as ms}from"./chunk-OXRN2257.js";import{l as Ft}from"./chunk-TOWY6Y23.js";import{d as Zr,f as W,g as Qr,i as es}from"./chunk-Z6HWSTEP.js";import{k as Nr}from"./chunk-XKDOPNQ5.js";import{c as ct}from"./chunk-GR4MJJCE.js";import{Ba as Gr,Ca as Re,Ha as Yr,Ia as De,K as qr,L as $r,M as Lr,N as Ur,P as Br,aa as Wr,ba as Fr,ia as Vr,ua as zr,wa as we,xa as Jr}from"./chunk-BYVE4TMU.js";import{x as ae}from"./chunk-3VT2PPKW.js";import{C as Or,S as Hr,T as Dr,Tb as jr}from"./chunk-D6L6UNUQ.js";import{f as Rr}from"./chunk-AJXWJLZA.js";import{L,M as Ar,Ob as Pr,R as Wt,S as oe,X as dt,Y as Mr,ba as He,d as Er,g as Cr,pb as ke,qb as ye}from"./chunk-ZEOYNUHL.js";import{bb as be,cb as Ir,ea as it,v as Ge}from"./chunk-ZY32SZ2P.js";import{l as _r,m as xr}from"./chunk-OTDDXEQ6.js";import{i as Tr,m as se,n as k}from"./chunk-RCT3O3HQ.js";import{m as Sr}from"./chunk-UGOK7VTC.js";import{A as P}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var zt={buildIntent:"verifiable_reward",methodHint:"grpo"};async function ii(e){let t=await aa(e.store,e.workspaceId,e.reviewRef),r=`harness-review-${k({review:t.contentHash,strategy:zt}).slice(0,24)}`,s=(await e.store.listTaskCreationSnapshots(e.profileId)).find(c=>c.request.candidateId===r);if(s)return s;let[a,o,n]=await Promise.all([e.store.listHarnessImprovementArtifacts(e.workspaceId,"route_decision",1e3),e.store.listHarnessImprovementArtifacts(e.workspaceId,"trigger_decision",1e3),e.store.listHarnessImprovementArtifacts(e.workspaceId,"observation",1e3)]),i=new Map(a.map(c=>[_e(c),c])),u=new Map(o.map(c=>[_e(c),c])),f=new Map(n.map(c=>[_e(c),c])),p=new Map;for(let c of t.selectedEvidence){if(c.kind!=="route_decision")continue;let m=i.get(_e(c.evidence)),g=m?u.get(_e(m.trigger)):null;if(!m||!g)throw new Error(`Harness review evidence ${c.evidence.id} cannot be reconstructed.`);let h=g.observations.map(y=>f.get(_e(y))??null).filter(y=>y?.runRef===c.sourceRef);if(!h.length)throw new Error(`Harness review source ${c.sourceRef} has no exact observation evidence.`);let w=p.get(c.sourceRef)??{turnIds:new Set,evidenceRefs:[],sourcePolicies:[]};for(let y of h)w.turnIds.add(y.turnId);w.evidenceRefs.push(c.evidence),w.sourcePolicies.push(c.sourcePolicy),p.set(c.sourceRef,w)}if(!p.size)throw new Error("Harness Taskset review has no reconstructable source runs.");let l=[];for(let[c,m]of[...p.entries()].sort(([g],[h])=>g.localeCompare(h))){let g=await e.taskCreator.addSessionSource({profileId:e.profileId,sessionId:c,turnIds:[...m.turnIds].sort(),consentScope:"selected_turns"}),h=Array.isArray(g.metadata.harnessEvaluationReviews)?g.metadata.harnessEvaluationReviews:[],w={...g,metadata:{...g.metadata,harnessEvaluationReviews:Gt([...h,{id:t.id,contentHash:t.contentHash,workspaceId:t.workspaceRef,harnessRelease:t.harnessRelease,claimFingerprint:t.claim?.fingerprint??null,evidenceRefs:m.evidenceRefs,sourcePolicies:m.sourcePolicies}])}};l.push(await e.store.upsertTrainingSource(w))}return e.startCreation({profileId:e.profileId,sourceIds:l.map(c=>c.id),surface:"task_candidate",mode:"customize",entryMode:"automated",resourceIntent:"workproduct",buildIntent:zt.buildIntent,buildSpecification:null,objective:t.claim?.statement??t.reason,methodHint:zt.methodHint,preferredBaseModelId:null,preferredBaseModel:null,candidateId:r,analysisModel:e.analysisModel??null,analysisReasoningEffort:e.analysisReasoningEffort??null,createImproveRunId:null,targetIntent:{kind:"model",id:null,displayName:null,operation:"create"}})}d(ii,"startHarnessReviewTasksetAuthoring");function di(e){let t=e.flatMap(o=>Array.isArray(o.metadata.harnessEvaluationReviews)?o.metadata.harnessEvaluationReviews.filter(Jt):[]);if(!t.length)return null;let r=`${String(t[0].id)}:${String(t[0].contentHash)}`,s=t.filter(o=>`${String(o.id)}:${String(o.contentHash)}`===r);if(s.length!==e.length)return null;let a=s[0];return{review:{id:String(a.id),contentHash:String(a.contentHash),workspaceId:String(a.workspaceId),harnessRelease:a.harnessRelease,claimFingerprint:typeof a.claimFingerprint=="string"?a.claimFingerprint:null},evidenceRefs:Gt(s.flatMap(o=>Array.isArray(o.evidenceRefs)?o.evidenceRefs:[])),sourcePolicies:Gt(s.flatMap(o=>Array.isArray(o.sourcePolicies)?o.sourcePolicies:[]))}}d(di,"harnessReviewLineageFromSources");async function Ps(e){let t=e.taskset.metadata.harnessEvaluationLineage;if(!Jt(t)||!Jt(t.review))return null;let r=String(t.review.workspaceId??""),s={id:String(t.review.id??""),contentHash:String(t.review.contentHash??"")};if(!r||!s.id||!s.contentHash)throw new Error("Taskset Harness Evaluation lineage is incomplete.");let a=await e.store.listHarnessImprovementArtifacts(r,"evaluation_review",1e3),o=a.find(c=>_e(c)===_e(s));if(!o)throw new Error("Originating Harness Evaluation review was not found.");let n=e.evaluationResult?{id:e.evaluationResult.id,contentHash:e.evaluationResult.contentHash}:null,i={id:e.taskset.id,contentHash:e.taskset.contentHash},u=k({originRef:s,tasksetRef:i,evaluationRef:n}),f=a.find(c=>c.metadata.downstreamLinkKey===u);if(f)return f;let p=(e.now??(()=>new Date().toISOString()))(),l=Rr({schemaVersion:"openpond.harnessEvaluationReviewReceipt.v1",id:`evaluation-review-link-${u.slice(0,24)}`,ownerScope:o.ownerScope,workspaceRef:o.workspaceRef,harnessRelease:o.harnessRelease,previousWatermark:o.nextWatermark,nextWatermark:{cursor:k({cursor:o.nextWatermark.cursor,tasksetRef:i,evaluationRef:n}),throughCreatedAt:p},selectedEvidence:o.selectedEvidence,excludedEvidence:o.excludedEvidence,claim:o.claim,classification:"taskset",triage:o.triage,reason:n?"The approved Taskset completed a real baseline Evaluation.":"The approved Harness review materialized one immutable Taskset.",nextAuthority:"human_review",maxEstimatedCostUsd:o.maxEstimatedCostUsd,tasksetProposal:i,evaluation:n,trainingQualification:null,policyVersion:o.policyVersion,createdAt:p,metadata:{originReview:s,downstreamLinkKey:u,tasksetRevision:e.taskset.revision}});return await e.store.saveHarnessImprovementArtifact(r,"evaluation_review",l),l}d(Ps,"linkHarnessReviewTaskset");async function aa(e,t,r){let s=await e.getHarnessWorkspace(t);if(!s)throw new Error(`Harness workspace ${t} was not found.`);let a=(await e.listHarnessImprovementArtifacts(t,"evaluation_review",1e3)).find(n=>n.id===r.id&&n.contentHash===r.contentHash);if(!a||a.schemaVersion!=="openpond.harnessEvaluationReviewReceipt.v1")throw new Error("Harness Evaluation review was not found.");let o=a;if(o.classification!=="taskset"||o.nextAuthority!=="human_review")throw new Error("Only a human-review Taskset recommendation can enter Taskset authoring.");if(o.tasksetProposal)throw new Error("Harness Evaluation review already has a materialized Taskset link.");if(o.ownerScope.kind!==s.ownerScope.kind||o.ownerScope.id!==s.ownerScope.id)throw new Error("Harness Evaluation review owner scope does not match its workspace.");return o}d(aa,"requireTasksetReview");function _e(e){return`${e.id}:${e.contentHash}`}d(_e,"artifactKey");function Jt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}d(Jt,"isRecord");function Gt(e){let t=new Set;return e.filter(r=>{let s=JSON.stringify(r);return t.has(s)?!1:(t.add(s),!0)})}d(Gt,"uniqueObjects");import{randomUUID as na}from"node:crypto";function bt(e){let t=St(St(St(e.metadata).billing).pricing);return{version:Le(t.version,"pricing version"),source:Le(t.source,"pricing source"),effectiveAt:Le(t.effectiveAt,"pricing effective date"),inputUsdPerMillionTokens:Ue(t.inputUsdPerMillionTokens,"input token rate"),cachedInputUsdPerMillionTokens:Ue(t.cachedInputUsdPerMillionTokens,"cached input token rate"),outputUsdPerMillionTokens:Ue(t.outputUsdPerMillionTokens,"output token rate")}}d(bt,"hostedTokenPricingFromCatalog");function mi(e){let t=St(e);try{return{version:Le(t.version,"pricing version"),source:Le(t.source,"pricing source"),effectiveAt:Le(t.effectiveAt,"pricing effective date"),inputUsdPerMillionTokens:Ue(t.inputUsdPerMillionTokens,"input token rate"),cachedInputUsdPerMillionTokens:Ue(t.cachedInputUsdPerMillionTokens,"cached input token rate"),outputUsdPerMillionTokens:Ue(t.outputUsdPerMillionTokens,"output token rate")}}catch{return null}}d(mi,"hostedTokenPricingFromValue");function xe(e,t){let r=ve(e);if(r.promptTokens===null&&r.completionTokens===null)return null;let s=r.cachedPromptTokens??0;return((r.uncachedPromptTokens??r.promptTokens??0)*t.inputUsdPerMillionTokens+s*t.cachedInputUsdPerMillionTokens+(r.completionTokens??0)*t.outputUsdPerMillionTokens)/1e6}d(xe,"hostedUsageCostUsd");function St(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(St,"record");function Le(e,t){if(typeof e=="string"&&e.trim())return e.trim();throw new Error(`Hosted model catalog is missing ${t}.`)}d(Le,"requiredString");function Ue(e,t){if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e;throw new Error(`Hosted model catalog is missing ${t}.`)}d(Ue,"requiredRate");function Ds(e={}){let t=e.catalog??pt,r=e.stream??ft;return{async prepare(s){if(s.providerId!=="openpond")throw new Error("The selected judge provider is not connected to the hosted judge transport.");if(s.revision!==null)throw new Error("This judge transport cannot enforce a model revision; select a provider with revision support.");let a=await t();if(a.error)throw new Error(`Judge model catalog unavailable: ${a.error}`);let o=a.models.find(l=>l.id===s.modelId);if(!o)throw new Error("The selected judge model is unavailable.");let n=Os(o.raw),i=bt(n),u=Hs(n.context_window,"context window"),f=Math.min(4096,Hs(n.output_limit,"output limit")),p=(u*Math.max(i.inputUsdPerMillionTokens,i.cachedInputUsdPerMillionTokens)+f*i.outputUsdPerMillionTokens)/1e6;if(!(p>0))throw new Error("The judge model must have a positive known charge ceiling.");return{maximumChargeUsd:p,async dispatch(l){l?.throwIfAborted();let c="",m=null,g=null,h=null,w=!1;for await(let _ of r({model:s.modelId,messages:[{role:"system",content:s.system},{role:"user",content:s.data}],requestId:`learning-judge-${na()}`,maxTokens:f,temperature:s.temperature,signal:l})){let x=Os(_.raw);if(typeof x.model=="string"){if(m!==null&&x.model!==m)throw new Error("Judge response model identity changed during streaming.");m=x.model}if(typeof x.id=="string"){if(g!==null&&g!==x.id)throw new Error("Judge response identity changed during streaming.");g=x.id}if(_.type==="text_delta"&&(c+=_.text),c.length>1e5)throw new Error("Judge response exceeds the retained response limit.");_.type==="usage"&&(h=_.usage),_.type==="finish"&&(w=!0)}if(!w||!m||!g)throw new Error("Judge response did not include a complete model receipt.");let y=ve(h),S=y.promptTokens!==null&&y.completionTokens!==null?xe(h,i):null;return{text:c,modelId:m,modelRevision:null,responseId:g,inputTokens:y.promptTokens,outputTokens:y.completionTokens,costUsd:S}}}},async cancel({run:s}){return!s.judgeCalls?.some(a=>a.status==="reserved")}}}d(Ds,"createLearningHostedJudgeProvider");function Os(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(Os,"record");function Hs(e,t){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new Error(`Judge catalog is missing its ${t}.`);return e}d(Hs,"positiveInteger");function xi(e,t=Ds()){return{execute(r){if(r.definition.execution.environment.entrypoint==="openpond.javascript-environment.v1")throw new Error("Tool Tasksets require grading an owner-recorded environment attempt.");let s=Pr({repository:e,scope:r.scope,run:r.run});return Ir({binding:r.binding,rewards:r.rewards,task:dt(r.evidence,r.definition),evidence:Mr(r.evidence,r.run.output),evaluatorContext:r.evidence.submission.evaluatorContext,signal:r.signal,modelJudge:Er({readRubric:d(a=>e.transaction(r.scope,async o=>oe(await ke(o,"asset",a.id,1),a)),"readRubric"),async executeBudgeted(a,o){let n=await t.prepare(a,{scope:r.scope,run:r.run});return Cr({store:s,maximumCharge:d(()=>n.maximumChargeUsd,"maximumCharge"),dispatch:d((u,f)=>n.dispatch(f),"dispatch")})(`grade-${k(a)}`,a,o)}}),customVerifier:d(async({grader:a,task:o,evidence:n})=>{let i=await Ye({repository:e,scope:r.scope,grader:a,task:o,evidence:n,evaluatorContext:r.evidence.submission.evaluatorContext,timeoutMs:r.run.timeoutMs,signal:r.signal});return{score:i.score,passed:i.passed,rewardEligible:a.rewardEligible,failureClass:null,feedback:[i.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:i.evidenceRefs}},"customVerifier")})},async cancel({scope:r,run:s}){let a=await e.transaction(r,o=>ke(o,"grade",s.id));return a.judgeCalls?.some(o=>o.status==="reserved")?!1:t.cancel({scope:r,run:a})}}}d(xi,"createLocalTaskGradeExecutor");async function Ye(e){let t=await e.repository.transaction(e.scope,async r=>oe(await ke(r,"asset",e.grader.verifierRef.id,1),e.grader.verifierRef));return $e({source:t,exportName:e.grader.exportName,runtime:e.grader.runtime,timeoutMs:Math.min(e.grader.timeoutMs,e.timeoutMs??e.grader.timeoutMs),signal:e.signal,value:{task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,expectedOutput:e.task.expectedOutput,evaluatorContext:e.evaluatorContext,infrastructureError:e.evidence.infrastructureError??null}})}d(Ye,"executeLocalLearningVerifier");import ia from"node:path";async function js(e,t,r){if(!r)throw new Error("Ordinary tool execution requires its owner's package directory.");let s=De({taskset:e,adapterId:qe(e)}),a=await vt({root:ia.join(r,"training","tasksets",ee(e)),content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:s.tasksetRelease,environment:s.environmentRelease,verifierSet:s.verifierSetRelease},sources:ct.parse(e.metadata.portableFileInventory)}),o=Fr(a);if(!o)throw new Error("The Taskset does not declare a JavaScript execution graph.");let n=a.taskset.tasks.find(f=>f.id===t.id);if(!n)throw new Error("The selected task is missing from its executable package.");let i=o.assets.find(f=>f.id===o.execution.javascript.module.id),u=o.assets.find(f=>f.id===n.privilegedContextRef);return{execution:o.execution,module:i,initialState:JSON.parse(u.text),definition:L(a.taskset),instructions:Vr(a),task:n}}d(js,"loadOrdinaryToolEnvironment");var J="openpond.javascript-environment.v1";async function Be(e,t,r,s){let a=t.tasks.find(o=>o.id===r.id);if(!a||k(a)!==k(r))throw new Error("Tool task differs from the selected immutable Taskset.");return t.metadata.taskDefinition===void 0?js(t,r,s):e.learningRepository().transaction(t.profileId,async o=>{let n=await ye(o,"definition",ae.parse(t.metadata.taskDefinition)),i=n.execution.environment;if(i.entrypoint!==J||t.environment.entrypoint!==J||t.environment.kind!=="agent"||t.environment.stateful!==i.stateful||t.environment.defaultTimeoutMs!==i.defaultTimeoutMs||t.environment.networkPolicy!==i.networkPolicy||t.environment.deterministicSeeds!==i.deterministicSeeds||k(t.environment.toolNames)!==k(n.execution.tools.map(v=>v.name))||k(t.environment.metadata.portableTools)!==k(n.execution.tools)||k(t.policy)!==k(n.execution.policy)||k(t.metadata.rewardBinding)!==k(n.rewardBinding))throw new Error("Tool Taskset context differs from its pinned task definition.");let u=await ye(o,"binding",n.rewardBinding),f=await Promise.all(u.sources.map(v=>ye(o,"reward",v.reward))),p=it.parse({id:r.id,clusterKey:r.clusterKey,split:r.split,input:r.input,expectedOutput:r.expectedOutput,policyVisibleContext:r.policyVisibleContext,privilegedContextRef:r.privilegedContextRef,artifactRefs:[],tags:r.tags}),l={...n.execution,graders:be(u,f),tasks:[p]},c=await ke(o,"asset",Ur(l),1),m=$r.parse(JSON.parse(oe(c,c.asset))),g=[m.javascript.module,m.environment.actionSchemaRef,m.environment.observationSchemaRef,m.environment.stateSchemaRef].filter(v=>v!==null),h=[...new Set([...g.map(v=>v.id),r.privilegedContextRef].filter(v=>v!==null))],w=await Promise.all(h.map(v=>ke(o,"asset",v,1))),y=Br(l,c,w);if(k(t.environment.metadata.portableExecutionResources)!==k({environment:y.environment,verifierSet:y.verifierSet}))throw new Error("Tool Taskset publication differs from its private execution resources.");let S=w.find(v=>v.id===y.javascript.module.id),_=w.find(v=>v.id===r.privilegedContextRef),x=JSON.parse(oe(_,_.asset));return{execution:y,module:S,initialState:x,definition:L(n),instructions:n.instructions,task:p}})}d(Be,"loadStarterToolEnvironment");function Ns(e){let t=Wt({text:e.instructions,path:"policy/instructions.txt",mediaType:"text/plain",visibility:"policy"}),r=Wt({text:JSON.stringify({environment:L(e.execution.environment),verifierSet:L(e.execution.verifierSet),javascript:L(e.execution.javascript)}),path:"environment/dependencies.json",mediaType:"application/json",visibility:"host_private"}),s=_r({schemaVersion:"openpond.agentSnapshot.v2",id:`starter-agent-${e.definition.contentHash}`,sourceRelease:{id:e.definition.id,contentHash:e.definition.contentHash},instructions:[t.asset],skills:[],agents:[],toolDeclarations:e.execution.javascript.tools,capabilityRequirements:[],dependencyLock:r.asset,portability:{portable:!0,blockers:[],localOnlyAssetRefs:[],hostPrivateAssetRefs:[e.module.id,r.id]},metadata:{execution:J}}),a=xr({schemaVersion:"openpond.harnessRelease.v2",id:`starter-harness-${s.contentHash}`,agentSnapshot:{id:s.id,contentHash:s.contentHash},program:e.module.asset,tools:e.execution.javascript.tools,lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output"],privilegedEvidence:["environment_state","private_verifier"],privateVerifierIsolation:!0},files:[t.asset,r.asset,e.module.asset],metadata:{execution:J}});return{agentSnapshot:s,harnessRelease:a,instructionContext:void 0}}d(Ns,"compileStarterToolHarness");import Rt from"node:path";import{constants as qs}from"node:fs";import{open as da,realpath as $s}from"node:fs/promises";var ca=P.string().regex(/^[a-f0-9]{64}$/),la=P.object({schemaVersion:P.literal("openpond.starterToolAttempt.v1"),requestId:P.string(),taskset:ae,taskHash:ca,model:P.unknown(),seed:P.number().int(),attempt:P.number().int(),definition:ae,policySource:P.enum(["model","fixture"]),environment:ae,verifierSet:ae,result:qr}).strict();async function _t(e){let{store:t,taskset:r,task:s,attempt:a}=e,o=await Be(t,r,s,e.storeDir),i=(await t.listTaskAttemptArtifacts({attemptId:a.id})).filter(S=>S.kind==="environment_state"&&S.tasksetId===r.id&&S.taskId===s.id&&S.attemptId===a.id&&a.artifactRefs.includes(S.id)&&a.privilegedOutcomeRef===S.id);if(i.length!==1)throw new Error("Tool grading requires exactly one owner-recorded environment artifact.");let u=i[0],f=await $s(Rt.join(e.storeDir,"training","evaluation-artifacts")),p=await $s(Rt.dirname(u.path)),l=Rt.relative(f,p);if(!l||l.startsWith("..")||Rt.isAbsolute(l))throw new Error("Tool evidence is outside the execution owner's artifact directory.");let c=await da(u.path,qs.O_RDONLY|qs.O_NOFOLLOW),m;try{let S=await c.stat();if(!S.isFile()||S.size>33554432||S.size!==u.sizeBytes)throw new Error("Tool evidence exceeds its declared byte boundary.");m=await c.readFile()}finally{await c.close()}if(m.byteLength!==u.sizeBytes||se(m)!==u.sha256)throw new Error("Owner-recorded tool evidence bytes changed.");let g=la.parse(JSON.parse(m.toString("utf8"))),{contentHash:h,...w}=g.result,y=g.result;if(k(w)!==h||!y.snapshot||!y.environmentCleanupComplete||!["completed","budget_exhausted","policy_failure"].includes(y.status)||k(g.taskset)!==k(L(r))||g.taskHash!==k(s)||k(g.model)!==k(a.modelRef)||g.seed!==a.seed||g.attempt!==a.attempt||a.tasksetId!==r.id||a.taskId!==s.id||a.split!==s.split||k(g.definition)!==k(o.definition)||k(g.environment)!==k(L(o.execution.environment))||k(g.verifierSet)!==k(L(o.execution.verifierSet))||y.taskId!==s.id||y.snapshot.seed!==a.seed||y.snapshot.inputHash!==k(s.input)||k(y.snapshot.definition)!==k(L(o.execution.javascript))||y.snapshot.finalStateHash!==k(y.snapshot.state)||k(a.output)!==k({text:y.output??""})||a.metadata.environmentAttemptHash!==h)throw new Error("Tool evidence differs from the selected task, model or recorded attempt.");if(a.metadata.policySource!==g.policySource)throw new Error("Tool evidence policy source changed.");return{environment:{status:y.status,collected:y.collected,definition:y.snapshot.definition,initialStateHash:y.snapshot.initialStateHash,finalStateHash:y.snapshot.finalStateHash,finalState:y.snapshot.state,events:y.snapshot.events}}}d(_t,"readStarterToolEvidence");async function Te(e,t){if(t.metadata.learning!==void 0)return He.parse(t.metadata.learning);if(t.metadata.rewardBinding===void 0)return;let r=ae.parse(t.metadata.rewardBinding);return e.learningRepository().transaction(t.profileId,async s=>{let a=await ye(s,"binding",r),o=[...new Map(a.sources.map(i=>[`${i.reward.id}:${i.reward.revision}:${i.reward.contentHash}`,i.reward])).values()],n=await Promise.all(o.map(i=>ye(s,"reward",i)));return{binding:a,rewards:n}})}d(Te,"resolveTasksetRewardBinding");async function ua(e,t,r){let s=await Te(e,t);if(!s)return{rewardExecution:void 0,verifierAssets:[]};let a=[...s.rewards.flatMap(i=>i.assets),...be(s.binding,s.rewards).flatMap(i=>i.kind==="custom_verifier"?[i.verifierRef]:i.kind==="model_judge"?[i.rubricRef]:[])],o=t.metadata.learning===void 0?void 0:await wt(r,t);if(o){let i=[...new Map(a.map(u=>{let f=o.learningResources.assets.find(p=>p.id===u.id);if(!f)throw new Error("Imported batch verifier is missing from its package.");return oe(f,u),[f.id,f]})).values()];return{rewardExecution:s,verifierAssets:i}}let n=await e.learningRepository().transaction(t.profileId,async i=>{let u=new Map;for(let f of a){let p=await ke(i,"asset",f.id,1);oe(p,f),u.set(p.id,p)}return[...u.values()]});return{rewardExecution:s,verifierAssets:n}}d(ua,"resolveTasksetTrainingReward");async function gd(e,t,r){let s=await ua(e,t,r.storeDir);if(!s.rewardExecution)return s;let a=be(s.rewardExecution.binding,s.rewardExecution.rewards);if(!s.rewardExecution.binding.sources.some(o=>o.role==="evaluation"&&o.weight>0))throw new Error("Managed training requires a positively weighted evaluation Reward source for retained validation.");if(a.some(o=>o.kind==="custom_verifier"&&o.runtime==="sandbox_process"))throw new Error("Managed preparation requires a qualified isolated sandbox for process verifiers.");if(r.placement!=="remote"||t.environment.kind==="work"||t.capabilities.requiresState||t.capabilities.requiresTools||a.some(o=>o.kind==="human"||o.kind==="model_judge"&&(!o.model||o.calibrationStatus!=="passed"))||t.tasks.some(o=>o.privilegedContextRef!==null)||!s.rewardExecution.binding.sources.some(o=>o.role==="training"&&o.weight>0)||r.hasLearnedPreferenceReward)throw new Error("This Reward binding requires an additional managed execution adapter.");return s}d(gd,"resolveManagedTasksetReward");async function Ls(e,t,r){let s=await Te(e,t);if(!s)throw new Error("The Taskset has no published Reward binding.");let a=be(s.binding,s.rewards);return async({grader:o,task:n,attempt:i,signal:u})=>{let f=t.tasks.find(m=>m.id===n.id);if(!f||k(f)!==k(n))throw new Error("Task differs from the selected immutable Taskset.");let p=null;if(t.environment.entrypoint===J){if(!r)throw new Error("Tool grading requires the execution owner's artifact directory.");p=await _t({store:e,storeDir:r,taskset:t,task:n,attempt:i})}else if(n.privilegedContextRef!==null)throw new Error("This authored Taskset requires a private evaluator-context resolver.");let l=a.find(m=>m.id===o.id);if(l?.kind!=="custom_verifier")throw new Error("The verifier is absent from the published Reward binding.");let c=it.parse({id:n.id,clusterKey:n.clusterKey,split:n.split,input:n.input,expectedOutput:n.expectedOutput,policyVisibleContext:n.policyVisibleContext,privilegedContextRef:n.privilegedContextRef,artifactRefs:[],tags:n.tags});return Ye({repository:e.learningRepository(),scope:t.profileId,grader:l,task:c,evidence:{output:i.output,artifactRefs:i.artifactRefs,runtimeEventRefs:i.runtimeEventRefs,infrastructureError:i.infrastructureError},evaluatorContext:p,signal:u})}}d(Ls,"createTasksetBindingVerifier");async function Ie(e,t,r){let s=r?ae.parse(r):null;if(s&&s.id!==t)throw new Error("Taskset execution reference differs from the requested Taskset.");let a=s?await e.getTasksetRevision(s.id,s.revision):await e.getTaskset(t);if(!a||s&&(a.contentHash!==s.contentHash||Re(a)!==s.contentHash))throw new Error("Taskset execution revision is unavailable or differs from its immutable hash.");return a}d(Ie,"requireLocalTasksetRevision");async function Sd(e,t,r){let s=await e.releaseForTaskset(t);return s||De({taskset:t,rewardExecution:r?await Te(r,t):void 0,adapterId:qe(t)}).tasksetRelease}d(Sd,"requireReleasedTaskset");import{createHash as ma}from"node:crypto";function Us(e,t,r){if(t.metadata.importedPackageHash!==e.contentHash)throw new Error("The Work projection differs from the admitted published package.");let s=e.taskset.tasks.find(n=>n.id===r.id);if(!s||s.split!==r.split||k(r.metadata.portableTaskRecord)!==k(s))throw new Error("The Work task differs from its exact released population.");let a=0,o=(r.assets??[]).map(n=>{let i=s.artifactRefs.find(l=>l.id===n.id&&l.contentHash===n.sha256&&l.path===n.artifactRef),u=i&&e.files.find(l=>k(l.asset)===k(i));if(!i||!u||i.visibility!=="policy")throw new Error("The Work task requests an unavailable or private evaluator file.");let f=Buffer.from(Wr(u));if(ma("sha256").update(f).digest("hex")!==n.sha256||f.length!==n.sizeBytes||n.split!==r.split)throw new Error("The published Work input manifest changed.");if(a+=f.length,a>25e7)throw new Error("Published Work inputs exceed the admitted 250 MB ceiling.");return{...n,assetId:n.id,storageName:n.stagingPath??n.fileName,bytes:f,sizeBytes:f.length}});if(o.length!==s.artifactRefs.length)throw new Error("The exact policy-visible Work asset population is incomplete.");return o}d(Us,"advancedPublishedWorkAssets");async function Yt(e,t=pt,r=!1){if(e.kind==="hosted_harness")return Yt({kind:"hosted_chat",modelId:e.modelId,...Nr(e)},t);if(e.kind!=="hosted_chat")throw new ne("local_target_not_qualified","Select an explicit model target for local execution.",422);if(e.harness&&!r)throw new ne("local_harness_not_qualified","This released Harness requires its native turn executor; it cannot run as a model-only case.",422);let s=await t();if(s.error)throw new ne("local_model_catalog_unavailable",s.error,422);let a=s.models.find(c=>c.id===e.modelId);if(!a)throw new ne("local_model_unavailable","The selected model is unavailable.",422);let o=Bs(a.raw),n=bt(o),i=Bs(o.capabilities).samplingParameters===!0;if(!i&&(e.temperature!==0||e.topP!==1))throw new ne("local_sampling_unsupported","This model uses provider-managed sampling. Custom temperature or top P requires an explicit supported capability.",422);let u=Ws(o.context_window),f=Ws(o.output_limit);if(e.maxOutputTokens>f)throw new ne("local_model_output_limit","The model cannot accept the configured output limit.",422);let p={providerId:"openpond",modelId:e.modelId,maxOutputTokens:e.maxOutputTokens,...i?{temperature:e.temperature,topP:e.topP}:{},messages:e.messages??[]},l=(u*Math.max(n.inputUsdPerMillionTokens,n.cachedInputUsdPerMillionTokens)+e.maxOutputTokens*n.outputUsdPerMillionTokens)/1e6;if(!(l>0))throw new ne("local_model_charge_unknown","The model must publish an enforceable positive request ceiling.",422);return{model:{...p,configurationHash:k({configuration:p,contextWindow:u,outputLimit:f,pricing:n})},pricing:n,maximumChargeUsd:l}}d(Yt,"prepareLocalExperimentModel");function Nd(e){let t=e.admission.streamFactory?.(e)??e.admission.stream??e.stream??ft;return async function*(r){if(!r.requestId)throw new ne("local_request_identity_missing","Every local model dispatch requires a stable request identity.");let s=e.admission.model;if(r.model!==s.modelId||r.maxTokens!==s.maxOutputTokens||r.temperature!==s.temperature||r.topP!==s.topP)throw new ne("local_model_configuration_conflict","The native model request changed its admitted model, output limit or sampling configuration.",422);let a=xs();a?.assertExecution(e.executionId);let o={teamId:e.teamId,id:e.executionId,ownerId:e.ownerId,requestId:r.requestId};await e.store.reserveLocalCharge({...o,caseId:e.caseId,maximumUsd:e.admission.maximumChargeUsd}),r.signal?.aborted&&(await e.store.settleLocalCharge({...o,costUsd:null,usage:null,notDispatched:!0}),r.signal.throwIfAborted());try{await e.store.markLocalChargeDispatched(o.teamId,o.id,o.requestId,o.ownerId)}catch(p){throw a&&await e.store.settleLocalCharge({...o,costUsd:null,usage:null,notDispatched:!0}),p}await e.store.appendLocalExperimentEvent({...o,caseId:e.caseId,type:"model.dispatch",payload:{requestId:o.requestId,model:r.model,messages:r.messages}});let n=null,i=!1,u=!1,f;try{for await(let p of t(r)){u=!0,p.type==="usage"&&(n=p.usage),p.type==="finish"&&(i=!0);let l=p.type==="text_delta"?{requestId:o.requestId,text:p.text}:p.type==="tool_call_delta"?{requestId:o.requestId,toolCalls:p.toolCalls}:p.type==="usage"?{requestId:o.requestId,usage:ve(p.usage)}:p.type==="finish"?{requestId:o.requestId,finishReason:p.finishReason}:null;l&&await e.store.appendLocalExperimentEvent({...o,caseId:e.caseId,type:`model.${p.type}`,payload:l}),yield p}}catch(p){throw!u&&p instanceof Is&&p.executionId===o.id&&p.requestId===o.requestId&&(f=p),p}finally{let p=ve(n),l=e.admission.pricing&&i&&p.promptTokens!==null&&p.completionTokens!==null?xe(n,e.admission.pricing):null;await e.store.settleLocalCharge({...o,costUsd:l,confirmedTransportNotInvoked:f,usage:n===null?null:{promptTokens:p.promptTokens,completionTokens:p.completionTokens,cachedPromptTokens:p.cachedPromptTokens,uncachedPromptTokens:p.uncachedPromptTokens}})}}}d(Nd,"createLocalBudgetedModelStream");function Bs(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}d(Bs,"record");function Ws(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new ne("local_model_bound_unknown","The model catalog is missing an enforceable context/output bound.",422);return e}d(Ws,"positive");import{AsyncLocalStorage as pa}from"node:async_hooks";import fa from"node:path";var Fs=new pa;function Vs(){return Fs.getStore()}d(Vs,"currentAdvancedRefinerBoundary");function Jd(e){let t=Sr(fa.join(e.storeDir,"library","harnesses","advanced-refiner-paid-calls.sqlite"));t.exec(`CREATE TABLE IF NOT EXISTS advanced_refiner_budgets(id TEXT PRIMARY KEY,actor_id TEXT NOT NULL,team_id TEXT NOT NULL,pin_hash TEXT NOT NULL,maximum_spend REAL NOT NULL,maximum_steps INTEGER NOT NULL,expires_at TEXT NOT NULL);
|
|
3
3
|
CREATE TABLE IF NOT EXISTS advanced_refiner_calls(run_id TEXT NOT NULL,id TEXT NOT NULL,intent_hash TEXT NOT NULL,ceiling REAL NOT NULL,state TEXT NOT NULL,actual_spend REAL,result TEXT,PRIMARY KEY(run_id,id));`);function r(a){t.exec("BEGIN IMMEDIATE");try{let o=a();return t.exec("COMMIT"),o}catch(o){throw t.exec("ROLLBACK"),o}}d(r,"transaction");async function s(a,o,n){let i=Ft(o);await e.authorize(i),r(()=>{let l=t.prepare("SELECT * FROM advanced_refiner_budgets WHERE id=?").get(a);if(l){if(l.actor_id!==i.actorId||l.team_id!==i.teamId||l.pin_hash!==i.contentHash)throw new Error("Advanced Run budget belongs to another immutable admission.");return}t.prepare("INSERT INTO advanced_refiner_budgets VALUES(?,?,?,?,?,?,?)").run(a,i.actorId,i.teamId,i.contentHash,i.maximumCostUsd,i.maximumModelSteps,new Date(Date.now()+i.maximumDurationMs).toISOString())});let u=t.prepare("SELECT expires_at FROM advanced_refiner_budgets WHERE id=?").get(a),f=Date.parse(String(u.expires_at))-Date.now();if(f<=0)throw new Error("The immutable advanced evaluation duration is exhausted.");let p={runId:a,pin:i,signal:AbortSignal.timeout(f),authorize:d(()=>e.authorize(i),"authorize"),async resolveWorkAssets(l,c){await e.authorize(i),p.signal.throwIfAborted();let m=await e.packageForPin(i),g=Us(m,l,c);return await e.authorize(i),p.signal.throwIfAborted(),g},async call(l,c,m,g,h){if(await e.authorize(i),!Number.isInteger(g)||g<1)throw new Error("Advanced paid requests require a finite enforced token ceiling.");let w=c.model;if(w?.providerId!=="openpond"||!w.modelId)throw new Error("Advanced paid calls require an explicitly qualified hosted model.");let y=w.modelId,S=e.prepareModel?await e.prepareModel(y,g,m):await(async()=>{let C=await Yt({kind:"hosted_chat",modelId:y,maxOutputTokens:g,temperature:0,topP:1});if(k(C.pricing)!==k(m))throw new Error("The actual model pricing differs from its reviewed request pin.");return{configurationHash:C.model.configurationHash,maximumChargeUsd:C.maximumChargeUsd}})();if(!/^[a-f0-9]{64}$/.test(S.configurationHash)||!Number.isFinite(S.maximumChargeUsd)||S.maximumChargeUsd<=0)throw new Error("The actual owner model ceiling is unavailable.");let _=k({intent:c,pricing:m,maximumOutputTokens:g,modelConfigurationHash:S.configurationHash}),x=S.maximumChargeUsd,v=r(()=>{let C=t.prepare("SELECT * FROM advanced_refiner_budgets WHERE id=?").get(a);if(!C||String(C.expires_at)<=new Date().toISOString())throw new Error("The immutable advanced evaluation duration is exhausted.");let E=t.prepare("SELECT * FROM advanced_refiner_calls WHERE run_id=? AND id=?").get(a,l);if(E){if(E.intent_hash!==_)throw new Error("Advanced provider request ID retains another exact payload.");if(E.state!=="completed")throw new Error("This paid request has an unknown outcome; recover its actual provider receipt before resuming.");return JSON.parse(String(E.result))}let T=t.prepare("SELECT COUNT(*) AS steps,COALESCE(SUM(COALESCE(actual_spend,ceiling)),0) AS spent,SUM(CASE WHEN state NOT IN ('completed','not_dispatched') THEN 1 ELSE 0 END) AS unknown FROM advanced_refiner_calls WHERE run_id=?").get(a);if(Number(T.unknown)>0)throw new Error("A prior advanced paid request is unsettled; no fresh request is allowed.");if(Number(T.steps)>=i.maximumModelSteps||Number(T.spent)+x>i.maximumCostUsd+1e-9)throw new Error("The advanced evaluation step or cumulative spend ceiling is exhausted.");t.prepare("INSERT INTO advanced_refiner_calls(run_id,id,intent_hash,ceiling,state) VALUES(?,?,?,?,?)").run(a,l,_,x,"reserved")});if(v!==void 0)return await e.authorize(i),p.signal.throwIfAborted(),v;let M=!1;try{if(await e.authorize(i),p.signal.throwIfAborted(),t.prepare("UPDATE advanced_refiner_calls SET state='dispatched' WHERE run_id=? AND id=? AND intent_hash=? AND state='reserved'").run(a,l,_).changes!==1)throw new Error("The retained advanced request admission changed.");M=!0;let E=await h();if(E.costUsd===null||!Number.isFinite(E.costUsd)||E.costUsd<0||E.costUsd>x+1e-9)throw new Error("The actual provider receipt cannot settle its admitted request ceiling.");let T=JSON.stringify(E.value);if(Buffer.byteLength(T)>8*1024*1024)throw new Error("The advanced provider response exceeds the retained output bound.");return r(()=>{if(t.prepare("UPDATE advanced_refiner_calls SET state='completed',actual_spend=?,result=? WHERE run_id=? AND id=? AND intent_hash=? AND state='dispatched'").run(E.costUsd,T,a,l,_).changes!==1)throw new Error("The advanced request settlement changed concurrently.")}),await e.authorize(i),E.value}catch(C){throw M?t.prepare("UPDATE advanced_refiner_calls SET state='unknown' WHERE run_id=? AND id=? AND state='dispatched'").run(a,l):t.prepare("UPDATE advanced_refiner_calls SET state='not_dispatched',actual_spend=0 WHERE run_id=? AND id=? AND state='reserved'").run(a,l),C}}};return Fs.run(p,n)}return d(s,"run"),{run:s,async authorize(a){await e.authorize(Ft(a))},read(a,o){return t.prepare("SELECT * FROM advanced_refiner_budgets WHERE id=? AND actor_id=? AND team_id=? AND pin_hash=?").get(a,o.actorId,o.teamId,o.contentHash)?t.prepare("SELECT id,intent_hash,ceiling,state,actual_spend FROM advanced_refiner_calls WHERE run_id=? ORDER BY id").all(a):null},accounting(a,o){let n=this.read(a,o)??[],i=n.filter(f=>f.state!=="completed"&&f.state!=="not_dispatched"),u=n.reduce((f,p)=>f+Number(p.actual_spend??0),0);return{modelRequests:n.filter(f=>f.state!=="not_dispatched").length,knownSpendUsd:u,totalSpendUsd:i.length?null:u,heldUsd:i.reduce((f,p)=>f+Number(p.ceiling),0),uncertainRequests:i.filter(f=>f.state!=="reserved").length}},close(){t.close()}}}d(Jd,"createAdvancedRefinerPaidBoundary");import ra from"node:path";function xt(e,t,r){let s=new Date().toISOString();return W.parse({schemaVersion:"openpond.taskAttempt.v1",id:`fixture_attempt_${t.id}_${r}`,tasksetId:e,taskId:t.taskId,split:Ke(t)??"frozen_eval",attempt:r,seed:0,modelRef:null,startedAt:s,completedAt:s,output:t.output,runtimeEventRefs:[],artifactRefs:[],privilegedOutcomeRef:null,infrastructureError:t.infrastructureError,costUsd:0,latencyMs:0,userInterventions:0,metadata:{fixtureLabel:t.label}})}d(xt,"fixtureAttempt");function Ke(e){let t=e&&typeof e=="object"&&!Array.isArray(e)&&"metadata"in e&&e.metadata&&typeof e.metadata=="object"&&!Array.isArray(e.metadata)?e.metadata.artifactSplit:null;return t==="train"||t==="validation"||t==="test"||t==="frozen_eval"?t:null}d(Ke,"artifactSplit");function Js(e){let t=Gr(e.taskset),r=t.issues.filter(b=>b.severity==="error").map(b=>({code:b.code,message:b.message,path:b.path})),s=t.issues.filter(b=>b.severity==="warning").map(b=>({code:b.code,message:b.message,path:b.path})),a=typeof e.taskset.metadata.trainingMethod=="string"?e.taskset.metadata.trainingMethod:null,o=ga(a),n=o==="sft",i=o==="dpo",u=o==="grpo"||o==="ppo",f=new Set(e.taskset.learningSignals.demonstrations.filter(b=>b.approved&&b.taskId).map(b=>b.taskId)),p=e.taskset.metadata.learning===void 0?null:He.parse(e.taskset.metadata.learning),l=d(b=>p?p.admissions.some(B=>B.taskId===b.id&&B.supervisedTarget!==null):b.expectedOutput!=null,"hasSupervisedTarget"),c=e.taskset.datasetArtifact,m=new Set(zs(e.taskset.metadata.approvedArtifactSignals)),g=!!c?.schema.fields.some(b=>b.semanticRole==="demonstration"||b.semanticRole==="expected_output"||b.semanticRole==="chosen"),h=e.taskset.tasks.filter(b=>b.split==="train"&&(l(b)||u)),w=n?h.filter(b=>f.has(b.id)):h,y=e.taskset.tasks.filter(b=>b.split==="train"&&l(b)&&!f.has(b.id)),S=e.taskset.tasks.filter(b=>b.split==="frozen_eval"&&(b.expectedOutput||u)),_=c&&g?c.splitCounts.train??0:0,x=c&&g?c.splitCounts.frozen_eval??0:0,v=c?m.has(o??""):!1,M=c?v?_:0:w.length,C=e.taskset.learningSignals.preferences.filter(b=>b.approved).length,E=Yr(e.taskset),T=E?E.binding.sources.filter(b=>b.role==="training"&&b.weight>0&&(!b.taskIds||w.some(B=>b.taskIds.includes(B.id)))).length:e.taskset.learningSignals.rewards.filter(b=>b.approved&&b.executable).length,A=i?C:u?T?M:0:M,R=c?x:S.length;A===0&&r.push(n?{code:"sft_demonstrations_missing",message:"At least one explicitly approved training demonstration is required.",path:"learningSignals.demonstrations"}:i?{code:"dpo_preferences_missing",message:"At least one approved chosen/rejected response pair is required for DPO.",path:"learningSignals.preferences"}:{code:"online_reward_missing",message:`${o?.toUpperCase()??"Online training"} requires an executable reward-bearing task.`,path:"learningSignals.rewards"});let j=c?n&&!v?_:0:y.length;n&&j&&r.push({code:"sft_demonstrations_unapproved",message:`${j} training example${j===1?" is":"s are"} not explicitly approved.`,path:c?"metadata.approvedArtifactSignals":"learningSignals.demonstrations"}),R===0&&s.push({code:"frozen_eval_missing",message:"At least one independent evaluation example is recommended before making quality claims.",path:c?"datasetArtifact.splitCounts.frozen_eval":"tasks"});let $=new Set(w.map(b=>b.clusterKey)),z=new Set(S.map(b=>b.clusterKey)),U=c&&e.taskset.metadata.splitIsolationVerified===!0;(c?!U||A===0||R===0:$.size===0||z.size===0||[...$].some(b=>z.has(b)))&&s.push({code:"independent_evaluation_missing",message:"Independent source clusters are recommended before using evaluation results for quality claims.",path:c?"metadata.splitIsolationVerified":"tasks"}),(c?e.taskset.metadata.artifactRowsVerified!==!0:e.taskset.tasks.some(b=>typeof b.metadata.exampleOrigin!="string"))&&r.push({code:"example_provenance_missing",message:"Every training and evaluation example must record whether it was extracted, corrected, synthetic, or expert-authored.",path:c?"metadata.artifactRowsVerified":"tasks.metadata.exampleOrigin"});let Q=ha(e.taskset.metadata.diagnosis);(!Q||typeof Q.summary!="string"||!Array.isArray(Q.stableBehavior))&&s.push({code:"capability_diagnosis_missing",message:"A capability diagnosis is recommended to separate stable behavior from changing knowledge.",path:"metadata.diagnosis"}),Q?.trainingEligible===!1&&s.push({code:"training_not_recommended",message:"The capability diagnosis does not recommend storing this behavior in model weights.",path:"metadata.diagnosis.trainingEligible"});let me=e.taskset.graders.some(b=>b.rewardEligible&&(b.kind!=="model_judge"||b.metadata.calibrationIsAdvisory!==!0));me&&!e.graderAudit&&s.push({code:"grader_audit_missing",message:"Optional grader calibration evidence has not been recorded.",path:"graderFixtures"}),me&&e.graderAudit&&e.graderAudit.tasksetHash!==e.taskset.contentHash&&s.push({code:"grader_audit_stale",message:"Optional grader calibration evidence predates this immutable Taskset revision.",path:"graderFixtures"}),me&&e.graderAudit&&!e.graderAudit.passed&&s.push({code:"grader_audit_failed",message:"The grader did not match every optional calibration fixture's expected outcome.",path:"graderFixtures"}),me&&e.graderAudit&&!e.graderAudit.hackingChecksPassed&&s.push({code:"grader_adversarial_calibration_failed",message:"Adversarial or prompt-injection calibration fixtures did not match their expected grader outcomes.",path:"graders"}),me&&e.graderAudit&&!e.graderAudit.leakageChecksPassed&&r.push({code:"environment_leakage",message:"Environment or privileged-state leakage checks failed.",path:"environment"}),me&&e.graderAudit&&!e.graderAudit.infrastructureSafetyPassed&&r.push({code:"infrastructure_reward",message:"An infrastructure failure produced a score or eligible reward.",path:"graderFixtures"});let tt=e.taskset.graders.some(b=>b.rewardEligible);u&&!tt&&r.push({code:"online_reward_grader_missing",message:`${o?.toUpperCase()} requires a user-selected reward-eligible grader.`,path:"graders"});let ie=o??(A>0&&e.taskset.capabilities.compatibleMethods.includes("sft")?"sft":"none"),I=e.taskset.learningSignals.demonstrations.filter(b=>b.approved).map(b=>b.id),N=ie==="none"?null:{primaryMethod:ie,bootstrap:ie==="grpo"&&I.length?{method:"sft",purpose:"trajectory_bootstrap",demonstrationRefs:I,limitations:["The SFT bootstrap imitates approved trajectories; it does not optimize verifier reward.","Completing the bootstrap does not satisfy the primary GRPO recommendation."]}:null},K=r.length===0,pe=r.length>0,rt=["sft","dpo","grpo","ppo"].map(b=>{let B=[],X=[];b==="sft"&&I.length===0&&(B.push("demonstrations_missing"),X.push("Add at least one approved prompt/response demonstration.")),b==="dpo"&&C===0&&(B.push("preference_pairs_missing"),X.push("Add at least one approved chosen/rejected response pair.")),(b==="grpo"||b==="ppo")&&T===0&&(B.push("executable_reward_missing"),X.push("Implement and validate an executable scalar reward.")),b==="ppo"&&(B.push("value_model_required"),X.push("Choose and bind a value/critic model before PPO can execute.")),R===0&&(B.push("frozen_eval_missing"),X.push("Add an independent frozen-evaluation split.")),pe&&B.length===0&&(B.push("taskset_not_ready"),X.push("Resolve the Dataset validation and grader-audit blockers."));let Me=B.filter(fe=>fe!=="value_model_required");return{method:b,status:Me.length?"needs_dataset_work":b===ie?"recommended":"compatible",reasonCodes:B,reasons:X}});return zr.parse({schemaVersion:"openpond.tasksetReadiness.v1",tasksetId:e.taskset.id,tasksetHash:e.taskset.contentHash,ready:K,recommendedMethod:ie,trainingPath:N,methodReadiness:rt,compatibleDestinationClasses:K?ie==="grpo"?["export","custom","hosted_managed"]:["export","custom"]:["export"],blockers:r,advisories:s,warnings:[...t.issues.filter(b=>b.severity==="warning").map(b=>b.message),...ie==="grpo"?["GRPO is readiness-compatible but not executable in the local CPU fixture."]:[],...zs(e.taskset.metadata.warnings)],generatedAt:e.generatedAt??new Date().toISOString(),metadata:{reportHash:k([e.taskset.contentHash,r])}})}d(Js,"buildTasksetReadiness");function ga(e){return e==="sft"||e==="dpo"||e==="grpo"||e==="ppo"||e==="sdft"||e==="opsd"||e==="sdpo"?e:null}d(ga,"trainingPathMethod");function ha(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}d(ha,"metadataRecord");function zs(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&!!t.trim()):[]}d(zs,"metadataStrings");import eo from"node:path";function Gs(e,t,r){let s=He.parse(t.metadata.learning),a=be(s.binding,s.rewards);return async({grader:o,task:n,attempt:i,signal:u})=>{let f=s.admissions.find(h=>h.taskId===n.id),p=a.find(h=>h.id===o.id);if(!f||p?.kind!=="custom_verifier")throw new Error("Prepared batch has no matching verifier admission.");let l=await wt(r,t),c=l?l.learningResources?.evidence.find(h=>Ar(L(h),f.evidence)):await e.learningRepository().transaction(t.profileId,h=>ye(h,"evidence",f.evidence));if(!c)throw new Error("Imported batch evidence is missing from its package.");let m=dt(c,s.definition),g=d(h=>({id:h.id,input:h.input,expectedOutput:h.expectedOutput,policyVisibleContext:h.policyVisibleContext,privilegedContextRef:h.privilegedContextRef}),"selected");if(k(g(n))!==k(g(m)))throw new Error("Prepared task differs from its admitted evaluator context.");if(l){let h=l.learningResources?.assets.find(w=>w.id===p.verifierRef.id);if(!h)throw new Error("Imported batch verifier is missing from its package.");return $e({source:oe(h,p.verifierRef),exportName:p.exportName,timeoutMs:p.timeoutMs,signal:u,value:{task:m,attempt:{output:i.output,artifactRefs:i.artifactRefs,runtimeEventRefs:i.runtimeEventRefs,infrastructureError:i.infrastructureError},input:m.input,output:i.output,expectedOutput:m.expectedOutput,evaluatorContext:c.submission.evaluatorContext,infrastructureError:i.infrastructureError??null}})}return Ye({repository:e.learningRepository(),scope:t.profileId,grader:p,task:m,evidence:{output:i.output,artifactRefs:i.artifactRefs,runtimeEventRefs:i.runtimeEventRefs,infrastructureError:i.infrastructureError},evaluatorContext:c.submission.evaluatorContext,signal:u})}}d(Gs,"createLearningBatchVerifier");import{readFile as ka,realpath as Ys}from"node:fs/promises";import Ks from"node:path";async function Xs(e){let t=await Ys(e.allowedRoot),r=await Ys(Ks.resolve(t,e.grader.module));if(r!==t&&!r.startsWith(`${t}${Ks.sep}`))throw new Error("Verifier module is outside the approved Taskset root.");let s=await ka(r);if(e.grader.metadata.portableVerifierRef!==void 0){let o=Tr.parse(e.grader.metadata.portableVerifierRef);if(o.sizeBytes!==s.length||o.contentHash!==se(s))throw new Error("Verifier source differs from its immutable Taskset release.")}let a=new TextDecoder("utf-8",{fatal:!0}).decode(s);return $e({source:a,exportName:e.grader.exportName,runtime:e.grader.runtime,timeoutMs:e.grader.timeoutMs,signal:e.signal,value:{task:e.task,attempt:e.attempt,input:e.task.input,expectedOutput:e.task.expectedOutput,output:e.attempt.output,infrastructureError:e.attempt.infrastructureError,...e.evaluatorContext?{evaluatorContext:e.evaluatorContext}:{}}})}d(Xs,"runSandboxedVerifier");import{constants as Kt}from"node:fs";import{open as ya,realpath as Zs}from"node:fs/promises";import We from"node:path";async function It(e,t){let r=De({taskset:t,adapterId:qe(t)});if(typeof t.metadata.importedPackageHash=="string"){let s=await Rs(e,t.metadata.importedPackageHash);if(s.taskset.contentHash!==r.tasksetRelease.contentHash)throw new Error("Evaluation Taskset differs from its pinned portable package.");let a=ct.parse(t.metadata.portableFileInventory??[]),{files:o,contentHash:n,...i}=s,u=await vt({root:We.join(e,"training","tasksets",ee(t)),content:i,sources:o.map(f=>({asset:f.asset,sourcePath:a.find(p=>p.asset.id===f.asset.id)?.sourcePath??f.asset.path})),fileOrder:o.map(f=>f.asset.id)});if(u.contentHash!==s.contentHash)throw new Error("Evaluation package changed during capture.");return u}return _s({storeDir:e,taskset:t,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:r.tasksetRelease,environment:r.environmentRelease,verifierSet:r.verifierSetRelease}})}d(It,"captureTasksetEvaluationPackage");function Qs(e){return async({grader:t,task:r,attempt:s,signal:a})=>{let o=e.taskset.tasks.find(l=>l.id===r.id),n=e.taskset.graders.find(l=>l.id===t.id);if(!o||k(o)!==k(r)||!n||k(n)!==k(t)||s.tasksetId!==e.taskset.id||s.taskId!==r.id||s.split!==r.split)throw new Error("Process grading differs from the selected Taskset revision or attempt.");let i=e.packageValue.taskset.tasks.find(l=>l.id===r.id),u=e.packageValue.taskset.graders.find(l=>l.id===t.id);if(!i||u?.kind!=="custom_verifier"||u.runtime!=="sandbox_process")throw new Error("The process verifier is absent from the immutable package.");let f=e.fixtures?.get(s.id);if(f&&f.attemptHash!==k(s))throw new Error("Fixture attempt changed before private grading.");let p=f?.artifacts??await wa(e.store,e.storeDir,e.taskset,s);return Es({packageValue:e.packageValue,grader:u,task:i,evidence:{output:s.output,artifactRefs:s.artifactRefs,runtimeEventRefs:s.runtimeEventRefs,infrastructureError:s.infrastructureError,artifacts:p},signal:a,authorize:d(async()=>{a?.throwIfAborted()},"authorize")})}}d(Qs,"createTasksetProcessVerifier");async function wa(e,t,r,s){let a=await e.listTaskAttemptArtifacts({attemptId:s.id}),o=[],n=0;if(new Set(s.artifactRefs).size!==s.artifactRefs.length)throw new Error("Attempt contains duplicate artifact references.");for(let i of s.artifactRefs){let u=a.filter(g=>g.id===i&&g.tasksetId===r.id&&g.taskId===s.taskId&&g.attemptId===s.id);if(u.length!==1)throw new Error("Attempt artifact is not recorded by its execution owner.");let f=u[0];if(f.kind!=="output_artifact")continue;if(o.length>=16||(n+=f.sizeBytes)>2e7)throw new Error("Attempt artifacts exceed their byte boundary.");let p=await Zs(t),l=await Zs(We.dirname(f.path));if(![We.join(p,"training/evaluation-artifacts"),We.join(p,"work/outputs")].some(g=>l===g||l.startsWith(`${g}${We.sep}`)))throw new Error("Attempt artifact is outside the execution owner's output directories.");let c=await ya(f.path,Kt.O_RDONLY|Kt.O_NOFOLLOW|Kt.O_NONBLOCK),m;try{let g=await c.stat();if(!g.isFile()||g.size!==f.sizeBytes)throw new Error("Owner-recorded artifact size changed.");m=Buffer.alloc(g.size);let h=0;for(;h<m.length;){let w=await c.read(m,h,m.length-h,h);if(!w.bytesRead)throw new Error("Owner-recorded artifact changed during capture.");h+=w.bytesRead}if((await c.read(Buffer.alloc(1),0,1,h)).bytesRead)throw new Error("Owner-recorded artifact changed during capture.")}finally{await c.close()}if(se(m)!==f.sha256)throw new Error("Owner-recorded artifact bytes changed.");o.push({reference:{id:f.id,contentHash:f.sha256,mediaType:f.mediaType??"application/octet-stream",sizeBytes:f.sizeBytes},title:We.basename(typeof f.metadata.requiredOutputPath=="string"?f.metadata.requiredOutputPath:f.path),contentType:f.mediaType??"application/octet-stream",base64:m.toString("base64")})}return o}d(wa,"readOwnedOutputArtifacts");async function Et(e,t,r){if(!t.graders.some(p=>p.kind==="custom_verifier"))return;let s=t.graders.some(p=>p.kind==="custom_verifier"&&p.runtime==="sandbox_process"),a=t.metadata.learning!==void 0?await Gs(e.store,t,e.storeDir):t.metadata.rewardBinding!==void 0?await Ls(e.store,t,e.storeDir):void 0;if(a&&!s)return a;let o=e.storeDir?null:await(e.loadProfileState??br)(),n=e.storeDir?eo.join(e.storeDir,"training","tasksets",ee(t)):o?.sourcePath?eo.join(o.sourcePath,"tasksets",t.id):null,i=typeof t.metadata.creationSnapshotId=="string"?t.metadata.creationSnapshotId:null,u=i?await e.store.getTaskDesignProposal(i):null;if(n&&t.purpose!=="benchmark"&&t.environment.metadata.runtimeSourceTasksetId===void 0&&await ut(t,n,{generatedFiles:u?.generatedFiles??[]}),s&&!e.storeDir)throw new Error("Process grading requires the execution owner's package directory.");let f=s?Qs({store:e.store,storeDir:e.storeDir,taskset:t,packageValue:r?.packageValue??await It(e.storeDir,t),fixtures:r?.fixtures}):void 0;return n?async({grader:p,task:l,attempt:c,signal:m})=>{let g=t.graders.find(w=>w.id===p.id);if(!g||g.kind!=="custom_verifier")throw new Error("Verifier is not declared by this Taskset revision.");if(g.runtime==="sandbox_process")return f({grader:p,task:l,attempt:c,signal:m});if(a)return a({grader:g,task:l,attempt:c,signal:m});let h;if(t.environment.entrypoint===J&&!c.infrastructureError){if(!e.storeDir)throw new Error("Tool grading requires the execution owner's artifact directory.");h=await _t({store:e.store,storeDir:e.storeDir,taskset:t,task:l,attempt:c})}return Xs({grader:g,task:l,attempt:c,allowedRoot:n,signal:m,evaluatorContext:h})}:void 0}d(Et,"createTasksetEvaluationVerifier");var va=new Set(["correct","incorrect","parse_failure","budget_exhausted","tool_schema_violation","infrastructure_failure","cancelled"]);async function to(e){let t=Sa(e.attempt);if(t){let f=k(e.graders),p=`Taskset Work attempt ended with ${t.failureClass}: `+t.message;return{schemaVersion:"openpond.gradeResult.v1",id:`grade_${k([e.attempt.id,f,t]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:f,score:null,passed:!1,components:e.graders.map(l=>({graderId:l.id,graderVersion:l.version,score:0,passed:!1,hardGate:l.hardGate,rewardEligible:!1,feedback:p,evidenceRefs:e.attempt.artifactRefs,judge:l.kind==="model_judge"?l.judge:null,calibrationStatus:l.kind==="model_judge"?l.calibrationStatus:"not_applicable"})),failureClass:t.failureClass,feedback:[p],rewardEligible:!1,createdAt:e.now?.()??new Date().toISOString()}}let r=e.learning?null:ba(e.attempt.metadata);if(!r)try{return await lt(e)}catch(f){return Ta({attempt:e.attempt,graders:e.graders,now:e.now,error:f})}let s=k(e.graders),a=r.rewardEligible?r.outcome==="correct"?1:0:null,o=r.outcome==="correct",n=Ra(r.outcome),i=`Cross-System trajectory verifier outcome: ${r.outcome}.`,u=e.graders.map(f=>({graderId:f.id,graderVersion:f.version,score:a??0,passed:o,hardGate:f.hardGate,rewardEligible:r.rewardEligible&&f.rewardEligible,feedback:i,evidenceRefs:e.attempt.artifactRefs,judge:f.kind==="model_judge"?f.judge:null,calibrationStatus:f.kind==="model_judge"?f.calibrationStatus:"not_applicable"}));return{schemaVersion:"openpond.gradeResult.v1",id:`grade_${k([e.attempt.id,s,r]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:s,score:a,passed:o,components:u,failureClass:n,feedback:[i],rewardEligible:r.rewardEligible,createdAt:e.now?.()??new Date().toISOString()}}d(to,"gradeTasksetEvaluationAttempt");function Ta(e){let t=k(e.graders),r=(e.error instanceof Error?e.error.message:String(e.error)).slice(0,19e3),s=`Taskset grader failed: ${r}`;return{schemaVersion:"openpond.gradeResult.v1",id:`grade_${k([e.attempt.id,t,"grader_failure",r]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:t,score:null,passed:!1,components:e.graders.map(a=>({graderId:a.id,graderVersion:a.version,score:0,passed:!1,hardGate:a.hardGate,rewardEligible:!1,feedback:s,evidenceRefs:e.attempt.artifactRefs,judge:a.kind==="model_judge"?a.judge:null,calibrationStatus:a.kind==="model_judge"?a.calibrationStatus:"not_applicable"})),failureClass:"grader_failure",feedback:[s],rewardEligible:!1,createdAt:e.now?.()??new Date().toISOString()}}d(Ta,"graderFailureResult");function Sa(e){if(e.metadata.execution!=="taskset_work"||!e.infrastructureError)return null;let t=Zr.safeParse(e.metadata.failureClass);if(!t.success||t.data==="policy_failure"||t.data==="grader_failure")throw new Error("Taskset Work attempt is missing a trusted execution failure class.");return{failureClass:t.data,message:e.infrastructureError}}d(Sa,"tasksetWorkFailure");function ba(e){if(e.execution!=="post_training_evaluation_tool_loop")return null;let t=e.verifierOutcome,r=e.verifierReward,s=e.verifierRewardEligible;if(typeof t!="string"||!va.has(t)||typeof s!="boolean"||r!==null&&typeof r!="number")throw new Error("Cross-System evaluation attempt is missing trusted verifier metadata.");if(s!==(t==="correct"||t==="incorrect"||t==="parse_failure")||s&&typeof r!="number"||!s&&r!==null)throw new Error("Cross-System evaluation verifier metadata is internally inconsistent.");return{outcome:t,reward:r,rewardEligible:s}}d(ba,"crossSystemGrade");function Ra(e){return e==="correct"?null:e==="infrastructure_failure"?"infrastructure_failure":e==="cancelled"?"cancelled":"policy_failure"}d(Ra,"failureClassFor");import Xe from"node:path";import{mkdir as ro,readFile as _a,writeFile as so}from"node:fs/promises";async function te(e){let t=Xe.join(e.storeDir,"training","evaluation-artifacts",e.tasksetId),r=Xe.join(t,`${e.attemptId}-${oo(e.fileLabel??e.kind)}.json`),s=Buffer.from(`${JSON.stringify({schemaVersion:"openpond.rawEvaluationArtifact.v1",requestId:e.requestId,...e.payload},null,2)}
|
|
4
4
|
`,"utf8");return await ro(t,{recursive:!0}),await so(r,s,{mode:384}),Xt({...e,file:r,bytes:s,mediaType:"application/json"})}d(te,"persistJsonTaskAttemptArtifact");async function Zc(e){let t=e.extension.replace(/^\.+/,"");if(!/^[a-z0-9]{1,12}$/i.test(t))throw new Error("Task Attempt artifact extension is invalid.");let r=Xe.join(e.storeDir,"training","evaluation-artifacts",e.tasksetId);await ro(r,{recursive:!0});let s=Xe.join(r,`${e.attemptId}-${oo(e.fileLabel)}.${t}`);return await so(s,e.bytes,{mode:384}),Xt({...e,file:s})}d(Zc,"persistBinaryTaskAttemptArtifact");function oo(e){let t=e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");if(!t)throw new Error("Evaluation artifact file label is empty.");return t}d(oo,"safeFileLabel");async function ao(e){let t=await _a(e.path),r=se(t);if(t.byteLength!==e.expectedSizeBytes||r!==e.expectedSha256)throw new Error(`Saved Work output ${Xe.basename(e.path)} no longer matches its OutputRef.`);return Xt({...e,file:e.path,bytes:t,kind:"output_artifact",metadata:{...e.metadata,source:"openpond-work",outputValidated:!0}})}d(ao,"persistTaskAttemptOutputArtifact");async function Xt(e){let t=se(e.bytes),r=Qr.parse({schemaVersion:"openpond.taskAttemptArtifact.v1",id:`attempt_artifact_${k([e.attemptId,e.kind,e.file,t]).slice(0,24)}`,tasksetId:e.tasksetId,taskId:e.taskId,attemptId:e.attemptId,kind:e.kind,path:e.file,mediaType:e.mediaType,sha256:t,sizeBytes:e.bytes.byteLength,createdAt:e.timestamp(),metadata:{requestId:e.requestId,localOnly:!0,containsPrivilegedOutcome:!1,...e.metadata}});return e.store.saveTaskAttemptArtifact(r)}d(Xt,"saveArtifact");function Zt(e){let t=new Set(e.approvedTrajectoryIds),r=new Map(e.tasks.map(a=>[a.id,a])),s=new Map(e.results.map(a=>[a.trajectoryId,a]));return e.trajectories.flatMap(a=>{let o=s.get(a.id),n=r.get(a.taskId);return!t.has(a.id)||!n||o?.outcome!=="correct"||!o.rewardEligible?[]:[us.parse({schemaVersion:V,id:`cso_bootstrap_${a.id}`,taskId:n.id,worldId:a.worldId,trajectoryId:a.id,toolContractHash:q,approval:{status:"approved",approvedBy:e.approvedBy,approvedAt:e.approvedAt},messages:xa(n,a)})]})}d(Zt,"buildCrossSystemBootstrapDataset");function xa(e,t){let r=[{role:"system",content:cs},{role:"user",content:e.prompt}];for(let s of t.steps)s.kind==="model"&&s.content.trim()&&r.push({role:"assistant",content:s.content}),s.kind==="tool_call"&&r.push({role:"assistant",content:null,tool_calls:[{id:s.callId,type:"function",function:{name:s.name,arguments:JSON.stringify(s.arguments)}}]}),s.kind==="tool_result"&&r.push({role:"tool",tool_call_id:s.callId,content:JSON.stringify({ok:s.ok,result:s.result,error:s.error})}),s.kind==="final"&&r.push({role:"assistant",content:s.content});return r}d(xa,"trajectoryMessages");import _n from"node:path";import{mkdir as Ia,mkdtemp as Ea,rm as Ca}from"node:fs/promises";import Aa from"node:path";async function no(e,t,r){await Ia(e,{recursive:!0});let s=await Ea(Aa.join(e,".authoring-"));try{return await ut(t,s,{generatedFiles:r}),await Qt(e,t,s)}finally{await Ca(s,{recursive:!0,force:!0})}}d(no,"materializeGeneratedTasksetPackage");async function Qt(e,t,r){let s=await Kr(r),a=await Ss(t,r),o=`authored-${k(a.taskset)}`,n=we.parse({...a.taskset,environment:{...a.taskset.environment,metadata:{...a.taskset.environment.metadata,runtimeSourceTasksetId:o}}}),i=we.parse({...n,contentHash:Re(n)});return await ys(e,{taskset:i,generatedFiles:a.generatedFiles},o,{source:{directory:r,packageHash:s},verify:d(u=>yt(u,i),"verify")}),i}d(Qt,"materializeTasksetRevisionFromSource");import{Buffer as tr}from"node:buffer";import{spawn as Ma}from"node:child_process";var io=String.raw`
|
|
5
5
|
import contextlib, io, json, math, statistics, decimal, datetime, collections, itertools, functools, sys
|