@peerbit/native-backbone 0.2.9 → 0.2.10

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 CHANGED
@@ -7,26 +7,60 @@ fused. It owns the native lower-log graph, native log block store, and shared-lo
7
7
  resident coordinate state in one Rust object so higher layers can move toward a
8
8
  single `JS -> native -> compact facts` transaction boundary.
9
9
 
10
- ## Coordinate WAL persistence
10
+ ## Coordinate and document-fact WAL persistence
11
11
 
12
- Native shared-log coordinates can be persisted through a write-through WAL or a
13
- buffered WAL. Write-through flushes every append and is the strictest persistence
14
- mode. Buffered WAL batches coordinate bytes and flushes on threshold, explicit
15
- flush, compact, or close, which is the high-throughput mode for strict native
16
- document writes.
12
+ Native shared-log coordinates, document values, and document signer facts can be
13
+ persisted through write-through or buffered WALs. Write-through flushes every
14
+ append and is the strictest persistence mode. Buffered WALs batch bytes and flush
15
+ on their pending-byte threshold, explicit flush, checkpoint, or close, which is
16
+ the high-throughput mode for strict native document writes.
17
17
 
18
18
  Use `createBufferedNativeBackboneCoordinatePersistence(store)` with OPFS, memory,
19
19
  or custom stores, and `createBufferedNativeBackboneNodeCoordinatePersistence(dir)`
20
- for the Node adapter. The lower-level
21
- `createNativeBackboneCoordinatePersistence({ store, buffered: true })` config
22
- uses the same bounded checkpoint default.
20
+ for the Node adapter. Persistence flush and replay are enabled by default;
21
+ checkpoint compaction is not.
23
22
 
24
- Buffered helpers also install a bounded checkpoint policy by default. When the
25
- coordinate journal reaches the checkpoint threshold, the adapter writes a compact
26
- snapshot and removes the replay WAL. This keeps high-throughput strict-native
27
- document writes from trading append speed for unbounded restart replay cost.
23
+ The built-in Node adapter supports explicit crash-safe checkpointing when its
24
+ filesystem implementation provides atomic replacement. Opt in by setting
25
+ `compactMaxJournalBytes` or `compactMaxJournalRecords` on
26
+ `NativeBackboneNodeCoordinatePersistence` or
27
+ `createBufferedNativeBackboneNodeCoordinatePersistence`:
28
28
 
29
- The coordinate WAL supports clean stop/restart. It is not the recovery authority
29
+ ```ts
30
+ const persistence = createBufferedNativeBackboneNodeCoordinatePersistence(
31
+ programDirectory,
32
+ { compactMaxJournalBytes: 64 * 1024 * 1024 },
33
+ );
34
+ ```
35
+
36
+ Crossing either configured threshold durably publishes one versioned, checksummed
37
+ checkpoint for all three fact sets, switches between fixed A/B WAL generations,
38
+ and records an atomic replay high-water mark before covered WAL data is retired.
39
+ Checkpointing is serialized with flushes, so recovery chooses a fully published
40
+ generation instead of combining partially replaced snapshots.
41
+
42
+ Memory and OPFS persistence, along with custom stores that do not implement the
43
+ atomic replacement, removal, and durability capabilities, continue to reject
44
+ these threshold options. They retain ordinary WAL flush and replay behavior.
45
+ There is intentionally no automatic checkpoint threshold, including for the
46
+ Node helpers.
47
+
48
+ The checkpoint bounds only the coordinate, document-value, and document-signer
49
+ WALs. The entry-block WAL has a separate owner and remains out of scope, so this
50
+ feature does not by itself bound every file in a program directory.
51
+
52
+ Existing directories using the legacy snapshots and WALs open without a manual
53
+ migration. Their first checkpoint becomes forward-only once its staged generation
54
+ and downgrade sentinel are durable. If publication is interrupted after that
55
+ boundary, current recovery validates and promotes the staged generation; before
56
+ the boundary, the complete legacy WAL remains authoritative. The sentinel makes a
57
+ pre-checkpoint package fail closed rather than replay stale legacy files. Rolling
58
+ back therefore requires restoring a pre-migration copy of the directory. This is
59
+ an opt-in, forward-only internal persistence-format migration. It removes no
60
+ public API and does not alter the peer-to-peer wire format; it does add observable
61
+ Node checkpoint capabilities and downgrade behavior.
62
+
63
+ These fact WALs support clean stop/restart. They are not the recovery authority
30
64
  for a crash-atomic append across blocks, graph state, heads, coordinates,
