@secondlayer/shared 18.0.1 → 19.0.0
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/dist/src/archive/range-digest.d.ts +8 -0
- package/dist/src/archive/semantic-digest-builder.d.ts +8 -0
- package/dist/src/coverage/index.d.ts +9 -341
- package/dist/src/coverage/index.js +2 -751
- package/dist/src/coverage/index.js.map +4 -13
- package/dist/src/db/index.d.ts +10 -1
- package/dist/src/db/index.js +2 -1
- package/dist/src/db/index.js.map +4 -4
- package/dist/src/db/queries/api-keys.d.ts +38 -0
- package/dist/src/db/queries/api-keys.js +89 -0
- package/dist/src/db/queries/api-keys.js.map +11 -0
- package/dist/src/db/queries/chain-reorgs.d.ts +8 -0
- package/dist/src/db/queries/chain-reorgs.js +2 -1
- package/dist/src/db/queries/chain-reorgs.js.map +4 -4
- package/dist/src/db/queries/contracts.d.ts +8 -0
- package/dist/src/db/queries/contracts.js.map +2 -2
- package/dist/src/db/queries/instance.d.ts +8 -0
- package/dist/src/db/queries/integrity.d.ts +8 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +8 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +8 -0
- package/dist/src/db/queries/subgraphs.d.ts +8 -0
- package/dist/src/db/queries/sync-scope.d.ts +8 -0
- package/dist/src/db/queries/webhook-replays.d.ts +8 -0
- package/dist/src/db/queries/webhooks.d.ts +8 -0
- package/dist/src/db/schema.d.ts +9 -1
- package/dist/src/db/schema.js.map +2 -2
- package/dist/src/index.d.ts +10 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +4 -4
- package/dist/src/insights/index.d.ts +8 -0
- package/dist/src/leader.js +2 -1
- package/dist/src/leader.js.map +4 -4
- package/dist/src/node/local-client.d.ts +8 -0
- package/dist/src/queue/listener.js +2 -1
- package/dist/src/queue/listener.js.map +4 -4
- package/dist/src/runtime/index.d.ts +1 -120
- package/dist/src/runtime/index.js +1 -310
- package/dist/src/runtime/index.js.map +3 -7
- package/dist/src/streams-rows/index.d.ts +0 -12
- package/dist/src/streams-rows/index.js +2 -3
- package/dist/src/streams-rows/index.js.map +8 -8
- package/migrations/0216_events_total_baseline.ts +26 -0
- package/package.json +6 -2
|
@@ -715,6 +715,13 @@ interface BnsNamespacesTable {
|
|
|
715
715
|
* `index_block_hash` marks a caller-declared contract-constant value, cached
|
|
716
716
|
* once per contract+args instead of once per block.
|
|
717
717
|
*/
|
|
718
|
+
interface EventsTotalBaselineTable {
|
|
719
|
+
id: Generated<boolean>;
|
|
720
|
+
through: ColumnType<number | null, number | null | undefined, number | null>;
|
|
721
|
+
count: ColumnType<string | null, string | number | null | undefined, string | number | null>;
|
|
722
|
+
taken_at: Date | null;
|
|
723
|
+
claimed_at: Date | null;
|
|
724
|
+
}
|
|
718
725
|
interface ChainReadCacheTable {
|
|
719
726
|
id: Generated<number>;
|
|
720
727
|
contract_id: string;
|
|
@@ -858,6 +865,7 @@ interface Database {
|
|
|
858
865
|
bns_namespaces: BnsNamespacesTable;
|
|
859
866
|
service_heartbeats: ServiceHeartbeatsTable;
|
|
860
867
|
chain_read_cache: ChainReadCacheTable;
|
|
868
|
+
events_total_baseline: EventsTotalBaselineTable;
|
|
861
869
|
pending_fork_blocks: PendingForkBlocksTable;
|
|
862
870
|
observer_journal: ObserverJournalTable;
|
|
863
871
|
sync_scopes: SyncScopesTable;
|
|
@@ -715,6 +715,13 @@ interface BnsNamespacesTable {
|
|
|
715
715
|
* `index_block_hash` marks a caller-declared contract-constant value, cached
|
|
716
716
|
* once per contract+args instead of once per block.
|
|
717
717
|
*/
|
|
718
|
+
interface EventsTotalBaselineTable {
|
|
719
|
+
id: Generated<boolean>;
|
|
720
|
+
through: ColumnType<number | null, number | null | undefined, number | null>;
|
|
721
|
+
count: ColumnType<string | null, string | number | null | undefined, string | number | null>;
|
|
722
|
+
taken_at: Date | null;
|
|
723
|
+
claimed_at: Date | null;
|
|
724
|
+
}
|
|
718
725
|
interface ChainReadCacheTable {
|
|
719
726
|
id: Generated<number>;
|
|
720
727
|
contract_id: string;
|
|
@@ -858,6 +865,7 @@ interface Database {
|
|
|
858
865
|
bns_namespaces: BnsNamespacesTable;
|
|
859
866
|
service_heartbeats: ServiceHeartbeatsTable;
|
|
860
867
|
chain_read_cache: ChainReadCacheTable;
|
|
868
|
+
events_total_baseline: EventsTotalBaselineTable;
|
|
861
869
|
pending_fork_blocks: PendingForkBlocksTable;
|
|
862
870
|
observer_journal: ObserverJournalTable;
|
|
863
871
|
sync_scopes: SyncScopesTable;
|
|
@@ -22,12 +22,6 @@ type CoverageRange = {
|
|
|
22
22
|
from_height: number
|
|
23
23
|
to_height: number
|
|
24
24
|
};
|
|
25
|
-
type ReceiptRow = {
|
|
26
|
-
block_height: number
|
|
27
|
-
input_count: number
|
|
28
|
-
finalized: boolean
|
|
29
|
-
compacted_at: Date | null
|
|
30
|
-
};
|
|
31
25
|
type FailureRow = {
|
|
32
26
|
from_height: number | null
|
|
33
27
|
to_height: number | null
|
|
@@ -46,13 +40,9 @@ declare function isFailureClass(value: string): value is FailureClass;
|
|
|
46
40
|
declare function isRetryState(value: string): value is RetryState;
|
|
47
41
|
declare function isNonNegativeInt(value: number): boolean;
|
|
48
42
|
declare function rangeIsOrdered(from: number, to: number): boolean;
|
|
49
|
-
/** Compacted receipts must already be finalized. */
|
|
50
|
-
declare function receiptRetentionHolds(row: ReceiptRow): boolean;
|
|
51
43
|
declare function failureRangeHolds(row: FailureRow): boolean;
|
|
52
44
|
/** Resolved rows need `resolved_at`; open rows keep `retain_until` ≥ created. */
|
|
53
45
|
declare function failureRetentionHolds(row: FailureRow): boolean;
|
|
54
|
-
/** Two closed ranges on the same stage must not overlap. */
|
|
55
|
-
declare function segmentsOverlap(a: CoverageRange, b: CoverageRange): boolean;
|
|
56
46
|
declare function defaultRetainUntil(createdAt: Date): Date;
|
|
57
47
|
declare const COVERAGE_REPORT_SCHEMA_VERSION: 1;
|
|
58
48
|
declare const COVERAGE_STATES: readonly ["complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled"];
|
|
@@ -170,170 +160,6 @@ declare function topoSort(stages: readonly StageDeclaration[]): {
|
|
|
170
160
|
cycles: string[][]
|
|
171
161
|
};
|
|
172
162
|
declare function evaluateCoverage(input: EvaluatorInput): CoverageReport;
|
|
173
|
-
declare const RUNNER_STATUSES: readonly ["pending", "running", "complete", "failed", "halted"];
|
|
174
|
-
type RunnerStatus = (typeof RUNNER_STATUSES)[number];
|
|
175
|
-
declare const RUNNER_EVENT_TYPES: readonly ["start", "ack", "fail", "retry", "halt", "resume", "reorg", "version", "finish"];
|
|
176
|
-
type RunnerEventType = (typeof RUNNER_EVENT_TYPES)[number];
|
|
177
|
-
declare const DEFAULT_MAX_RETRIES = 3;
|
|
178
|
-
type RunnerVersion = {
|
|
179
|
-
code_hash: string
|
|
180
|
-
config_hash: string
|
|
181
|
-
handler_hash: string | null
|
|
182
|
-
};
|
|
183
|
-
type RunnerFailure = {
|
|
184
|
-
unit_kind: FailureUnit
|
|
185
|
-
class: FailureClass
|
|
186
|
-
retry_state: Exclude<RetryState, "resolved">
|
|
187
|
-
from_height: number | null
|
|
188
|
-
to_height: number | null
|
|
189
|
-
error: string | null
|
|
190
|
-
};
|
|
191
|
-
type RunnerState = {
|
|
192
|
-
stage_id: string
|
|
193
|
-
status: RunnerStatus
|
|
194
|
-
version: RunnerVersion
|
|
195
|
-
start_height: number
|
|
196
|
-
target_height: number | null
|
|
197
|
-
complete_through: number | null
|
|
198
|
-
last_acked_hash: string | null
|
|
199
|
-
retry_count: number
|
|
200
|
-
open_failure: RunnerFailure | null
|
|
201
|
-
};
|
|
202
|
-
type RunnerEvent = {
|
|
203
|
-
type: "start"
|
|
204
|
-
} | {
|
|
205
|
-
type: "ack"
|
|
206
|
-
height: number
|
|
207
|
-
hash: string
|
|
208
|
-
input_count: number
|
|
209
|
-
input_digest: string
|
|
210
|
-
effect_digest: string
|
|
211
|
-
} | {
|
|
212
|
-
type: "fail"
|
|
213
|
-
unit_kind: FailureUnit
|
|
214
|
-
class: FailureClass
|
|
215
|
-
from_height: number | null
|
|
216
|
-
to_height: number | null
|
|
217
|
-
error: string | null
|
|
218
|
-
} | {
|
|
219
|
-
type: "retry"
|
|
220
|
-
} | {
|
|
221
|
-
type: "halt"
|
|
222
|
-
} | {
|
|
223
|
-
type: "resume"
|
|
224
|
-
} | {
|
|
225
|
-
type: "reorg"
|
|
226
|
-
fork_point: number
|
|
227
|
-
} | {
|
|
228
|
-
type: "version"
|
|
229
|
-
version: RunnerVersion
|
|
230
|
-
} | {
|
|
231
|
-
type: "finish"
|
|
232
|
-
};
|
|
233
|
-
type RunnerEffect = {
|
|
234
|
-
type: "invalidate_receipts"
|
|
235
|
-
range: CoverageRange
|
|
236
|
-
} | {
|
|
237
|
-
type: "spawn_run"
|
|
238
|
-
version: RunnerVersion
|
|
239
|
-
} | {
|
|
240
|
-
type: "open_failure"
|
|
241
|
-
failure: RunnerFailure
|
|
242
|
-
} | {
|
|
243
|
-
type: "resolve_failure"
|
|
244
|
-
};
|
|
245
|
-
type RunnerResult = {
|
|
246
|
-
ok: true
|
|
247
|
-
state: RunnerState
|
|
248
|
-
effects: RunnerEffect[]
|
|
249
|
-
} | {
|
|
250
|
-
ok: false
|
|
251
|
-
reason: string
|
|
252
|
-
state: RunnerState
|
|
253
|
-
};
|
|
254
|
-
type TransitionRule = {
|
|
255
|
-
from: RunnerStatus
|
|
256
|
-
event: RunnerEventType
|
|
257
|
-
to: RunnerStatus | "reject"
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* Structural transition table. Guards (order, retry budget, version
|
|
261
|
-
* equality, reorg overlap) are applied on top in `applyRunnerEvent`.
|
|
262
|
-
*/
|
|
263
|
-
declare const RUNNER_TRANSITION_TABLE: readonly TransitionRule[];
|
|
264
|
-
declare function lookupTransition(from: RunnerStatus, event: RunnerEventType): TransitionRule;
|
|
265
|
-
declare function versionsEqual(a: RunnerVersion, b: RunnerVersion): boolean;
|
|
266
|
-
/** Next height this run must acknowledge. */
|
|
267
|
-
declare function expectedAckHeight(state: RunnerState): number;
|
|
268
|
-
declare function createRunnerState(init: {
|
|
269
|
-
stage_id: string
|
|
270
|
-
start_height: number
|
|
271
|
-
target_height?: number | null
|
|
272
|
-
version: RunnerVersion
|
|
273
|
-
}): RunnerState;
|
|
274
|
-
declare function applyRunnerEvent(state: RunnerState, event: RunnerEvent, opts?: {
|
|
275
|
-
maxRetries?: number
|
|
276
|
-
}): RunnerResult;
|
|
277
|
-
/**
|
|
278
|
-
* Canonical Streams cursor codec, shared by every product (Streams, Index,
|
|
279
|
-
* Datasets, bulk). A cursor is `"<block_height>:<event_index>"` — an opaque,
|
|
280
|
-
* monotonic resume token. One implementation so encode/decode and the
|
|
281
|
-
* empty-range sentinel can never drift between products.
|
|
282
|
-
*
|
|
283
|
-
* NOTE: this codec IS the shared piece worth centralizing. A broader "shared
|
|
284
|
-
* canonical reader" across the ~10 raw-event query sites (streams-events,
|
|
285
|
-
* streams-bulk/query, l2/storage) was deliberately NOT built: those sites split
|
|
286
|
-
* into distinct query patterns and share only the row_number ordering *pattern*,
|
|
287
|
-
* not an identical reader. The reorg-archive design (migration 0084) keeps the
|
|
288
|
-
* main tables canonical-only, so each reader's `WHERE canonical` filter already
|
|
289
|
-
* needs no dedup logic. Forcing one mega-reader was the wrong abstraction; this
|
|
290
|
-
* codec captures the only part that actually drifts.
|
|
291
|
-
*/
|
|
292
|
-
type StreamsCursor = {
|
|
293
|
-
block_height: number
|
|
294
|
-
event_index: number
|
|
295
|
-
};
|
|
296
|
-
type CanonicalBlock = {
|
|
297
|
-
height: number
|
|
298
|
-
hash: string
|
|
299
|
-
};
|
|
300
|
-
type DecoderClockEvent = {
|
|
301
|
-
cursor: string
|
|
302
|
-
block_hash: string
|
|
303
|
-
matched: boolean
|
|
304
|
-
};
|
|
305
|
-
type DecoderClockInput = {
|
|
306
|
-
start_height: number
|
|
307
|
-
/** Exclusive. Null = before `start_height`. */
|
|
308
|
-
from_cursor: string | null
|
|
309
|
-
/** Exclusive high-water after this batch. */
|
|
310
|
-
to_cursor: string
|
|
311
|
-
blocks: readonly CanonicalBlock[]
|
|
312
|
-
events: readonly DecoderClockEvent[]
|
|
313
|
-
};
|
|
314
|
-
type DecoderClockReceipt = {
|
|
315
|
-
height: number
|
|
316
|
-
hash: string
|
|
317
|
-
input_count: number
|
|
318
|
-
input_cursors: string[]
|
|
319
|
-
input_digest: string
|
|
320
|
-
through_cursor: string
|
|
321
|
-
no_match: boolean
|
|
322
|
-
};
|
|
323
|
-
type DecoderClockResult = {
|
|
324
|
-
ok: true
|
|
325
|
-
receipts: DecoderClockReceipt[]
|
|
326
|
-
through_cursor: string
|
|
327
|
-
} | {
|
|
328
|
-
ok: false
|
|
329
|
-
reason: string
|
|
330
|
-
receipts: DecoderClockReceipt[]
|
|
331
|
-
};
|
|
332
|
-
declare function inputDigest(cursors: readonly string[]): string;
|
|
333
|
-
declare function cursorIsAfterBlock(cursor: StreamsCursor, height: number): boolean;
|
|
334
|
-
/** True when `from` is strictly before the first event that can live in `height`. */
|
|
335
|
-
declare function cursorIsBeforeBlock(cursor: StreamsCursor, height: number): boolean;
|
|
336
|
-
declare function planDecoderReceipts(input: DecoderClockInput): DecoderClockResult;
|
|
337
163
|
import { Kysely } from "kysely";
|
|
338
164
|
import { ColumnType, Generated } from "kysely";
|
|
339
165
|
/**
|
|
@@ -1034,6 +860,13 @@ interface BnsNamespacesTable {
|
|
|
1034
860
|
* `index_block_hash` marks a caller-declared contract-constant value, cached
|
|
1035
861
|
* once per contract+args instead of once per block.
|
|
1036
862
|
*/
|
|
863
|
+
interface EventsTotalBaselineTable {
|
|
864
|
+
id: Generated<boolean>;
|
|
865
|
+
through: ColumnType<number | null, number | null | undefined, number | null>;
|
|
866
|
+
count: ColumnType<string | null, string | number | null | undefined, string | number | null>;
|
|
867
|
+
taken_at: Date | null;
|
|
868
|
+
claimed_at: Date | null;
|
|
869
|
+
}
|
|
1037
870
|
interface ChainReadCacheTable {
|
|
1038
871
|
id: Generated<number>;
|
|
1039
872
|
contract_id: string;
|
|
@@ -1177,6 +1010,7 @@ interface Database {
|
|
|
1177
1010
|
bns_namespaces: BnsNamespacesTable;
|
|
1178
1011
|
service_heartbeats: ServiceHeartbeatsTable;
|
|
1179
1012
|
chain_read_cache: ChainReadCacheTable;
|
|
1013
|
+
events_total_baseline: EventsTotalBaselineTable;
|
|
1180
1014
|
pending_fork_blocks: PendingForkBlocksTable;
|
|
1181
1015
|
observer_journal: ObserverJournalTable;
|
|
1182
1016
|
sync_scopes: SyncScopesTable;
|
|
@@ -1764,172 +1598,6 @@ declare function commitDecoderAdapter(db: Kysely<Database>, input: DecoderAdapte
|
|
|
1764
1598
|
* stays on the single-entry path.
|
|
1765
1599
|
*/
|
|
1766
1600
|
declare function commitDecoderAdapterBatch(db: Kysely<Database>, inputs: readonly Omit<DecoderAdapterCommit, "crashAfter">[]): Promise<void>;
|
|
1767
|
-
type SealableReceipt = {
|
|
1768
|
-
height: number
|
|
1769
|
-
hash: string
|
|
1770
|
-
input_digest: string
|
|
1771
|
-
effect_digest: string
|
|
1772
|
-
finalized: boolean
|
|
1773
|
-
};
|
|
1774
|
-
type SealedSegment = {
|
|
1775
|
-
from_height: number
|
|
1776
|
-
to_height: number
|
|
1777
|
-
chain_digest: string
|
|
1778
|
-
input_digest: string
|
|
1779
|
-
output_digest: string
|
|
1780
|
-
};
|
|
1781
|
-
type SealResult = {
|
|
1782
|
-
ok: true
|
|
1783
|
-
segment: SealedSegment
|
|
1784
|
-
compacted: number
|
|
1785
|
-
} | {
|
|
1786
|
-
ok: false
|
|
1787
|
-
reason: string
|
|
1788
|
-
};
|
|
1789
|
-
declare function rangeDigestOf(parts: readonly string[]): string;
|
|
1790
|
-
declare function sealFinalizedRange(receipts: readonly SealableReceipt[], range: CoverageRange): SealResult;
|
|
1791
|
-
/** After a reorg at `fork`, any sealed segment that overlaps cannot stay green. */
|
|
1792
|
-
declare function segmentsSurviveReorg(segments: readonly SealedSegment[], fork: number): SealedSegment[];
|
|
1793
|
-
declare function receiptsAfterReorg(receipts: readonly SealableReceipt[], fork: number): SealableReceipt[];
|
|
1794
|
-
type EffectOp = "insert" | "update" | "delete" | "increment";
|
|
1795
|
-
type EffectMutation = {
|
|
1796
|
-
op: EffectOp
|
|
1797
|
-
table: string
|
|
1798
|
-
key: Record<string, string | number | boolean | null>
|
|
1799
|
-
value?: Record<string, string | number | boolean | null>
|
|
1800
|
-
};
|
|
1801
|
-
declare function canonicalizeMutations(ops: readonly EffectMutation[]): EffectMutation[];
|
|
1802
|
-
declare function hashEffectManifest(ops: readonly EffectMutation[]): string;
|
|
1803
|
-
declare function manifestsEqual(a: readonly EffectMutation[], b: readonly EffectMutation[]): boolean;
|
|
1804
|
-
declare const SUBGRAPH_COMMIT_STEPS: readonly ["effects", "rows", "journal", "cursor", "receipt", "failure"];
|
|
1805
|
-
type SubgraphCommitStep = (typeof SUBGRAPH_COMMIT_STEPS)[number];
|
|
1806
|
-
declare class SubgraphAdapterCrash extends Error {
|
|
1807
|
-
readonly step: SubgraphCommitStep;
|
|
1808
|
-
readonly name = "SubgraphAdapterCrash";
|
|
1809
|
-
constructor(step: SubgraphCommitStep);
|
|
1810
|
-
}
|
|
1811
|
-
type SubgraphCommitInput = {
|
|
1812
|
-
stage_id: string
|
|
1813
|
-
effects: readonly EffectMutation[]
|
|
1814
|
-
receipts: readonly (DecoderClockReceipt & {
|
|
1815
|
-
effect_digest: string
|
|
1816
|
-
})[]
|
|
1817
|
-
failure?: DecoderAdapterFailure | null
|
|
1818
|
-
writeEffects: () => Promise<void>
|
|
1819
|
-
writeRows: () => Promise<void>
|
|
1820
|
-
writeJournal: () => Promise<void>
|
|
1821
|
-
writeCursor: () => Promise<void>
|
|
1822
|
-
writeReceipts: () => Promise<void>
|
|
1823
|
-
writeFailure: () => Promise<void>
|
|
1824
|
-
crashAfter?: SubgraphCommitStep
|
|
1825
|
-
};
|
|
1826
|
-
declare function runSubgraphCommitSteps(steps: Record<SubgraphCommitStep, () => Promise<void>>, crashAfter?: SubgraphCommitStep): Promise<void>;
|
|
1827
|
-
declare function commitSubgraphAdapter(input: SubgraphCommitInput, wrap?: (fn: () => Promise<void>) => Promise<void>): Promise<void>;
|
|
1828
|
-
type SparseSkip = CoverageRange & {
|
|
1829
|
-
reason: "no-match" | "filtered"
|
|
1830
|
-
};
|
|
1831
|
-
type HeightDigest = {
|
|
1832
|
-
height: number
|
|
1833
|
-
hash: string
|
|
1834
|
-
effect_digest: string
|
|
1835
|
-
row_digest: string
|
|
1836
|
-
};
|
|
1837
|
-
declare function sequentialDigests(heights: readonly HeightDigest[]): {
|
|
1838
|
-
chain: string
|
|
1839
|
-
effect: string
|
|
1840
|
-
row: string
|
|
1841
|
-
};
|
|
1842
|
-
declare function sparseDigests(executed: readonly HeightDigest[], skips: readonly {
|
|
1843
|
-
skip: SparseSkip
|
|
1844
|
-
hash: string
|
|
1845
|
-
}[]): {
|
|
1846
|
-
chain: string
|
|
1847
|
-
effect: string
|
|
1848
|
-
row: string
|
|
1849
|
-
};
|
|
1850
|
-
declare function proofsAgree(sequential: {
|
|
1851
|
-
chain: string
|
|
1852
|
-
effect: string
|
|
1853
|
-
row: string
|
|
1854
|
-
}, sparse: {
|
|
1855
|
-
chain: string
|
|
1856
|
-
effect: string
|
|
1857
|
-
row: string
|
|
1858
|
-
}): boolean;
|
|
1859
|
-
type RowSnapshot = {
|
|
1860
|
-
table: string
|
|
1861
|
-
key: string
|
|
1862
|
-
value: string
|
|
1863
|
-
};
|
|
1864
|
-
declare function finalRowDigest(rows: readonly RowSnapshot[]): string;
|
|
1865
|
-
declare function applyMutations(rows: readonly RowSnapshot[], ops: readonly EffectMutation[]): RowSnapshot[];
|
|
1866
|
-
type DeepVerifyResult = {
|
|
1867
|
-
ok: boolean
|
|
1868
|
-
live_digest: string
|
|
1869
|
-
scratch_digest: string
|
|
1870
|
-
found_mutation: boolean
|
|
1871
|
-
};
|
|
1872
|
-
declare function deepVerify(opts: {
|
|
1873
|
-
live: readonly RowSnapshot[]
|
|
1874
|
-
replay: readonly EffectMutation[]
|
|
1875
|
-
seed?: EffectMutation
|
|
1876
|
-
}): DeepVerifyResult;
|
|
1877
|
-
declare const QUEUE_STAGES: readonly ["decision", "outbox", "delivery", "rollback", "dlq", "replay"];
|
|
1878
|
-
type QueueStage = (typeof QUEUE_STAGES)[number];
|
|
1879
|
-
type QueueEvent = {
|
|
1880
|
-
type: "accept"
|
|
1881
|
-
} | {
|
|
1882
|
-
type: "decide"
|
|
1883
|
-
matched: boolean
|
|
1884
|
-
} | {
|
|
1885
|
-
type: "enqueue"
|
|
1886
|
-
} | {
|
|
1887
|
-
type: "deliver"
|
|
1888
|
-
} | {
|
|
1889
|
-
type: "fail"
|
|
1890
|
-
} | {
|
|
1891
|
-
type: "dead"
|
|
1892
|
-
} | {
|
|
1893
|
-
type: "requeue"
|
|
1894
|
-
} | {
|
|
1895
|
-
type: "rollback"
|
|
1896
|
-
} | {
|
|
1897
|
-
type: "replay"
|
|
1898
|
-
cursor: string
|
|
1899
|
-
};
|
|
1900
|
-
type QueueState = QueueCounters & {
|
|
1901
|
-
stage: QueueStage
|
|
1902
|
-
last_cursor: string | null
|
|
1903
|
-
dedupe: Set<string>
|
|
1904
|
-
};
|
|
1905
|
-
declare function emptyQueueState(): QueueState;
|
|
1906
|
-
type QueueApply = {
|
|
1907
|
-
ok: true
|
|
1908
|
-
state: QueueState
|
|
1909
|
-
} | {
|
|
1910
|
-
ok: false
|
|
1911
|
-
reason: string
|
|
1912
|
-
state: QueueState
|
|
1913
|
-
};
|
|
1914
|
-
declare function applyQueueEvent(state: QueueState, event: QueueEvent, dedupeKey?: string): QueueApply;
|
|
1915
|
-
declare function queueCaughtUp(state: QueueState): boolean;
|
|
1916
|
-
declare const SAFE_REPAIR_MODES: readonly RepairMode[];
|
|
1917
|
-
type RepairDefect = "gap" | "digest_mismatch" | "omission" | "version" | "reorg" | "source_gap";
|
|
1918
|
-
type RepairPlan = {
|
|
1919
|
-
stage_id: string
|
|
1920
|
-
range: CoverageRange
|
|
1921
|
-
mode: RepairMode
|
|
1922
|
-
defect: RepairDefect
|
|
1923
|
-
safe: boolean
|
|
1924
|
-
reason: string
|
|
1925
|
-
};
|
|
1926
|
-
declare function planRepair(input: {
|
|
1927
|
-
stage_id: string
|
|
1928
|
-
range: CoverageRange
|
|
1929
|
-
mode: RepairMode
|
|
1930
|
-
defect: RepairDefect
|
|
1931
|
-
range_safe_proven?: boolean
|
|
1932
|
-
}): RepairPlan;
|
|
1933
1601
|
declare const VERIFY_EXIT: {
|
|
1934
1602
|
readonly CLEAN: 0
|
|
1935
1603
|
readonly DIVERGED: 1
|
|
@@ -1965,4 +1633,4 @@ declare function reportVerify(opts: {
|
|
|
1965
1633
|
diverged?: boolean
|
|
1966
1634
|
detail?: string
|
|
1967
1635
|
}): VerifyReport;
|
|
1968
|
-
export { BootstrapSource, COVERAGE_REPORT_SCHEMA_VERSION, COVERAGE_STATES,
|
|
1636
|
+
export { BootstrapSource, COVERAGE_REPORT_SCHEMA_VERSION, COVERAGE_STATES, CoverageRange, CoverageReport, CoverageState, DECODER_COMMIT_STEPS, DecoderAdapterCommit, DecoderAdapterCrash, DecoderAdapterFailure, DecoderCommitStep, EvaluatorInput, EvaluatorOptions, FAILURE_CLASSES, FAILURE_RETENTION_DAYS, FAILURE_UNITS, FailureClass, FailureRow, FailureUnit, NATIVE_CLOCKS, NativeClock, OpenFailure, QueueCounters, REPAIR_MODES, RETRY_STATES, RUN_STATUSES, RepairMode, RetryState, RunStatus, STAGE_KINDS, SourceClock, StageCoverage, StageDeclaration, StageEvidence, StageKind, StageRunView, SyncScope, VERIFY_EXIT, VerifyExit, VerifyMode, VerifyReport, VerifyTarget, commitDecoderAdapter, commitDecoderAdapterBatch, contiguousThrough, cursorHeight, datasetMatchesTarget, defaultRetainUntil, evaluateCoverage, failureRangeHolds, failureRetentionHolds, findRangeGaps, isFailureClass, isFailureUnit, isNativeClock, isNonNegativeInt, isRepairMode, isRetryState, isRunStatus, isStageKind, mergeRanges, parseVerifyTarget, rangeIsOrdered, reportVerify, rewindDecoderCheckpoint, runDecoderCommitSteps, topoSort };
|