chainlesschain 0.166.91 → 0.166.93
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/README.md +17 -17
- package/package.json +3 -3
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-DgV7xb8F.js → AIOps-oo9rE0gh.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CgANpkKu.js → ActionButton-CVJVVv4i.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-DnvpX7RB.js → Analytics-CUXuwmia.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-C2bHccBM.js → AppLayout-iM4PvCuY.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-BIhijC9g.js → Artifacts-DKUIJbf9.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-CKRjWGdp.js → Audit-C4_SzFN2.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-CblYtgBE.js → BackgroundAgents-C3427uy-.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-Cq35b78a.js → Backup-BpEQQiog.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-DcB7NoRz.js → BaseInput-C_exQomZ.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-tc3b-s7i.js → Chat-DzpkLtWa.js} +5 -5
- package/src/assets/web-panel/assets/ChatBubbleRenderer-DX4XmTWm.js +1 -0
- package/src/assets/web-panel/assets/{Checkbox-BLD5bH5u.js → Checkbox-CxAC1CU8.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BLOsoazN.js → Codegen-wDFAGCLp.js} +1 -1
- package/src/assets/web-panel/assets/{Col-Bdr7JwIx.js → Col-BvwirhMf.js} +1 -1
- package/src/assets/web-panel/assets/{Community-C84BsWE0.js → Community-BJuA7paY.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-Dzdwd04z.js → Compact-DzV35_u2.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CCG-R0EV.js → Compliance-CIDPPvr9.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-BYj72SK0.js → Cowork-DyTMxP3N.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-B6iKAwOf.js → Cron-PcNLjMFx.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-BJ-oDC6u.js → Crosschain-B_O7ck6Z.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BnMckGLr.js → DID-CII35Me1.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-Cyje-gCO.js → Dashboard-DU56fkNz.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BpNlenjK.js → Dropdown-DHC8HVeJ.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-BhonO7Nv.js → EmailListRenderer-oUOHFNsD.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-DVoNU-Id.js → EvolutionSettings-D7RCAWNl.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-tdn-KC67.js → FamilyGuardDashboard-CGONPZxC.js} +1 -1
- package/src/assets/web-panel/assets/{Federation--EEVrHhz.js → Federation-BbDlPWcl.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-Cy8zr0-4.js → FormItemContext-BBJbFQQT.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-BuUhpgFi.js → GenericCardRenderer-iuxAero4.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Ctd3E5Pe.js → Git-Dw0prdY5.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-Ce7dV6aU.js → Governance-DOGqi_uV.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CD1vExIH.js → Inference-BY5oUGGj.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-Dn64OdQ7.js → KnowledgeGraph-CcE2EVYX.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-PmElVRrT.js → Logs-DyfN4R5w.js} +2 -2
- package/src/assets/web-panel/assets/{MarkdownRenderer-BFiVKf5t.js → MarkdownRenderer-Bj62Aq0M.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-OW4jTXwx.js → Marketplace-CuuuAXUh.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BEq2Ib4x.js → McpTools-948Fithv.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-Can_P2oK.js → Memory-D4PINvyy.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-DJ8R-dn3.js → MobileBridge-ECKMaLzX.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-B7kV9GOt.js → MobileProjects-CB5MAcvD.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-BfxamolS.js → Mtc-BRzIM3HJ.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-DHtuv7av.js → MtcAudit-CGeAXJGn.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-DLkLpvxc.js → Multisig-C_qJ-8K-.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-u4XtJTIt.js → NLProgramming-DAEyCn7T.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-BwuuPJLS.js → Notes-DmD3MEec.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-HEeu-E9v.js → NotificationSettings-Cv4Q3VC9.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-BNlpaFjH.js +1 -0
- package/src/assets/web-panel/assets/{Organization-Yh-czs3b.js → Organization-DqAFdz6p.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-DmE8mYVM.js → Overflow-8Ye9cIcE.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CWVck8WN.js → P2P-755SfHoJ.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-DgFqekod.js → PdhVaultBrowser-CgZLiucX.js} +4 -4
- package/src/assets/web-panel/assets/{Permissions-BtJBVOHV.js → Permissions-C-vFF_rL.js} +3 -3
- package/src/assets/web-panel/assets/{PersonalDataHub-6VBObXzd.js → PersonalDataHub-Diz1oXM3.js} +5 -5
- package/src/assets/web-panel/assets/{Pipeline-D222FmqY.js → Pipeline-D4kIzsZG.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-Bi9FMikp.js → Privacy-QKLkSAUH.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-Bo52H47H.js → ProjectInit-I0S9o_RT.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-BPkesfOc.js → ProjectSettings-DdgV3-Ho.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-GynohSFX.js → Projects-BJHHegtj.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-DVdMg04n.js → Providers-uVa1zfbS.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-DqJCb595.js → QrScannerModal-YLVpOChR.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-J7loQbXi.js → QuickAsk-535AYH61.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-BI5aURVc.js → Recommend-C_P6eNSw.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-BN2sqGvz.js → RemoteSession-EXH1SbNj.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-BGOND-Fi.js → Reputation-Cxc7d3eU.js} +1 -1
- package/src/assets/web-panel/assets/{Row-77dfwaUk.js → Row-EDqJy-wS.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-FtBAxS3g.js → RssFeed-C03Xeg9_.js} +2 -2
- package/src/assets/web-panel/assets/{Search-BaYVLFb7.js → Search-DsIga9DK.js} +1 -1
- package/src/assets/web-panel/assets/{Security-LE3Vv6ab.js → Security-DgArMFc-.js} +3 -3
- package/src/assets/web-panel/assets/{Services-C5pP-Whz.js → Services-MooDpHBP.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CLqKUVsF.js → Skeleton-B10P1Dr6.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-BPjN0SX5.js → Skills-DHLHEkLl.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-14jD70kg.js → Sla-D4RT7d4g.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-Dr9ij42W.js → SpeechSettings-D8u6F-LV.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BzLHP7B8.js → SyncSettings-4nvNzRq8.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-YqV9b0rV.js → Tasks-CmCb8zNO.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CxxAE4PK.js → Templates-CzESIa21.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-CRb3PcKJ.js → Tenant-Ch_N3p4d.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-CTzPpBaP.js → Terminal-BZccUf_X.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-DjFUj_hy.js → TimelineRenderer-FrKcNy_3.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-Bbb8tPvx.js → Tokens-4xvLpXfD.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-CSeWGM0W.js → Trigger-84UjyxXd.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-JgESMBo3.js → Trust-M6UtHnji.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-CiObLk0T.js → UkeySign-L_xEgtCg.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CFEZaQ2x.js → VideoEditing-BLJCX9ru.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-DR8ZGDNn.js → Wallet-DwL6uJCj.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-DxZukvu7.js → WebAuthn-Bmn9pdzz.js} +5 -5
- package/src/assets/web-panel/assets/{WorkflowEditor-CKgSZQwn.js → WorkflowEditor-DSsZ5xG1.js} +1 -1
- package/src/assets/web-panel/assets/{chat-CTxEQE66.js → chat--FGNUaa8.js} +1 -1
- package/src/assets/web-panel/assets/{colors-CAjKMUu3.js → colors-DeuwNdqX.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-BXuz49at.js → compact-item-I4XKxRFU.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-CFN_Hwr9.js → createContext-RoD2p5Ba.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-ctnml4IW.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-BwoSBSfP.js → hasIn-BsvyddUM.js} +1 -1
- package/src/assets/web-panel/assets/{index-CB3kVd9c.js → index-0tRU1Sv-.js} +1 -1
- package/src/assets/web-panel/assets/{index-o9DpkZKf.js → index-4xHc2WjT.js} +1 -1
- package/src/assets/web-panel/assets/{index-BmQITjMU.js → index-B8-eGLN9.js} +1 -1
- package/src/assets/web-panel/assets/{index-DY-gBSm8.js → index-BS_uqSTa.js} +1 -1
- package/src/assets/web-panel/assets/{index-F2E5RCwz.js → index-BYEVBlCl.js} +1 -1
- package/src/assets/web-panel/assets/{index-CF9lWi1o.js → index-BcBM065G.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bu2P6u8m.js → index-BnrL4s-3.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dv7V2kg6.js → index-BrZPb0On.js} +1 -1
- package/src/assets/web-panel/assets/index-C7PN8mh1.js +1 -0
- package/src/assets/web-panel/assets/{index-DViK2bkv.js → index-CBazK4-7.js} +1 -1
- package/src/assets/web-panel/assets/{index-BmXpdcHI.js → index-CPS3zv1c.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bqv_Cray.js → index-CSrZiiAs.js} +1 -1
- package/src/assets/web-panel/assets/{index-B7kp-zRE.js → index-CVwZMt9Z.js} +1 -1
- package/src/assets/web-panel/assets/{index-B0QbLlWn.js → index-CdgKZYgm.js} +1 -1
- package/src/assets/web-panel/assets/{index-DjF5BOZx.js → index-CesTu01s.js} +1 -1
- package/src/assets/web-panel/assets/{index-CSmFby3Q.js → index-CiHlSuMl.js} +1 -1
- package/src/assets/web-panel/assets/{index-B2o_BBjg.js → index-CsLVac9n.js} +1 -1
- package/src/assets/web-panel/assets/{index-CehdwJ_Q.js → index-D1ONyBTW.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bj4hIiLW.js → index-D4IZsKbF.js} +1 -1
- package/src/assets/web-panel/assets/{index-_ZtCyUdz.js → index-D4P4vpmv.js} +1 -1
- package/src/assets/web-panel/assets/{index-B9yR7zqr.js → index-D6J8dz7X.js} +1 -1
- package/src/assets/web-panel/assets/{index-u9_DM3ZC.js → index-DChy2sHE.js} +1 -1
- package/src/assets/web-panel/assets/{index-C8er4W9u.js → index-DKUCl_Lk.js} +1 -1
- package/src/assets/web-panel/assets/{index-BK4ftQ4d.js → index-DRluW3_r.js} +1 -1
- package/src/assets/web-panel/assets/{index-B2tEnBPx.js → index-DWUmhNO-.js} +1 -1
- package/src/assets/web-panel/assets/{index-IY9bd5az.js → index-DXnpVGG3.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cp5y7lX_.js → index-DYOpAS6-.js} +1 -1
- package/src/assets/web-panel/assets/{index-T3MTE6jB.js → index-DiH-3cR2.js} +1 -1
- package/src/assets/web-panel/assets/{index-DxunxaTw.js → index-DlEfwgzr.js} +1 -1
- package/src/assets/web-panel/assets/index-KnbBJAO-.js +1 -0
- package/src/assets/web-panel/assets/{index-DTX9CJPx.js → index-R4St_zjR.js} +1 -1
- package/src/assets/web-panel/assets/{index-Tz5dheZa.js → index-ScgoDU9V.js} +1 -1
- package/src/assets/web-panel/assets/{index-DmkbAADP.js → index-UWdT_lty.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bw9s2d3c.js → index-VAlor744.js} +1 -1
- package/src/assets/web-panel/assets/{index-CN53dE_u.js → index-Wco_uvRo.js} +1 -1
- package/src/assets/web-panel/assets/{index-DpdDnZX_.js → index-ZgFED_Zd.js} +1 -1
- package/src/assets/web-panel/assets/{index-IahILygB.js → index-jaHeti4i.js} +3 -3
- package/src/assets/web-panel/assets/{index-Cgk0YEiq.js → index-rJDabtw4.js} +1 -1
- package/src/assets/web-panel/assets/{index-t2Ch_JKn.js → index-vRiGKIP0.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-BoiGJDoO.js → initDefaultProps-BHT0PacY.js} +1 -1
- package/src/assets/web-panel/assets/{motion-5eL4E0pA.js → motion-CBYsMtsC.js} +1 -1
- package/src/assets/web-panel/assets/{move-DjggDi_1.js → move-DnHfFV4K.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-Ce8Vo2T3.js → mtc-parser-DfGkRYrx.js} +1 -1
- package/src/assets/web-panel/assets/{omit-D1yOBaO2.js → omit-SjLcPQA9.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-8NLceQe8.js → pickAttrs-CCZHF4ep.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CsIdBRmQ.js → placementArrow-DjCGn2sJ.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-GM5NE8En.js → responsiveObserve-BCFCl2on.js} +1 -1
- package/src/assets/web-panel/assets/{slide-44yj3u49.js → slide-DsfmuIZu.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-B8tqtWcX.js → statusUtils-hPKuJUia.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-NhDPBbyB.js → styleChecker-DOXKH7Kf.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-C8Qz1GtN.js → useFlexGapSupport-B_G7yqio.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-ClUv4kih.js → useFs-BXOTOm2l.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-BwkOVEh6.js → usePersonalDataHub-CRvie3g7.js} +1 -1
- package/src/assets/web-panel/assets/{vnode--gMF33R0.js → vnode-D9_zMmww.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-DXg3TqOP.js → zoom-C4tW03qI.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/data/changelog.json +52 -0
- package/src/lib/artifact-store.js +51 -3
- package/src/lib/bounded-artifact-file-read.js +131 -0
- package/src/lib/evolution/evolution-artifact-ports.js +235 -129
- package/src/lib/evolution/evolution-eval-cohort-enrollment.js +713 -47
- package/src/lib/evolution/evolution-eval-gate.js +146 -0
- package/src/lib/evolution/evolution-eval-launch-admission.js +168 -90
- package/src/lib/evolution/evolution-eval-ledger-capture.js +50 -0
- package/src/lib/evolution/evolution-eval-readonly-audit.js +106 -0
- package/src/lib/evolution/evolution-ledger-file-backend.js +20 -0
- package/src/lib/evolution/evolution-ledger-ports.js +59 -27
- package/src/lib/evolution/evolution-ledger-v2-journal.js +55 -18
- package/src/lib/evolution/evolution-workbench-file-resources.js +19 -1
- package/src/lib/evolution/rrsi-cohort-registration.js +275 -0
- package/src/lib/evolution/rrsi-contracts.js +742 -0
- package/src/lib/evolution/rrsi-data.js +196 -0
- package/src/lib/evolution/rrsi-evaluation-adapter.js +275 -0
- package/src/lib/evolution/rrsi-evaluation-variants.js +267 -0
- package/src/lib/evolution/rrsi-group-statistics.js +553 -0
- package/src/lib/evolution/rrsi-history-ledger-adapter.js +3286 -0
- package/src/lib/evolution/rrsi-installation-route-contracts.js +275 -0
- package/src/lib/evolution/rrsi-installation-route-reader.js +282 -0
- package/src/lib/evolution/rrsi-native-batch-evidence.js +520 -0
- package/src/lib/evolution/rrsi-native-eval-row-collector.js +538 -0
- package/src/lib/evolution/rrsi-native-evaluation-batch.js +547 -0
- package/src/lib/evolution/rrsi-native-evaluation-plan.js +431 -0
- package/src/lib/evolution/rrsi-native-group-statistics-plan.js +121 -0
- package/src/lib/evolution/rrsi-native-group-statistics.js +482 -0
- package/src/lib/evolution/rrsi-native-quality-receipt-contracts.js +321 -0
- package/src/lib/evolution/rrsi-native-quality-receipt.js +256 -0
- package/src/lib/evolution/rrsi-native-statistics-protocol.js +330 -0
- package/src/lib/evolution/rrsi-observed-text-index.js +978 -0
- package/src/lib/evolution/rrsi-parent-binding.js +290 -0
- package/src/lib/evolution/rrsi-pm-execution-bridge.js +500 -0
- package/src/lib/evolution/rrsi-pm-training-mapping.js +134 -0
- package/src/lib/evolution/rrsi-preparation-contracts.js +213 -0
- package/src/lib/evolution/rrsi-registry-history-binding.js +193 -0
- package/src/lib/evolution/rrsi-registry-runtime-policy.js +648 -0
- package/src/lib/evolution/rrsi-registry-store-policy.js +1271 -0
- package/src/lib/evolution/rrsi-runtime-composition.js +79 -0
- package/src/lib/evolution/rrsi-selector.js +434 -0
- package/src/lib/evolution/rrsi-statistics-simulation.js +354 -0
- package/src/lib/evolution/rrsi-tenant-index-anchor-contracts.js +223 -0
- package/src/lib/evolution/rrsi-tenant-index-anchor-history.js +157 -0
- package/src/lib/evolution/skill-candidate-registry.js +216 -29
- package/src/lib/evolution/skill-registry-maintenance.js +80 -0
- package/src/lib/evolution/skill-registry-writer-control.js +138 -0
- package/src/lib/evolution/skill-release-registry.js +414 -169
- package/src/lib/formal-quality-eval-runtime.js +2 -14
- package/src/lib/goal-store.js +225 -16
- package/src/lib/process-execution-broker/windows-native-evaluator-capabilities.js +291 -30
- package/src/lib/record-replay/skill-recorder.js +38 -3
- package/src/lib/remote-read-loop-guard.js +227 -24
- package/src/lib/scheduler-kernel/authority-resolver.js +12 -163
- package/src/lib/scheduler-kernel/contract.js +27 -414
- package/src/lib/scheduler-kernel/runtime.js +21 -823
- package/src/lib/scheduler-kernel/service.js +11 -328
- package/src/lib/scheduler-kernel/source-locator-path.js +7 -142
- package/src/lib/scheduler-kernel/store.js +67 -5931
- package/src/lib/secure-fs.js +16 -1314
- package/src/lib/task-progress-tracker.js +6 -1
- package/src/lib/with-file-lock.js +122 -20
- package/src/runtime/agent-core.js +71 -23
- package/src/assets/web-panel/assets/ChatBubbleRenderer-fcc_Tvqu.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-BtvN-Qwh.js +0 -1
- package/src/assets/web-panel/assets/devWarning-CfB8DxT2.js +0 -1
- package/src/assets/web-panel/assets/index-CCsRfd0k.js +0 -1
- package/src/assets/web-panel/assets/index-CsmiZIQ4.js +0 -1
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
EVOLUTION_LEDGER_QUERY_SCHEMA,
|
|
23
23
|
EvolutionLedger,
|
|
24
24
|
} from "./evolution-ledger.js";
|
|
25
|
+
import { isEvolutionLedgerV2Journal } from "./evolution-ledger-v2-journal.js";
|
|
25
26
|
import {
|
|
26
27
|
SKILL_MUTATION_NONCE_ACK_SCHEMA,
|
|
27
28
|
SKILL_MUTATION_OPERATIONS,
|
|
@@ -697,6 +698,37 @@ function requireStableInstance(value, prototype, label) {
|
|
|
697
698
|
throw new TypeError(`${label} instance is required`);
|
|
698
699
|
}
|
|
699
700
|
|
|
701
|
+
// A migrated journal must execute its own recovery and retained-payload checks.
|
|
702
|
+
// Never unwrap it to the source Ledger or accept matching ordinary callbacks.
|
|
703
|
+
function captureLedgerJournal(ledger) {
|
|
704
|
+
rejectProxy(ledger, "EvolutionLedger journal");
|
|
705
|
+
const v2 = isEvolutionLedgerV2Journal(ledger);
|
|
706
|
+
if (!v2)
|
|
707
|
+
requireStableInstance(ledger, EvolutionLedger.prototype, "EvolutionLedger");
|
|
708
|
+
const methods = {};
|
|
709
|
+
for (const name of [
|
|
710
|
+
"appendDomainEvent",
|
|
711
|
+
"query",
|
|
712
|
+
"read",
|
|
713
|
+
"verify",
|
|
714
|
+
"verifyReceipt",
|
|
715
|
+
]) {
|
|
716
|
+
const owner = v2 ? ledger : EvolutionLedger.prototype;
|
|
717
|
+
const field = Object.getOwnPropertyDescriptor(owner, name);
|
|
718
|
+
const method = field?.value;
|
|
719
|
+
if (typeof method !== "function" || utilTypes.isProxy(method))
|
|
720
|
+
throw portsError(
|
|
721
|
+
EVOLUTION_LEDGER_PORTS_INVALID_CODE,
|
|
722
|
+
"genuine Ledger journal method is missing",
|
|
723
|
+
);
|
|
724
|
+
// Do not invoke caller-editable function properties such as method.bind.
|
|
725
|
+
methods[name] = Object.freeze((...args) =>
|
|
726
|
+
Reflect.apply(method, ledger, args),
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
return Object.freeze({ ledger, methods: Object.freeze(methods) });
|
|
730
|
+
}
|
|
731
|
+
|
|
700
732
|
function captureDurabilityAuthority(value) {
|
|
701
733
|
assertAllExactRecord(
|
|
702
734
|
value,
|
|
@@ -1174,7 +1206,7 @@ class EvolutionLedgerDomainPorts {
|
|
|
1174
1206
|
artifactPorts,
|
|
1175
1207
|
artifactTenantId,
|
|
1176
1208
|
audience,
|
|
1177
|
-
|
|
1209
|
+
ledgerMethods,
|
|
1178
1210
|
purpose,
|
|
1179
1211
|
}) {
|
|
1180
1212
|
this.#artifactTenantId = identifier(artifactTenantId, "artifactTenantId");
|
|
@@ -1184,35 +1216,34 @@ class EvolutionLedgerDomainPorts {
|
|
|
1184
1216
|
this.#durabilityAuthority = artifactDurabilityAuthority;
|
|
1185
1217
|
this.#durabilityAuthorityId = artifactDurabilityAuthority.id;
|
|
1186
1218
|
this.#durabilityRetain = artifactDurabilityAuthority.retain;
|
|
1187
|
-
this.#appendDomainEvent =
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
this.#
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
this.#
|
|
1194
|
-
|
|
1219
|
+
this.#appendDomainEvent = ledgerMethods.appendDomainEvent;
|
|
1220
|
+
this.#ledgerQuery = ledgerMethods.query;
|
|
1221
|
+
this.#ledgerRead = ledgerMethods.read;
|
|
1222
|
+
this.#ledgerVerify = ledgerMethods.verify;
|
|
1223
|
+
this.#ledgerVerifyReceipt = ledgerMethods.verifyReceipt;
|
|
1224
|
+
const putCanonical = EvolutionArtifactPorts.prototype.putCanonical;
|
|
1225
|
+
this.#artifactPut = Object.freeze((...args) =>
|
|
1226
|
+
Reflect.apply(putCanonical, artifactPorts, args),
|
|
1195
1227
|
);
|
|
1196
|
-
this.#
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
EvolutionLedger.prototype.verifyReceipt.bind(ledger),
|
|
1201
|
-
);
|
|
1202
|
-
this.#artifactPut = Object.freeze(
|
|
1203
|
-
EvolutionArtifactPorts.prototype.putCanonical.bind(artifactPorts),
|
|
1228
|
+
this.#artifactResolve = Reflect.apply(
|
|
1229
|
+
EvolutionArtifactPorts.prototype.createEvolutionLedgerArtifactResolver,
|
|
1230
|
+
artifactPorts,
|
|
1231
|
+
[Object.freeze({ purpose: this.#purpose })],
|
|
1204
1232
|
);
|
|
1205
|
-
this.#artifactResolve =
|
|
1206
|
-
EvolutionArtifactPorts.prototype.createEvolutionLedgerArtifactResolver.call(
|
|
1207
|
-
artifactPorts,
|
|
1208
|
-
Object.freeze({ purpose: this.#purpose }),
|
|
1209
|
-
);
|
|
1210
1233
|
this.#artifactResolveBatch = captureEvolutionLedgerBatchResolver(
|
|
1211
1234
|
this.#artifactResolve,
|
|
1212
1235
|
);
|
|
1213
1236
|
Object.freeze(this);
|
|
1214
1237
|
}
|
|
1215
1238
|
|
|
1239
|
+
readArtifactScope() {
|
|
1240
|
+
return deepFreeze({
|
|
1241
|
+
artifactTenantId: this.#artifactTenantId,
|
|
1242
|
+
audience: this.#audience,
|
|
1243
|
+
purpose: this.#purpose,
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1216
1247
|
#assertAudience(value, label, { nullable = false } = {}) {
|
|
1217
1248
|
if (value === null && nullable) return null;
|
|
1218
1249
|
const normalized = identifier(value, label);
|
|
@@ -4078,16 +4109,15 @@ export function createEvolutionLedgerPorts(options = {}) {
|
|
|
4078
4109
|
FACTORY_REQUIRED_KEYS,
|
|
4079
4110
|
"evolution ledger ports options",
|
|
4080
4111
|
);
|
|
4081
|
-
const
|
|
4112
|
+
const capturedLedger = captureLedgerJournal(
|
|
4082
4113
|
ownData(
|
|
4083
4114
|
options,
|
|
4084
4115
|
"ledger",
|
|
4085
4116
|
"evolution ledger ports options",
|
|
4086
4117
|
EVOLUTION_LEDGER_PORTS_INVALID_CODE,
|
|
4087
4118
|
),
|
|
4088
|
-
EvolutionLedger.prototype,
|
|
4089
|
-
"EvolutionLedger",
|
|
4090
4119
|
);
|
|
4120
|
+
const { ledger, methods: ledgerMethods } = capturedLedger;
|
|
4091
4121
|
const artifactPorts = requireStableInstance(
|
|
4092
4122
|
ownData(
|
|
4093
4123
|
options,
|
|
@@ -4123,7 +4153,7 @@ export function createEvolutionLedgerPorts(options = {}) {
|
|
|
4123
4153
|
EVOLUTION_LEDGER_PORTS_INVALID_CODE,
|
|
4124
4154
|
)
|
|
4125
4155
|
: undefined,
|
|
4126
|
-
|
|
4156
|
+
ledgerMethods,
|
|
4127
4157
|
purpose: Object.hasOwn(options, "purpose")
|
|
4128
4158
|
? ownData(
|
|
4129
4159
|
options,
|
|
@@ -4149,10 +4179,11 @@ export function createEvolutionLedgerPorts(options = {}) {
|
|
|
4149
4179
|
prepare,
|
|
4150
4180
|
query,
|
|
4151
4181
|
});
|
|
4152
|
-
const readCurrentHead =
|
|
4182
|
+
const readCurrentHead = ledgerMethods.verify;
|
|
4153
4183
|
RELEASE_OPERATION_READERS.set(
|
|
4154
4184
|
transactionLedger,
|
|
4155
4185
|
Object.freeze({
|
|
4186
|
+
scope: adapter.readArtifactScope(),
|
|
4156
4187
|
currentContext: Object.freeze(() => {
|
|
4157
4188
|
const head = readCurrentHead();
|
|
4158
4189
|
return deepFreeze({
|
|
@@ -4172,6 +4203,7 @@ export function createEvolutionLedgerPorts(options = {}) {
|
|
|
4172
4203
|
captureWikiRevisionReader(wikiAdapter).matchesLedger(ledger),
|
|
4173
4204
|
),
|
|
4174
4205
|
matchesLedger: Object.freeze((value) => value === ledger),
|
|
4206
|
+
matchesArtifactPorts: Object.freeze((value) => value === artifactPorts),
|
|
4175
4207
|
resolveOperation: Object.freeze((input) =>
|
|
4176
4208
|
adapter.resolveReleaseOperation(input),
|
|
4177
4209
|
),
|
|
@@ -4,6 +4,7 @@ import { types as utilTypes } from "node:util";
|
|
|
4
4
|
import { withFileLock } from "../with-file-lock.js";
|
|
5
5
|
import { EvolutionArtifactPorts } from "./evolution-artifact-ports.js";
|
|
6
6
|
import {
|
|
7
|
+
EvolutionLedger,
|
|
7
8
|
captureEvolutionLedgerMigrationSource,
|
|
8
9
|
EVOLUTION_LEDGER_MAX_EVENTS,
|
|
9
10
|
EVOLUTION_LEDGER_V2_MIGRATION_INTENT,
|
|
@@ -105,6 +106,38 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
105
106
|
});
|
|
106
107
|
const source = captureEvolutionLedgerMigrationSource(config.sourceLedger);
|
|
107
108
|
const ledger = source.ledger;
|
|
109
|
+
// Genuine subclasses also own migration capabilities. Capture original
|
|
110
|
+
// private-field operations and physical paths rather than virtual overrides.
|
|
111
|
+
const original = Object.fromEntries(
|
|
112
|
+
[
|
|
113
|
+
"read",
|
|
114
|
+
"query",
|
|
115
|
+
"queryMany",
|
|
116
|
+
"verifyReceipt",
|
|
117
|
+
"verify",
|
|
118
|
+
"checkpointState",
|
|
119
|
+
"exportAuditBundle",
|
|
120
|
+
].map((name) => {
|
|
121
|
+
const method = Object.getOwnPropertyDescriptor(
|
|
122
|
+
EvolutionLedger.prototype,
|
|
123
|
+
name,
|
|
124
|
+
).value;
|
|
125
|
+
return [name, (...args) => Reflect.apply(method, ledger, args)];
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
const rootDir = Reflect.apply(
|
|
129
|
+
Object.getOwnPropertyDescriptor(EvolutionLedger.prototype, "rootDir").get,
|
|
130
|
+
ledger,
|
|
131
|
+
[],
|
|
132
|
+
);
|
|
133
|
+
const authorityRootDir = Reflect.apply(
|
|
134
|
+
Object.getOwnPropertyDescriptor(
|
|
135
|
+
EvolutionLedger.prototype,
|
|
136
|
+
"authorityRootDir",
|
|
137
|
+
).get,
|
|
138
|
+
ledger,
|
|
139
|
+
[],
|
|
140
|
+
);
|
|
108
141
|
const backend = captureEvolutionLedgerV2ManifestBackend(config.backend);
|
|
109
142
|
const retention = config.minimumRetainedUntil;
|
|
110
143
|
if (
|
|
@@ -120,7 +153,8 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
120
153
|
)
|
|
121
154
|
fail("constructed EvolutionArtifactPorts are required");
|
|
122
155
|
// Calling the original private-field method also rejects prototype forgeries.
|
|
123
|
-
const
|
|
156
|
+
const putCanonical = EvolutionArtifactPorts.prototype.putCanonical;
|
|
157
|
+
const put = (...args) => Reflect.apply(putCanonical, artifactPorts, args);
|
|
124
158
|
const lock = config.lock ?? withFileLock;
|
|
125
159
|
if (typeof lock !== "function" || utilTypes.isProxy(lock))
|
|
126
160
|
fail("synchronous journal lock is required");
|
|
@@ -134,7 +168,7 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
134
168
|
const locked = (operation) => {
|
|
135
169
|
let calls = 0;
|
|
136
170
|
const result = lock(
|
|
137
|
-
path.join(
|
|
171
|
+
path.join(authorityRootDir, "manifest-cutover-v2"),
|
|
138
172
|
(context) => {
|
|
139
173
|
if (++calls !== 1)
|
|
140
174
|
fail("journal lock callback must execute exactly once");
|
|
@@ -149,7 +183,7 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
149
183
|
return result;
|
|
150
184
|
};
|
|
151
185
|
const sourceEvents = () =>
|
|
152
|
-
|
|
186
|
+
original.read({ limit: EVOLUTION_LEDGER_MAX_EVENTS });
|
|
153
187
|
|
|
154
188
|
function binding(authority) {
|
|
155
189
|
if (
|
|
@@ -252,7 +286,7 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
252
286
|
return receipt;
|
|
253
287
|
}
|
|
254
288
|
function recover() {
|
|
255
|
-
const authority =
|
|
289
|
+
const authority = original.verify();
|
|
256
290
|
const expectedBinding = binding(authority);
|
|
257
291
|
let events = sourceEvents();
|
|
258
292
|
let intents = events.filter(
|
|
@@ -416,8 +450,8 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
416
450
|
}
|
|
417
451
|
const journal = Object.freeze({
|
|
418
452
|
descriptor,
|
|
419
|
-
rootDir
|
|
420
|
-
authorityRootDir
|
|
453
|
+
rootDir,
|
|
454
|
+
authorityRootDir,
|
|
421
455
|
append: (input, options = {}) =>
|
|
422
456
|
append("append", input, options, false, false),
|
|
423
457
|
appendBatch: (inputs, options = {}) =>
|
|
@@ -433,14 +467,14 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
433
467
|
read: (options = {}) =>
|
|
434
468
|
readOperation(({ events }) => {
|
|
435
469
|
// Preserve exact v1 read validation and return events recovered from v2.
|
|
436
|
-
const selected =
|
|
470
|
+
const selected = original.read(options);
|
|
437
471
|
return Object.freeze(
|
|
438
472
|
selected.map((event) => events[event.sequence - 1]),
|
|
439
473
|
);
|
|
440
474
|
}),
|
|
441
475
|
query: (selector, options = {}) =>
|
|
442
476
|
readOperation(({ events }) => {
|
|
443
|
-
const result =
|
|
477
|
+
const result = original.query(selector, options);
|
|
444
478
|
return result
|
|
445
479
|
? Object.freeze({
|
|
446
480
|
...result,
|
|
@@ -451,7 +485,7 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
451
485
|
queryMany: (selectors, options = {}) =>
|
|
452
486
|
readOperation(({ events }) =>
|
|
453
487
|
Object.freeze(
|
|
454
|
-
|
|
488
|
+
original.queryMany(selectors, options).map((result) =>
|
|
455
489
|
result
|
|
456
490
|
? Object.freeze({
|
|
457
491
|
...result,
|
|
@@ -463,17 +497,20 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
463
497
|
),
|
|
464
498
|
findByEventId: (eventId) =>
|
|
465
499
|
readOperation(({ events }) => {
|
|
466
|
-
const event =
|
|
500
|
+
const event =
|
|
501
|
+
original.query({ eventId }, { issueReceipt: false })?.event ?? null;
|
|
467
502
|
return event ? events[event.sequence - 1] : null;
|
|
468
503
|
}),
|
|
469
504
|
recoverReceipt: (selector) =>
|
|
470
|
-
readOperation(
|
|
505
|
+
readOperation(
|
|
506
|
+
() => original.query(selector, { issueReceipt: true })?.receipt ?? null,
|
|
507
|
+
),
|
|
471
508
|
verifyReceipt: (receipt, options = {}) =>
|
|
472
|
-
readOperation(() =>
|
|
473
|
-
verify: () => readOperation(() =>
|
|
474
|
-
getAuthority: () => readOperation(() =>
|
|
475
|
-
checkpointState: () => readOperation(() =>
|
|
476
|
-
exportAuditBundle: () => readOperation(() =>
|
|
509
|
+
readOperation(() => original.verifyReceipt(receipt, options)),
|
|
510
|
+
verify: () => readOperation(() => original.verify()),
|
|
511
|
+
getAuthority: () => readOperation(() => original.verify()),
|
|
512
|
+
checkpointState: () => readOperation(() => original.checkpointState()),
|
|
513
|
+
exportAuditBundle: () => readOperation(() => original.exportAuditBundle()),
|
|
477
514
|
recover: () =>
|
|
478
515
|
readOperation(({ checkpoint, intent, completed }) =>
|
|
479
516
|
Object.freeze({ checkpoint, intent, completed }),
|
|
@@ -506,8 +543,8 @@ export function createEvolutionLedgerV2JournalFromFactory(
|
|
|
506
543
|
utilTypes.isProxy(config.createBackend)
|
|
507
544
|
)
|
|
508
545
|
fail("explicit manifest backend construction authority is required");
|
|
509
|
-
const
|
|
510
|
-
|
|
546
|
+
const ledger = captureEvolutionLedgerMigrationSource(sourceLedger).ledger;
|
|
547
|
+
const authority = Reflect.apply(EvolutionLedger.prototype.verify, ledger, []);
|
|
511
548
|
const scope = Object.freeze({
|
|
512
549
|
...record(config.descriptor, ["tenantId", "artifactTenantId", "audience"]),
|
|
513
550
|
});
|
|
@@ -13,12 +13,21 @@ const ID = /^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,255}$/u;
|
|
|
13
13
|
const DIGEST = /^sha256:[a-f0-9]{64}$/u;
|
|
14
14
|
const STORAGE_ID = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/u;
|
|
15
15
|
const FILE_RESOURCES = new WeakSet();
|
|
16
|
+
const FILE_BACKEND_BINDINGS = new WeakMap();
|
|
16
17
|
|
|
17
18
|
export function captureWorkbenchFileResources(value) {
|
|
18
19
|
if (!FILE_RESOURCES.has(value))
|
|
19
20
|
throw new TypeError("genuine Workbench file resources are required");
|
|
20
21
|
return value;
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
/** Root composition retains the exact backends; public resource bytes stay compatible. */
|
|
25
|
+
export function captureWorkbenchFileBackendBinding(value) {
|
|
26
|
+
const binding = FILE_BACKEND_BINDINGS.get(value);
|
|
27
|
+
if (!binding)
|
|
28
|
+
throw new TypeError("genuine Workbench file backend bindings are required");
|
|
29
|
+
return binding;
|
|
30
|
+
}
|
|
22
31
|
const DESCRIPTOR_KEYS = [
|
|
23
32
|
"tenantId",
|
|
24
33
|
"artifactTenantId",
|
|
@@ -327,7 +336,7 @@ export function openEvolutionWorkbenchFileResources(input) {
|
|
|
327
336
|
artifactPorts.createEvolutionLedgerArtifactResolver({
|
|
328
337
|
purpose: descriptor.purpose,
|
|
329
338
|
});
|
|
330
|
-
const
|
|
339
|
+
const backend = createEvolutionLedgerFileBackend({
|
|
331
340
|
rootDir: storage.ledgerRootDir,
|
|
332
341
|
authorityRootDir: storage.ledgerAuthorityRootDir,
|
|
333
342
|
witnessFilePath: storage.witnessFilePath,
|
|
@@ -339,6 +348,7 @@ export function openEvolutionWorkbenchFileResources(input) {
|
|
|
339
348
|
fsImpl: io,
|
|
340
349
|
clock: now,
|
|
341
350
|
});
|
|
351
|
+
const { ledger } = backend;
|
|
342
352
|
const ports = createEvolutionLedgerPorts({
|
|
343
353
|
artifactPorts,
|
|
344
354
|
ledger,
|
|
@@ -356,6 +366,7 @@ export function openEvolutionWorkbenchFileResources(input) {
|
|
|
356
366
|
fsImpl: io,
|
|
357
367
|
});
|
|
358
368
|
return {
|
|
369
|
+
backend,
|
|
359
370
|
artifactPorts,
|
|
360
371
|
ledger,
|
|
361
372
|
ledgerArtifactResolver,
|
|
@@ -399,5 +410,12 @@ export function openEvolutionWorkbenchFileResources(input) {
|
|
|
399
410
|
}),
|
|
400
411
|
});
|
|
401
412
|
FILE_RESOURCES.add(result);
|
|
413
|
+
FILE_BACKEND_BINDINGS.set(
|
|
414
|
+
result,
|
|
415
|
+
Object.freeze({
|
|
416
|
+
backend: primary.backend,
|
|
417
|
+
verifierBackend: verifier.backend,
|
|
418
|
+
}),
|
|
419
|
+
);
|
|
402
420
|
return result;
|
|
403
421
|
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/** Derive enrollment declarations only from a genuine History resolver at composition. */
|
|
2
|
+
import {
|
|
3
|
+
snapshotRrsiData,
|
|
4
|
+
rrsiExact,
|
|
5
|
+
rrsiHash,
|
|
6
|
+
rrsiEnvelope,
|
|
7
|
+
rrsiFail,
|
|
8
|
+
rrsiInteger,
|
|
9
|
+
rrsiCanonical,
|
|
10
|
+
freezeRrsiData,
|
|
11
|
+
} from "./rrsi-data.js";
|
|
12
|
+
import { normalizeRrsiNativeEvaluationBatch } from "./rrsi-native-evaluation-batch.js";
|
|
13
|
+
|
|
14
|
+
export const RRSI_COHORT_REGISTRATION_SCHEMA =
|
|
15
|
+
"chainlesschain.rrsi-cohort-registration/v1";
|
|
16
|
+
export const RRSI_COHORT_PLAN_SCHEMA = "chainlesschain.rrsi-cohort-plan/v1";
|
|
17
|
+
export const RRSI_COHORT_PLAN_V2_SCHEMA = "chainlesschain.rrsi-cohort-plan/v2";
|
|
18
|
+
export const RRSI_COHORT_MANIFEST_SCHEMA =
|
|
19
|
+
"chainlesschain.rrsi-cohort-manifest/v1";
|
|
20
|
+
export const RRSI_COHORT_MANIFEST_V2_SCHEMA =
|
|
21
|
+
"chainlesschain.rrsi-cohort-manifest/v2";
|
|
22
|
+
export const RRSI_EVAL_CAMPAIGN_PLAN_SCHEMA =
|
|
23
|
+
"chainlesschain.rrsi-eval-campaign-plan/v1";
|
|
24
|
+
|
|
25
|
+
/** Structural provenance only. Consumers obtain the registration from genuine History. */
|
|
26
|
+
export function buildRrsiNativeStatisticsRegistrationBindings(
|
|
27
|
+
registrationInput,
|
|
28
|
+
reservationRecordInput,
|
|
29
|
+
) {
|
|
30
|
+
const registration = snapshotRrsiData(registrationInput);
|
|
31
|
+
const reservationRecord = snapshotRrsiData(reservationRecordInput);
|
|
32
|
+
if (
|
|
33
|
+
registration.schema !==
|
|
34
|
+
"chainlesschain.rrsi-native-statistics-registration-resolution/v1" ||
|
|
35
|
+
registration.historyAuthenticated !== true ||
|
|
36
|
+
registration.preObservationRegistrationVerified !== true ||
|
|
37
|
+
registration.reservationKind !== "reserve-native-batch-v2" ||
|
|
38
|
+
registration.statisticsPlanDigest !==
|
|
39
|
+
registration.statisticsPlan?.statisticsPlanDigest ||
|
|
40
|
+
rrsiCanonical(registration.reservationRecord) !==
|
|
41
|
+
rrsiCanonical(reservationRecord) ||
|
|
42
|
+
!(
|
|
43
|
+
registration.binding.rootRegistrationRecord.sequence <
|
|
44
|
+
registration.scopeRegistrationRecord.sequence &&
|
|
45
|
+
registration.scopeRegistrationRecord.sequence <
|
|
46
|
+
registration.planRegistrationRecord.sequence &&
|
|
47
|
+
registration.planRegistrationRecord.sequence < reservationRecord.sequence
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
rrsiFail("native statistics registration provenance or sequence differs");
|
|
51
|
+
return freezeRrsiData({
|
|
52
|
+
schema: "chainlesschain.rrsi-native-statistics-registration-bindings/v1",
|
|
53
|
+
binding: registration.binding,
|
|
54
|
+
protocolDigest: registration.protocolDigest,
|
|
55
|
+
statisticsPlanDigest: registration.statisticsPlanDigest,
|
|
56
|
+
scopeRegistrationRecord: registration.scopeRegistrationRecord,
|
|
57
|
+
planRegistrationRecord: registration.planRegistrationRecord,
|
|
58
|
+
reservationRecord,
|
|
59
|
+
reservationKind: registration.reservationKind,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function buildRrsiEvalCampaignPlan(rootInput) {
|
|
64
|
+
const root = snapshotRrsiData(rootInput);
|
|
65
|
+
return rrsiEnvelope(RRSI_EVAL_CAMPAIGN_PLAN_SCHEMA, "campaignRootDigest", {
|
|
66
|
+
historyScopeId: root.descriptor.scopeId,
|
|
67
|
+
historyDescriptorDigest: rrsiHash(
|
|
68
|
+
"chainlesschain.rrsi-history-descriptor/v1",
|
|
69
|
+
root.descriptor,
|
|
70
|
+
),
|
|
71
|
+
ledgerIdentity: root.identity,
|
|
72
|
+
rootCampaignDigest: root.campaign.campaignDigest,
|
|
73
|
+
rootRegistrationRecord: root.registrationRecord,
|
|
74
|
+
policyDigest: root.campaign.policy.policyDigest,
|
|
75
|
+
executionDigest: rrsiHash(
|
|
76
|
+
"chainlesschain.rrsi-execution-bindings/v1",
|
|
77
|
+
root.campaign.execution,
|
|
78
|
+
),
|
|
79
|
+
budgetDigest: rrsiHash(
|
|
80
|
+
"chainlesschain.rrsi-root-budget/v1",
|
|
81
|
+
root.campaign.budget,
|
|
82
|
+
),
|
|
83
|
+
experimentDigest: rrsiHash(
|
|
84
|
+
"chainlesschain.rrsi-root-experiment/v1",
|
|
85
|
+
root.campaign.experiment,
|
|
86
|
+
),
|
|
87
|
+
maxSelectionQueries: root.campaign.policy.limits.maxSelectionQueries,
|
|
88
|
+
querySlotPolicy: "global-history-ordinal-and-stage/v1",
|
|
89
|
+
productionBudgetAuthorityVerified: false,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function rrsiEvalQueryStreamId(root, resolution) {
|
|
94
|
+
rrsiInteger(
|
|
95
|
+
resolution.queryOrdinal,
|
|
96
|
+
"global History query ordinal",
|
|
97
|
+
1,
|
|
98
|
+
root.maxSelectionQueries,
|
|
99
|
+
);
|
|
100
|
+
return `rrsi-query.${rrsiHash("chainlesschain.rrsi-eval-query-stream/v1", { campaignRootDigest: root.campaignRootDigest, queryOrdinal: resolution.queryOrdinal, stage: resolution.batch.stage }).slice(7)}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Immutable plan/manifest bytes exclude changing budget statuses and current head digests. */
|
|
104
|
+
export function buildRrsiCohortRegistration(
|
|
105
|
+
rootInput,
|
|
106
|
+
resolutionInput,
|
|
107
|
+
cohortId,
|
|
108
|
+
) {
|
|
109
|
+
return prepareRrsiCohortRegistration(rootInput, resolutionInput).build(
|
|
110
|
+
cohortId,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Structural preparation only; trusted audit callers supply genuine History data. */
|
|
115
|
+
export function prepareRrsiCohortRegistration(rootInput, resolutionInput) {
|
|
116
|
+
const root = snapshotRrsiData(rootInput),
|
|
117
|
+
resolution = snapshotRrsiData(resolutionInput);
|
|
118
|
+
const batch = normalizeRrsiNativeEvaluationBatch(
|
|
119
|
+
resolution.batch,
|
|
120
|
+
resolution.campaign,
|
|
121
|
+
);
|
|
122
|
+
if (rrsiCanonical(root.ledgerIdentity) !== rrsiCanonical(resolution.identity))
|
|
123
|
+
rrsiFail("RRSI cohort belongs to another History journal");
|
|
124
|
+
const childrenByCohort = new Map();
|
|
125
|
+
for (const child of batch.children) {
|
|
126
|
+
if (!childrenByCohort.has(child.cohortId))
|
|
127
|
+
childrenByCohort.set(child.cohortId, []);
|
|
128
|
+
childrenByCohort.get(child.cohortId).push(child);
|
|
129
|
+
}
|
|
130
|
+
const groups = new Map();
|
|
131
|
+
for (const group of resolution.children)
|
|
132
|
+
if (!groups.has(group.bindings.childId))
|
|
133
|
+
groups.set(group.bindings.childId, group);
|
|
134
|
+
const statisticsRegistration = resolution.statisticsRegistration
|
|
135
|
+
? buildRrsiNativeStatisticsRegistrationBindings(
|
|
136
|
+
resolution.statisticsRegistration,
|
|
137
|
+
resolution.reservationRecord,
|
|
138
|
+
)
|
|
139
|
+
: null;
|
|
140
|
+
return Object.freeze({
|
|
141
|
+
build(cohortId) {
|
|
142
|
+
return deriveRrsiCohortRegistration(
|
|
143
|
+
root,
|
|
144
|
+
resolution,
|
|
145
|
+
batch,
|
|
146
|
+
childrenByCohort.get(cohortId) ?? [],
|
|
147
|
+
groups,
|
|
148
|
+
cohortId,
|
|
149
|
+
statisticsRegistration,
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function deriveRrsiCohortRegistration(
|
|
156
|
+
root,
|
|
157
|
+
resolution,
|
|
158
|
+
batch,
|
|
159
|
+
sourceChildren,
|
|
160
|
+
groups,
|
|
161
|
+
cohortId,
|
|
162
|
+
statisticsRegistration,
|
|
163
|
+
) {
|
|
164
|
+
const children = [...sourceChildren].sort((a, b) =>
|
|
165
|
+
a.slotId < b.slotId ? -1 : a.slotId > b.slotId ? 1 : 0,
|
|
166
|
+
);
|
|
167
|
+
if (!children.length)
|
|
168
|
+
rrsiFail("RRSI cohort is outside the committed native batch");
|
|
169
|
+
const first = children[0];
|
|
170
|
+
const queryStreamId = rrsiEvalQueryStreamId(root, resolution);
|
|
171
|
+
const plan = rrsiEnvelope(
|
|
172
|
+
statisticsRegistration
|
|
173
|
+
? RRSI_COHORT_PLAN_V2_SCHEMA
|
|
174
|
+
: RRSI_COHORT_PLAN_SCHEMA,
|
|
175
|
+
"planDigest",
|
|
176
|
+
{
|
|
177
|
+
campaignRootDigest: root.campaignRootDigest,
|
|
178
|
+
campaignDigest: batch.campaignDigest,
|
|
179
|
+
batchDigest: batch.batchDigest,
|
|
180
|
+
nativeEvaluationPlanDigest: batch.nativeEvaluationPlanDigest,
|
|
181
|
+
evaluationMappingDigest: batch.evaluationMappingDigest,
|
|
182
|
+
nativePlanDigest: first.nativePlanDigest,
|
|
183
|
+
candidateDigest: batch.candidate.candidateDigest,
|
|
184
|
+
rrsiAggregateContentDigest: batch.candidate.contentDigest,
|
|
185
|
+
nativeCandidateContents: batch.nativeCandidateContents,
|
|
186
|
+
versions: batch.versions,
|
|
187
|
+
lifecycleDigests: batch.lifecycleDigests,
|
|
188
|
+
queryOrdinal: resolution.queryOrdinal,
|
|
189
|
+
queryStreamId,
|
|
190
|
+
stage: batch.stage,
|
|
191
|
+
role: first.role,
|
|
192
|
+
variant: first.variant,
|
|
193
|
+
pairId: first.pairId,
|
|
194
|
+
variantMappingDigest: first.variantMappingDigest,
|
|
195
|
+
recipeDigest: first.recipeDigest,
|
|
196
|
+
costAttribution: batch.costAttribution,
|
|
197
|
+
executionCountSemantics: batch.executionCountSemantics,
|
|
198
|
+
productionAdmissionVerified: false,
|
|
199
|
+
...(statisticsRegistration ? { statisticsRegistration } : {}),
|
|
200
|
+
},
|
|
201
|
+
);
|
|
202
|
+
const denominator = Object.fromEntries(
|
|
203
|
+
Object.keys(first.byArm).map((arm) => [
|
|
204
|
+
arm,
|
|
205
|
+
Object.fromEntries(
|
|
206
|
+
Object.keys(first.plannedObservationsPerArmByPartition).map(
|
|
207
|
+
(partition) => [
|
|
208
|
+
partition,
|
|
209
|
+
children.reduce(
|
|
210
|
+
(sum, child) =>
|
|
211
|
+
sum + child.plannedObservationsPerArmByPartition[partition],
|
|
212
|
+
0,
|
|
213
|
+
),
|
|
214
|
+
],
|
|
215
|
+
),
|
|
216
|
+
),
|
|
217
|
+
]),
|
|
218
|
+
);
|
|
219
|
+
const childBindings = children.map((child) => {
|
|
220
|
+
const group = groups.get(child.childId);
|
|
221
|
+
if (!group) rrsiFail("RRSI cohort has no reserved paired child");
|
|
222
|
+
return {
|
|
223
|
+
slotId: child.slotId,
|
|
224
|
+
childId: child.childId,
|
|
225
|
+
bindings: group.bindings,
|
|
226
|
+
expectedContext: child.expectedContext,
|
|
227
|
+
evaluationContextDigest: child.evaluationContextDigest,
|
|
228
|
+
reservationDigestsByArm: group.bindings.armReservationDigests,
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
const manifest = rrsiEnvelope(
|
|
232
|
+
statisticsRegistration
|
|
233
|
+
? RRSI_COHORT_MANIFEST_V2_SCHEMA
|
|
234
|
+
: RRSI_COHORT_MANIFEST_SCHEMA,
|
|
235
|
+
"manifestDigest",
|
|
236
|
+
{
|
|
237
|
+
cohortId,
|
|
238
|
+
planDigest: plan.planDigest,
|
|
239
|
+
batchDigest: batch.batchDigest,
|
|
240
|
+
campaignRootDigest: root.campaignRootDigest,
|
|
241
|
+
queryOrdinal: resolution.queryOrdinal,
|
|
242
|
+
queryStreamId,
|
|
243
|
+
reservationRecord: resolution.reservationRecord,
|
|
244
|
+
slotIds: children.map((child) => child.slotId),
|
|
245
|
+
childBindings,
|
|
246
|
+
allCohortIds: [
|
|
247
|
+
...new Set(batch.children.map((child) => child.cohortId)),
|
|
248
|
+
].sort(),
|
|
249
|
+
plannedObservationsPerArmByPartition: denominator,
|
|
250
|
+
denominatorSemantics: "complete-validation-and-test-paired-attempts/v1",
|
|
251
|
+
nativeExecutionDenominatorVerified: false,
|
|
252
|
+
...(statisticsRegistration ? { statisticsRegistration } : {}),
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
const slots = children.map((child) => ({
|
|
256
|
+
slotId: child.slotId,
|
|
257
|
+
evaluationPlanDigest: child.nativePlanDigest,
|
|
258
|
+
requestDigest: child.requestDigest,
|
|
259
|
+
policyDigest: child.expectedContext.policyDigest,
|
|
260
|
+
evaluationAuthorityRoot: child.expectedContext.evaluationAuthorityRoot,
|
|
261
|
+
}));
|
|
262
|
+
return { plan, manifest, slots };
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function normalizeRrsiCohortLookup(input) {
|
|
266
|
+
const lookup = snapshotRrsiData(input);
|
|
267
|
+
rrsiExact(
|
|
268
|
+
lookup,
|
|
269
|
+
["schema", "batchDigest", "cohortId"],
|
|
270
|
+
"RRSI cohort registration reference",
|
|
271
|
+
);
|
|
272
|
+
if (lookup.schema !== RRSI_COHORT_REGISTRATION_SCHEMA)
|
|
273
|
+
rrsiFail("RRSI registration schema differs");
|
|
274
|
+
return lookup;
|
|
275
|
+
}
|