31
65
  documents, and signer facts.
32
66
 
@@ -50,9 +84,10 @@ directory sync. Its first open creates a synced genesis only in an otherwise
50
84
  empty program directory; a nonempty legacy directory fails with
51
85
  `NativeDurabilityMigrationRequiredError` and is never adopted implicitly.
52
86
 
53
- Phase one retains the full journal and pins genesis as its scan base while newer
54
- A/B checkpoints prove staging coverage. Journal compaction is deliberately
55
- deferred until a later phase can switch the journal generation and its scan base
56
- together. Memory storage is a non-crash-safe reference adapter, and OPFS remains
57
- unsupported until its lifetime lease and worker-termination barriers have a
58
- dedicated conformance gate.
87
+ Phase one retains this separate durability-transaction journal and pins genesis
88
+ as its scan base while newer A/B checkpoints prove staging coverage. Compaction
89
+ of that journal is deliberately deferred until a later phase can switch its
90
+ generation and scan base together; the coordinate/document-fact checkpointing
91
+ described above does not alter it. Memory storage is a non-crash-safe reference
92
+ adapter, and OPFS remains unsupported until its lifetime lease and
93
+ worker-termination barriers have a dedicated conformance gate.
@@ -5,6 +5,11 @@ export * from "./durability/node-lease.js";
5
5
  export * from "./durability/node-storage.js";
6
6
  export * from "./durability/storage.js";
7
7
  export type RangeResolution = "u32" | "u64";
8
+ type NativePrepareNoNextDocumentIndexCompactTrimFacts = (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentValuePrefixBytes: Uint8Array, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
9
+ type NativePrepareNoNextCachedDocumentIndexCompactTrimFacts = (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
10
+ type NativePrepareNoNextCachedPlainPutPayloadDocumentIndexCompactTrimFacts = (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionSigner: Uint8Array | undefined) => unknown[];
11
+ type NativePrepareLatestDocumentIndexTrimFacts = (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentValuePrefixBytes: Uint8Array, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
12
+ type NativePrepareLatestCachedDocumentIndexTrimFacts = (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
8
13
  type NativePeerbitBackboneHandle = {
9
14
  log_len: () => number;
10
15
  block_len: () => number;
@@ -244,18 +249,24 @@ type NativePeerbitBackboneHandle = {
244
249
  ]>;
245
250
  plan_receive_coordinates_for_gids_batch: (entryHashes: string[], gids: string[], hashNumbers: string[], nextHashBatches: string[][], replicaCounts: number[], roleAgeMs: number, now: string, peerFilter: string[] | undefined, expandPeerFilter: boolean, selfHash: string, includeSelf: boolean, fullReplicaFallback: boolean, includeStrictFullReplica: boolean) => Array<[unknown[], unknown[], boolean, boolean, unknown[]]>;
246
251
  prepare_plain_entry_commit_facts: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined) => unknown[];
252
+ prepare_plain_entry_commit_facts_trim_refs?: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number) => unknown[];
247
253
  prepare_plain_entry_commit_facts_document_index: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentValuePrefixBytes: Uint8Array, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
248
254
  prepare_plain_entry_commit_facts_document_index_cached_plan: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
249
255
  prepare_plain_entry_commit_no_next_facts_document_index_compact: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, documentKey: string, documentValuePrefixBytes: Uint8Array, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
250
256
  prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
251
257
  prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_plain_put_payload?: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionSigner: Uint8Array | undefined) => unknown[];
252
258
  prepare_plain_entry_commit_no_next_facts_document_index_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentValuePrefixBytes: Uint8Array, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
253
- prepare_plain_entry_commit_no_next_facts_document_index_compact_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentValuePrefixBytes: Uint8Array, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
259
+ prepare_plain_entry_commit_no_next_facts_document_index_compact_trim_hashes: NativePrepareNoNextDocumentIndexCompactTrimFacts;
260
+ prepare_plain_entry_commit_no_next_facts_document_index_compact_trim_refs?: NativePrepareNoNextDocumentIndexCompactTrimFacts;
254
261
  prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
255
- prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
256
- prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_hashes_plain_put_payload?: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number, documentKey: string, documentExistingCreated: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionSigner: Uint8Array | undefined) => unknown[];
257
- prepare_plain_entry_commit_latest_facts_document_index_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentValuePrefixBytes: Uint8Array, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlan: NativeBackboneSimpleDocumentProjectionPlan | undefined, documentProjectionEncodedDocument: Uint8Array | undefined, documentProjectionSigner: Uint8Array | undefined) => unknown[];
258
- prepare_plain_entry_commit_latest_facts_document_index_cached_plan_trim_hashes: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number | undefined, documentKey: string, documentByteElementIndexLimit: number, documentDeleteTrimmedHeads: boolean, documentProjectionPlanId: number, documentProjectionEncodedDocument: Uint8Array, documentProjectionSigner: Uint8Array | undefined) => unknown[];
262
+ prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_hashes: NativePrepareNoNextCachedDocumentIndexCompactTrimFacts;
263
+ prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_refs?: NativePrepareNoNextCachedDocumentIndexCompactTrimFacts;
264
+ prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_hashes_plain_put_payload?: NativePrepareNoNextCachedPlainPutPayloadDocumentIndexCompactTrimFacts;
265
+ prepare_plain_entry_commit_no_next_facts_document_index_cached_plan_compact_trim_refs_plain_put_payload?: NativePrepareNoNextCachedPlainPutPayloadDocumentIndexCompactTrimFacts;
266
+ prepare_plain_entry_commit_latest_facts_document_index_trim_hashes: NativePrepareLatestDocumentIndexTrimFacts;
267
+ prepare_plain_entry_commit_latest_facts_document_index_trim_refs?: NativePrepareLatestDocumentIndexTrimFacts;
268
+ prepare_plain_entry_commit_latest_facts_document_index_cached_plan_trim_hashes: NativePrepareLatestCachedDocumentIndexTrimFacts;
269
+ prepare_plain_entry_commit_latest_facts_document_index_cached_plan_trim_refs?: NativePrepareLatestCachedDocumentIndexTrimFacts;
259
270
  prepare_plain_entry_storage_facts_and_put: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array) => unknown[];
