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
|
@@ -15,11 +15,43 @@ import { types as utilTypes } from "node:util";
|
|
|
15
15
|
import { ArtifactStore } from "../artifact-store.js";
|
|
16
16
|
import { artifactPhysicalIdentity as physicalIdentity } from "./evolution-artifact-identity.js";
|
|
17
17
|
import { withEvolutionFileIdentity } from "./evolution-file-identity.js";
|
|
18
|
+
import { readBoundedDescriptor } from "./bounded-descriptor-read.js";
|
|
19
|
+
import { readBoundedArtifactFile } from "../bounded-artifact-file-read.js";
|
|
18
20
|
import {
|
|
19
21
|
EVOLUTION_ARTIFACT_REF_SCHEMA,
|
|
20
22
|
EVOLUTION_ARTIFACT_RESOLUTION_SCHEMA,
|
|
21
23
|
} from "./evolution-ledger.js";
|
|
22
24
|
|
|
25
|
+
const ARTIFACT_STORE_DIRECTORY_BOUNDARIES = new WeakMap();
|
|
26
|
+
// Only the shared identity helper's directory opens use this adapter. A POSIX
|
|
27
|
+
// directory/FIFO swap must fail before reaching a potentially blocking open.
|
|
28
|
+
const INDEX_DIRECTORY_FS = Object.freeze({
|
|
29
|
+
constants: fs.constants,
|
|
30
|
+
realpathSync: fs.realpathSync,
|
|
31
|
+
lstatSync: (...args) => fs.lstatSync(...args),
|
|
32
|
+
fstatSync: (...args) => fs.fstatSync(...args),
|
|
33
|
+
closeSync: (...args) => fs.closeSync(...args),
|
|
34
|
+
openSync: (target, flags) =>
|
|
35
|
+
fs.openSync(
|
|
36
|
+
target,
|
|
37
|
+
flags | (fs.constants.O_NONBLOCK || 0) | (fs.constants.O_DIRECTORY || 0),
|
|
38
|
+
),
|
|
39
|
+
});
|
|
40
|
+
const INDEX_STAT_FIELDS = Object.freeze([
|
|
41
|
+
"dev",
|
|
42
|
+
"ino",
|
|
43
|
+
"mode",
|
|
44
|
+
"uid",
|
|
45
|
+
"gid",
|
|
46
|
+
"nlink",
|
|
47
|
+
"size",
|
|
48
|
+
"mtimeNs",
|
|
49
|
+
"ctimeNs",
|
|
50
|
+
]);
|
|
51
|
+
const INDEX_MUTATION_FIELDS = Object.freeze(
|
|
52
|
+
INDEX_STAT_FIELDS.filter((name) => name !== "dev" && name !== "ino"),
|
|
53
|
+
);
|
|
54
|
+
|
|
23
55
|
export const EVOLUTION_DURABLE_ARTIFACT_RECORD_SCHEMA =
|
|
24
56
|
"chainlesschain.evolution-durable-artifact-record/v1";
|
|
25
57
|
export const EVOLUTION_ARTIFACT_ENVELOPE_CORE_SCHEMA =
|
|
@@ -82,6 +114,12 @@ export const EVOLUTION_ARTIFACT_LEDGER_RETENTION_TYPES = Object.freeze([
|
|
|
82
114
|
"skill-runtime-revalidation-state",
|
|
83
115
|
"evolution-ledger-v2-journal",
|
|
84
116
|
"evolution-run-event",
|
|
117
|
+
"rrsi-history-event",
|
|
118
|
+
"skill-registry-store-policy",
|
|
119
|
+
"skill-registry-runtime-policy",
|
|
120
|
+
"rrsi-observed-text-chunk",
|
|
121
|
+
"rrsi-observed-text-manifest",
|
|
122
|
+
"rrsi-content-restriction-event",
|
|
85
123
|
"pm-exploration-recovery-snapshot",
|
|
86
124
|
"pm-exploration-provider-settlement",
|
|
87
125
|
"evolution-eval-child-evidence",
|
|
@@ -140,6 +178,12 @@ export const EVOLUTION_ARTIFACT_TYPES = Object.freeze([
|
|
|
140
178
|
"evaluation",
|
|
141
179
|
"evaluation-result",
|
|
142
180
|
"evolution-run-event",
|
|
181
|
+
"rrsi-history-event",
|
|
182
|
+
"skill-registry-store-policy",
|
|
183
|
+
"skill-registry-runtime-policy",
|
|
184
|
+
"rrsi-observed-text-chunk",
|
|
185
|
+
"rrsi-observed-text-manifest",
|
|
186
|
+
"rrsi-content-restriction-event",
|
|
143
187
|
"pm-exploration-recovery-snapshot",
|
|
144
188
|
"pm-exploration-provider-settlement",
|
|
145
189
|
"evolution-eval-child-evidence",
|
|
@@ -357,6 +401,7 @@ const CONSTRUCTOR_REQUIRED_KEYS = new Set([
|
|
|
357
401
|
const LEDGER_RESOLVER_OPTION_KEYS = new Set(["purpose"]);
|
|
358
402
|
const EVOLUTION_LEDGER_ARTIFACT_RESOLVERS = new WeakSet();
|
|
359
403
|
const EVOLUTION_LEDGER_BATCH_RESOLVERS = new WeakMap();
|
|
404
|
+
const EVOLUTION_LEDGER_RESOLVER_BINDINGS = new WeakMap();
|
|
360
405
|
const isProxy = Object.freeze(utilTypes.isProxy.bind(utilTypes));
|
|
361
406
|
const isDate = Object.freeze(utilTypes.isDate.bind(utilTypes));
|
|
362
407
|
const dateGetTime = Object.freeze(
|
|
@@ -395,6 +440,12 @@ const LEDGER_RETENTION_PURPOSES_BY_TYPE = new Map([
|
|
|
395
440
|
["wiki-pruning-journal", new Set(["evolution-ledger"])],
|
|
396
441
|
["wiki-pruning-retrieval-projection", new Set(["evolution-ledger"])],
|
|
397
442
|
["evolution-run-event", new Set(["evolution-ledger"])],
|
|
443
|
+
["rrsi-history-event", new Set(["evolution-ledger"])],
|
|
444
|
+
["skill-registry-store-policy", new Set(["evolution-ledger"])],
|
|
445
|
+
["skill-registry-runtime-policy", new Set(["evolution-ledger"])],
|
|
446
|
+
["rrsi-observed-text-chunk", new Set(["evolution-ledger"])],
|
|
447
|
+
["rrsi-observed-text-manifest", new Set(["evolution-ledger"])],
|
|
448
|
+
["rrsi-content-restriction-event", new Set(["evolution-ledger"])],
|
|
398
449
|
["pm-exploration-recovery-snapshot", new Set(["evolution-ledger"])],
|
|
399
450
|
["pm-exploration-provider-settlement", new Set(["evolution-ledger"])],
|
|
400
451
|
["evolution-eval-child-evidence", new Set(["evolution-ledger"])],
|
|
@@ -1110,7 +1161,12 @@ function inspectPhysicalDirectory(directory, label) {
|
|
|
1110
1161
|
let stat;
|
|
1111
1162
|
let realPath;
|
|
1112
1163
|
try {
|
|
1113
|
-
stat = fs.lstatSync(directory);
|
|
1164
|
+
stat = fs.lstatSync(directory, { bigint: true });
|
|
1165
|
+
if (typeof stat.dev !== "bigint" || typeof stat.ino !== "bigint")
|
|
1166
|
+
throw artifactError(
|
|
1167
|
+
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1168
|
+
`${label} requires full-precision directory stat fields`,
|
|
1169
|
+
);
|
|
1114
1170
|
assertDirectory(stat, label);
|
|
1115
1171
|
realPath = physicalRealpath(directory);
|
|
1116
1172
|
} catch (cause) {
|
|
@@ -1134,8 +1190,11 @@ function inspectPhysicalDirectory(directory, label) {
|
|
|
1134
1190
|
}
|
|
1135
1191
|
|
|
1136
1192
|
function inspectPhysicalIndex(indexPath, rootRealPath) {
|
|
1137
|
-
return withEvolutionFileIdentity(
|
|
1138
|
-
|
|
1193
|
+
return withEvolutionFileIdentity(
|
|
1194
|
+
INDEX_DIRECTORY_FS,
|
|
1195
|
+
indexPath,
|
|
1196
|
+
(samePathHandle) =>
|
|
1197
|
+
inspectPhysicalIndexWithIdentity(indexPath, rootRealPath, samePathHandle),
|
|
1139
1198
|
);
|
|
1140
1199
|
}
|
|
1141
1200
|
|
|
@@ -1148,8 +1207,8 @@ function inspectPhysicalIndexWithIdentity(
|
|
|
1148
1207
|
let realPath;
|
|
1149
1208
|
let descriptor = null;
|
|
1150
1209
|
try {
|
|
1151
|
-
pathStat = fs.lstatSync(indexPath);
|
|
1152
|
-
|
|
1210
|
+
pathStat = fs.lstatSync(indexPath, { bigint: true });
|
|
1211
|
+
assertIndexStat(pathStat, "ArtifactStore index");
|
|
1153
1212
|
realPath = physicalRealpath(indexPath);
|
|
1154
1213
|
if (
|
|
1155
1214
|
!samePath(realPath, indexPath) ||
|
|
@@ -1162,16 +1221,36 @@ function inspectPhysicalIndexWithIdentity(
|
|
|
1162
1221
|
}
|
|
1163
1222
|
descriptor = fs.openSync(
|
|
1164
1223
|
indexPath,
|
|
1165
|
-
fs.constants.O_RDONLY |
|
|
1224
|
+
fs.constants.O_RDONLY |
|
|
1225
|
+
Number(fs.constants.O_NOFOLLOW || 0) |
|
|
1226
|
+
Number(fs.constants.O_NONBLOCK || 0),
|
|
1166
1227
|
);
|
|
1167
|
-
const descriptorStat = fs.fstatSync(descriptor);
|
|
1168
|
-
|
|
1169
|
-
if (
|
|
1228
|
+
const descriptorStat = fs.fstatSync(descriptor, { bigint: true });
|
|
1229
|
+
assertIndexStat(descriptorStat, "ArtifactStore index descriptor");
|
|
1230
|
+
if (
|
|
1231
|
+
!samePathHandle(pathStat, descriptorStat) ||
|
|
1232
|
+
!sameIndexMutationMetadata(pathStat, descriptorStat)
|
|
1233
|
+
) {
|
|
1170
1234
|
throw artifactError(
|
|
1171
1235
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1172
1236
|
"ArtifactStore index pathname and descriptor identities differ",
|
|
1173
1237
|
);
|
|
1174
1238
|
}
|
|
1239
|
+
const afterPathStat = fs.lstatSync(indexPath, { bigint: true });
|
|
1240
|
+
const afterDescriptorStat = fs.fstatSync(descriptor, { bigint: true });
|
|
1241
|
+
assertIndexStat(afterPathStat, "ArtifactStore index");
|
|
1242
|
+
assertIndexStat(afterDescriptorStat, "ArtifactStore index descriptor");
|
|
1243
|
+
if (
|
|
1244
|
+
!sameIndexStat(pathStat, afterPathStat) ||
|
|
1245
|
+
!sameIndexStat(descriptorStat, afterDescriptorStat) ||
|
|
1246
|
+
!samePathHandle(afterPathStat, afterDescriptorStat) ||
|
|
1247
|
+
!sameIndexMutationMetadata(afterPathStat, afterDescriptorStat) ||
|
|
1248
|
+
!samePath(physicalRealpath(indexPath), realPath)
|
|
1249
|
+
)
|
|
1250
|
+
throw artifactError(
|
|
1251
|
+
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1252
|
+
"ArtifactStore index changed while its identity was captured",
|
|
1253
|
+
);
|
|
1175
1254
|
} catch (cause) {
|
|
1176
1255
|
if (isEvolutionArtifactPortError(cause)) throw cause;
|
|
1177
1256
|
throw artifactError(
|
|
@@ -1266,16 +1345,6 @@ function attestCapturedDirectory(directory, realPath, identity, label) {
|
|
|
1266
1345
|
}
|
|
1267
1346
|
}
|
|
1268
1347
|
|
|
1269
|
-
function sameFileIdentity(left, right) {
|
|
1270
|
-
return (
|
|
1271
|
-
left.dev === right.dev &&
|
|
1272
|
-
left.ino === right.ino &&
|
|
1273
|
-
left.size === right.size &&
|
|
1274
|
-
left.mtimeMs === right.mtimeMs &&
|
|
1275
|
-
left.ctimeMs === right.ctimeMs
|
|
1276
|
-
);
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
1348
|
function assertRegularSingleLink(stat, label) {
|
|
1280
1349
|
if (
|
|
1281
1350
|
!stat ||
|
|
@@ -1291,6 +1360,35 @@ function assertRegularSingleLink(stat, label) {
|
|
|
1291
1360
|
}
|
|
1292
1361
|
}
|
|
1293
1362
|
|
|
1363
|
+
function assertIndexStat(stat, label) {
|
|
1364
|
+
if (INDEX_STAT_FIELDS.some((name) => typeof stat?.[name] !== "bigint"))
|
|
1365
|
+
throw artifactError(
|
|
1366
|
+
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1367
|
+
`${label} requires full-precision index stat fields`,
|
|
1368
|
+
);
|
|
1369
|
+
assertRegularSingleLink(stat, label);
|
|
1370
|
+
if (stat.size < 0n || stat.size > BigInt(EVOLUTION_ARTIFACT_MAX_INDEX_BYTES))
|
|
1371
|
+
throw artifactError(
|
|
1372
|
+
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1373
|
+
`${label} exceeds its bounded snapshot size`,
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
function sameIndexMutationMetadata(left, right) {
|
|
1378
|
+
return (
|
|
1379
|
+
INDEX_MUTATION_FIELDS.every((name) => left[name] === right[name]) &&
|
|
1380
|
+
physicalIdentity(left).birthtimeMs === physicalIdentity(right).birthtimeMs
|
|
1381
|
+
);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
function sameIndexStat(left, right) {
|
|
1385
|
+
return (
|
|
1386
|
+
left.dev === right.dev &&
|
|
1387
|
+
left.ino === right.ino &&
|
|
1388
|
+
sameIndexMutationMetadata(left, right)
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1294
1392
|
function attestStoreDirectories(layout) {
|
|
1295
1393
|
attestCapturedDirectory(
|
|
1296
1394
|
layout.rootDir,
|
|
@@ -1413,8 +1511,11 @@ function parseTrustedIndexBytes(bytes) {
|
|
|
1413
1511
|
}
|
|
1414
1512
|
|
|
1415
1513
|
function readTrustedIndexSnapshot(layout) {
|
|
1416
|
-
return withEvolutionFileIdentity(
|
|
1417
|
-
|
|
1514
|
+
return withEvolutionFileIdentity(
|
|
1515
|
+
INDEX_DIRECTORY_FS,
|
|
1516
|
+
layout.indexPath,
|
|
1517
|
+
(samePathHandle) =>
|
|
1518
|
+
readTrustedIndexSnapshotWithIdentity(layout, samePathHandle),
|
|
1418
1519
|
);
|
|
1419
1520
|
}
|
|
1420
1521
|
|
|
@@ -1427,8 +1528,8 @@ function readTrustedIndexSnapshotWithIdentity(layout, samePathHandle) {
|
|
|
1427
1528
|
let bytes;
|
|
1428
1529
|
let indexRealPath;
|
|
1429
1530
|
try {
|
|
1430
|
-
beforePathStat = fs.lstatSync(layout.indexPath);
|
|
1431
|
-
|
|
1531
|
+
beforePathStat = fs.lstatSync(layout.indexPath, { bigint: true });
|
|
1532
|
+
assertIndexStat(beforePathStat, "ArtifactStore index");
|
|
1432
1533
|
if (!samePhysicalIdentity(beforePathStat, layout.indexIdentity)) {
|
|
1433
1534
|
throw artifactError(
|
|
1434
1535
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
@@ -1448,27 +1549,32 @@ function readTrustedIndexSnapshotWithIdentity(layout, samePathHandle) {
|
|
|
1448
1549
|
}
|
|
1449
1550
|
descriptor = fs.openSync(
|
|
1450
1551
|
layout.indexPath,
|
|
1451
|
-
fs.constants.O_RDONLY |
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
assertRegularSingleLink(
|
|
1455
|
-
beforeDescriptorStat,
|
|
1456
|
-
"ArtifactStore index descriptor",
|
|
1552
|
+
fs.constants.O_RDONLY |
|
|
1553
|
+
Number(fs.constants.O_NOFOLLOW || 0) |
|
|
1554
|
+
Number(fs.constants.O_NONBLOCK || 0),
|
|
1457
1555
|
);
|
|
1556
|
+
beforeDescriptorStat = fs.fstatSync(descriptor, { bigint: true });
|
|
1557
|
+
assertIndexStat(beforeDescriptorStat, "ArtifactStore index descriptor");
|
|
1458
1558
|
if (
|
|
1459
1559
|
!samePathHandle(beforePathStat, beforeDescriptorStat) ||
|
|
1460
|
-
beforeDescriptorStat
|
|
1560
|
+
!sameIndexMutationMetadata(beforePathStat, beforeDescriptorStat)
|
|
1461
1561
|
) {
|
|
1462
1562
|
throw artifactError(
|
|
1463
1563
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
1464
1564
|
"ArtifactStore index descriptor is replaced or oversized",
|
|
1465
1565
|
);
|
|
1466
1566
|
}
|
|
1467
|
-
bytes =
|
|
1468
|
-
|
|
1567
|
+
bytes = readBoundedDescriptor(
|
|
1568
|
+
fs,
|
|
1569
|
+
descriptor,
|
|
1570
|
+
Number(beforeDescriptorStat.size),
|
|
1571
|
+
EVOLUTION_ARTIFACT_MAX_INDEX_BYTES,
|
|
1572
|
+
);
|
|
1573
|
+
afterDescriptorStat = fs.fstatSync(descriptor, { bigint: true });
|
|
1574
|
+
assertIndexStat(afterDescriptorStat, "ArtifactStore index descriptor");
|
|
1469
1575
|
if (
|
|
1470
|
-
!
|
|
1471
|
-
bytes.length !== beforeDescriptorStat.size
|
|
1576
|
+
!sameIndexStat(beforeDescriptorStat, afterDescriptorStat) ||
|
|
1577
|
+
BigInt(bytes.length) !== beforeDescriptorStat.size
|
|
1472
1578
|
) {
|
|
1473
1579
|
throw artifactError(
|
|
1474
1580
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
@@ -1487,10 +1593,10 @@ function readTrustedIndexSnapshotWithIdentity(layout, samePathHandle) {
|
|
|
1487
1593
|
}
|
|
1488
1594
|
let afterPathStat;
|
|
1489
1595
|
try {
|
|
1490
|
-
afterPathStat = fs.lstatSync(layout.indexPath);
|
|
1491
|
-
|
|
1596
|
+
afterPathStat = fs.lstatSync(layout.indexPath, { bigint: true });
|
|
1597
|
+
assertIndexStat(afterPathStat, "ArtifactStore index");
|
|
1492
1598
|
if (
|
|
1493
|
-
!
|
|
1599
|
+
!sameIndexStat(beforePathStat, afterPathStat) ||
|
|
1494
1600
|
!samePhysicalIdentity(afterPathStat, layout.indexIdentity) ||
|
|
1495
1601
|
!samePath(physicalRealpath(layout.indexPath), indexRealPath)
|
|
1496
1602
|
) {
|
|
@@ -2010,6 +2116,42 @@ export class EvolutionArtifactPorts {
|
|
|
2010
2116
|
throw new TypeError("EvolutionArtifactPorts now must be a function");
|
|
2011
2117
|
}
|
|
2012
2118
|
this.#now = Object.freeze((...args) => now(...args));
|
|
2119
|
+
const layout = this.#store.layout;
|
|
2120
|
+
const directoryBoundary = deepFreeze({
|
|
2121
|
+
schema: "chainlesschain.evolution-artifact-store-directory-boundary/v1",
|
|
2122
|
+
artifactTenantId: this.#tenantId,
|
|
2123
|
+
audience: this.#audience,
|
|
2124
|
+
root: { path: layout.rootRealPath, identity: layout.rootIdentity },
|
|
2125
|
+
files: { path: layout.filesRealPath, identity: layout.filesIdentity },
|
|
2126
|
+
scope: "root-and-files-directories",
|
|
2127
|
+
indexLocation: layout.indexRealPath,
|
|
2128
|
+
indexFileIdentityVerified: false,
|
|
2129
|
+
indexContentsVerified: false,
|
|
2130
|
+
artifactInventoryVerified: false,
|
|
2131
|
+
independentVolumeIdentityVerified: false,
|
|
2132
|
+
fullPhysicalStorageGraphVerified: false,
|
|
2133
|
+
rootAuthorityVerified: false,
|
|
2134
|
+
generationProvenanceVerified: false,
|
|
2135
|
+
tenantWideIndexAuthorityVerified: false,
|
|
2136
|
+
grantsMutationOrPromotionAuthority: false,
|
|
2137
|
+
});
|
|
2138
|
+
const recheck = (...args) => {
|
|
2139
|
+
if (args.length)
|
|
2140
|
+
throw artifactError(
|
|
2141
|
+
EVOLUTION_ARTIFACT_INVALID_CODE,
|
|
2142
|
+
"artifact directory boundary takes no replacement context",
|
|
2143
|
+
);
|
|
2144
|
+
attestStoreDirectories(layout);
|
|
2145
|
+
return directoryBoundary;
|
|
2146
|
+
};
|
|
2147
|
+
recheck();
|
|
2148
|
+
ARTIFACT_STORE_DIRECTORY_BOUNDARIES.set(
|
|
2149
|
+
this,
|
|
2150
|
+
Object.freeze({
|
|
2151
|
+
descriptor: directoryBoundary,
|
|
2152
|
+
recheck: Object.freeze(recheck),
|
|
2153
|
+
}),
|
|
2154
|
+
);
|
|
2013
2155
|
Object.freeze(this);
|
|
2014
2156
|
}
|
|
2015
2157
|
|
|
@@ -2355,26 +2497,6 @@ export class EvolutionArtifactPorts {
|
|
|
2355
2497
|
}
|
|
2356
2498
|
|
|
2357
2499
|
#readStoredBytes(entry, normalizedEntry, expectedDigest) {
|
|
2358
|
-
const expectedPath = path.resolve(
|
|
2359
|
-
this.#store.layout.filesDir,
|
|
2360
|
-
normalizedEntry.file,
|
|
2361
|
-
);
|
|
2362
|
-
return withEvolutionFileIdentity(fs, expectedPath, (samePathHandle) =>
|
|
2363
|
-
this.#readStoredBytesWithIdentity(
|
|
2364
|
-
entry,
|
|
2365
|
-
normalizedEntry,
|
|
2366
|
-
expectedDigest,
|
|
2367
|
-
samePathHandle,
|
|
2368
|
-
),
|
|
2369
|
-
);
|
|
2370
|
-
}
|
|
2371
|
-
|
|
2372
|
-
#readStoredBytesWithIdentity(
|
|
2373
|
-
entry,
|
|
2374
|
-
normalizedEntry,
|
|
2375
|
-
expectedDigest,
|
|
2376
|
-
samePathHandle,
|
|
2377
|
-
) {
|
|
2378
2500
|
attestStoreDirectories(this.#store.layout);
|
|
2379
2501
|
const expectedHex = expectedDigest.slice("sha256:".length);
|
|
2380
2502
|
let storedPath;
|
|
@@ -2406,9 +2528,13 @@ export class EvolutionArtifactPorts {
|
|
|
2406
2528
|
);
|
|
2407
2529
|
}
|
|
2408
2530
|
|
|
2531
|
+
const readBounds = Object.freeze({
|
|
2532
|
+
expectedSize: normalizedEntry.size,
|
|
2533
|
+
maximumBytes: EVOLUTION_ARTIFACT_MAX_CANONICAL_BYTES,
|
|
2534
|
+
});
|
|
2409
2535
|
let integrityBefore;
|
|
2410
2536
|
try {
|
|
2411
|
-
integrityBefore = this.#store.verifyIntegrity(entry);
|
|
2537
|
+
integrityBefore = this.#store.verifyIntegrity(entry, readBounds);
|
|
2412
2538
|
} catch (cause) {
|
|
2413
2539
|
throw artifactError(
|
|
2414
2540
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
@@ -2418,53 +2544,13 @@ export class EvolutionArtifactPorts {
|
|
|
2418
2544
|
}
|
|
2419
2545
|
validateIntegrityResult(integrityBefore, expectedHex);
|
|
2420
2546
|
|
|
2421
|
-
let rootRealPath;
|
|
2422
|
-
let beforePathStat;
|
|
2423
|
-
let targetRealPath;
|
|
2424
|
-
let descriptor = null;
|
|
2425
|
-
let beforeDescriptorStat;
|
|
2426
|
-
let afterDescriptorStat;
|
|
2427
2547
|
let bytes;
|
|
2428
2548
|
try {
|
|
2429
|
-
|
|
2430
|
-
if (!samePath(rootRealPath, this.#store.layout.filesRealPath)) {
|
|
2431
|
-
throw artifactError(
|
|
2432
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2433
|
-
"ArtifactStore files root physical identity changed before byte read",
|
|
2434
|
-
);
|
|
2435
|
-
}
|
|
2436
|
-
beforePathStat = fs.lstatSync(resolvedStoredPath);
|
|
2437
|
-
assertRegularSingleLink(beforePathStat, "stored artifact path");
|
|
2438
|
-
targetRealPath = physicalRealpath(resolvedStoredPath);
|
|
2439
|
-
if (!isContained(rootRealPath, targetRealPath)) {
|
|
2440
|
-
throw artifactError(
|
|
2441
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2442
|
-
"stored artifact realpath escapes the captured files root",
|
|
2443
|
-
);
|
|
2444
|
-
}
|
|
2445
|
-
descriptor = fs.openSync(
|
|
2549
|
+
bytes = readBoundedArtifactFile(
|
|
2446
2550
|
resolvedStoredPath,
|
|
2447
|
-
|
|
2551
|
+
readBounds.expectedSize,
|
|
2552
|
+
readBounds.maximumBytes,
|
|
2448
2553
|
);
|
|
2449
|
-
beforeDescriptorStat = fs.fstatSync(descriptor);
|
|
2450
|
-
assertRegularSingleLink(
|
|
2451
|
-
beforeDescriptorStat,
|
|
2452
|
-
"stored artifact descriptor",
|
|
2453
|
-
);
|
|
2454
|
-
if (!samePathHandle(beforePathStat, beforeDescriptorStat)) {
|
|
2455
|
-
throw artifactError(
|
|
2456
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2457
|
-
"stored artifact pathname and descriptor identities differ",
|
|
2458
|
-
);
|
|
2459
|
-
}
|
|
2460
|
-
bytes = fs.readFileSync(descriptor);
|
|
2461
|
-
afterDescriptorStat = fs.fstatSync(descriptor);
|
|
2462
|
-
if (!sameFileIdentity(beforeDescriptorStat, afterDescriptorStat)) {
|
|
2463
|
-
throw artifactError(
|
|
2464
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2465
|
-
"stored artifact changed while it was read",
|
|
2466
|
-
);
|
|
2467
|
-
}
|
|
2468
2554
|
} catch (cause) {
|
|
2469
2555
|
if (isEvolutionArtifactPortError(cause)) throw cause;
|
|
2470
2556
|
throw artifactError(
|
|
@@ -2472,33 +2558,6 @@ export class EvolutionArtifactPorts {
|
|
|
2472
2558
|
"stored artifact could not be opened safely",
|
|
2473
2559
|
{ cause },
|
|
2474
2560
|
);
|
|
2475
|
-
} finally {
|
|
2476
|
-
if (descriptor !== null) fs.closeSync(descriptor);
|
|
2477
|
-
}
|
|
2478
|
-
let afterPathStat;
|
|
2479
|
-
try {
|
|
2480
|
-
afterPathStat = fs.lstatSync(resolvedStoredPath);
|
|
2481
|
-
assertRegularSingleLink(afterPathStat, "stored artifact path");
|
|
2482
|
-
if (!sameFileIdentity(beforePathStat, afterPathStat)) {
|
|
2483
|
-
throw artifactError(
|
|
2484
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2485
|
-
"stored artifact pathname changed during readback",
|
|
2486
|
-
);
|
|
2487
|
-
}
|
|
2488
|
-
const afterRealPath = physicalRealpath(resolvedStoredPath);
|
|
2489
|
-
if (!samePath(targetRealPath, afterRealPath)) {
|
|
2490
|
-
throw artifactError(
|
|
2491
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2492
|
-
"stored artifact realpath changed during readback",
|
|
2493
|
-
);
|
|
2494
|
-
}
|
|
2495
|
-
} catch (cause) {
|
|
2496
|
-
if (isEvolutionArtifactPortError(cause)) throw cause;
|
|
2497
|
-
throw artifactError(
|
|
2498
|
-
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
2499
|
-
"stored artifact could not be re-attested",
|
|
2500
|
-
{ cause },
|
|
2501
|
-
);
|
|
2502
2561
|
}
|
|
2503
2562
|
if (
|
|
2504
2563
|
bytes.length !== normalizedEntry.size ||
|
|
@@ -2511,7 +2570,7 @@ export class EvolutionArtifactPorts {
|
|
|
2511
2570
|
}
|
|
2512
2571
|
let integrityAfter;
|
|
2513
2572
|
try {
|
|
2514
|
-
integrityAfter = this.#store.verifyIntegrity(entry);
|
|
2573
|
+
integrityAfter = this.#store.verifyIntegrity(entry, readBounds);
|
|
2515
2574
|
} catch (cause) {
|
|
2516
2575
|
throw artifactError(
|
|
2517
2576
|
EVOLUTION_ARTIFACT_INTEGRITY_FAILED_CODE,
|
|
@@ -3557,6 +3616,15 @@ export class EvolutionArtifactPorts {
|
|
|
3557
3616
|
EVOLUTION_LEDGER_BATCH_RESOLVERS.set(resolveReadOnly, (requests) =>
|
|
3558
3617
|
this.#resolveLedgerBatch(requests, normalizedPurpose),
|
|
3559
3618
|
);
|
|
3619
|
+
EVOLUTION_LEDGER_RESOLVER_BINDINGS.set(
|
|
3620
|
+
resolveReadOnly,
|
|
3621
|
+
Object.freeze({
|
|
3622
|
+
purpose: normalizedPurpose,
|
|
3623
|
+
tenantId: this.#tenantId,
|
|
3624
|
+
audience: this.#audience,
|
|
3625
|
+
matchesArtifactPorts: Object.freeze((value) => value === this),
|
|
3626
|
+
}),
|
|
3627
|
+
);
|
|
3560
3628
|
return Object.freeze(resolveReadOnly);
|
|
3561
3629
|
}
|
|
3562
3630
|
}
|
|
@@ -3591,4 +3659,42 @@ export function captureEvolutionLedgerBatchResolver(value) {
|
|
|
3591
3659
|
return resolve;
|
|
3592
3660
|
}
|
|
3593
3661
|
|
|
3662
|
+
/** Private construction identity, independent of matching resolver descriptors. */
|
|
3663
|
+
export function captureEvolutionLedgerArtifactResolverBinding(value) {
|
|
3664
|
+
const binding = EVOLUTION_LEDGER_RESOLVER_BINDINGS.get(value);
|
|
3665
|
+
if (!binding)
|
|
3666
|
+
throw new TypeError(
|
|
3667
|
+
"a branded ledger artifact resolver binding is required",
|
|
3668
|
+
);
|
|
3669
|
+
return binding;
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
/** Original root/files directory capture only; never an installer or tenant grant. */
|
|
3673
|
+
export function captureEvolutionArtifactStoreDirectoryBoundary(value) {
|
|
3674
|
+
if (arguments.length !== 1)
|
|
3675
|
+
throw new TypeError(
|
|
3676
|
+
"artifact directory boundary capture takes exactly one original ports object",
|
|
3677
|
+
);
|
|
3678
|
+
rejectProxy(value, "EvolutionArtifactPorts directory boundary");
|
|
3679
|
+
if (
|
|
3680
|
+
!value ||
|
|
3681
|
+
Object.getPrototypeOf(value) !== EvolutionArtifactPorts.prototype ||
|
|
3682
|
+
!hasStablePrototype(
|
|
3683
|
+
value,
|
|
3684
|
+
EvolutionArtifactPorts.prototype,
|
|
3685
|
+
"EvolutionArtifactPorts directory boundary",
|
|
3686
|
+
)
|
|
3687
|
+
)
|
|
3688
|
+
throw new TypeError(
|
|
3689
|
+
"a genuine EvolutionArtifactPorts directory boundary is required",
|
|
3690
|
+
);
|
|
3691
|
+
const boundary = ARTIFACT_STORE_DIRECTORY_BOUNDARIES.get(value);
|
|
3692
|
+
if (!boundary)
|
|
3693
|
+
throw new TypeError(
|
|
3694
|
+
"a genuine EvolutionArtifactPorts directory boundary is required",
|
|
3695
|
+
);
|
|
3696
|
+
boundary.recheck();
|
|
3697
|
+
return boundary;
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3594
3700
|
Object.freeze(EvolutionArtifactPorts.prototype);
|