@engramx/client 0.16.0-rc.2 → 0.16.0-rc.21
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 +69 -8
- package/dist/EngramClient.d.ts +60 -16
- package/dist/EngramClient.js +139 -70
- package/dist/EngramClient.js.map +1 -1
- package/dist/MarketClient.js.map +1 -1
- package/dist/ProfileManager.d.ts +3 -19
- package/dist/ProfileManager.js +1 -58
- package/dist/ProfileManager.js.map +1 -1
- package/dist/SessionManager.d.ts +1 -1
- package/dist/SessionManager.js.map +1 -1
- package/dist/actionReceipt.d.ts +8 -0
- package/dist/actionReceipt.js +8 -0
- package/dist/actionReceipt.js.map +1 -1
- package/dist/birthChain.d.ts +87 -0
- package/dist/birthChain.js +233 -0
- package/dist/birthChain.js.map +1 -0
- package/dist/cache.js.map +1 -1
- package/dist/certifiedAudit.d.ts +31 -0
- package/dist/certifiedAudit.js +124 -0
- package/dist/certifiedAudit.js.map +1 -1
- package/dist/claude-setup.d.ts +15 -6
- package/dist/claude-setup.js +30 -17
- package/dist/claude-setup.js.map +1 -1
- package/dist/cli.d.ts +7 -1
- package/dist/cli.js +212 -187
- package/dist/cli.js.map +1 -1
- package/dist/connect-config.d.ts +109 -0
- package/dist/connect-config.js +251 -0
- package/dist/connect-config.js.map +1 -0
- package/dist/encryption.d.ts +4 -0
- package/dist/encryption.js +7 -1
- package/dist/encryption.js.map +1 -1
- package/dist/evidence.d.ts +94 -0
- package/dist/evidence.js +352 -0
- package/dist/evidence.js.map +1 -0
- package/dist/idl.d.ts +21 -3
- package/dist/idl.js +34 -4
- package/dist/idl.js.map +1 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/ledgerfsHash.d.ts +0 -2
- package/dist/ledgerfsHash.js +0 -2
- package/dist/ledgerfsHash.js.map +1 -1
- package/dist/lineage.d.ts +7 -1
- package/dist/lineage.js +7 -1
- package/dist/lineage.js.map +1 -1
- package/dist/memoryArchive.d.ts +77 -98
- package/dist/memoryArchive.js +58 -31
- package/dist/memoryArchive.js.map +1 -1
- package/dist/migrate.d.ts +18 -30
- package/dist/migrate.js +42 -136
- package/dist/migrate.js.map +1 -1
- package/dist/openEngram.d.ts +7 -0
- package/dist/openEngram.js +27 -3
- package/dist/openEngram.js.map +1 -1
- package/dist/openclaw-local.d.ts +86 -0
- package/dist/openclaw-local.js +332 -0
- package/dist/openclaw-local.js.map +1 -0
- package/dist/openclaw-setup.d.ts +82 -3
- package/dist/openclaw-setup.js +162 -50
- package/dist/openclaw-setup.js.map +1 -1
- package/dist/pair.js.map +1 -1
- package/dist/path-utils.d.ts +0 -16
- package/dist/path-utils.js +4 -27
- package/dist/path-utils.js.map +1 -1
- package/dist/publicRecord.d.ts +5 -0
- package/dist/publicRecord.js +52 -0
- package/dist/publicRecord.js.map +1 -0
- package/dist/recordChain.d.ts +69 -0
- package/dist/recordChain.js +145 -0
- package/dist/recordChain.js.map +1 -0
- package/dist/schema.d.ts +11 -22
- package/dist/schema.js +6 -28
- package/dist/schema.js.map +1 -1
- package/dist/types.d.ts +67 -451
- package/dist/verify.d.ts +8 -0
- package/dist/verify.js +19 -0
- package/dist/verify.js.map +1 -0
- package/dist/version.d.ts +22 -0
- package/dist/version.js +22 -0
- package/dist/version.js.map +1 -1
- package/package.json +27 -12
- package/dist/generated/engram.idl.d.ts +0 -6
- package/dist/generated/engram.idl.js +0 -1366
- package/dist/generated/engram.idl.js.map +0 -1
- package/dist/generated/market.idl.d.ts +0 -6
- package/dist/generated/market.idl.js +0 -557
- package/dist/generated/market.idl.js.map +0 -1
- package/dist/generated/registry.idl.d.ts +0 -6
- package/dist/generated/registry.idl.js +0 -510
- package/dist/generated/registry.idl.js.map +0 -1
- package/dist/offline.d.ts +0 -21
- package/dist/offline.js +0 -104
- package/dist/offline.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export { verifyCertifiedAuditHead } from './certifiedAudit.js';
|
|
|
8
8
|
export { verifyCertifiedLeaf, verifyCertifiedRegistryHead, verifyCertifiedAnchor, } from './certifiedAudit.js';
|
|
9
9
|
export type { CertifiedLeaf } from './certifiedAudit.js';
|
|
10
10
|
export type { CertifiedAuditHead, VerifiedAuditHead } from './certifiedAudit.js';
|
|
11
|
+
export { verifyHistoricalCertificate, IC_MAINNET_ROOT_KEY_HEX } from './certifiedAudit.js';
|
|
12
|
+
export type { HistoricalCertificate } from './certifiedAudit.js';
|
|
13
|
+
export { recordEntryBody, recordDigest, recordLink, legacyRecordLink, recordEntryHash, sealedRowOf, walkToCertifiedHead, } from './recordChain.js';
|
|
14
|
+
export type { RecordEntryFields, SealedRow, WalkResult } from './recordChain.js';
|
|
15
|
+
export { checkEvidence, EVIDENCE_FORMAT } from './evidence.js';
|
|
16
|
+
export type { EvidenceBundle, EvidenceCheck, EvidenceLink, CheckOptions } from './evidence.js';
|
|
17
|
+
export { fetchSealedRows } from './publicRecord.js';
|
|
11
18
|
export { verifyActionReceipt, actionMessage, actionFields, enrolmentMessage, signEnrolment, } from './actionReceipt.js';
|
|
12
19
|
export type { ActionAuth, Enrolment } from './actionReceipt.js';
|
|
13
20
|
export * as Schema from './schema.js';
|
|
@@ -21,16 +28,16 @@ export type { PairOptions, PairResult } from './pair.js';
|
|
|
21
28
|
export { openEngram, NOT_ALLOWED } from './openEngram.js';
|
|
22
29
|
export type { OpenEngramOptions, OpenEngramResult, OpenEngramIO, OpenEngramEngram, } from './openEngram.js';
|
|
23
30
|
export { setupOpenClaw, OpenClawNotFoundError } from './openclaw-setup.js';
|
|
31
|
+
export { getOpenClawDir, loadOpenClawConfig, resolveMemoryDir, detectDatabases, encodeDatabaseBackup, restoreDatabaseBackup, snapshotSqliteFile, DB_TYPES, GITIGNORE_CONTENT, } from './openclaw-local.js';
|
|
32
|
+
export type { OpenClawConfig, DetectedDatabase, DbSuffix } from './openclaw-local.js';
|
|
24
33
|
export type { OpenClawSetupOptions, OpenClawSetupResult } from './openclaw-setup.js';
|
|
25
34
|
export { generateMcpConfig, claudeConfigPaths, installMcpConfig } from './claude-setup.js';
|
|
26
35
|
export type { ClaudeSetupOptions, McpConfig } from './claude-setup.js';
|
|
27
36
|
export { migrateOpenClawMemory, recoverOpenClaw, createCheckpoint, rollbackCheckpoint, listCheckpoints, hasValidPairing, resumeMigration, findIncompleteCheckpoint, } from './migrate.js';
|
|
28
37
|
export type { MigrateOptions, MigrateFileEvent, MigrateCallback, MigrateResult, RecoverResult, RollbackResult, CheckpointSummary, CheckpointMetadata, } from './migrate.js';
|
|
29
|
-
export {
|
|
30
|
-
export { LRUCache } from './cache.js';
|
|
31
|
-
export { OfflineQueue } from './offline.js';
|
|
32
|
-
export type { Role, AgentStatus, AgentPermissions, AgentRecord, ChildAllowanceRow, KeyNomination, LogPosition, HeldKey, AgentEnding, AgentEndReason, Pairing, TrackRecordNotice, EnrolmentProof, RawMemoryFile, MemoryVersionSummary, MemoryEviction, MemoryFile, MemoryFileInfo, SessionContext, MemoryHistory, MemoryRangePage, Account, AuditEntry, AuditPage, EngramStatus, OwnerConsole, EngramRecord, EngramRecordStatus, RegistryStatus, GuardianPermissions, GuardianRecord, BackupMetadata, BackupType, BackupStatus, ApprovalStatus, ApprovalRequest, } from './types.js';
|
|
38
|
+
export type { Role, AgentStatus, AgentPermissions, AgentRecord, AgentGrant, PaymentLimits, PaymentsNow, PaymentsStop, ChildAllowanceRow, KeyNomination, LogPosition, HeldKey, AgentEnding, AgentEndReason, Pairing, TrackRecordNotice, EnrolmentProof, RawMemoryFile, MemoryVersionSummary, MemoryEviction, MemoryFile, MemoryFileInfo, SessionContext, MemoryHistory, MemoryRangePage, AuditEntry, AuditPage, EngramStatus, OwnerConsole, GuardianPermissions, GuardianRecord, BackupMetadata, BackupRetention, BackupType, BackupStatus, ApprovalStatus, ApprovalRequest, } from './types.js';
|
|
33
39
|
export { verifyCanonicalLineage, classifyLineage, CANONICAL_REGISTRY_CANISTER_ID, type LineageVerdict, type CustodyMode, } from './lineage.js';
|
|
40
|
+
export { verifyBirthChain, registryBirthWitness, encodeBirthRecord, birthFingerprint, fromCandidBirthRecord, type BirthRecord, type CandidBirthRecord, type CertifiedBirthReply, type BirthLinkVerdict, type BirthChainVerdict, } from './birthChain.js';
|
|
34
41
|
export { chunkHash, deltaHash, contentRoot, merkle, leaf, evictedRoot, opsRoot, eventHash, eventPreambleAndBody, manifestBytes, opBody, opTag, toHex, type Hash as LedgerFsHash, type ChunkRef as LedgerFsChunkRef, type Manifest as LedgerFsManifest, type Op as LedgerFsOp, type Event as LedgerFsEvent, type ImportNote as LedgerFsImportNote, } from './ledgerfsHash.js';
|
|
35
|
-
export { assembleMemoryArchive, verifyMemoryArchive, recomputeOpsRoot, memoryLogEventHash, toLedgerFsEvent,
|
|
36
|
-
export type { MemoryLogEvent, MemoryLogOp, MemoryLogImportNote, MemoryLogManifest, MemoryLogChunkRef, MemoryLogPage, MemoryLogPageFetcher, MemoryExportReceipt, MemoryCondenseResult, MemoryCondensePreview, MemoryReceiptRef, MemoryExportReceiptRow, MemoryCheckpointRow, MemoryArchive, MemoryArchiveVerification, AssembleArchiveOptions, OpsRootAttestation, } from './memoryArchive.js';
|
|
42
|
+
export { assembleMemoryArchive, verifyMemoryArchive, recomputeOpsRoot, memoryLogEventHash, toLedgerFsEvent, } from './memoryArchive.js';
|
|
43
|
+
export type { MemoryLogEvent, MemoryLogOp, MemoryLogImportNote, MemoryLogManifest, MemoryLogChunkRef, MemoryLogPage, MemoryLogEventPage, MemoryLogPageFetcher, MemoryExportReceipt, MemoryCondenseResult, MemoryCondensePreview, MemoryReceiptRef, MemoryExportReceiptRow, MemoryCheckpointRow, MemoryArchive, MemoryArchiveVerification, AssembleArchiveOptions, OpsRootAttestation, } from './memoryArchive.js';
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,14 @@ export { verifyCertifiedAuditHead } from './certifiedAudit.js';
|
|
|
9
9
|
// Tree-format verification (registry ≥ 0.7.17): the registry's certified_data is a merkle root and
|
|
10
10
|
// its bare-head method was REMOVED (loud break). Engram/cashier slots keep verifyCertifiedAuditHead.
|
|
11
11
|
export { verifyCertifiedLeaf, verifyCertifiedRegistryHead, verifyCertifiedAnchor, } from './certifiedAudit.js';
|
|
12
|
+
// ⟨2026-10-15, the owner's ruling 6B of 2026-10-14⟩ Checking one record entry without the owner: the
|
|
13
|
+
// historical-certificate check (any age, signed time read, pinned mainnet key), the record's hash
|
|
14
|
+
// contract and the walk to a certified head, and the evidence bundle a writer captures and anyone
|
|
15
|
+
// checks (`engramx verify`). recordChain and the certificate check are also on `./verify`.
|
|
16
|
+
export { verifyHistoricalCertificate, IC_MAINNET_ROOT_KEY_HEX } from './certifiedAudit.js';
|
|
17
|
+
export { recordEntryBody, recordDigest, recordLink, legacyRecordLink, recordEntryHash, sealedRowOf, walkToCertifiedHead, } from './recordChain.js';
|
|
18
|
+
export { checkEvidence, EVIDENCE_FORMAT } from './evidence.js';
|
|
19
|
+
export { fetchSealedRows } from './publicRecord.js';
|
|
12
20
|
// Owner-action receipts (D1), VERIFY half only. An owner authorizes a money-path action by signing
|
|
13
21
|
// a canonical, domain-separated message with their IC identity key; the engram persists it into the
|
|
14
22
|
// tamper-evident audit log. Whoever later reads that log is a relying party, and this is what they
|
|
@@ -42,11 +50,12 @@ export { pair, PairError } from './pair.js';
|
|
|
42
50
|
// ⟨2026-10-01, the owner's ruling 2 A⟩ The open-engram command, for an agent that runs it without the CLI.
|
|
43
51
|
export { openEngram, NOT_ALLOWED } from './openEngram.js';
|
|
44
52
|
export { setupOpenClaw, OpenClawNotFoundError } from './openclaw-setup.js';
|
|
53
|
+
// ⟨2026-10-13, the bloat audit⟩ Where OpenClaw keeps things on this machine, and the database backup
|
|
54
|
+
// format: the one copy, which the OpenClaw plugin imports for its backups and `migrate --recover`
|
|
55
|
+
// for its restore (openclaw-local.ts says why there were three).
|
|
56
|
+
export { getOpenClawDir, loadOpenClawConfig, resolveMemoryDir, detectDatabases, encodeDatabaseBackup, restoreDatabaseBackup, snapshotSqliteFile, DB_TYPES, GITIGNORE_CONTENT, } from './openclaw-local.js';
|
|
45
57
|
export { generateMcpConfig, claudeConfigPaths, installMcpConfig } from './claude-setup.js';
|
|
46
58
|
export { migrateOpenClawMemory, recoverOpenClaw, createCheckpoint, rollbackCheckpoint, listCheckpoints, hasValidPairing, resumeMigration, findIncompleteCheckpoint, } from './migrate.js';
|
|
47
|
-
export { resolveAndValidate, isValidCanisterId, isSafePathComponent } from './path-utils.js';
|
|
48
|
-
export { LRUCache } from './cache.js';
|
|
49
|
-
export { OfflineQueue } from './offline.js';
|
|
50
59
|
// The blind `@ic402/client` re-export block (Ic402Client, signVoucher, encodeVoucherPayload,
|
|
51
60
|
// Ic402Error, probeX402, fetchX402, findPaymentOption, broadcastTransaction, pollReceipt,
|
|
52
61
|
// registerAgent, and their types) was removed on 2026-08-17. Nothing consumed any of them: the two
|
|
@@ -58,13 +67,17 @@ export { OfflineQueue } from './offline.js';
|
|
|
58
67
|
// Canonical-lineage verification — the one-call check for agents/relying parties: is this
|
|
59
68
|
// engram canonically spawned (registry testimony), and does it run the attested template?
|
|
60
69
|
export { verifyCanonicalLineage, classifyLineage, CANONICAL_REGISTRY_CANISTER_ID, } from './lineage.js';
|
|
70
|
+
// ⟨2026-10-26⟩ Birth chains — an engram's certified ancestry: the canonical record encoding, its
|
|
71
|
+
// fingerprint, and the verifier that walks a chain and checks each fingerprint against the
|
|
72
|
+
// registry's certified tree. Also on `./verify`.
|
|
73
|
+
export { verifyBirthChain, registryBirthWitness, encodeBirthRecord, birthFingerprint, fromCandidBirthRecord, } from './birthChain.js';
|
|
61
74
|
// ledgerfs — the era-2 hash contract (§3), reimplemented here so a relying party can recompute
|
|
62
75
|
// every ledgerfs digest from the anchored chain without trusting the canister. Locked to the Motoko
|
|
63
76
|
// implementation by the `ledgerfs-goldens` cross-lock. This is the verifier surface, not a writer.
|
|
64
77
|
export { chunkHash, deltaHash, contentRoot, merkle, leaf, evictedRoot, opsRoot, eventHash, eventPreambleAndBody, manifestBytes, opBody, opTag, toHex, } from './ledgerfsHash.js';
|
|
65
78
|
// Archive — the owner's read → attest → verify → condense path over the memory log. The paging
|
|
66
79
|
// helper honours the engram's disclosed page cap and halves on a response the engram could not
|
|
67
|
-
// fit; the verifier recomputes the ops root through ledgerfsHash above, never through a second
|
|
80
|
+
// fit (⟨2026-10-07⟩ the window each page states, `items.length + withheld`, since 0.16.0); the verifier recomputes the ops root through ledgerfsHash above, never through a second
|
|
68
81
|
// copy of the hash rules. Owner-only on the canister: a log entry's `path` is inside its own hash
|
|
69
82
|
// preimage, so it cannot be redacted for a lesser caller — which is why the EngramClient wrappers
|
|
70
83
|
// over this family left in the 2026-08-17 charter diet and these module functions did not. If you
|
|
@@ -75,5 +88,9 @@ export { chunkHash, deltaHash, contentRoot, merkle, leaf, evictedRoot, opsRoot,
|
|
|
75
88
|
// `listMemoryLog`, whose page is a different envelope from `MemoryLogPage`, so it cannot be passed
|
|
76
89
|
// straight in. See the note on `MemoryLogPage` in memoryArchive.ts: that adapter is an open
|
|
77
90
|
// question, not something done here.
|
|
78
|
-
|
|
91
|
+
// ⟨RESHAPED 2026-10-07, beside the correction above — the owner's decision of that day⟩ No adapter:
|
|
92
|
+
// the walk itself reads the served page now. `MemoryLogPage` IS `listMemoryLog`'s `LogPage`, and a
|
|
93
|
+
// fetcher has that method's shape, so `assembleMemoryArchive(actor.listMemoryLog.bind(actor), opts)`
|
|
94
|
+
// with an owner-authenticated actor is the whole call.
|
|
95
|
+
export { assembleMemoryArchive, verifyMemoryArchive, recomputeOpsRoot, memoryLogEventHash, toLedgerFsEvent, } from './memoryArchive.js';
|
|
79
96
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,iGAA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AAe,EACf,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAyDtB,6FAA6F;AAC7F,0FAA0F;AAC1F,mGAAmG;AACnG,gGAAgG;AAChG,iGAAiG;AACjG,kGAAkG;AAClG,iGAAiG;AACjG,gEAAgE;AAEhE,0FAA0F;AAC1F,0FAA0F;AAC1F,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,8BAA8B,GAG/B,MAAM,cAAc,CAAC;AAEtB,iGAAiG;AACjG,2FAA2F;AAC3F,iDAAiD;AACjD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GAMtB,MAAM,iBAAiB,CAAC;AAEzB,+FAA+F;AAC/F,oGAAoG;AACpG,mGAAmG;AACnG,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,MAAM,EACN,IAAI,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,KAAK,EACL,KAAK,GAON,MAAM,mBAAmB,CAAC;AAE3B,+FAA+F;AAC/F,+FAA+F;AAC/F,mLAAmL;AACnL,kGAAkG;AAClG,kGAAkG;AAClG,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,wCAAwC;AACxC,qFAAqF;AACrF,mGAAmG;AACnG,4FAA4F;AAC5F,qCAAqC;AACrC,oGAAoG;AACpG,mGAAmG;AACnG,qGAAqG;AACrG,uDAAuD;AACvD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
package/dist/ledgerfsHash.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export declare function sle64(t: number | bigint): Uint8Array;
|
|
|
4
4
|
export declare function concat(parts: Uint8Array[]): Uint8Array;
|
|
5
5
|
export declare function lp(b: Uint8Array): Uint8Array;
|
|
6
6
|
export declare const lpText: (t: string) => Uint8Array;
|
|
7
|
-
/** Principal raw bytes, length-prefixed — attribution, never authorization. */
|
|
8
|
-
export declare const lpPrincipalRaw: (raw: Uint8Array) => Uint8Array;
|
|
9
7
|
export declare const optBytes: (v: Uint8Array | null) => Uint8Array;
|
|
10
8
|
export declare const chunkHash: (bytes: Uint8Array) => Hash;
|
|
11
9
|
/** The #append delta attestation (owner-ratified era-2 gap fill, 2026-08-11): a DISTINCT domain,
|
package/dist/ledgerfsHash.js
CHANGED
|
@@ -60,8 +60,6 @@ export function lp(b) {
|
|
|
60
60
|
}
|
|
61
61
|
const utf8 = (s) => new TextEncoder().encode(s);
|
|
62
62
|
export const lpText = (t) => lp(utf8(t));
|
|
63
|
-
/** Principal raw bytes, length-prefixed — attribution, never authorization. */
|
|
64
|
-
export const lpPrincipalRaw = (raw) => lp(raw);
|
|
65
63
|
export const optBytes = (v) => v === null ? new Uint8Array([0x00]) : concat([new Uint8Array([0x01]), v]);
|
|
66
64
|
// ── Domain-separated hash: SHA-256( ASCII(domain) ‖ 0x00 ‖ payload ) ───────────────────────────
|
|
67
65
|
function h(domain, payload) {
|
package/dist/ledgerfsHash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledgerfsHash.js","sourceRoot":"","sources":["../src/ledgerfsHash.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,wEAAwE;AACxE,EAAE;AACF,mGAAmG;AACnG,iGAAiG;AACjG,4FAA4F;AAC5F,kGAAkG;AAClG,kGAAkG;AAClG,yBAAyB;AACzB,EAAE;AACF,+FAA+F;AAC/F,mGAAmG;AACnG,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,qGAAqG;AACrG,qGAAqG;AACrG,mFAAmF;AACnF,MAAM,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AAE7B,iGAAiG;AAEjG,MAAM,UAAU,IAAI,CAAC,CAAkB;IACrC,MAAM,CAAC,GAAG,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C,CAAC,CAAC,OAAO,CAAC;QAC5B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QACX,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW;QAC/B,IAAI,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;KACb,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAQ,EAAQ,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAa,EAAU,EAAE,CAC7C,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/lineage.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type HttpAgent } from '@icp-sdk/core/agent';
|
|
2
2
|
/** The canonical registry — SET AT FLEET DEPLOY (empty until then, like @engramx/owner's
|
|
3
3
|
* config). While empty, verification without an explicit registryId reports 'indeterminate'
|
|
4
|
-
* rather than guessing.
|
|
4
|
+
* rather than guessing.
|
|
5
|
+
* ⟨CORRECTED 2026-10-13⟩ It is set: the production registry, the same id as @engramx/owner's
|
|
6
|
+
* config.ts (held equal by test/lineage.test.ts, since the owner kit imports no sibling by
|
|
7
|
+
* design). The 0.16.0 cut reinstalls that registry in place, so the id does not move. An empty
|
|
8
|
+
* registryId passed explicitly still reports 'indeterminate'. */
|
|
5
9
|
export declare const CANONICAL_REGISTRY_CANISTER_ID = "safaa-qaaaa-aaaam-qjb5a-cai";
|
|
6
10
|
export type CustodyMode = 'managed' | 'sovereign' | 'unknown';
|
|
7
11
|
export interface LineageVerdict {
|
|
@@ -33,6 +37,8 @@ export declare function classifyLineage(custody: CustodyMode | null, registryAsk
|
|
|
33
37
|
* @param opts.registryId override the canonical registry (defaults to
|
|
34
38
|
* CANONICAL_REGISTRY_CANISTER_ID; REQUIRED in practice until that constant is set at
|
|
35
39
|
* fleet deploy — without it the verdict is 'indeterminate' by design, never a guess)
|
|
40
|
+
* ⟨2026-10-13⟩ The constant is set (see it), so the default is the canonical registry; pass
|
|
41
|
+
* an id to check against a staging fleet or a fork, or '' to skip the registry.
|
|
36
42
|
*/
|
|
37
43
|
export declare function verifyCanonicalLineage(engramId: string, agent: HttpAgent, opts?: {
|
|
38
44
|
registryId?: string;
|
package/dist/lineage.js
CHANGED
|
@@ -19,7 +19,11 @@ import { Principal } from '@icp-sdk/core/principal';
|
|
|
19
19
|
import { engramSubset, registrySubset } from './idl.js';
|
|
20
20
|
/** The canonical registry — SET AT FLEET DEPLOY (empty until then, like @engramx/owner's
|
|
21
21
|
* config). While empty, verification without an explicit registryId reports 'indeterminate'
|
|
22
|
-
* rather than guessing.
|
|
22
|
+
* rather than guessing.
|
|
23
|
+
* ⟨CORRECTED 2026-10-13⟩ It is set: the production registry, the same id as @engramx/owner's
|
|
24
|
+
* config.ts (held equal by test/lineage.test.ts, since the owner kit imports no sibling by
|
|
25
|
+
* design). The 0.16.0 cut reinstalls that registry in place, so the id does not move. An empty
|
|
26
|
+
* registryId passed explicitly still reports 'indeterminate'. */
|
|
23
27
|
export const CANONICAL_REGISTRY_CANISTER_ID = 'safaa-qaaaa-aaaam-qjb5a-cai';
|
|
24
28
|
// Both lineage actors are NARROWED views of the generated interfaces rather than hand-declared
|
|
25
29
|
// shapes. These three signatures were the last hand-typed Candid left in the package and the only
|
|
@@ -46,6 +50,8 @@ export function classifyLineage(custody, registryAsked) {
|
|
|
46
50
|
* @param opts.registryId override the canonical registry (defaults to
|
|
47
51
|
* CANONICAL_REGISTRY_CANISTER_ID; REQUIRED in practice until that constant is set at
|
|
48
52
|
* fleet deploy — without it the verdict is 'indeterminate' by design, never a guess)
|
|
53
|
+
* ⟨2026-10-13⟩ The constant is set (see it), so the default is the canonical registry; pass
|
|
54
|
+
* an id to check against a staging fleet or a fork, or '' to skip the registry.
|
|
49
55
|
*/
|
|
50
56
|
export async function verifyCanonicalLineage(engramId, agent, opts = {}) {
|
|
51
57
|
const registryId = opts.registryId ?? CANONICAL_REGISTRY_CANISTER_ID;
|
package/dist/lineage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage.js","sourceRoot":"","sources":["../src/lineage.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,6FAA6F;AAC7F,mCAAmC;AACnC,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,6FAA6F;AAC7F,8FAA8F;AAC9F,8FAA8F;AAC9F,6FAA6F;AAC7F,OAAO,EAAE,KAAK,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"lineage.js","sourceRoot":"","sources":["../src/lineage.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,6FAA6F;AAC7F,mCAAmC;AACnC,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,6FAA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'./wire.js';
|
|
3
|
+
import type * as Engram from '@engramx/idl/engram';
|
|
2
4
|
import { type Event as LedgerFsEvent, type Hash } from './ledgerfsHash.js';
|
|
3
5
|
export interface MemoryLogChunkRef {
|
|
4
|
-
hash: Uint8Array;
|
|
6
|
+
hash: Uint8Array | number[];
|
|
5
7
|
size: bigint;
|
|
6
8
|
birthSeq: bigint;
|
|
7
9
|
}
|
|
8
10
|
export interface MemoryLogManifest {
|
|
9
11
|
chunks: MemoryLogChunkRef[];
|
|
10
12
|
totalSize: bigint;
|
|
11
|
-
contentRoot: Uint8Array;
|
|
13
|
+
contentRoot: Uint8Array | number[];
|
|
12
14
|
}
|
|
13
15
|
/** Why an imported entry exists — the pre-ledgerfs migration seam. All five classes. */
|
|
14
16
|
export type MemoryLogImportNote = {
|
|
15
17
|
genesis: {
|
|
16
|
-
boundTo: [] | [Uint8Array];
|
|
18
|
+
boundTo: [] | [Uint8Array | number[]];
|
|
17
19
|
};
|
|
18
20
|
} | {
|
|
19
21
|
legacyGap: {
|
|
@@ -22,20 +24,20 @@ export type MemoryLogImportNote = {
|
|
|
22
24
|
} | {
|
|
23
25
|
legacyTruncated: {
|
|
24
26
|
storedBytes: bigint;
|
|
25
|
-
prefixHash: Uint8Array;
|
|
27
|
+
prefixHash: Uint8Array | number[];
|
|
26
28
|
};
|
|
27
29
|
} | {
|
|
28
30
|
legacyDelete: null;
|
|
29
31
|
} | {
|
|
30
32
|
legacyUnreconstructable: {
|
|
31
|
-
contentHash: Uint8Array;
|
|
33
|
+
contentHash: Uint8Array | number[];
|
|
32
34
|
reason: string;
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
37
|
/** The operation one log entry records. `condense` and `exported` are store-global. */
|
|
36
38
|
export type MemoryLogOp = {
|
|
37
39
|
append: {
|
|
38
|
-
deltaHash: Uint8Array;
|
|
40
|
+
deltaHash: Uint8Array | number[];
|
|
39
41
|
deltaSize: bigint;
|
|
40
42
|
newSize: bigint;
|
|
41
43
|
};
|
|
@@ -56,21 +58,21 @@ export type MemoryLogOp = {
|
|
|
56
58
|
toVersion: bigint;
|
|
57
59
|
chunkCount: bigint;
|
|
58
60
|
byteCount: bigint;
|
|
59
|
-
evictedRoot: Uint8Array;
|
|
61
|
+
evictedRoot: Uint8Array | number[];
|
|
60
62
|
};
|
|
61
63
|
} | {
|
|
62
64
|
condense: {
|
|
63
65
|
fromSeq: bigint;
|
|
64
66
|
toSeq: bigint;
|
|
65
67
|
opCount: bigint;
|
|
66
|
-
opsRoot: Uint8Array;
|
|
67
|
-
headAtBoundary: Uint8Array;
|
|
68
|
+
opsRoot: Uint8Array | number[];
|
|
69
|
+
headAtBoundary: Uint8Array | number[];
|
|
68
70
|
};
|
|
69
71
|
} | {
|
|
70
72
|
exported: {
|
|
71
73
|
fromSeq: bigint;
|
|
72
74
|
toSeq: bigint;
|
|
73
|
-
opsRoot: Uint8Array;
|
|
75
|
+
opsRoot: Uint8Array | number[];
|
|
74
76
|
authorFilter: [] | [Principal];
|
|
75
77
|
};
|
|
76
78
|
} | {
|
|
@@ -103,9 +105,9 @@ export interface MemoryLogEvent {
|
|
|
103
105
|
*/
|
|
104
106
|
atNs: bigint;
|
|
105
107
|
size: bigint;
|
|
106
|
-
contentRoot: Uint8Array;
|
|
108
|
+
contentRoot: Uint8Array | number[];
|
|
107
109
|
/** Hash of the previous entry under the canonical (non-Candid) encoding. */
|
|
108
|
-
prev: Uint8Array;
|
|
110
|
+
prev: Uint8Array | number[];
|
|
109
111
|
}
|
|
110
112
|
/**
|
|
111
113
|
* One page of the memory log.
|
|
@@ -113,6 +115,10 @@ export interface MemoryLogEvent {
|
|
|
113
115
|
* `pageCap` is the width of the window the engram actually covered — its clamp on `max`, which
|
|
114
116
|
* sits at 256 rather than the library's 1024. It is DISCLOSED for exactly one reason: a caller
|
|
115
117
|
* that cannot see the cap cannot know whether it has the whole window. Read it, never `max`.
|
|
118
|
+
* ⟨2026-10-07, beside the paragraph above, which describes the page before 0.16.0⟩ The disclosure
|
|
119
|
+
* survives under another shape: the window is `page.items.length + page.withheld`, the entries the
|
|
120
|
+
* engram scanned for this page — the ones it returned and the ones the author filter removed. Read
|
|
121
|
+
* that, never `max`.
|
|
116
122
|
*
|
|
117
123
|
* ⚠ ⟨STALE 2026-10-05 — measured, not fixed⟩ This envelope no longer mirrors the wire, and the
|
|
118
124
|
* difference goes beyond a field name. 0.16.0 renamed `getMemoryLogPage` to `listMemoryLog`, and it
|
|
@@ -120,97 +126,47 @@ export interface MemoryLogEvent {
|
|
|
120
126
|
* `totalEvents` and `pageCap` are not served. `assembleMemoryArchive` walks by `pageCap`, and the
|
|
121
127
|
* served page has no field with that meaning. A caller therefore has to adapt `listMemoryLog` into
|
|
122
128
|
* this shape, and the adaptation decides how wide each window really was. That is a design call
|
|
123
|
-
* for the walk, not a rename. It is left open and named in test/wire-mirror.test.ts
|
|
129
|
+
* for the walk, not a rename. It is left open and named in test/wire-mirror.test.ts (⟨2026-10-13⟩
|
|
130
|
+
* deleted with the hand mirrors it policed — the owner's 3A; generated-actor-fits holds this type), which fails
|
|
124
131
|
* once this envelope matches, so the exception cannot outlive the drift. The entries themselves
|
|
125
132
|
* (`MemoryLogEvent`) do mirror the wire.
|
|
133
|
+
*
|
|
134
|
+
* ⟨RESHAPED 2026-10-07, beside the note above — the owner's decision of that day: reshape the walk
|
|
135
|
+
* to the served page, as the owner's own archive page walks it; not an adapter⟩ This now mirrors
|
|
136
|
+
* `listMemoryLog`'s reply exactly: `LogPage = { firstAvailableSeq; head; page : { items; total;
|
|
137
|
+
* withheld } }`. The fields it carried (`events`, `totalEvents`, `pageCap`) are gone, and the walk
|
|
138
|
+
* below reads the window from the page. test/wire-mirror.test.ts no longer carries an exception for
|
|
139
|
+
* this type: it must match.
|
|
126
140
|
*/
|
|
127
141
|
export interface MemoryLogPage {
|
|
128
|
-
events: MemoryLogEvent[];
|
|
129
|
-
/** Entries EVER chained, not the retained count — a condensed prefix never shortens this. */
|
|
130
|
-
totalEvents: bigint;
|
|
131
142
|
/** The floor below which entries are no longer served: a condensed prefix, made visible. */
|
|
132
143
|
firstAvailableSeq: bigint;
|
|
133
|
-
head
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/** What `exportMemoryRange` writes into the chain and hands back. */
|
|
137
|
-
export interface MemoryExportReceipt {
|
|
138
|
-
/** Chain position of the receipt entry itself — always above every entry it covers. */
|
|
139
|
-
seq: bigint;
|
|
140
|
-
head: Uint8Array;
|
|
141
|
-
fromSeq: bigint;
|
|
142
|
-
toSeq: bigint;
|
|
143
|
-
opsRoot: Uint8Array;
|
|
144
|
-
authorFilter: [] | [Principal];
|
|
145
|
-
/** ⟨RENAMED 2026-10-05⟩ was `at` — see `MemoryLogEvent.atNs`. */
|
|
146
|
-
atNs: bigint;
|
|
144
|
+
/** The chain's head when the page was read — what a third party checks the page against. */
|
|
145
|
+
head: Uint8Array | number[];
|
|
146
|
+
page: MemoryLogEventPage;
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
export interface
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
toSeq: bigint;
|
|
154
|
-
opCount: bigint;
|
|
155
|
-
opsRoot: Uint8Array;
|
|
156
|
-
/** The head attested at the boundary — what a verifier seeds from once the prefix is gone. */
|
|
157
|
-
headAtBoundary: Uint8Array;
|
|
158
|
-
newFirstAvailableSeq: bigint;
|
|
148
|
+
/** The rows of one memory-log page, in the house page shape. */
|
|
149
|
+
export interface MemoryLogEventPage {
|
|
150
|
+
items: MemoryLogEvent[];
|
|
151
|
+
/** Entries EVER chained, not the retained count — a condensed prefix never shortens this. */
|
|
152
|
+
total: bigint;
|
|
159
153
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* representable outcome, not an error.
|
|
154
|
+
* Entries the author filter removed from this window. 0 on an unfiltered read, where a short
|
|
155
|
+
* page then means exactly one thing: the chain ended. `items.length + withheld` is the window.
|
|
163
156
|
*/
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
/** A receipt or checkpoint named by a preview, enough to go fetch or explain it. */
|
|
167
|
-
export interface MemoryReceiptRef {
|
|
168
|
-
seq: bigint;
|
|
169
|
-
fromSeq: bigint;
|
|
170
|
-
toSeq: bigint;
|
|
157
|
+
withheld: bigint;
|
|
171
158
|
}
|
|
159
|
+
/** What `exportMemoryRange` writes into the chain and hands back. */
|
|
160
|
+
export type MemoryExportReceipt = Engram.MemoryRangeExport;
|
|
161
|
+
/** What `condenseMemoryLog` returns: the checkpoint that replaced the dropped prefix. Its
|
|
162
|
+
* `historyBytesDelta` is SIGNED: a short condense can cost more history bytes than it frees. */
|
|
163
|
+
export type MemoryCondenseResult = Engram.CondenseResult;
|
|
172
164
|
/** What a condense WOULD do, and whether the export gate is open. Reads nothing destructive. */
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
/** True when an unfiltered receipt already covers the whole proposed prefix. */
|
|
179
|
-
unlocked: boolean;
|
|
180
|
-
coveringReceipt: [] | [MemoryReceiptRef];
|
|
181
|
-
/** The nearest miss, so a refusal says what is still needed rather than only "no". */
|
|
182
|
-
bestUnfilteredReceipt: [] | [MemoryReceiptRef];
|
|
183
|
-
/**
|
|
184
|
-
* Author-filtered receipts seen while scanning. They are counted, never credited: a filtered
|
|
185
|
-
* ops root cannot witness that every entry in the range was served.
|
|
186
|
-
*/
|
|
187
|
-
filteredReceiptsSeen: bigint;
|
|
188
|
-
maxUnlockableToSeq: bigint;
|
|
189
|
-
scannedFromSeq: bigint;
|
|
190
|
-
/** True ⇒ the scan hit its bound; the answer describes what was scanned, not the whole chain. */
|
|
191
|
-
scanTruncated: boolean;
|
|
192
|
-
}
|
|
193
|
-
export interface MemoryExportReceiptRow {
|
|
194
|
-
seq: bigint;
|
|
195
|
-
/** ⟨RENAMED 2026-10-05⟩ was `at` — see `MemoryLogEvent.atNs`. */
|
|
196
|
-
atNs: bigint;
|
|
197
|
-
by: Principal;
|
|
198
|
-
fromSeq: bigint;
|
|
199
|
-
toSeq: bigint;
|
|
200
|
-
opsRoot: Uint8Array;
|
|
201
|
-
authorFilter: [] | [Principal];
|
|
202
|
-
}
|
|
203
|
-
export interface MemoryCheckpointRow {
|
|
204
|
-
seq: bigint;
|
|
205
|
-
/** ⟨RENAMED 2026-10-05⟩ was `at` — see `MemoryLogEvent.atNs`. */
|
|
206
|
-
atNs: bigint;
|
|
207
|
-
by: Principal;
|
|
208
|
-
fromSeq: bigint;
|
|
209
|
-
toSeq: bigint;
|
|
210
|
-
opCount: bigint;
|
|
211
|
-
opsRoot: Uint8Array;
|
|
212
|
-
headAtBoundary: Uint8Array;
|
|
213
|
-
}
|
|
165
|
+
export type MemoryCondensePreview = Engram.CondensePreview;
|
|
166
|
+
/** A receipt or checkpoint named by a preview, enough to go fetch or explain it. */
|
|
167
|
+
export type MemoryReceiptRef = Engram.CondensePreview['coveringReceipt'][number];
|
|
168
|
+
export type MemoryExportReceiptRow = Engram.ExportReceiptRow;
|
|
169
|
+
export type MemoryCheckpointRow = Engram.CondenseCheckpointRow;
|
|
214
170
|
/**
|
|
215
171
|
* How many log entries one assembled archive may span.
|
|
216
172
|
*
|
|
@@ -233,6 +189,8 @@ export declare const ARCHIVE_MAX_RANGE = 10000n;
|
|
|
233
189
|
* `pageCap`. Asking for the cap is safe rather than optimistic because the fallback below it is
|
|
234
190
|
* real: a page that will not fit is retried at half the size, and a walk that had to shrink says
|
|
235
191
|
* so through `smallestPageUsed`.
|
|
192
|
+
* ⟨2026-10-07, beside "reports the result as `pageCap`"⟩ It reports the window it scanned as
|
|
193
|
+
* `items.length + withheld` now; `pageCap` is not served.
|
|
236
194
|
*/
|
|
237
195
|
export declare const ARCHIVE_PAGE_EVENTS = 256n;
|
|
238
196
|
/**
|
|
@@ -246,7 +204,7 @@ export declare function toLedgerFsEvent(e: MemoryLogEvent): LedgerFsEvent;
|
|
|
246
204
|
/** The canonical hash of one log entry, recomputed from its decoded fields. */
|
|
247
205
|
export declare const memoryLogEventHash: (e: MemoryLogEvent) => Hash;
|
|
248
206
|
/**
|
|
249
|
-
* Fetches one page.
|
|
207
|
+
* Fetches one page: `listMemoryLog`, as the engram serves it.
|
|
250
208
|
*
|
|
251
209
|
* The caller supplies it, and after 2026-08-17 that is the only way it arrives: `EngramClient`
|
|
252
210
|
* used to carry a `getMemoryLogPage` wrapper that satisfied this shape, and the charter diet
|
|
@@ -259,8 +217,24 @@ export declare const memoryLogEventHash: (e: MemoryLogEvent) => Hash;
|
|
|
259
217
|
* serves `listMemoryLog`, not `getMemoryLogPage`, and its reply is not a `MemoryLogPage` (see the
|
|
260
218
|
* note there). Until the walk is adapted, a fetcher has to translate the served page into this
|
|
261
219
|
* shape. That translation is open, not done.
|
|
220
|
+
*
|
|
221
|
+
* ⟨RESHAPED 2026-10-07, beside the correction above — the owner's decision of that day⟩ It can
|
|
222
|
+
* again: the fetcher's shape IS the served method's, `listMemoryLog(startSeq, max, authorFilter :
|
|
223
|
+
* opt principal) -> Result<LogPage>`, so an owner tool passes its owner-authenticated actor's
|
|
224
|
+
* `listMemoryLog` (bound to the actor) straight in, and nothing translates the page. A typed
|
|
225
|
+
* refusal (`Err`) ends the walk with the engram's own sentence; it is never halved into. A REJECTED
|
|
226
|
+
* call (the promise fails) is a transport fact, and only a response-size one is halved and retried.
|
|
227
|
+
*
|
|
228
|
+
* ⟨CORRECTED 2026-10-07, same day, beside "straight in" above⟩ That was false as first written. tsc
|
|
229
|
+
* refused a generated actor's `listMemoryLog` here: "Type 'ActorMethod<[bigint, bigint, [] |
|
|
230
|
+
* [Principal]], Result_30>' is not assignable to type 'MemoryLogPageFetcher' … The types of 'Ok.head'
|
|
231
|
+
* are incompatible", because the page types declared blobs `Uint8Array` and the generated interface
|
|
232
|
+
* declares them `Uint8Array | number[]`. The test that said it passed straight in used a stand-in
|
|
233
|
+
* already typed as this fetcher. The blob fields are widened now (see the note under "Wire shapes"),
|
|
234
|
+
* and test/generated-actor-fits.test.ts compiles the generated method into this type, so the
|
|
235
|
+
* sentence is held by a check that fails when it stops being true.
|
|
262
236
|
*/
|
|
263
|
-
export type MemoryLogPageFetcher = (startSeq: bigint, max: bigint, authorFilter
|
|
237
|
+
export type MemoryLogPageFetcher = (startSeq: bigint, max: bigint, authorFilter: [] | [Principal]) => Promise<WireResult<MemoryLogPage>>;
|
|
264
238
|
export interface AssembleArchiveOptions {
|
|
265
239
|
/** Default: the engram's retained floor, learned from the first page. */
|
|
266
240
|
fromSeq?: bigint | number;
|
|
@@ -268,7 +242,7 @@ export interface AssembleArchiveOptions {
|
|
|
268
242
|
toSeq?: bigint | number;
|
|
269
243
|
/** Restrict to one author. A filtered archive can only be checked against a filtered receipt. */
|
|
270
244
|
authorFilter?: Principal;
|
|
271
|
-
/** Starting page size. Only ever shrinks from here — never grows toward
|
|
245
|
+
/** Starting page size. Only ever shrinks from here — never grows back toward the engram's clamp. */
|
|
272
246
|
pageEvents?: bigint | number;
|
|
273
247
|
/** Lower the range ceiling for this call. Values above {@link ARCHIVE_MAX_RANGE} are clamped. */
|
|
274
248
|
maxRange?: bigint | number;
|
|
@@ -283,8 +257,6 @@ export interface MemoryArchive {
|
|
|
283
257
|
firstAvailableSeq: bigint;
|
|
284
258
|
/** The engram's chain head as of the last page fetched. */
|
|
285
259
|
head: Uint8Array;
|
|
286
|
-
/** The cap the engram disclosed on the last page. */
|
|
287
|
-
pageCap: bigint;
|
|
288
260
|
pagesFetched: number;
|
|
289
261
|
/**
|
|
290
262
|
* The smallest page size the walk had to fall back to. Below the requested size ⇒ at least one
|
|
@@ -315,6 +287,13 @@ export declare function isResponseTooLarge(err: unknown): boolean;
|
|
|
315
287
|
* - start below the retained floor (a condensed prefix is unattestable, so an explicit request
|
|
316
288
|
* for it is refused rather than silently raised);
|
|
317
289
|
* - assemble more than {@link ARCHIVE_MAX_RANGE} entries in one pass.
|
|
290
|
+
* ⟨2026-10-07, beside the second point — the owner's decision of that day⟩ The window the engram
|
|
291
|
+
* confirmed is `page.items.length + page.withheld` now — the entries it scanned for the page,
|
|
292
|
+
* starting at `max(startSeq, firstAvailableSeq)` — the rule the engram's own `listMemoryLog` doc
|
|
293
|
+
* states and the owner's archive page walks by. Two refusals join the list: a page whose window is
|
|
294
|
+
* EMPTY while the range still has entries to serve (the walk would spin, or end short), and a floor
|
|
295
|
+
* that rises above the cursor mid-walk (a condense ran during the walk, and what it dropped can no
|
|
296
|
+
* longer be served or attested).
|
|
318
297
|
*
|
|
319
298
|
* Termination is structural: the cursor advances by at least one seq per successful page, and the
|
|
320
299
|
* page size strictly halves per size failure until it reaches one.
|
|
@@ -328,7 +307,7 @@ export declare function assembleMemoryArchive(fetchPage: MemoryLogPageFetcher, o
|
|
|
328
307
|
export interface OpsRootAttestation {
|
|
329
308
|
fromSeq: bigint;
|
|
330
309
|
toSeq: bigint;
|
|
331
|
-
opsRoot: Uint8Array;
|
|
310
|
+
opsRoot: Uint8Array | number[];
|
|
332
311
|
/** Absent or `[]` ⇒ the attestation covers every author in the range. */
|
|
333
312
|
authorFilter?: [] | [Principal];
|
|
334
313
|
}
|