260
271
  prepare_plain_entry_storage_facts_trim_and_put: (wallTime: bigint, logical: number, gid: string, next: string[], type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, trimLengthTo: number) => unknown[];
261
272
  prepare_plain_no_next_storage_append_transaction: (wallTime: bigint, logical: number, gid: string, type: number, metaData: Uint8Array | undefined, payloadData: Uint8Array, replicas: number, roleAgeMs: number, now: string, selfHash: string, selfReplicating: boolean, resolveTrimmedEntries: boolean) => unknown[];
@@ -763,6 +774,7 @@ export type NativeBackboneAppendResult = {
763
774
  assignedToRangeBoundary: boolean;
764
775
  trimmed: NativeBackboneTrimmedEntry[];
765
776
  trimmedHashes?: string[];
777
+ trimmedGids?: string[];
766
778
  documentTrimmedHeadsProcessed?: boolean;
767
779
  documentPreviousContext?: NativeBackboneDocumentContextFacts;
768
780
  };
@@ -774,6 +786,7 @@ type NativeBackboneStorageAppendResult = {
774
786
  assignedToRangeBoundary: boolean;
775
787
  trimmed: NativeBackboneTrimmedEntry[];
776
788
  trimmedHashes?: string[];
789
+ trimmedGids?: string[];
777
790
  documentTrimmedHeadsProcessed?: boolean;
778
791
  documentPreviousContext?: NativeBackboneDocumentContextFacts;
779
792
  };
