chainlesschain 0.166.150 → 0.166.156
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 +20 -6
- package/package.json +2 -2
- 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/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-bYMRw36k.js → AIOps-CraNGNgc.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-xprOFj7C.js → ActionButton-C0jn6sgg.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BRZ6F3vk.js → Analytics-DVrR_wjl.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-C_volo3Y.js → AppLayout-CeKP8mgC.js} +1 -1
- package/src/assets/web-panel/assets/{Artifacts-Db0iD_H2.js → Artifacts-OHCS9wLN.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-Bzp7NOA9.js → Audit-C77b6pDl.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-CPa5KqjU.js → BackgroundAgents-CefiwCgM.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-BraBbkcd.js → Backup-B-5KmWNA.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-D8LlXxCM.js → BaseInput-C3bJ1Qlc.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-FWtdQ7HW.js → Chat-DBahPz9B.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-DtxhjGV3.js → ChatBubbleRenderer-J4BVVrXZ.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BoCeVuib.js → Checkbox-w856fzfY.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-C58CW3JB.js → Codegen-XKmsL_C3.js} +1 -1
- package/src/assets/web-panel/assets/{Col-BlkVpYfD.js → Col-B37-gr7d.js} +1 -1
- package/src/assets/web-panel/assets/{Community-BmQ95FuI.js → Community-DdahlN0f.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BzWphLgo.js → Compact-oKnoE-9_.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CG1Plf7v.js → Compliance-CnCRlOB_.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CS8_XrAS.js → Cowork-D3Vr5R3E.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-C1m-mGo0.js → Cron-X46CdLRQ.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-TU1UPo_V.js → Crosschain-CV3_6jVw.js} +1 -1
- package/src/assets/web-panel/assets/{DID-bhbIsq__.js → DID-Kr6H4WKr.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-B0wCsqTw.js → Dashboard-Bj4usrhx.js} +1 -1
- package/src/assets/web-panel/assets/{Dropdown-CVokY3lt.js → Dropdown-V3DPV21D.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-CfatTKx0.js → EmailListRenderer-8MCX0Y4b.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-DnT_Uiag.js → EvolutionSettings-SUoykpjc.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-Dyahx8jQ.js → FamilyGuardDashboard-C0iE0T9x.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DuJ39hyj.js → Federation-CSU3kpK2.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-V4Ic5oQ_.js → FormItemContext-Bcv2XJNw.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-UlZdAl_W.js → GenericCardRenderer-PdEqwQZd.js} +1 -1
- package/src/assets/web-panel/assets/{Git-B_363OIs.js → Git-CVZ0MSRN.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-C61_SW_q.js → Governance-CF64-eGc.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CU80t_tb.js → Inference-DJ1J40Th.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BEtPQz8C.js → KnowledgeGraph-Cf3ULXmf.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CXqWvdFk.js → Logs-DM_RbXG_.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-BFgkiBfA.js → MarkdownRenderer-B2wey_j8.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-oKgzevz2.js → Marketplace-tqdANxLa.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DHcNKyfb.js → McpTools-BiSYAtKB.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-DEVpDL-x.js → Memory-hOvA-Tqp.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-D92T6ztp.js → MobileBridge-CIpwBK6G.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-B2Y7xpPw.js → MobileProjects-DMpV98oD.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-VOiGefD2.js → Mtc-CVoJZMuY.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-CAnmf1Im.js → MtcAudit-Dz9YsrvV.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-BCPOmJxC.js → Multisig-CamW3sTK.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-DYFqTLhe.js → NLProgramming-DlZo8q6W.js} +1 -1
- package/src/assets/web-panel/assets/{Notes--N-8WbHM.js → Notes-DZJSYibx.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-Dka_XX0P.js → NotificationSettings-BSlIIGOM.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-CIVkknQY.js → OrderTableRenderer-Bo9vImgU.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-MToqvn2N.js → Organization-B1sBf0Kk.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-DgYLr6Hh.js → Overflow-CD8GUNOV.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-DiRHC93-.js → P2P-CeaIuSa9.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-Cw8MYDt-.js → PdhVaultBrowser-DCOkcRse.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-JhxdHQqC.js → Permissions-DQCZnN_y.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-CcEeur_W.js → PersonalDataHub-D_9PtVvT.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-Dau0R1tw.js → Pipeline-BawUxj0i.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-UF1HoZ-q.js → Privacy-CPyw19Ai.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DyPmrkmp.js → ProjectInit-GDtYLbL6.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-DZ4DQBbI.js → ProjectSettings-DhmGKXVL.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-BRhaPrL4.js → Projects-O2spSrud.js} +1 -1
- package/src/assets/web-panel/assets/Providers-CNKCrJbY.css +1 -0
- package/src/assets/web-panel/assets/Providers-lEDu4Qdj.js +1 -0
- package/src/assets/web-panel/assets/{QrScannerModal-Dgvs6EGu.js → QrScannerModal-Dcqm-i6j.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DqKybfXf.js → QuickAsk-C6uPAeAE.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-BGQDw5cu.js → Recommend-ClVlhga7.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-KE-6VZN0.js → RemoteSession-2raJDKUb.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-Ifxvbk7U.js → Reputation-BYWC8k3t.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DoD3nauz.js → Row-Bv7Y68ai.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BlMKhrqt.js → RssFeed-Ba54MKvz.js} +1 -1
- package/src/assets/web-panel/assets/{Search-D4MaHzRS.js → Search-B9EkRkZK.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DMpqDgSc.js → Security-DuXQGU4o.js} +1 -1
- package/src/assets/web-panel/assets/{Services-C9yzBSd8.js → Services-DJnCtY8x.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-h8kJILZh.js → Skeleton-BVDdtf_S.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-jXdYN4vu.js → Skills-DGkYCesm.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-Cuk7apSe.js → Sla-CHND6lwC.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-B5hPI4N_.js → SpeechSettings-Bg0Bgy9c.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-MGyaOfUD.js → SyncSettings-DwtcZ2Ml.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-BSqf89Jx.js → Tasks-BoHc0cP2.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-BYjHba7u.js → Templates-DAMs4m8X.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-CEkhV7yX.js → Tenant-DkVQbOzT.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-D2deCxuf.js → Terminal-BTOLM8Yu.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-C8YVFoC3.js → TimelineRenderer-BO5ZyxUU.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DN-S9EsT.js → Tokens-D0LjCtSA.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-F6LwAuyn.js → Trigger-DgGXg9VB.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Cx8jhn1i.js → Trust-BAEQrND-.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-BN--f0JV.js → UkeySign-TtBclFRw.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-i32OtN88.js → VideoEditing-ByxvpIpS.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-DQImHu1X.js → Wallet-CTa7jqur.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-5waEqMup.js → WebAuthn-oHbCSjrD.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-Bh0xyyOO.js → WorkflowEditor-DQKQAdUS.js} +1 -1
- package/src/assets/web-panel/assets/{chat-EXJ3Usf5.js → chat-BcCU2FuK.js} +1 -1
- package/src/assets/web-panel/assets/{colors-Cdoap8Z7.js → colors-BcXAFjHT.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-QPjKEhW_.js → compact-item-GhZzQppm.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-BOGUY650.js → createContext-Bc6nwTUy.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-DRN_I25i.js → hasIn-DRH8Xt0Y.js} +1 -1
- package/src/assets/web-panel/assets/{index-BoDNVZfc.js → index-60aCmptm.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_J_PUwW.js → index-B7hScRVB.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeRxNc4x.js → index-BDIN9KWp.js} +1 -1
- package/src/assets/web-panel/assets/{index-DAuglUM-.js → index-BEQha9Ur.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFh62a_Z.js → index-BFFyqn3k.js} +1 -1
- package/src/assets/web-panel/assets/{index-jo9saD-R.js → index-BOquBdmK.js} +1 -1
- package/src/assets/web-panel/assets/{index-9hwjpOFE.js → index-BQ6b5kJR.js} +1 -1
- package/src/assets/web-panel/assets/{index-BvX72fLD.js → index-BaUmYzDB.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dusibyek.js → index-Bb5XCEKT.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_pIGWDh.js → index-BdOccG1D.js} +1 -1
- package/src/assets/web-panel/assets/{index-shByGhT7.js → index-Bebe5WYu.js} +1 -1
- package/src/assets/web-panel/assets/index-BlS3EjXM.js +1 -0
- package/src/assets/web-panel/assets/{index-DULwfIin.js → index-BsRmNZCk.js} +1 -1
- package/src/assets/web-panel/assets/{index-15P436aq.js → index-CB1Thk9t.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_pCKR-k.js → index-CSHz8UnK.js} +1 -1
- package/src/assets/web-panel/assets/{index-_fW5KelD.js → index-Cexk6Y1r.js} +1 -1
- package/src/assets/web-panel/assets/{index-BRo2j8Jz.js → index-CtC-B6Zy.js} +1 -1
- package/src/assets/web-panel/assets/{index-DID83zEQ.js → index-D08s-CJ_.js} +1 -1
- package/src/assets/web-panel/assets/{index-DzUL46rU.js → index-D6B_ELy6.js} +1 -1
- package/src/assets/web-panel/assets/{index-CXP_MepL.js → index-D6pWvvp-.js} +1 -1
- package/src/assets/web-panel/assets/{index-BmVIyCgf.js → index-D9QfJDQg.js} +1 -1
- package/src/assets/web-panel/assets/{index-DISFHFjT.js → index-DCCEt-pU.js} +1 -1
- package/src/assets/web-panel/assets/{index-iYCp3otx.js → index-DCgr2bDL.js} +1 -1
- package/src/assets/web-panel/assets/{index-DBb3W3bA.js → index-DNi_t23H.js} +1 -1
- package/src/assets/web-panel/assets/{index-DfXsHnc0.js → index-DOBzu5UO.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFXhCqpm.js → index-DOtNt1m7.js} +1 -1
- package/src/assets/web-panel/assets/{index-FBoQQHLy.js → index-DQnXn3vs.js} +1 -1
- package/src/assets/web-panel/assets/{index-Lwktngzr.js → index-DXip1xUj.js} +1 -1
- package/src/assets/web-panel/assets/{index-C33cfAQE.js → index-DoRIPzwv.js} +1 -1
- package/src/assets/web-panel/assets/index-DwIMwROa.js +1 -0
- package/src/assets/web-panel/assets/{index-hmILMYKF.js → index-Dzh9Ud2R.js} +3 -3
- package/src/assets/web-panel/assets/{index-kc4lgpMy.js → index-DzhMohzV.js} +1 -1
- package/src/assets/web-panel/assets/{index-6KPTDWDG.js → index-IW9dUJK_.js} +1 -1
- package/src/assets/web-panel/assets/{index-6nTP4-QK.js → index-WrMfehhj.js} +1 -1
- package/src/assets/web-panel/assets/{index-DNpnprSx.js → index-gvsatTPZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CafxYv7t.js → index-lEDZUWRO.js} +1 -1
- package/src/assets/web-panel/assets/{index-CVJG_i6e.js → index-mqlLcSgP.js} +1 -1
- package/src/assets/web-panel/assets/{index-L3zdSmTh.js → index-owU4npmQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CKfdYM3I.js → index-wnmY4P7_.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-Bno49hyl.js → initDefaultProps-DfHPrIA5.js} +1 -1
- package/src/assets/web-panel/assets/{motion-Cs9KpFRZ.js → motion-CCzrK3c5.js} +1 -1
- package/src/assets/web-panel/assets/{move-DN2kt6Fk.js → move-B2uu6I9f.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-IXnfFKcF.js → mtc-parser-DtFu2-C_.js} +1 -1
- package/src/assets/web-panel/assets/{omit-ULuXK3m0.js → omit-BFjLuAHb.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-B3f1sg_2.js → pickAttrs-DfsjYq45.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CB3ISXbH.js → placementArrow-CDdYIVXw.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-BhRD48Wz.js → responsiveObserve-CfrplFjn.js} +1 -1
- package/src/assets/web-panel/assets/{slide-B4qkLP8K.js → slide-DHNX5Xwt.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-KfItOu2F.js → statusUtils-BI-C3SSk.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BeLQUf-Z.js → styleChecker-C5Y3Oyy2.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-CPIJfd28.js → useFlexGapSupport-atF45w0U.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CUBjOVdy.js → useFs-C4M8-xm9.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DEKScTxs.js → usePersonalDataHub-jjZdnfs_.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-DhNnfLeH.js → vnode-BRTSCmU3.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-D5rdpCyb.js → zoom-BaS5ZYRC.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/data/changelog.json +78 -0
- package/src/lib/evolution/evolution-artifact-ports.js +304 -0
- package/src/lib/evolution/evolution-file-retained-segment-backend.js +291 -0
- package/src/lib/evolution/evolution-file-witness.js +46 -4
- package/src/lib/evolution/evolution-immutable-ledger-segment-store.js +112 -0
- package/src/lib/evolution/evolution-ledger-manifest-chain.js +65 -1
- package/src/lib/evolution/evolution-ledger-manifest-witness-adapter.js +19 -2
- package/src/lib/evolution/evolution-ledger-v2-journal.js +115 -0
- package/src/lib/evolution/evolution-ledger-v2-manifest-backend.js +242 -1
- package/src/lib/evolution/evolution-ledger.js +215 -27
- package/src/lib/evolution/evolution-witness-contracts.js +5 -0
- package/src/lib/evolution/evolution-witness-segments.js +2 -0
- package/src/lib/evolution/rrsi-observed-text-index.js +171 -9
- package/src/lib/evolution/rrsi-tenant-index-anchor-history.js +20 -0
- package/src/lib/lk-account-api.cjs +14 -2
- package/src/lib/lk-model-catalog.json +919 -467
- package/src/lib/llm-channel-presets.js +27 -8
- package/src/lib/llm-connection-config.js +6 -1
- package/src/lib/llm-connection-resolution.js +3 -1
- package/src/lib/llm-onboarding-catalog.json +16 -16
- package/src/lib/read-file-loop-guard.js +36 -12
- package/src/assets/web-panel/assets/Providers-DVyNl0mO.css +0 -1
- package/src/assets/web-panel/assets/Providers-TFpSkyej.js +0 -1
- package/src/assets/web-panel/assets/index-BFYVw5aJ.js +0 -1
- package/src/assets/web-panel/assets/index-wtySft9h.js +0 -1
|
@@ -9,11 +9,16 @@ import {
|
|
|
9
9
|
EVOLUTION_LEDGER_MAX_EVENTS,
|
|
10
10
|
EVOLUTION_LEDGER_V2_MIGRATION_INTENT,
|
|
11
11
|
EVOLUTION_LEDGER_V2_CUTOVER_COMPLETED,
|
|
12
|
+
getEvolutionLedgerReadOnlyHistoryReader,
|
|
12
13
|
} from "./evolution-ledger.js";
|
|
13
14
|
import {
|
|
14
15
|
captureEvolutionLedgerV2ManifestBackend,
|
|
15
16
|
captureEvolutionLedgerV2ManifestDirectoryBoundaries,
|
|
16
17
|
captureEvolutionLedgerV2ManifestWitnessDirectoryBoundaries,
|
|
18
|
+
captureEvolutionLedgerV2RetainedSegmentDirectoryBoundary,
|
|
19
|
+
captureEvolutionLedgerV2ReferencedSegmentInventory,
|
|
20
|
+
captureEvolutionLedgerV2LocalRetentionInventory,
|
|
21
|
+
getEvolutionLedgerV2ReadOnlyEventsReader,
|
|
17
22
|
hasEvolutionLedgerV2ManifestDirectoryBoundaries,
|
|
18
23
|
} from "./evolution-ledger-v2-manifest-backend.js";
|
|
19
24
|
|
|
@@ -23,6 +28,9 @@ export const EVOLUTION_LEDGER_V2_FINALIZATION_SCHEMA =
|
|
|
23
28
|
"chainlesschain.evolution-ledger-v2-finalization/v2";
|
|
24
29
|
const JOURNALS = new WeakSet();
|
|
25
30
|
const MANIFEST_BACKENDS = new WeakMap();
|
|
31
|
+
const READ_ONLY_BINDINGS = new WeakMap();
|
|
32
|
+
export const EVOLUTION_LEDGER_V2_SOURCE_AUDIT_HELD_CODE =
|
|
33
|
+
"CC_EVOLUTION_LEDGER_V2_SOURCE_AUDIT_HELD";
|
|
26
34
|
const RESERVED = new Set([
|
|
27
35
|
EVOLUTION_LEDGER_V2_MIGRATION_INTENT,
|
|
28
36
|
EVOLUTION_LEDGER_V2_CUTOVER_COMPLETED,
|
|
@@ -525,6 +533,13 @@ export function createEvolutionLedgerV2Journal(options) {
|
|
|
525
533
|
locked(recover);
|
|
526
534
|
JOURNALS.add(journal);
|
|
527
535
|
MANIFEST_BACKENDS.set(journal, backend);
|
|
536
|
+
READ_ONLY_BINDINGS.set(
|
|
537
|
+
journal,
|
|
538
|
+
Object.freeze({
|
|
539
|
+
readSource: getEvolutionLedgerReadOnlyHistoryReader(ledger),
|
|
540
|
+
readManifest: getEvolutionLedgerV2ReadOnlyEventsReader(backend),
|
|
541
|
+
}),
|
|
542
|
+
);
|
|
528
543
|
return journal;
|
|
529
544
|
}
|
|
530
545
|
|
|
@@ -554,6 +569,106 @@ export function isEvolutionLedgerV2Journal(value) {
|
|
|
554
569
|
return JOURNALS.has(value);
|
|
555
570
|
}
|
|
556
571
|
|
|
572
|
+
export function captureEvolutionLedgerV2JournalRetainedSegmentDirectoryBoundary(
|
|
573
|
+
value,
|
|
574
|
+
) {
|
|
575
|
+
if (arguments.length !== 1 || !MANIFEST_BACKENDS.has(value))
|
|
576
|
+
throw new TypeError("one original v2 journal is required");
|
|
577
|
+
return captureEvolutionLedgerV2RetainedSegmentDirectoryBoundary(
|
|
578
|
+
MANIFEST_BACKENDS.get(value),
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export function captureEvolutionLedgerV2JournalReferencedSegmentInventory(
|
|
583
|
+
value,
|
|
584
|
+
) {
|
|
585
|
+
if (arguments.length !== 1 || !MANIFEST_BACKENDS.has(value))
|
|
586
|
+
throw new TypeError("one original v2 journal is required");
|
|
587
|
+
return captureEvolutionLedgerV2ReferencedSegmentInventory(
|
|
588
|
+
MANIFEST_BACKENDS.get(value),
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export function captureEvolutionLedgerV2JournalLocalRetentionInventory(value) {
|
|
593
|
+
if (arguments.length !== 1 || !MANIFEST_BACKENDS.has(value))
|
|
594
|
+
throw new TypeError("one original v2 journal is required");
|
|
595
|
+
return captureEvolutionLedgerV2LocalRetentionInventory(
|
|
596
|
+
MANIFEST_BACKENDS.get(value),
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** Existing source and witnessed v2 only. No source locks or v2 recovery. */
|
|
601
|
+
export function captureEvolutionLedgerV2JournalSourceConsistency(value) {
|
|
602
|
+
if (arguments.length !== 1 || !READ_ONLY_BINDINGS.has(value))
|
|
603
|
+
throw new TypeError("one original v2 journal is required");
|
|
604
|
+
const { readSource, readManifest } = READ_ONLY_BINDINGS.get(value);
|
|
605
|
+
if (readSource === null || readManifest === null) return null;
|
|
606
|
+
const held = (message) =>
|
|
607
|
+
fail(message, undefined, EVOLUTION_LEDGER_V2_SOURCE_AUDIT_HELD_CODE);
|
|
608
|
+
const read = () => {
|
|
609
|
+
const before = readSource();
|
|
610
|
+
const manifest = readManifest();
|
|
611
|
+
if (manifest === null) return null;
|
|
612
|
+
const after = readSource();
|
|
613
|
+
if (
|
|
614
|
+
before.eventsDigest !== after.eventsDigest ||
|
|
615
|
+
canonical(before.frontier) !== canonical(after.frontier)
|
|
616
|
+
)
|
|
617
|
+
held("source frontier changed during v2 consistency audit");
|
|
618
|
+
const frontier = before.frontier;
|
|
619
|
+
if (
|
|
620
|
+
manifest.head.ledgerId !== frontier.ledgerId ||
|
|
621
|
+
manifest.head.epoch !== frontier.epoch ||
|
|
622
|
+
manifest.head.tenantId !== value.descriptor.tenantId ||
|
|
623
|
+
manifest.head.sequence !== frontier.sequence ||
|
|
624
|
+
manifest.head.eventDigest !== frontier.headDigest ||
|
|
625
|
+
manifest.events.length !== before.events.length
|
|
626
|
+
)
|
|
627
|
+
held(
|
|
628
|
+
"source WAL is not exactly finalized in the current v2 manifest head",
|
|
629
|
+
);
|
|
630
|
+
for (let index = 0; index < before.events.length; index++)
|
|
631
|
+
if (canonical(before.events[index]) !== canonical(manifest.events[index]))
|
|
632
|
+
held(
|
|
633
|
+
"v2 event payload differs from the original authenticated source event",
|
|
634
|
+
);
|
|
635
|
+
const core = Object.freeze({
|
|
636
|
+
schema: "chainlesschain.evolution-source-v2-consistency/v1",
|
|
637
|
+
sourceFrontier: frontier,
|
|
638
|
+
sourceEventsDigest: before.eventsDigest,
|
|
639
|
+
manifestHead: manifest.head,
|
|
640
|
+
manifestCount: manifest.manifestCount,
|
|
641
|
+
eventCount: before.events.length,
|
|
642
|
+
readOnlyOpen: true,
|
|
643
|
+
recoveryPerformed: false,
|
|
644
|
+
sourceEventsExactlyMirrored: true,
|
|
645
|
+
artifactCurrentAuthorityVerified: false,
|
|
646
|
+
fullPhysicalStorageGraphVerified: false,
|
|
647
|
+
grantsMutationOrPromotionAuthority: false,
|
|
648
|
+
});
|
|
649
|
+
return Object.freeze({
|
|
650
|
+
...core,
|
|
651
|
+
consistencyDigest: `sha256:${createHash("sha256").update(`${core.schema}\0`).update(canonical(core)).digest("hex")}`,
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
const snapshot = read();
|
|
655
|
+
if (snapshot === null) return null;
|
|
656
|
+
return Object.freeze({
|
|
657
|
+
snapshot,
|
|
658
|
+
recheck(...args) {
|
|
659
|
+
if (args.length)
|
|
660
|
+
throw new TypeError("source consistency takes no replacement context");
|
|
661
|
+
const current = read();
|
|
662
|
+
if (
|
|
663
|
+
current === null ||
|
|
664
|
+
current.consistencyDigest !== snapshot.consistencyDigest
|
|
665
|
+
)
|
|
666
|
+
held("source/v2 consistency changed after capture");
|
|
667
|
+
return true;
|
|
668
|
+
},
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
|
|
557
672
|
// Production factory receives authenticated scope, not a structural ledger or a
|
|
558
673
|
// capability to bypass cutover. Capturing the result enforces the backend brand.
|
|
559
674
|
export function createEvolutionLedgerV2JournalFromFactory(
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { types as utilTypes } from "node:util";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
captureImmutableLedgerSegmentStorePort,
|
|
6
|
+
captureImmutableLedgerSegmentStoreDirectoryBoundary,
|
|
7
|
+
captureImmutableLedgerSegmentStoreFileInventory,
|
|
8
|
+
} from "./evolution-immutable-ledger-segment-store.js";
|
|
5
9
|
import {
|
|
6
10
|
captureEvolutionLedgerManifestAuthority,
|
|
7
11
|
deriveEvolutionLedgerManifestHead,
|
|
8
12
|
sealEvolutionLedgerManifestSegment,
|
|
9
13
|
verifyEvolutionLedgerManifestChain,
|
|
10
14
|
readEvolutionLedgerManifestEvents,
|
|
15
|
+
inspectEvolutionLedgerReferencedSegmentInventory,
|
|
11
16
|
} from "./evolution-ledger-manifest-chain.js";
|
|
12
17
|
import {
|
|
13
18
|
captureEvolutionLedgerManifestHeadStore,
|
|
@@ -23,6 +28,7 @@ import {
|
|
|
23
28
|
captureEvolutionLedgerManifestWitnessAdapter,
|
|
24
29
|
captureEvolutionLedgerManifestWitnessDirectoryBoundaries,
|
|
25
30
|
hasEvolutionLedgerManifestWitnessDirectoryBoundaries,
|
|
31
|
+
getEvolutionLedgerManifestWitnessReadOnlyReader,
|
|
26
32
|
} from "./evolution-ledger-manifest-witness-adapter.js";
|
|
27
33
|
|
|
28
34
|
export const EVOLUTION_LEDGER_V2_MANIFEST_BACKEND_SCHEMA =
|
|
@@ -65,6 +71,7 @@ const APPEND_KEYS = new Set([
|
|
|
65
71
|
const VERIFY_KEYS = new Set();
|
|
66
72
|
const BACKENDS = new WeakSet();
|
|
67
73
|
const ORIGINAL_MANIFEST_COMPONENTS = new WeakMap();
|
|
74
|
+
const READ_ONLY_EVENT_READERS = new WeakMap();
|
|
68
75
|
|
|
69
76
|
export class EvolutionLedgerV2ManifestBackendError extends Error {
|
|
70
77
|
constructor(code, message, options = undefined) {
|
|
@@ -619,11 +626,122 @@ export function createEvolutionLedgerV2ManifestBackend(options = undefined) {
|
|
|
619
626
|
catalog,
|
|
620
627
|
headStore,
|
|
621
628
|
witnessAdapter,
|
|
629
|
+
segmentStore,
|
|
622
630
|
boundaries: null,
|
|
631
|
+
captureReferencedInventory() {
|
|
632
|
+
// Inspection must not repair a partial checkpoint or publish any state.
|
|
633
|
+
const read = () => {
|
|
634
|
+
const boundaries = hasEvolutionLedgerV2ManifestDirectoryBoundaries(
|
|
635
|
+
backend,
|
|
636
|
+
)
|
|
637
|
+
? captureEvolutionLedgerV2ManifestDirectoryBoundaries(backend)
|
|
638
|
+
: null;
|
|
639
|
+
const witness =
|
|
640
|
+
captureEvolutionLedgerV2ManifestWitnessDirectoryBoundaries(backend);
|
|
641
|
+
const retained =
|
|
642
|
+
captureEvolutionLedgerV2RetainedSegmentDirectoryBoundary(backend);
|
|
643
|
+
const recheckDirectories = () => {
|
|
644
|
+
boundaries?.catalog.recheck();
|
|
645
|
+
boundaries?.head.recheck();
|
|
646
|
+
witness?.recheck();
|
|
647
|
+
retained?.recheck();
|
|
648
|
+
};
|
|
649
|
+
const before = coherentSnapshot(catalog, headStore, witnessAdapter);
|
|
650
|
+
if (before.head === null)
|
|
651
|
+
throw failure(
|
|
652
|
+
EVOLUTION_LEDGER_V2_MANIFEST_INVALID_CODE,
|
|
653
|
+
"an empty manifest chain has no referenced inventory",
|
|
654
|
+
);
|
|
655
|
+
const snapshot = inspectEvolutionLedgerReferencedSegmentInventory({
|
|
656
|
+
authority: manifestAuthority,
|
|
657
|
+
descriptor: normalizedDescriptor,
|
|
658
|
+
head: before.head,
|
|
659
|
+
manifests: catalog.list(),
|
|
660
|
+
segmentStore,
|
|
661
|
+
});
|
|
662
|
+
const after = coherentSnapshot(catalog, headStore, witnessAdapter);
|
|
663
|
+
if (canonical(before) !== canonical(after))
|
|
664
|
+
throw failure(
|
|
665
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
666
|
+
"manifest checkpoint changed during referenced inventory readback",
|
|
667
|
+
);
|
|
668
|
+
recheckDirectories();
|
|
669
|
+
return snapshot;
|
|
670
|
+
};
|
|
671
|
+
const snapshot = read();
|
|
672
|
+
return Object.freeze({
|
|
673
|
+
snapshot,
|
|
674
|
+
recheck(...args) {
|
|
675
|
+
if (args.length)
|
|
676
|
+
throw new TypeError(
|
|
677
|
+
"referenced inventory takes no replacement context",
|
|
678
|
+
);
|
|
679
|
+
if (read().inventoryDigest !== snapshot.inventoryDigest)
|
|
680
|
+
throw failure(
|
|
681
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
682
|
+
"referenced segment inventory changed after capture",
|
|
683
|
+
);
|
|
684
|
+
return true;
|
|
685
|
+
},
|
|
686
|
+
});
|
|
687
|
+
},
|
|
623
688
|
});
|
|
689
|
+
const readOnlyWitness =
|
|
690
|
+
getEvolutionLedgerManifestWitnessReadOnlyReader(witnessAdapter);
|
|
691
|
+
if (
|
|
692
|
+
readOnlyWitness !== null &&
|
|
693
|
+
hasEvolutionLedgerV2ManifestDirectoryBoundaries(backend)
|
|
694
|
+
)
|
|
695
|
+
READ_ONLY_EVENT_READERS.set(
|
|
696
|
+
backend,
|
|
697
|
+
Object.freeze((...args) => {
|
|
698
|
+
if (args.length)
|
|
699
|
+
throw new TypeError(
|
|
700
|
+
"read-only manifest events take no replacement context",
|
|
701
|
+
);
|
|
702
|
+
const retention =
|
|
703
|
+
captureEvolutionLedgerV2RetainedSegmentDirectoryBoundary(backend);
|
|
704
|
+
if (retention === null) return null;
|
|
705
|
+
const directories =
|
|
706
|
+
captureEvolutionLedgerV2ManifestDirectoryBoundaries(backend);
|
|
707
|
+
const witnessDirectories =
|
|
708
|
+
captureEvolutionLedgerV2ManifestWitnessDirectoryBoundaries(backend);
|
|
709
|
+
const observer = Object.freeze({ read: readOnlyWitness });
|
|
710
|
+
const before = coherentSnapshot(catalog, headStore, observer);
|
|
711
|
+
if (before.head === null)
|
|
712
|
+
throw failure(
|
|
713
|
+
EVOLUTION_LEDGER_V2_MANIFEST_INVALID_CODE,
|
|
714
|
+
"read-only manifest events require a committed head",
|
|
715
|
+
);
|
|
716
|
+
const result = readEvolutionLedgerManifestEvents({
|
|
717
|
+
authority: manifestAuthority,
|
|
718
|
+
descriptor: normalizedDescriptor,
|
|
719
|
+
head: before.head,
|
|
720
|
+
manifests: catalog.list(),
|
|
721
|
+
segmentStore,
|
|
722
|
+
});
|
|
723
|
+
const after = coherentSnapshot(catalog, headStore, observer);
|
|
724
|
+
if (canonical(before) !== canonical(after))
|
|
725
|
+
throw failure(
|
|
726
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
727
|
+
"manifest checkpoint changed during read-only event capture",
|
|
728
|
+
);
|
|
729
|
+
directories.catalog.recheck();
|
|
730
|
+
directories.head.recheck();
|
|
731
|
+
witnessDirectories.recheck();
|
|
732
|
+
retention.recheck();
|
|
733
|
+
return result;
|
|
734
|
+
}),
|
|
735
|
+
);
|
|
624
736
|
return backend;
|
|
625
737
|
}
|
|
626
738
|
|
|
739
|
+
export function getEvolutionLedgerV2ReadOnlyEventsReader(value) {
|
|
740
|
+
if (arguments.length !== 1 || !ORIGINAL_MANIFEST_COMPONENTS.has(value))
|
|
741
|
+
throw new TypeError("one original v2 manifest backend is required");
|
|
742
|
+
return READ_ONLY_EVENT_READERS.get(value) ?? null;
|
|
743
|
+
}
|
|
744
|
+
|
|
627
745
|
/** Local metadata only. Capturing these components does not authenticate state. */
|
|
628
746
|
export function hasEvolutionLedgerV2ManifestDirectoryBoundaries(value) {
|
|
629
747
|
const components = ORIGINAL_MANIFEST_COMPONENTS.get(value);
|
|
@@ -673,3 +791,126 @@ export function captureEvolutionLedgerV2ManifestBackend(value) {
|
|
|
673
791
|
export function isEvolutionLedgerV2ManifestBackend(value) {
|
|
674
792
|
return BACKENDS.has(value);
|
|
675
793
|
}
|
|
794
|
+
|
|
795
|
+
export function captureEvolutionLedgerV2RetainedSegmentDirectoryBoundary(
|
|
796
|
+
value,
|
|
797
|
+
) {
|
|
798
|
+
if (arguments.length !== 1 || !ORIGINAL_MANIFEST_COMPONENTS.has(value))
|
|
799
|
+
throw new TypeError("one original v2 manifest backend is required");
|
|
800
|
+
return captureImmutableLedgerSegmentStoreDirectoryBoundary(
|
|
801
|
+
ORIGINAL_MANIFEST_COMPONENTS.get(value).segmentStore,
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/** Original factory chain only; caller-supplied manifests cannot trim inventory. */
|
|
806
|
+
export function captureEvolutionLedgerV2ReferencedSegmentInventory(value) {
|
|
807
|
+
if (arguments.length !== 1 || !ORIGINAL_MANIFEST_COMPONENTS.has(value))
|
|
808
|
+
throw new TypeError("one original v2 manifest backend is required");
|
|
809
|
+
return ORIGINAL_MANIFEST_COMPONENTS.get(value).captureReferencedInventory();
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/** Full local retention audit is explicit; ordinary referenced replay is unchanged. */
|
|
813
|
+
export function captureEvolutionLedgerV2LocalRetentionInventory(value) {
|
|
814
|
+
if (arguments.length !== 1 || !ORIGINAL_MANIFEST_COMPONENTS.has(value))
|
|
815
|
+
throw new TypeError("one original v2 manifest backend is required");
|
|
816
|
+
const components = ORIGINAL_MANIFEST_COMPONENTS.get(value);
|
|
817
|
+
const read = () => {
|
|
818
|
+
const files = captureImmutableLedgerSegmentStoreFileInventory(
|
|
819
|
+
components.segmentStore,
|
|
820
|
+
);
|
|
821
|
+
if (files === null) return null;
|
|
822
|
+
const before = coherentSnapshot(
|
|
823
|
+
components.catalog,
|
|
824
|
+
components.headStore,
|
|
825
|
+
components.witnessAdapter,
|
|
826
|
+
);
|
|
827
|
+
const references = components.captureReferencedInventory();
|
|
828
|
+
const after = coherentSnapshot(
|
|
829
|
+
components.catalog,
|
|
830
|
+
components.headStore,
|
|
831
|
+
components.witnessAdapter,
|
|
832
|
+
);
|
|
833
|
+
if (
|
|
834
|
+
canonical(before) !== canonical(after) ||
|
|
835
|
+
before.head?.headDigest !== references.snapshot.head.headDigest
|
|
836
|
+
)
|
|
837
|
+
throw failure(
|
|
838
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
839
|
+
"manifest checkpoint changed during local retention audit",
|
|
840
|
+
);
|
|
841
|
+
const referenced = new Map(
|
|
842
|
+
references.snapshot.entries.map((entry) => [entry.segmentRef, entry]),
|
|
843
|
+
);
|
|
844
|
+
const entries = files.snapshot.entries.map((entry) => {
|
|
845
|
+
const reference = referenced.get(entry.segmentRef);
|
|
846
|
+
if (reference) {
|
|
847
|
+
if (
|
|
848
|
+
[
|
|
849
|
+
"contentDigest",
|
|
850
|
+
"proofDigest",
|
|
851
|
+
"storageVersion",
|
|
852
|
+
"sequenceStart",
|
|
853
|
+
"sequenceEnd",
|
|
854
|
+
"payloadBytes",
|
|
855
|
+
].some((field) => reference[field] !== entry[field])
|
|
856
|
+
)
|
|
857
|
+
throw failure(
|
|
858
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
859
|
+
"referenced segment differs from the complete local file inventory",
|
|
860
|
+
);
|
|
861
|
+
referenced.delete(entry.segmentRef);
|
|
862
|
+
}
|
|
863
|
+
return Object.freeze({
|
|
864
|
+
...entry,
|
|
865
|
+
disposition: reference ? "referenced" : "unreferenced-retained",
|
|
866
|
+
manifestDigest: reference?.manifestDigest ?? null,
|
|
867
|
+
});
|
|
868
|
+
});
|
|
869
|
+
if (referenced.size)
|
|
870
|
+
throw failure(
|
|
871
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
872
|
+
"referenced segments are missing from local file inventory",
|
|
873
|
+
);
|
|
874
|
+
// After ALL signing/verifier callbacks, check captured files without invoking
|
|
875
|
+
// those callbacks again. This is still a sequential, local state window.
|
|
876
|
+
files.recheckPhysicalSnapshot();
|
|
877
|
+
const core = Object.freeze({
|
|
878
|
+
schema: "chainlesschain.evolution-local-retention-audit/v1",
|
|
879
|
+
scope: "original-local-retention-directory-and-current-manifest-chain",
|
|
880
|
+
head: references.snapshot.head,
|
|
881
|
+
directoryInventoryDigest: files.snapshot.inventoryDigest,
|
|
882
|
+
referencedInventoryDigest: references.snapshot.inventoryDigest,
|
|
883
|
+
entries: Object.freeze(entries),
|
|
884
|
+
fileCount: entries.length,
|
|
885
|
+
referencedCount: references.snapshot.segmentCount,
|
|
886
|
+
unreferencedCount: entries.length - references.snapshot.segmentCount,
|
|
887
|
+
totalEncodedBytes: files.snapshot.totalEncodedBytes,
|
|
888
|
+
totalPayloadBytes: files.snapshot.totalPayloadBytes,
|
|
889
|
+
localDirectoryInventoryVerified: true,
|
|
890
|
+
externalWormVerified: false,
|
|
891
|
+
fullPhysicalStorageGraphVerified: false,
|
|
892
|
+
grantsMutationOrPromotionAuthority: false,
|
|
893
|
+
});
|
|
894
|
+
return Object.freeze({
|
|
895
|
+
...core,
|
|
896
|
+
auditDigest: `sha256:${createHash("sha256").update(`${core.schema}\0`).update(canonical(core)).digest("hex")}`,
|
|
897
|
+
});
|
|
898
|
+
};
|
|
899
|
+
const snapshot = read();
|
|
900
|
+
if (snapshot === null) return null;
|
|
901
|
+
return Object.freeze({
|
|
902
|
+
snapshot,
|
|
903
|
+
recheck(...args) {
|
|
904
|
+
if (args.length)
|
|
905
|
+
throw new TypeError(
|
|
906
|
+
"local retention audit takes no replacement context",
|
|
907
|
+
);
|
|
908
|
+
if (read().auditDigest !== snapshot.auditDigest)
|
|
909
|
+
throw failure(
|
|
910
|
+
EVOLUTION_LEDGER_V2_MANIFEST_CORRUPT_CODE,
|
|
911
|
+
"local retention inventory changed after capture",
|
|
912
|
+
);
|
|
913
|
+
return true;
|
|
914
|
+
},
|
|
915
|
+
});
|
|
916
|
+
}
|