chainlesschain 0.166.149 → 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 +33 -5
- 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-BjBY1txq.js → AIOps-CraNGNgc.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CS2ov4iK.js → ActionButton-C0jn6sgg.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-C9LS7ahG.js → Analytics-DVrR_wjl.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-4_s9gBVg.js → AppLayout-CeKP8mgC.js} +1 -1
- package/src/assets/web-panel/assets/{Artifacts-CwS17ayg.js → Artifacts-OHCS9wLN.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-D3QMRsd-.js → Audit-C77b6pDl.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-Bxau9H9Q.js → BackgroundAgents-CefiwCgM.js} +1 -1
- package/src/assets/web-panel/assets/{Backup--YSJyAuP.js → Backup-B-5KmWNA.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-DZolkmdu.js → BaseInput-C3bJ1Qlc.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-DA-7fNKq.js → Chat-DBahPz9B.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-DniEWT5j.js → ChatBubbleRenderer-J4BVVrXZ.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-B4hgbnOB.js → Checkbox-w856fzfY.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BQ3HSq9S.js → Codegen-XKmsL_C3.js} +1 -1
- package/src/assets/web-panel/assets/{Col-DJwxq_Wu.js → Col-B37-gr7d.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DZYVM_iz.js → Community-DdahlN0f.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-1Yq5o53N.js → Compact-oKnoE-9_.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-52Per8mR.js → Compliance-CnCRlOB_.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-BaCNxzo7.js → Cowork-D3Vr5R3E.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-DADTMPPr.js → Cron-X46CdLRQ.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-CS3rx96X.js → Crosschain-CV3_6jVw.js} +1 -1
- package/src/assets/web-panel/assets/{DID-B8eatIvd.js → DID-Kr6H4WKr.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-0vsurC1X.js → Dashboard-Bj4usrhx.js} +1 -1
- package/src/assets/web-panel/assets/{Dropdown-BULy3ccq.js → Dropdown-V3DPV21D.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-CcwgCUpu.js → EmailListRenderer-8MCX0Y4b.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-DLs_6II3.js → EvolutionSettings-SUoykpjc.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-DpUpWwQP.js → FamilyGuardDashboard-C0iE0T9x.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-6hx8MMYA.js → Federation-CSU3kpK2.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-CsdE-ZR5.js → FormItemContext-Bcv2XJNw.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DzXneQPV.js → GenericCardRenderer-PdEqwQZd.js} +1 -1
- package/src/assets/web-panel/assets/{Git-D_ThKL1Q.js → Git-CVZ0MSRN.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-BFBSlr-9.js → Governance-CF64-eGc.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-BAI0b1Jl.js → Inference-DJ1J40Th.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-CpO6Bdtr.js → KnowledgeGraph-Cf3ULXmf.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-BcRaS_HC.js → Logs-DM_RbXG_.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-CmZaA7Ct.js → MarkdownRenderer-B2wey_j8.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-BpHBn0Nw.js → Marketplace-tqdANxLa.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-auVxEYSE.js → McpTools-BiSYAtKB.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-DpCyb656.js → Memory-hOvA-Tqp.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-CEIGi769.js → MobileBridge-CIpwBK6G.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-pphH0a8n.js → MobileProjects-DMpV98oD.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-CMJXBEp1.js → Mtc-CVoJZMuY.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-BI25yvzM.js → MtcAudit-Dz9YsrvV.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-BhMDExsQ.js → Multisig-CamW3sTK.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-CatOR9Ez.js → NLProgramming-DlZo8q6W.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-BHG6SBpu.js → Notes-DZJSYibx.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-BB-m0AbL.js → NotificationSettings-BSlIIGOM.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-W-WReAih.js → OrderTableRenderer-Bo9vImgU.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-BkQCgon_.js → Organization-B1sBf0Kk.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-kCTwPrIc.js → Overflow-CD8GUNOV.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CvOF8whc.js → P2P-CeaIuSa9.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-DYkTzn6u.js → PdhVaultBrowser-DCOkcRse.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-F-UzeWVt.js → Permissions-DQCZnN_y.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-BURpZBb6.js → PersonalDataHub-D_9PtVvT.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-lZYx_7qc.js → Pipeline-BawUxj0i.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-DdfYgt1_.js → Privacy-CPyw19Ai.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DbMBCojn.js → ProjectInit-GDtYLbL6.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-DPGbzkyi.js → ProjectSettings-DhmGKXVL.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-B9-t2ofM.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-BIth1Lij.js → QrScannerModal-Dcqm-i6j.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-C928WbdK.js → QuickAsk-C6uPAeAE.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CzDNsNPZ.js → Recommend-ClVlhga7.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-CedjOslI.js → RemoteSession-2raJDKUb.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-B8ggKVtj.js → Reputation-BYWC8k3t.js} +1 -1
- package/src/assets/web-panel/assets/{Row-Cx167nF6.js → Row-Bv7Y68ai.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-Cj8hwiLP.js → RssFeed-Ba54MKvz.js} +1 -1
- package/src/assets/web-panel/assets/{Search-Dsyrkogu.js → Search-B9EkRkZK.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DfOcWFt-.js → Security-DuXQGU4o.js} +1 -1
- package/src/assets/web-panel/assets/{Services-CSyv-JgS.js → Services-DJnCtY8x.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-B0chhFP5.js → Skeleton-BVDdtf_S.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-B_jrR_AF.js → Skills-DGkYCesm.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-krP10aUI.js → Sla-CHND6lwC.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-Cm_Cjvf2.js → SpeechSettings-Bg0Bgy9c.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-Cmb-KoqG.js → SyncSettings-DwtcZ2Ml.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-DUOiwTxY.js → Tasks-BoHc0cP2.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-DcEPspsP.js → Templates-DAMs4m8X.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-Dw93LtrE.js → Tenant-DkVQbOzT.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-B04i0AIG.js → Terminal-BTOLM8Yu.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-C-aAORNK.js → TimelineRenderer-BO5ZyxUU.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-W1RBfDKb.js → Tokens-D0LjCtSA.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-BuuH9sMn.js → Trigger-DgGXg9VB.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Bma-Vz-f.js → Trust-BAEQrND-.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-CqWw3_ha.js → UkeySign-TtBclFRw.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-6NYmQRUe.js → VideoEditing-ByxvpIpS.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-CTUuBxsr.js → Wallet-CTa7jqur.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-D8mN5UQU.js → WebAuthn-oHbCSjrD.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-DOB46XMH.js → WorkflowEditor-DQKQAdUS.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BPNlNLwi.js → chat-BcCU2FuK.js} +1 -1
- package/src/assets/web-panel/assets/{colors-D-LNng0Q.js → colors-BcXAFjHT.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-Vkl3KOAb.js → compact-item-GhZzQppm.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-CFsJ9Bmp.js → createContext-Bc6nwTUy.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-C1v7eiIB.js → hasIn-DRH8Xt0Y.js} +1 -1
- package/src/assets/web-panel/assets/{index-BGyhWFpc.js → index-60aCmptm.js} +1 -1
- package/src/assets/web-panel/assets/{index-BefXafSw.js → index-B7hScRVB.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dq9SDl82.js → index-BDIN9KWp.js} +1 -1
- package/src/assets/web-panel/assets/{index-BQr5mmyc.js → index-BEQha9Ur.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cjxxw-1P.js → index-BFFyqn3k.js} +1 -1
- package/src/assets/web-panel/assets/{index-MGJzHAw_.js → index-BOquBdmK.js} +1 -1
- package/src/assets/web-panel/assets/{index-DbmhJVc3.js → index-BQ6b5kJR.js} +1 -1
- package/src/assets/web-panel/assets/{index-DFErisPY.js → index-BaUmYzDB.js} +1 -1
- package/src/assets/web-panel/assets/{index-9JeeBF92.js → index-Bb5XCEKT.js} +1 -1
- package/src/assets/web-panel/assets/{index-ChGe005u.js → index-BdOccG1D.js} +1 -1
- package/src/assets/web-panel/assets/{index-BObyCZ2w.js → index-Bebe5WYu.js} +1 -1
- package/src/assets/web-panel/assets/index-BlS3EjXM.js +1 -0
- package/src/assets/web-panel/assets/{index-CaJvbmCw.js → index-BsRmNZCk.js} +1 -1
- package/src/assets/web-panel/assets/{index-CD8egQCF.js → index-CB1Thk9t.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmkppTkH.js → index-CSHz8UnK.js} +1 -1
- package/src/assets/web-panel/assets/{index-a_H30VZX.js → index-Cexk6Y1r.js} +1 -1
- package/src/assets/web-panel/assets/{index-hBzgHVea.js → index-CtC-B6Zy.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZ16Oxcu.js → index-D08s-CJ_.js} +1 -1
- package/src/assets/web-panel/assets/{index-PiL6D-FC.js → index-D6B_ELy6.js} +1 -1
- package/src/assets/web-panel/assets/{index-BoZnaD3Q.js → index-D6pWvvp-.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMcTUbpz.js → index-D9QfJDQg.js} +1 -1
- package/src/assets/web-panel/assets/{index-BiPmMm38.js → index-DCCEt-pU.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMsRfvkp.js → index-DCgr2bDL.js} +1 -1
- package/src/assets/web-panel/assets/{index-BgvrlrtJ.js → index-DNi_t23H.js} +1 -1
- package/src/assets/web-panel/assets/{index-DgYmI2pD.js → index-DOBzu5UO.js} +1 -1
- package/src/assets/web-panel/assets/{index-0oRhV07J.js → index-DOtNt1m7.js} +1 -1
- package/src/assets/web-panel/assets/{index-DmUZGqe2.js → index-DQnXn3vs.js} +1 -1
- package/src/assets/web-panel/assets/{index-DuIfomtv.js → index-DXip1xUj.js} +1 -1
- package/src/assets/web-panel/assets/{index-PCe8NA3J.js → index-DoRIPzwv.js} +1 -1
- package/src/assets/web-panel/assets/index-DwIMwROa.js +1 -0
- package/src/assets/web-panel/assets/{index-Dd0OgZmt.js → index-Dzh9Ud2R.js} +3 -3
- package/src/assets/web-panel/assets/{index-BH5PxoVq.js → index-DzhMohzV.js} +1 -1
- package/src/assets/web-panel/assets/{index-CfVl0Oqt.js → index-IW9dUJK_.js} +1 -1
- package/src/assets/web-panel/assets/{index-BPwv3l6X.js → index-WrMfehhj.js} +1 -1
- package/src/assets/web-panel/assets/{index-uDSUo2y2.js → index-gvsatTPZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BVHaJNpn.js → index-lEDZUWRO.js} +1 -1
- package/src/assets/web-panel/assets/{index-5oK4ICcR.js → index-mqlLcSgP.js} +1 -1
- package/src/assets/web-panel/assets/{index-BxJC59QT.js → index-owU4npmQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-DVfUt2bK.js → index-wnmY4P7_.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-CCYgHcTH.js → initDefaultProps-DfHPrIA5.js} +1 -1
- package/src/assets/web-panel/assets/{motion-4Yr4ZkjE.js → motion-CCzrK3c5.js} +1 -1
- package/src/assets/web-panel/assets/{move-ZP90E-ji.js → move-B2uu6I9f.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-s0N3WyRA.js → mtc-parser-DtFu2-C_.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BZ6gx9Kf.js → omit-BFjLuAHb.js} +1 -1
- package/src/assets/web-panel/assets/parsers-DftYMnlk.js +3 -0
- package/src/assets/web-panel/assets/{pickAttrs-DxUtFOOQ.js → pickAttrs-DfsjYq45.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-Btzjn1hK.js → placementArrow-CDdYIVXw.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DYcoe1XJ.js → responsiveObserve-CfrplFjn.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BiBewdr4.js → slide-DHNX5Xwt.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-D9vt0dkG.js → statusUtils-BI-C3SSk.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BXsm_vG0.js → styleChecker-C5Y3Oyy2.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-CIG8zET4.js → useFlexGapSupport-atF45w0U.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-ChFPF8GI.js → useFs-C4M8-xm9.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-D4CzWJhY.js → usePersonalDataHub-jjZdnfs_.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-6V5tphk5.js → vnode-BRTSCmU3.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-B2H_VwfU.js → zoom-BaS5ZYRC.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/llm.js +45 -0
- package/src/commands/setup.js +100 -47
- package/src/data/changelog.json +91 -0
- package/src/gateways/ws/message-dispatcher.js +68 -0
- package/src/lib/config-manager.js +23 -5
- package/src/lib/config-schema.js +10 -5
- 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 +111 -6
- package/src/lib/evolution/evolution-immutable-ledger-segment-store.js +112 -0
- package/src/lib/evolution/evolution-ledger-file-backend.js +18 -1
- package/src/lib/evolution/evolution-ledger-manifest-chain.js +65 -1
- package/src/lib/evolution/evolution-ledger-manifest-witness-adapter.js +41 -2
- package/src/lib/evolution/evolution-ledger-v2-journal.js +126 -0
- package/src/lib/evolution/evolution-ledger-v2-manifest-backend.js +261 -2
- 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 +216 -12
- package/src/lib/evolution/rrsi-tenant-index-anchor-history.js +30 -0
- package/src/lib/lk-account-api.cjs +245 -0
- package/src/lib/lk-account.js +20 -0
- package/src/lib/lk-model-catalog.json +1840 -0
- package/src/lib/llm-channel-presets.js +111 -0
- package/src/lib/llm-connection-config.js +110 -19
- 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-CpAXh_6c.css +0 -1
- package/src/assets/web-panel/assets/Providers-q9dSBLsP.js +0 -1
- package/src/assets/web-panel/assets/index-CLafGdQC.js +0 -1
- package/src/assets/web-panel/assets/index-DYHw3Xoi.js +0 -1
- package/src/assets/web-panel/assets/parsers-YNLm7sQ0.js +0 -4
|
@@ -17,6 +17,15 @@ import {
|
|
|
17
17
|
import { withFileLock } from "../with-file-lock.js";
|
|
18
18
|
import { isLocalUiEvolutionFileSystem } from "./evolution-windows-directory-durability.js";
|
|
19
19
|
import { isProductionEvolutionFileSystem } from "./evolution-private-storage.js";
|
|
20
|
+
import { getEvolutionFileWitnessReadOnlyReader } from "./evolution-file-witness.js";
|
|
21
|
+
import {
|
|
22
|
+
EVOLUTION_LEDGER_WITNESS_SCHEMA,
|
|
23
|
+
EVOLUTION_LEDGER_WITNESS_ANCESTRY_SCHEMA,
|
|
24
|
+
} from "./evolution-witness-contracts.js";
|
|
25
|
+
export {
|
|
26
|
+
EVOLUTION_LEDGER_WITNESS_SCHEMA,
|
|
27
|
+
EVOLUTION_LEDGER_WITNESS_ANCESTRY_SCHEMA,
|
|
28
|
+
};
|
|
20
29
|
import {
|
|
21
30
|
assertKnowledgeWikiSourceAdmission,
|
|
22
31
|
WIKI_SOURCE_ADMISSION_INVALID_CODE,
|
|
@@ -39,10 +48,6 @@ export const EVOLUTION_LEDGER_VERIFICATION_SCHEMA =
|
|
|
39
48
|
"chainlesschain.evolution-ledger-verification/v2";
|
|
40
49
|
export const EVOLUTION_LEDGER_QUERY_SCHEMA =
|
|
41
50
|
"chainlesschain.evolution-ledger-query-result/v1";
|
|
42
|
-
export const EVOLUTION_LEDGER_WITNESS_SCHEMA =
|
|
43
|
-
"chainlesschain.evolution-ledger-witness/v1";
|
|
44
|
-
export const EVOLUTION_LEDGER_WITNESS_ANCESTRY_SCHEMA =
|
|
45
|
-
"chainlesschain.evolution-ledger-witness-ancestry/v1";
|
|
46
51
|
export const EVOLUTION_LEDGER_STORE_MARKER_SCHEMA =
|
|
47
52
|
"chainlesschain.evolution-ledger-store-marker/v1";
|
|
48
53
|
export const EVOLUTION_LEDGER_AUDIT_EXPORT_SCHEMA =
|
|
@@ -65,6 +70,10 @@ export const EVOLUTION_LEDGER_V2_MIGRATION_INTENT =
|
|
|
65
70
|
export const EVOLUTION_LEDGER_V2_CUTOVER_COMPLETED =
|
|
66
71
|
"evolution.ledger-v2.cutover-completed";
|
|
67
72
|
const MIGRATION_SOURCES = new WeakMap();
|
|
73
|
+
const READ_ONLY_HISTORY_READERS = new WeakMap();
|
|
74
|
+
export const EVOLUTION_LEDGER_READ_ONLY_HELD_CODE =
|
|
75
|
+
"CC_EVOLUTION_LEDGER_READ_ONLY_HELD";
|
|
76
|
+
export const EVOLUTION_LEDGER_READ_ONLY_MAX_EVENTS = 10_000;
|
|
68
77
|
const DIRECTORY_BOUNDARIES = new WeakMap();
|
|
69
78
|
const VERIFIED_HISTORY_READERS = new WeakMap();
|
|
70
79
|
const DEFAULT_APPEND_PORTS = new WeakSet();
|
|
@@ -569,7 +578,7 @@ function isUnsafeAsyncResult(value) {
|
|
|
569
578
|
const descriptor = Object.getOwnPropertyDescriptor(value, "then");
|
|
570
579
|
return Boolean(
|
|
571
580
|
descriptor &&
|
|
572
|
-
|
|
581
|
+
(!("value" in descriptor) || typeof descriptor.value === "function"),
|
|
573
582
|
);
|
|
574
583
|
}
|
|
575
584
|
|
|
@@ -1975,6 +1984,7 @@ export class EvolutionLedger {
|
|
|
1975
1984
|
#verifySignature;
|
|
1976
1985
|
#verifyWitnessSignature;
|
|
1977
1986
|
#witness;
|
|
1987
|
+
#readOnlyWitness;
|
|
1978
1988
|
#witnessTrust;
|
|
1979
1989
|
|
|
1980
1990
|
constructor({
|
|
@@ -2046,6 +2056,7 @@ export class EvolutionLedger {
|
|
|
2046
2056
|
this.#trust = normalizeTrust(trust);
|
|
2047
2057
|
this.#witnessTrust = normalizeTrust(witnessTrust);
|
|
2048
2058
|
this.#witness = captureWitness(witness);
|
|
2059
|
+
this.#readOnlyWitness = getEvolutionFileWitnessReadOnlyReader(witness);
|
|
2049
2060
|
this.#clock = Object.freeze((...args) => clock(...args));
|
|
2050
2061
|
this.#lockClock = Object.freeze((...args) => lockClock(...args));
|
|
2051
2062
|
this.#random = Object.freeze((...args) => random(...args));
|
|
@@ -2352,6 +2363,48 @@ export class EvolutionLedger {
|
|
|
2352
2363
|
) {
|
|
2353
2364
|
DEFAULT_APPEND_PORTS.add(this);
|
|
2354
2365
|
}
|
|
2366
|
+
if (new.target === EvolutionLedger && this.#readOnlyWitness !== null)
|
|
2367
|
+
READ_ONLY_HISTORY_READERS.set(
|
|
2368
|
+
this,
|
|
2369
|
+
Object.freeze((...args) => {
|
|
2370
|
+
if (args.length)
|
|
2371
|
+
throw new TypeError(
|
|
2372
|
+
"read-only source history takes no replacement context",
|
|
2373
|
+
);
|
|
2374
|
+
const state = this.#loadState({ readOnly: true });
|
|
2375
|
+
const frontier = deepFreeze({
|
|
2376
|
+
ledgerId: state.identity.ledgerId,
|
|
2377
|
+
identityDigest: state.identity.identityDigest,
|
|
2378
|
+
epoch: state.identity.epoch,
|
|
2379
|
+
sequence: state.head.sequence,
|
|
2380
|
+
headDigest: state.head.headDigest,
|
|
2381
|
+
anchorDigest: state.head.anchorDigest,
|
|
2382
|
+
storeMarkerDigest: state.identity.storeMarkerDigest,
|
|
2383
|
+
storeMarkerEntryDigest: state.identity.storeMarkerEntryDigest,
|
|
2384
|
+
witnessId: this.#witness.id,
|
|
2385
|
+
witnessDigest: state.witness.witnessDigest,
|
|
2386
|
+
witnessGeneration: state.witness.generation,
|
|
2387
|
+
});
|
|
2388
|
+
const hash = crypto
|
|
2389
|
+
.createHash("sha256")
|
|
2390
|
+
.update("chainlesschain.evolution-read-only-source-events/v1\0")
|
|
2391
|
+
.update(`${state.events.length}\0`);
|
|
2392
|
+
for (const event of state.events) {
|
|
2393
|
+
const json = canonicalJson(event);
|
|
2394
|
+
hash.update(`${Buffer.byteLength(json)}:`).update(json);
|
|
2395
|
+
}
|
|
2396
|
+
return deepFreeze({
|
|
2397
|
+
schema: "chainlesschain.evolution-read-only-source-history/v1",
|
|
2398
|
+
frontier,
|
|
2399
|
+
events: state.events,
|
|
2400
|
+
eventsDigest: `sha256:${hash.digest("hex")}`,
|
|
2401
|
+
readOnlyOpen: true,
|
|
2402
|
+
recoveryPerformed: false,
|
|
2403
|
+
fullPhysicalStorageGraphVerified: false,
|
|
2404
|
+
grantsMutationOrPromotionAuthority: false,
|
|
2405
|
+
});
|
|
2406
|
+
}),
|
|
2407
|
+
);
|
|
2355
2408
|
Object.freeze(this);
|
|
2356
2409
|
}
|
|
2357
2410
|
|
|
@@ -2936,7 +2989,30 @@ export class EvolutionLedger {
|
|
|
2936
2989
|
return proof;
|
|
2937
2990
|
}
|
|
2938
2991
|
|
|
2939
|
-
#readWitness() {
|
|
2992
|
+
#readWitness(readOnly = false) {
|
|
2993
|
+
if (readOnly) {
|
|
2994
|
+
if (this.#readOnlyWitness === null)
|
|
2995
|
+
throw ledgerError(
|
|
2996
|
+
EVOLUTION_LEDGER_READ_ONLY_HELD_CODE,
|
|
2997
|
+
"source witness has no original read-only reader",
|
|
2998
|
+
);
|
|
2999
|
+
let record;
|
|
3000
|
+
try {
|
|
3001
|
+
record = this.#readOnlyWitness();
|
|
3002
|
+
} catch (cause) {
|
|
3003
|
+
throw ledgerError(
|
|
3004
|
+
"CC_EVOLUTION_LEDGER_WITNESS_UNAVAILABLE",
|
|
3005
|
+
"read-only source witness failed closed",
|
|
3006
|
+
{ cause },
|
|
3007
|
+
);
|
|
3008
|
+
}
|
|
3009
|
+
if (isUnsafeAsyncResult(record))
|
|
3010
|
+
throw ledgerError(
|
|
3011
|
+
"CC_EVOLUTION_LEDGER_WITNESS_UNAVAILABLE",
|
|
3012
|
+
"read-only witness must be synchronous",
|
|
3013
|
+
);
|
|
3014
|
+
return this.#verifyWitnessRecord(record);
|
|
3015
|
+
}
|
|
2940
3016
|
return this.#callWitness("read", {
|
|
2941
3017
|
ledgerTrust: this.#trust,
|
|
2942
3018
|
witnessTrust: this.#witnessTrust,
|
|
@@ -4429,18 +4505,78 @@ export class EvolutionLedger {
|
|
|
4429
4505
|
return state;
|
|
4430
4506
|
}
|
|
4431
4507
|
|
|
4432
|
-
#loadState({
|
|
4508
|
+
#loadState({
|
|
4509
|
+
allowInitialize = false,
|
|
4510
|
+
incremental = false,
|
|
4511
|
+
readOnly = false,
|
|
4512
|
+
} = {}) {
|
|
4433
4513
|
this.#assertBoundaries();
|
|
4434
|
-
|
|
4435
|
-
|
|
4514
|
+
const held = (message) => {
|
|
4515
|
+
throw ledgerError(EVOLUTION_LEDGER_READ_ONLY_HELD_CODE, message);
|
|
4516
|
+
};
|
|
4517
|
+
const noDebris = () => {
|
|
4518
|
+
for (const directory of [
|
|
4519
|
+
this.#paths.rootDir,
|
|
4520
|
+
this.#paths.segmentDir,
|
|
4521
|
+
this.#paths.authorityRootDir,
|
|
4522
|
+
this.#paths.anchorDir,
|
|
4523
|
+
])
|
|
4524
|
+
for (const entry of this.#fs.readdirSync(directory, {
|
|
4525
|
+
withFileTypes: true,
|
|
4526
|
+
}))
|
|
4527
|
+
if (
|
|
4528
|
+
entry.name.startsWith(".stage-") ||
|
|
4529
|
+
entry.name.startsWith(".replace-") ||
|
|
4530
|
+
entry.name.endsWith(".tmp")
|
|
4531
|
+
)
|
|
4532
|
+
held("read-only source history encountered recovery debris");
|
|
4533
|
+
};
|
|
4534
|
+
const observedFiles = [];
|
|
4535
|
+
const readFile = (file, maximum, label, options = {}) => {
|
|
4536
|
+
if (!readOnly)
|
|
4537
|
+
return this.#readCanonicalFile(file, maximum, label, options);
|
|
4538
|
+
let before = null;
|
|
4539
|
+
try {
|
|
4540
|
+
before = this.#fs.lstatSync(file, { bigint: true });
|
|
4541
|
+
} catch (cause) {
|
|
4542
|
+
if (!(options.allowMissing && cause?.code === "ENOENT"))
|
|
4543
|
+
throw ledgerError(
|
|
4544
|
+
"CC_EVOLUTION_LEDGER_STORE_UNSAFE",
|
|
4545
|
+
"read-only source file is unavailable",
|
|
4546
|
+
{ cause },
|
|
4547
|
+
);
|
|
4548
|
+
}
|
|
4549
|
+
const value = this.#readCanonicalFile(file, maximum, label, options);
|
|
4550
|
+
if (value === null) {
|
|
4551
|
+
if (before !== null)
|
|
4552
|
+
held("source file disappeared during read-only capture");
|
|
4553
|
+
return null;
|
|
4554
|
+
}
|
|
4555
|
+
if (before === null)
|
|
4556
|
+
held("source file appeared during read-only capture");
|
|
4557
|
+
assertPhysicalFile(before, maximum, label);
|
|
4558
|
+
const after = this.#fs.lstatSync(file, { bigint: true });
|
|
4559
|
+
assertPhysicalFile(after, maximum, label);
|
|
4560
|
+
if (!samePhysicalFile(before, after))
|
|
4561
|
+
held("source file changed during read-only capture");
|
|
4562
|
+
observedFiles.push({
|
|
4563
|
+
file,
|
|
4564
|
+
maximum,
|
|
4565
|
+
fingerprint: physicalFileFingerprint(after),
|
|
4566
|
+
});
|
|
4567
|
+
return value;
|
|
4568
|
+
};
|
|
4569
|
+
if (readOnly) noDebris();
|
|
4570
|
+
else this.#cleanupDebris();
|
|
4571
|
+
let witnessed = this.#readWitness(readOnly);
|
|
4436
4572
|
|
|
4437
|
-
const identityFile =
|
|
4573
|
+
const identityFile = readFile(
|
|
4438
4574
|
this.#paths.identityPath,
|
|
4439
4575
|
64 * 1024,
|
|
4440
4576
|
"ledger identity",
|
|
4441
4577
|
{ allowMissing: true },
|
|
4442
4578
|
);
|
|
4443
|
-
let storeMarkerFile =
|
|
4579
|
+
let storeMarkerFile = readFile(
|
|
4444
4580
|
this.#paths.storeMarkerPath,
|
|
4445
4581
|
64 * 1024,
|
|
4446
4582
|
"store incarnation marker",
|
|
@@ -4456,12 +4592,9 @@ export class EvolutionLedger {
|
|
|
4456
4592
|
SEGMENT_FILE_PATTERN,
|
|
4457
4593
|
"segment directory",
|
|
4458
4594
|
);
|
|
4459
|
-
let headFile = this.#
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
"ledger HEAD",
|
|
4463
|
-
{ allowMissing: true },
|
|
4464
|
-
);
|
|
4595
|
+
let headFile = readFile(this.#paths.headPath, 64 * 1024, "ledger HEAD", {
|
|
4596
|
+
allowMissing: true,
|
|
4597
|
+
});
|
|
4465
4598
|
|
|
4466
4599
|
if (!identityFile) {
|
|
4467
4600
|
if (
|
|
@@ -4520,6 +4653,7 @@ export class EvolutionLedger {
|
|
|
4520
4653
|
}
|
|
4521
4654
|
if (anchorNames.length === 0 || !headFile) {
|
|
4522
4655
|
if (witnessed.status === "absent") {
|
|
4656
|
+
if (readOnly) held("source bootstrap requires recovery");
|
|
4523
4657
|
this.#recoverUnwitnessedBootstrap(
|
|
4524
4658
|
identity,
|
|
4525
4659
|
anchorNames,
|
|
@@ -4537,7 +4671,13 @@ export class EvolutionLedger {
|
|
|
4537
4671
|
);
|
|
4538
4672
|
}
|
|
4539
4673
|
|
|
4540
|
-
if (
|
|
4674
|
+
if (
|
|
4675
|
+
anchorNames.length >
|
|
4676
|
+
(readOnly
|
|
4677
|
+
? EVOLUTION_LEDGER_READ_ONLY_MAX_EVENTS
|
|
4678
|
+
: EVOLUTION_LEDGER_MAX_EVENTS) +
|
|
4679
|
+
1
|
|
4680
|
+
) {
|
|
4541
4681
|
throw ledgerError(
|
|
4542
4682
|
"CC_EVOLUTION_LEDGER_CAPACITY_EXCEEDED",
|
|
4543
4683
|
"anchor chain exceeds ledger capacity",
|
|
@@ -4550,13 +4690,10 @@ export class EvolutionLedger {
|
|
|
4550
4690
|
identity,
|
|
4551
4691
|
{ standalone: true },
|
|
4552
4692
|
);
|
|
4553
|
-
const cached =
|
|
4554
|
-
|
|
4555
|
-
anchorNames,
|
|
4556
|
-
|
|
4557
|
-
incremental,
|
|
4558
|
-
);
|
|
4559
|
-
if (!cached) {
|
|
4693
|
+
const cached = readOnly
|
|
4694
|
+
? null
|
|
4695
|
+
: this.#cachedPrefix(identity, anchorNames, segmentNames, incremental);
|
|
4696
|
+
if (!cached && !readOnly) {
|
|
4560
4697
|
const snapshotted = this.#tryStateSnapshot(
|
|
4561
4698
|
identity,
|
|
4562
4699
|
storeMarker,
|
|
@@ -4591,7 +4728,7 @@ export class EvolutionLedger {
|
|
|
4591
4728
|
}
|
|
4592
4729
|
continue;
|
|
4593
4730
|
}
|
|
4594
|
-
const anchorFile =
|
|
4731
|
+
const anchorFile = readFile(
|
|
4595
4732
|
path.join(this.#paths.anchorDir, name),
|
|
4596
4733
|
64 * 1024,
|
|
4597
4734
|
`anchor ${index}`,
|
|
@@ -4617,7 +4754,7 @@ export class EvolutionLedger {
|
|
|
4617
4754
|
|
|
4618
4755
|
const segmentName = segmentFileName(index, anchor.segmentDigest);
|
|
4619
4756
|
expectedSegments.add(segmentName);
|
|
4620
|
-
const segmentFile =
|
|
4757
|
+
const segmentFile = readFile(
|
|
4621
4758
|
path.join(this.#paths.segmentDir, segmentName),
|
|
4622
4759
|
EVOLUTION_LEDGER_MAX_EVENT_BYTES,
|
|
4623
4760
|
`event segment ${index}`,
|
|
@@ -4652,6 +4789,7 @@ export class EvolutionLedger {
|
|
|
4652
4789
|
let removedOrphan = false;
|
|
4653
4790
|
for (const name of segmentNames) {
|
|
4654
4791
|
if (expectedSegments.has(name)) continue;
|
|
4792
|
+
if (readOnly) held("unanchored source segment requires recovery");
|
|
4655
4793
|
const match = SEGMENT_FILE_PATTERN.exec(name);
|
|
4656
4794
|
const sequence = Number(match[1]);
|
|
4657
4795
|
if (sequence !== events.length + 1) {
|
|
@@ -4702,6 +4840,7 @@ export class EvolutionLedger {
|
|
|
4702
4840
|
}
|
|
4703
4841
|
let authoritativeHead = head;
|
|
4704
4842
|
if (witnessed.status === "absent") {
|
|
4843
|
+
if (readOnly) held("source witness initialization requires recovery");
|
|
4705
4844
|
if (
|
|
4706
4845
|
anchors.length !== 1 ||
|
|
4707
4846
|
events.length !== 0 ||
|
|
@@ -4749,6 +4888,7 @@ export class EvolutionLedger {
|
|
|
4749
4888
|
witnessedEvent,
|
|
4750
4889
|
);
|
|
4751
4890
|
if (witnessed.sequence < maximumAnchor.sequence) {
|
|
4891
|
+
if (readOnly) held("unwitnessed source tail requires recovery");
|
|
4752
4892
|
if (
|
|
4753
4893
|
head.anchorDigest !== witnessed.anchorDigest ||
|
|
4754
4894
|
maximumAnchor.sequence !== witnessed.sequence + 1
|
|
@@ -4802,6 +4942,7 @@ export class EvolutionLedger {
|
|
|
4802
4942
|
maximumEvent,
|
|
4803
4943
|
);
|
|
4804
4944
|
if (head.sequence < maximumAnchor.sequence) {
|
|
4945
|
+
if (readOnly) held("source HEAD requires recovery");
|
|
4805
4946
|
const bytes = serializeRecord(maximumAnchor, 64 * 1024, "head anchor");
|
|
4806
4947
|
this.#replaceHead(bytes);
|
|
4807
4948
|
authoritativeHead = maximumAnchor;
|
|
@@ -4820,6 +4961,46 @@ export class EvolutionLedger {
|
|
|
4820
4961
|
storeMarker,
|
|
4821
4962
|
witness: witnessed,
|
|
4822
4963
|
});
|
|
4964
|
+
if (readOnly) {
|
|
4965
|
+
const currentWitness = this.#readWitness(true);
|
|
4966
|
+
if (currentWitness.witnessDigest !== witnessed.witnessDigest)
|
|
4967
|
+
held("source witness changed during read-only capture");
|
|
4968
|
+
const currentHead = readFile(
|
|
4969
|
+
this.#paths.headPath,
|
|
4970
|
+
64 * 1024,
|
|
4971
|
+
"read-only source HEAD",
|
|
4972
|
+
);
|
|
4973
|
+
if (
|
|
4974
|
+
canonicalJson(currentHead.record) !== canonicalJson(authoritativeHead)
|
|
4975
|
+
)
|
|
4976
|
+
held("source HEAD changed during read-only capture");
|
|
4977
|
+
if (
|
|
4978
|
+
JSON.stringify(
|
|
4979
|
+
this.#listFiles(
|
|
4980
|
+
this.#paths.anchorDir,
|
|
4981
|
+
ANCHOR_FILE_PATTERN,
|
|
4982
|
+
"anchor directory",
|
|
4983
|
+
),
|
|
4984
|
+
) !== JSON.stringify(anchorNames) ||
|
|
4985
|
+
JSON.stringify(
|
|
4986
|
+
this.#listFiles(
|
|
4987
|
+
this.#paths.segmentDir,
|
|
4988
|
+
SEGMENT_FILE_PATTERN,
|
|
4989
|
+
"segment directory",
|
|
4990
|
+
),
|
|
4991
|
+
) !== JSON.stringify(segmentNames)
|
|
4992
|
+
)
|
|
4993
|
+
held("source immutable inventory changed during read-only capture");
|
|
4994
|
+
noDebris();
|
|
4995
|
+
for (const observed of observedFiles) {
|
|
4996
|
+
const stat = this.#fs.lstatSync(observed.file, { bigint: true });
|
|
4997
|
+
assertPhysicalFile(stat, observed.maximum, "read-only source release");
|
|
4998
|
+
if (physicalFileFingerprint(stat) !== observed.fingerprint)
|
|
4999
|
+
held("source file changed before read-only history release");
|
|
5000
|
+
}
|
|
5001
|
+
this.#assertBoundaries();
|
|
5002
|
+
return verifiedState;
|
|
5003
|
+
}
|
|
4823
5004
|
return this.#rememberState(
|
|
4824
5005
|
verifiedState,
|
|
4825
5006
|
anchorNames,
|
|
@@ -5808,6 +5989,13 @@ export function getEvolutionLedgerVerifiedHistoryReader(ledger) {
|
|
|
5808
5989
|
return VERIFIED_HISTORY_READERS.get(ledger) ?? null;
|
|
5809
5990
|
}
|
|
5810
5991
|
|
|
5992
|
+
/** A cold authenticated prefix with no lock, cleanup, snapshot fallback or recovery. */
|
|
5993
|
+
export function getEvolutionLedgerReadOnlyHistoryReader(ledger) {
|
|
5994
|
+
if (arguments.length !== 1)
|
|
5995
|
+
throw new TypeError("read-only history capture takes one original ledger");
|
|
5996
|
+
return READ_ONLY_HISTORY_READERS.get(ledger) ?? null;
|
|
5997
|
+
}
|
|
5998
|
+
|
|
5811
5999
|
/** Construction identity only: custom filesystem/lock/crash ports keep phases. */
|
|
5812
6000
|
export function hasEvolutionLedgerDefaultAppendPorts(ledger) {
|
|
5813
6001
|
return DEFAULT_APPEND_PORTS.has(ledger);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shared wire constants keep witness readers independent of ledger factories. */
|
|
2
|
+
export const EVOLUTION_LEDGER_WITNESS_SCHEMA =
|
|
3
|
+
"chainlesschain.evolution-ledger-witness/v1";
|
|
4
|
+
export const EVOLUTION_LEDGER_WITNESS_ANCESTRY_SCHEMA =
|
|
5
|
+
"chainlesschain.evolution-ledger-witness-ancestry/v1";
|
|
@@ -168,6 +168,8 @@ export function createEvolutionWitnessSegments({
|
|
|
168
168
|
const bytes = readBytes(
|
|
169
169
|
segmentPath(digest),
|
|
170
170
|
maximumHistoryBytes - storedBytes,
|
|
171
|
+
false,
|
|
172
|
+
options.readOnly === true,
|
|
171
173
|
);
|
|
172
174
|
storedBytes += bytes.length;
|
|
173
175
|
if (hash(bytes) !== digest)
|