@@ -933,6 +946,12 @@ export type NativeBackboneCoordinatePersistenceStore = {
933
946
  */
934
947
  readLimited?(name: string, maxBytes: number): Promise<Uint8Array | undefined>;
935
948
  write(name: string, bytes: Uint8Array): Promise<void>;
949
+ /**
950
+ * Durably replace one named file without exposing a torn destination. The
951
+ * replacement is not visible until its bytes and containing directory have
952
+ * crossed their physical durability barriers.
953
+ */
954
+ atomicReplace?(name: string, bytes: Uint8Array): Promise<void>;
936
955
  /**
937
956
  * Appends `bytes` to the named file. Callers hand over ownership of
938
957
  * `bytes` and must not mutate it afterwards: buffering stores keep the
@@ -1022,7 +1041,7 @@ export type NativeBackboneNodeCoordinatePersistenceOptions = NativeBackboneCoord
1022
1041
  };
1023
1042
  export declare const nativeBackboneCoordinateDropTombstoneFile = "native-backbone-drop.tombstone";
1024
1043
  export declare const defaultNativeBackboneCoordinateFlushMaxPendingBytes: number;
1025
- /** @deprecated Built-in coordinate persistence compaction is currently disabled. */
1044
+ /** Recommended explicit byte threshold for crash-safe Node checkpointing. */
1026
1045
  export declare const defaultNativeBackboneCoordinateCompactMaxJournalBytes: number;
1027
1046
  type NativeBackboneNodeFs = {
1028
1047
  mkdir(path: string, options?: {
@@ -1031,6 +1050,7 @@ type NativeBackboneNodeFs = {
1031
1050
  readFile(path: string): Promise<Uint8Array>;
1032
1051
  writeFile(path: string, data: Uint8Array): Promise<unknown>;
1033
1052
  appendFile(path: string, data: Uint8Array): Promise<unknown>;
1053
+ rename?(from: string, to: string): Promise<unknown>;
1034
1054
  /** Explicit capability for pre-allocation-bounded positional reads. */
1035
1055
  openBoundedRead?(path: string): Promise<NativeBackboneNodeBoundedReadFileHandle>;
1036
1056
  open?(path: string, flags: string): Promise<NativeBackboneNodeAppendFileHandle>;
@@ -1147,7 +1167,9 @@ declare class NativeBackboneLogGraph {
1147
1167
  }, _blockStore: unknown): (NativeBackboneCommittedEntry & {
1148
1168
  trimmedEntries?: NativeBackboneLogEntry[];
1149
1169
  trimmedEntryHashes?: string[];
1170
+ trimmedEntryGids?: string[];
1150
1171
  documentTrimmedHeadsProcessed?: boolean;
1172
+ documentPreviousContext?: NativeBackboneDocumentContextFacts;
1151
1173
  }) | undefined;
1152
1174
  prepareEntryV0PlainEntryAndPut(input: {
1153
1175
  clockId: Uint8Array;
@@ -1580,6 +1602,7 @@ export declare class NativeBackboneNodeCoordinatePersistenceStore implements Nat
1580
1602
  private appendFailure;
1581
1603
  readonly readLimited?: (name: string, maxBytes: number) => Promise<Uint8Array | undefined>;
1582
1604
  readonly durableBarrier?: (name?: string) => Promise<void>;
1605
+ readonly atomicReplace?: (name: string, bytes: Uint8Array) => Promise<void>;
1583
1606
  constructor(directory: string, fs?: NativeBackboneNodeFs | undefined);
1584
1607
  private nodeFs;
1585
1608
  private filePath;
@@ -1589,6 +1612,7 @@ export declare class NativeBackboneNodeCoordinatePersistenceStore implements Nat
1589
1612
  read(name: string): Promise<Uint8Array | undefined>;
1590
1613
  private readWithinLimit;
1591
1614
  write(name: string, bytes: Uint8Array): Promise<void>;
1615
+ private replaceAtomically;
1592
1616
  append(name: string, bytes: Uint8Array): Promise<void>;
1593
1617
  remove(name: string): Promise<void>;
1594
1618
  flush(name?: string): Promise<void>;
@@ -1621,6 +1645,7 @@ export declare class NativeBackboneBufferedCoordinatePersistenceStore implements
1621
1645
  readonly readLimited?: (name: string, maxBytes: number) => Promise<Uint8Array | undefined>;
1622
1646
  readonly supportsRemoval: boolean;
1623
1647
  readonly durableBarrier?: (name?: string) => Promise<void>;
1648
+ readonly atomicReplace?: (name: string, bytes: Uint8Array) => Promise<void>;
1624
1649
  constructor(inner: NativeBackboneCoordinatePersistenceStore, options?: {
1625
1650
  maxBufferedBytes?: number;
1626
1651
  });
@@ -1642,7 +1667,7 @@ export declare class NativeBackboneCoordinatePersistence {
1642
1667
  readonly flushIntervalMs?: number;
1643
1668
  readonly compactMaxJournalBytes?: number;
1644
1669
  readonly compactMaxJournalRecords?: number;
1645
- readonly crashSafeCompaction = false;
1670
+ readonly crashSafeCompaction: boolean;
1646
1671
  readonly durableBarrier: boolean;
1647
1672
  readonly supportsDrop: boolean;
1648
1673
  readonly dropIsTerminal = true;
@@ -1652,9 +1677,22 @@ export declare class NativeBackboneCoordinatePersistence {
1652
1677
  private readonly documentJournalFile;
1653
1678
  private readonly documentSignerSnapshotFile;
1654
1679
  private readonly documentSignerJournalFile;
1680
+ private readonly checkpointConfigurationChecksum;
1681
+ private readonly checkpointStateFile;
1682
+ private readonly checkpointFiles;
1683
+ private readonly checkpointJournalFiles;
1655
1684
  private journalInitialized;
1685
+ private journalByteLength;
1686
+ private journalRecordCount;
1656
1687
  private documentJournalInitialized;
1688
+ private documentJournalByteLength;
1689
+ private documentJournalRecordCount;
1657
1690
  private documentSignerJournalInitialized;
1691
+ private documentSignerJournalByteLength;
1692
+ private documentSignerJournalRecordCount;
1693
+ private checkpointHighwater;
1694
+ private checkpointCompleted?;
1695
+ private checkpointPending?;
1658
1696
  private lastFlushMs;
1659
1697
  private persistenceQueue;
1660
1698
  private persistenceLifecycle;
@@ -1667,13 +1705,22 @@ export declare class NativeBackboneCoordinatePersistence {
1667
1705
  constructor(store: NativeBackboneCoordinatePersistenceStore, options?: NativeBackboneCoordinatePersistenceOptions);
1668
1706
  /** Durable operation-intent capability for strict shared-log transactions. */
1669
1707
  get intentStore(): NativeBackboneCoordinatePersistenceStore;
1708
+ private legacyConfiguredFiles;
1670
1709
  private configuredFiles;
1710
+ private checkpointSlot;
1711
+ private activeJournalFiles;
1671
1712
  private assertLifecycleActive;
1672
1713
  private assertActive;
1714
+ private assertPersistenceHealthy;
1673
1715
  private resetJournalTracking;
1716
+ private persistDropTombstone;
1674
1717
  private eraseDropFiles;
1675
1718
  drop(additionalFiles?: readonly string[]): Promise<void>;
1676
1719
  resumeDrop(): Promise<boolean>;
1720
+ private barrierFile;
1721
+ private hasDurableLegacyMigrationSentinel;
1722
+ private installLegacyMigrationSentinel;
1723
+ private requireLegacyMigrationSentinel;
1677
1724
  hydrate(backbone: NativePeerbitBackbone): Promise<number>;
1678
1725
  private assertHydrating;
1679
1726
  private resumeDropInternal;
@@ -1681,8 +1728,12 @@ export declare class NativeBackboneCoordinatePersistence {
1681
1728
  flushJournalOnAppend(backbone: NativePeerbitBackbone): number | Promise<number>;
1682
1729
  flushJournal(backbone: NativePeerbitBackbone): Promise<number>;
1683
1730
  private enqueuePersistence;
1731
+ private shouldCompactJournal;
1732
+ private nextCheckpointGeneration;
1733
+ private publishCheckpoint;
1734
+ private cleanupRetiredCheckpointFiles;
1684
1735
  private flushJournalInternal;
1685
- compact(_backbone: NativePeerbitBackbone): Promise<void>;
1736
+ compact(backbone: NativePeerbitBackbone): Promise<void>;
1686
1737
  close(): Promise<void>;
1687
1738
  }
1688
1739
  export declare class NativeBackboneNodeCoordinatePersistence extends NativeBackboneCoordinatePersistence {