opencode-swarm 7.143.6 → 7.144.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/background/delegation-health.d.ts +213 -0
- package/dist/background/pending-delegations.d.ts +122 -15
- package/dist/cli/{config-doctor-72zp0k4x.js → config-doctor-7gy47evn.js} +2 -2
- package/dist/cli/{core-aj0wmbg8.js → core-cpcspaw5.js} +1 -1
- package/dist/cli/{curator-llm-factory-x1vjhrnc.js → curator-llm-factory-fyjmgxyp.js} +18 -18
- package/dist/cli/{curator-2gt2835v.js → curator-v97jnwn2.js} +18 -18
- package/dist/cli/{evidence-summary-service-yjr0662r.js → evidence-summary-service-79mtxzhd.js} +6 -6
- package/dist/cli/{gate-evidence-r3c7eqpz.js → gate-evidence-kgyqz1g1.js} +2 -2
- package/dist/cli/{guardrail-explain-f3zysesy.js → guardrail-explain-9ry66z5g.js} +19 -19
- package/dist/cli/{guardrail-log-eat71fnh.js → guardrail-log-fe6smme1.js} +3 -3
- package/dist/cli/{hive-promoter-fyb40am9.js → hive-promoter-vwq1dbh1.js} +18 -18
- package/dist/cli/{index-hjy4txgr.js → index-0ck3e366.js} +1 -1
- package/dist/cli/{index-peqmw3wr.js → index-1pr8x10a.js} +2 -2
- package/dist/cli/{index-02nm8qhk.js → index-269b52r3.js} +3 -3
- package/dist/cli/{index-7bs015gm.js → index-3q9w6e6v.js} +1 -1
- package/dist/cli/{index-w1q9yy1e.js → index-3v3dxf75.js} +3 -3
- package/dist/cli/{index-6vmazy9f.js → index-4fda8kkw.js} +1050 -88
- package/dist/cli/{index-fn0k0vsa.js → index-6p09gyra.js} +1 -1
- package/dist/cli/{index-kc2x117y.js → index-8xertnqz.js} +3 -3
- package/dist/cli/{index-36vry26a.js → index-d45d4zyq.js} +1 -1
- package/dist/cli/{index-nd1j9wkw.js → index-d45yrzkg.js} +1 -1
- package/dist/cli/{index-dtf2va28.js → index-e70d3xr7.js} +20 -20
- package/dist/cli/{index-whyrhjsk.js → index-evvbmbbv.js} +1 -1
- package/dist/cli/{index-gzxz0s50.js → index-ewzmjm7m.js} +1 -1
- package/dist/cli/{index-0adcjpyx.js → index-ez18gjk2.js} +3 -3
- package/dist/cli/{index-5d8ydxae.js → index-j1scj25g.js} +129 -50
- package/dist/cli/{index-wjk00vwk.js → index-jqabjy7t.js} +4 -4
- package/dist/cli/{index-bbv64s17.js → index-jvbfrwt2.js} +1 -1
- package/dist/cli/{index-92bm9ys3.js → index-mw6p3nt6.js} +1 -1
- package/dist/cli/{index-72zhsqgy.js → index-rd2082y4.js} +2 -2
- package/dist/cli/{index-s7nb33pc.js → index-tfkfyshg.js} +1 -1
- package/dist/cli/{index-scj2asek.js → index-vb9cpaz4.js} +5 -5
- package/dist/cli/{index-z4cv77tq.js → index-zv4pwyas.js} +2 -2
- package/dist/cli/index.js +18 -18
- package/dist/cli/{knowledge-escalator-ejpyrby0.js → knowledge-escalator-rmy3jcx4.js} +6 -6
- package/dist/cli/{knowledge-events-yw2kydyy.js → knowledge-events-1tqpbwvj.js} +4 -4
- package/dist/cli/{knowledge-store-j6gkk62e.js → knowledge-store-389ck792.js} +1 -1
- package/dist/cli/{knowledge-validator-xervpe5k.js → knowledge-validator-kvtk6633.js} +2 -2
- package/dist/cli/{pending-delegations-19wg9j08.js → pending-delegations-thy8g30k.js} +23 -1
- package/dist/cli/{scan-cursor-x7a99wmq.js → scan-cursor-ahgm4f5p.js} +2 -2
- package/dist/cli/{schema-z141arx9.js → schema-epdq7ykx.js} +1 -1
- package/dist/cli/{scope-persistence-js90c1f4.js → scope-persistence-37s9n40v.js} +4 -4
- package/dist/cli/{skill-generator-t202jza0.js → skill-generator-4d2t5gem.js} +7 -7
- package/dist/cli/{worktree-collision-ownership-42bb3gcb.js → worktree-collision-ownership-j6d33p49.js} +1 -1
- package/dist/cli/{worktree-isolation-fbfvxw9a.js → worktree-isolation-4628yaka.js} +18 -18
- package/dist/evaluation/contracts.d.ts +4 -4
- package/dist/evaluation/gate-ground-truth.d.ts +1 -1
- package/dist/hooks/init-orphan-recovery.d.ts +2 -0
- package/dist/index.js +439 -436
- package/dist/services/status-service.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable health/status artifact for the background-delegation store (issue #2034,
|
|
3
|
+
* parent #1659).
|
|
4
|
+
*
|
|
5
|
+
* This module owns ONLY the `.swarm/background-delegations-health.json` artifact:
|
|
6
|
+
* a bounded, machine-readable observation copy of ledger health (bytes/limit/
|
|
7
|
+
* pressure, last successful checkpoint, recovery source, the most recent durable
|
|
8
|
+
* uncertainty, and live-set counters). It deliberately imports nothing from the
|
|
9
|
+
* store itself so `pending-delegations.ts` can write the artifact while holding
|
|
10
|
+
* the store lock without an import cycle, and so `/swarm status` can read it with
|
|
11
|
+
* nothing more than `statSync` + one small JSON read — never a ledger fold.
|
|
12
|
+
*
|
|
13
|
+
* The artifact is an OBSERVATION copy, never an ownership or settlement record
|
|
14
|
+
* (issue requirement 8): deleting it loses no state, only visibility. Counters
|
|
15
|
+
* are computed and refreshed by the store (at compaction time, under the store
|
|
16
|
+
* lock) and by recovery observations; readers treat a missing artifact as
|
|
17
|
+
* "nothing to report" rather than "healthy".
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
export declare const BACKGROUND_DELEGATIONS_HEALTH_FILE = "background-delegations-health.json";
|
|
21
|
+
/**
|
|
22
|
+
* Strict recovery bound for the delegation ledger/tail (issue #2034: the
|
|
23
|
+
* guard itself is unchanged — compaction exists so normal operation never
|
|
24
|
+
* approaches it). Lives here so the health module can default a valid artifact
|
|
25
|
+
* without importing the store (no import cycle).
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAX_RECOVERY_LEDGER_BYTES: number;
|
|
28
|
+
export type DelegationLedgerPressureBand = 'ok' | 'nominal' | 'compact-overdue' | 'fail-closed';
|
|
29
|
+
export interface DelegationCheckpointAuditSummary {
|
|
30
|
+
dispatchCount: number;
|
|
31
|
+
terminalsByStatus: {
|
|
32
|
+
completed: number;
|
|
33
|
+
error: number;
|
|
34
|
+
cancelled: number;
|
|
35
|
+
stale: number;
|
|
36
|
+
};
|
|
37
|
+
settledCount: number;
|
|
38
|
+
preservedCount: number;
|
|
39
|
+
lateTerminalCount: number;
|
|
40
|
+
compactedTransitionCount: number;
|
|
41
|
+
compactedRecordCount: number;
|
|
42
|
+
firstDispatchAt: number | null;
|
|
43
|
+
lastTerminalAt: number | null;
|
|
44
|
+
lastCompactionAt: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DelegationHealthCheckpointSection {
|
|
47
|
+
sequence: number;
|
|
48
|
+
createdAt: number;
|
|
49
|
+
liveRecords: number;
|
|
50
|
+
closedSummaries: number;
|
|
51
|
+
bytes: number;
|
|
52
|
+
audit: DelegationCheckpointAuditSummary;
|
|
53
|
+
}
|
|
54
|
+
export interface DelegationHealthRecoverySection {
|
|
55
|
+
source: 'checkpoint+tail' | 'checkpoint+ledger-suffix' | 'legacy-ledger' | 'unknown';
|
|
56
|
+
at: number;
|
|
57
|
+
ok: boolean;
|
|
58
|
+
reason?: string;
|
|
59
|
+
repairHint?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface DelegationHealthUncertaintySection {
|
|
62
|
+
reason: string;
|
|
63
|
+
at: number;
|
|
64
|
+
source: string;
|
|
65
|
+
repairHint?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface DelegationLedgerHealth {
|
|
68
|
+
schemaVersion: 1;
|
|
69
|
+
updatedAt: number;
|
|
70
|
+
ledger: {
|
|
71
|
+
bytes: number;
|
|
72
|
+
limitBytes: number;
|
|
73
|
+
pressurePct: number;
|
|
74
|
+
band: DelegationLedgerPressureBand;
|
|
75
|
+
};
|
|
76
|
+
checkpoint: DelegationHealthCheckpointSection | null;
|
|
77
|
+
recovery: DelegationHealthRecoverySection | null;
|
|
78
|
+
lastUncertainty: DelegationHealthUncertaintySection | null;
|
|
79
|
+
counts: {
|
|
80
|
+
activeOwners: number;
|
|
81
|
+
pendingAdvisories: number;
|
|
82
|
+
lateTerminals: number;
|
|
83
|
+
orphanWorktreeOwners: number;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export declare const DelegationCheckpointAuditSchema: z.ZodObject<{
|
|
87
|
+
dispatchCount: z.ZodNumber;
|
|
88
|
+
terminalsByStatus: z.ZodObject<{
|
|
89
|
+
completed: z.ZodNumber;
|
|
90
|
+
error: z.ZodNumber;
|
|
91
|
+
cancelled: z.ZodNumber;
|
|
92
|
+
stale: z.ZodNumber;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
settledCount: z.ZodNumber;
|
|
95
|
+
preservedCount: z.ZodNumber;
|
|
96
|
+
lateTerminalCount: z.ZodNumber;
|
|
97
|
+
compactedTransitionCount: z.ZodNumber;
|
|
98
|
+
compactedRecordCount: z.ZodNumber;
|
|
99
|
+
firstDispatchAt: z.ZodNullable<z.ZodNumber>;
|
|
100
|
+
lastTerminalAt: z.ZodNullable<z.ZodNumber>;
|
|
101
|
+
lastCompactionAt: z.ZodNumber;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
export declare const DelegationLedgerHealthSchema: z.ZodObject<{
|
|
104
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
105
|
+
updatedAt: z.ZodNumber;
|
|
106
|
+
ledger: z.ZodObject<{
|
|
107
|
+
bytes: z.ZodNumber;
|
|
108
|
+
limitBytes: z.ZodNumber;
|
|
109
|
+
pressurePct: z.ZodNumber;
|
|
110
|
+
band: z.ZodEnum<{
|
|
111
|
+
ok: "ok";
|
|
112
|
+
nominal: "nominal";
|
|
113
|
+
"compact-overdue": "compact-overdue";
|
|
114
|
+
"fail-closed": "fail-closed";
|
|
115
|
+
}>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
checkpoint: z.ZodNullable<z.ZodObject<{
|
|
118
|
+
sequence: z.ZodNumber;
|
|
119
|
+
createdAt: z.ZodNumber;
|
|
120
|
+
liveRecords: z.ZodNumber;
|
|
121
|
+
closedSummaries: z.ZodNumber;
|
|
122
|
+
bytes: z.ZodNumber;
|
|
123
|
+
audit: z.ZodObject<{
|
|
124
|
+
dispatchCount: z.ZodNumber;
|
|
125
|
+
terminalsByStatus: z.ZodObject<{
|
|
126
|
+
completed: z.ZodNumber;
|
|
127
|
+
error: z.ZodNumber;
|
|
128
|
+
cancelled: z.ZodNumber;
|
|
129
|
+
stale: z.ZodNumber;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
settledCount: z.ZodNumber;
|
|
132
|
+
preservedCount: z.ZodNumber;
|
|
133
|
+
lateTerminalCount: z.ZodNumber;
|
|
134
|
+
compactedTransitionCount: z.ZodNumber;
|
|
135
|
+
compactedRecordCount: z.ZodNumber;
|
|
136
|
+
firstDispatchAt: z.ZodNullable<z.ZodNumber>;
|
|
137
|
+
lastTerminalAt: z.ZodNullable<z.ZodNumber>;
|
|
138
|
+
lastCompactionAt: z.ZodNumber;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
recovery: z.ZodNullable<z.ZodObject<{
|
|
142
|
+
source: z.ZodEnum<{
|
|
143
|
+
unknown: "unknown";
|
|
144
|
+
"checkpoint+tail": "checkpoint+tail";
|
|
145
|
+
"checkpoint+ledger-suffix": "checkpoint+ledger-suffix";
|
|
146
|
+
"legacy-ledger": "legacy-ledger";
|
|
147
|
+
}>;
|
|
148
|
+
at: z.ZodNumber;
|
|
149
|
+
ok: z.ZodBoolean;
|
|
150
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
151
|
+
repairHint: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
lastUncertainty: z.ZodNullable<z.ZodObject<{
|
|
154
|
+
reason: z.ZodString;
|
|
155
|
+
at: z.ZodNumber;
|
|
156
|
+
source: z.ZodString;
|
|
157
|
+
repairHint: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
counts: z.ZodObject<{
|
|
160
|
+
activeOwners: z.ZodNumber;
|
|
161
|
+
pendingAdvisories: z.ZodNumber;
|
|
162
|
+
lateTerminals: z.ZodNumber;
|
|
163
|
+
orphanWorktreeOwners: z.ZodNumber;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
/**
|
|
167
|
+
* Test seam for the atomic-rename retry (issue #2034): tests inject a
|
|
168
|
+
* transient EPERM here to exercise the real retry loop.
|
|
169
|
+
*/
|
|
170
|
+
export declare const _healthInternals: {
|
|
171
|
+
renameOnce: (from: string, to: string) => void;
|
|
172
|
+
};
|
|
173
|
+
export declare function healthArtifactPath(directory: string): string;
|
|
174
|
+
/** Read the health artifact; null when absent or malformed (readers fail open). */
|
|
175
|
+
export declare function readDelegationHealthArtifact(directory: string): DelegationLedgerHealth | null;
|
|
176
|
+
/**
|
|
177
|
+
* Merge a partial update into the current artifact and write it atomically.
|
|
178
|
+
* Callers that can hold the store lock must do so (compaction, recovery
|
|
179
|
+
* observation); standalone readers never write. Merge is section-wise: a null
|
|
180
|
+
* section clears it, an undefined section preserves the existing value.
|
|
181
|
+
*/
|
|
182
|
+
export declare function writeDelegationHealthArtifact(directory: string, update: {
|
|
183
|
+
ledger?: DelegationLedgerHealth['ledger'];
|
|
184
|
+
checkpoint?: DelegationLedgerHealth['checkpoint'] | null;
|
|
185
|
+
recovery?: DelegationLedgerHealth['recovery'] | null;
|
|
186
|
+
lastUncertainty?: DelegationLedgerHealth['lastUncertainty'] | null;
|
|
187
|
+
counts?: DelegationLedgerHealth['counts'];
|
|
188
|
+
uncertainty?: DelegationHealthUncertaintySection;
|
|
189
|
+
}): DelegationLedgerHealth | null;
|
|
190
|
+
/**
|
|
191
|
+
* Record a startup-recovery observation (called by init-orphan-recovery after
|
|
192
|
+
* its scans): how the primary store was reconstructed and whether it succeeded.
|
|
193
|
+
* A failing observation also becomes the durable `lastUncertainty`, so the
|
|
194
|
+
* incident stays visible in `/swarm status` after the in-memory failure is gone
|
|
195
|
+
* (issue #1659). Best-effort: never throws.
|
|
196
|
+
*/
|
|
197
|
+
export declare function recordDelegationRecoveryObservation(directory: string, observation: {
|
|
198
|
+
source: 'checkpoint+tail' | 'checkpoint+ledger-suffix' | 'legacy-ledger' | 'unknown';
|
|
199
|
+
ok: boolean;
|
|
200
|
+
reason?: string;
|
|
201
|
+
repairHint?: string;
|
|
202
|
+
}): void;
|
|
203
|
+
/**
|
|
204
|
+
* Fold-free health collection for `/swarm status`: statSync of the ledger and
|
|
205
|
+
* checkpoint, a display-tolerant manifest peek (sequence/tailRolled only), and
|
|
206
|
+
* the durable artifact. Never reads or folds the ledger contents, so the status
|
|
207
|
+
* path stays bounded no matter how much history exists (issue #2034 critic #5).
|
|
208
|
+
*/
|
|
209
|
+
export declare function collectDelegationLedgerHealth(directory: string, options: {
|
|
210
|
+
ledgerLimitBytes: number;
|
|
211
|
+
lowWaterBytes: number;
|
|
212
|
+
highWaterBytes: number;
|
|
213
|
+
}): DelegationLedgerHealth | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Durable pending background-delegation store (issue #1151, PR 2 Stage A
|
|
2
|
+
* Durable pending background-delegation store (issue #1151, PR 2 Stage A;
|
|
3
|
+
* bounded recovery via checkpoint/tail compaction — issue #2034).
|
|
3
4
|
*
|
|
4
5
|
* Append-only JSONL event log under project-root `.swarm/background-delegations.jsonl`.
|
|
5
6
|
* Each line is a full record snapshot; readers fold to the latest snapshot per
|
|
@@ -7,34 +8,79 @@
|
|
|
7
8
|
* async advisory lanes so trusted completions can be correlated to a real dispatch.
|
|
8
9
|
* The stale sweep bounds the number of permanently-running entries by transitioning
|
|
9
10
|
* them to `stale`, so the folded in-memory view stays bounded by distinct correlationIds.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* Bounded recovery (issue #2034): the raw log alone is no longer the recovery
|
|
13
|
+
* source once history grows. Compaction — run lazily under the store lock when the
|
|
14
|
+
* ledger passes `DELEGATION_COMPACTION_HIGH_WATER_BYTES` — checkpoints the folded
|
|
15
|
+
* authoritative state (active ownership, terminal results, coder settlement, pending
|
|
16
|
+
* advisory inbox) plus compact closed-record summaries into
|
|
17
|
+
* `.swarm/background-delegations.checkpoint.json`, publishes it via
|
|
18
|
+
* `.swarm/background-delegations.manifest.json`, and rolls the ledger to the
|
|
19
|
+
* post-cut transition tail. Recovery folds checkpoint + bounded tail with hard
|
|
20
|
+
* byte/count bounds and preserves fail-closed uncertainty; the 4 MiB
|
|
21
|
+
* `MAX_RECOVERY_LEDGER_BYTES` guard is unchanged and still applies to legacy
|
|
22
|
+
* uncheckpointed ledgers.
|
|
12
23
|
*
|
|
13
24
|
* Scope: dispatch records `pending`/`running` snapshots, collection or trusted synthetic
|
|
14
25
|
* completions record terminal snapshots, and the stale sweep records `stale` snapshots.
|
|
15
26
|
* This store itself has no gate-advancement side effect. Stage B gate ingestion is a
|
|
16
|
-
* separate consumer of trusted terminal snapshots.
|
|
27
|
+
* separate consumer of trusted terminal snapshots. Circuit-breaker and transient-retry
|
|
28
|
+
* counters are invocation-owned and are NEVER serialized here (issue #2034 req 9).
|
|
17
29
|
*
|
|
18
|
-
* Concurrency: all writes (append, sweep) run under a single
|
|
19
|
-
* `withEvidenceLock`, so concurrent dispatches/sweeps cannot
|
|
20
|
-
* lock-free (line-oriented; partial trailing lines are
|
|
30
|
+
* Concurrency: all writes (append, sweep, compaction) run under a single
|
|
31
|
+
* project-scoped lock via `withEvidenceLock`, so concurrent dispatches/sweeps cannot
|
|
32
|
+
* interleave appends. Reads are lock-free (line-oriented; partial trailing lines are
|
|
33
|
+
* skipped defensively by the lenient reader; the strict recovery reader fails closed).
|
|
21
34
|
*
|
|
22
|
-
* Containment:
|
|
23
|
-
* `.swarm/` (Invariant 4).
|
|
35
|
+
* Containment: every path is validated with `validateSwarmPath`, so it can never
|
|
36
|
+
* escape `.swarm/` (Invariant 4).
|
|
24
37
|
*/
|
|
38
|
+
import { type DelegationCheckpointAuditSummary } from './delegation-health.js';
|
|
25
39
|
export declare const BACKGROUND_DELEGATIONS_FILE = "background-delegations.jsonl";
|
|
26
40
|
export declare const BACKGROUND_DELEGATION_FALLBACK_DIR = "background-delegation-fallback";
|
|
27
41
|
export declare const BACKGROUND_CODER_RESERVATIONS_FILE = "background-coder-reservations.json";
|
|
42
|
+
export declare const BACKGROUND_DELEGATIONS_CHECKPOINT_FILE = "background-delegations.checkpoint.json";
|
|
43
|
+
export declare const BACKGROUND_DELEGATIONS_MANIFEST_FILE = "background-delegations.manifest.json";
|
|
28
44
|
export declare const MAX_LIVE_BACKGROUND_FALLBACKS = 256;
|
|
29
45
|
export declare const MAX_LIVE_BACKGROUND_CODER_RESERVATIONS = 256;
|
|
30
46
|
export declare const MAX_BACKGROUND_OBSERVED_FILES = 5000;
|
|
31
47
|
export declare const MAX_BACKGROUND_ADVISORY_CHARS = 4000;
|
|
48
|
+
/** Strict recovery bound for the ledger/tail (issue #2034: unchanged guard). */
|
|
49
|
+
export { MAX_RECOVERY_LEDGER_BYTES } from './delegation-health.js';
|
|
50
|
+
/**
|
|
51
|
+
* Compaction watermarks (issue #2034). Auto-compaction fires above the high
|
|
52
|
+
* water mark so the post-roll tail plus one in-flight append (~250 KiB worst
|
|
53
|
+
* case) stays far below the 4 MiB strict recovery bound in normal operation.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DELEGATION_COMPACTION_LOW_WATER_BYTES: number;
|
|
56
|
+
export declare const DELEGATION_COMPACTION_HIGH_WATER_BYTES: number;
|
|
57
|
+
/** Hard validation bound for the checkpoint file on every read. */
|
|
58
|
+
export declare const MAX_CHECKPOINT_BYTES: number;
|
|
59
|
+
/** Hard validation bound for live (non-summary) records in a checkpoint. */
|
|
60
|
+
export declare const MAX_CHECKPOINT_RECORDS = 2048;
|
|
61
|
+
/**
|
|
62
|
+
* Closed-record summaries younger than this are never evicted to meet the
|
|
63
|
+
* checkpoint byte budget — evicting them would let a replayed dispatch of a
|
|
64
|
+
* recently closed session be recorded as fresh (double delivery). Over-budget
|
|
65
|
+
* young state skips compaction and surfaces pressure instead.
|
|
66
|
+
*/
|
|
67
|
+
export declare const TOMBSTONE_MIN_AGE_MS: number;
|
|
32
68
|
export type RecoveryOwnershipScanResult<T> = {
|
|
33
69
|
status: 'ok';
|
|
34
70
|
owners: T[];
|
|
71
|
+
/** How the primary store was reconstructed (issue #2034); absent for pre-checkpoint scans. */
|
|
72
|
+
source?: 'checkpoint+tail' | 'checkpoint+ledger-suffix' | 'legacy-ledger';
|
|
35
73
|
} | {
|
|
36
74
|
status: 'uncertain';
|
|
37
75
|
reason: string;
|
|
76
|
+
/**
|
|
77
|
+
* Best-known interpretation mode at failure time; `'unknown'` when the
|
|
78
|
+
* manifest/checkpoint state itself was unreadable (issue #2034 — the
|
|
79
|
+
* durable recovery observation must not claim a wrong source).
|
|
80
|
+
*/
|
|
81
|
+
source?: 'checkpoint+tail' | 'checkpoint+ledger-suffix' | 'legacy-ledger' | 'unknown';
|
|
82
|
+
/** Operator remediation guidance, when the failure mode has one. */
|
|
83
|
+
repairHint?: string;
|
|
38
84
|
};
|
|
39
85
|
/** An abandoned ingestion lease may be reclaimed after this bounded interval. */
|
|
40
86
|
export declare const BACKGROUND_INGESTION_LEASE_MS = 30000;
|
|
@@ -251,20 +297,81 @@ export interface BackgroundCoderReservation {
|
|
|
251
297
|
createdAt: number;
|
|
252
298
|
updatedAt: number;
|
|
253
299
|
}
|
|
300
|
+
export interface BackgroundDelegationCheckpoint {
|
|
301
|
+
schemaVersion: 1;
|
|
302
|
+
/** Monotonic checkpoint sequence for this store. */
|
|
303
|
+
sequence: number;
|
|
304
|
+
/** Diagnostics-only identity of the writing process (never validated). */
|
|
305
|
+
writerId: string;
|
|
306
|
+
/** Resolved project root this checkpoint is bound to. */
|
|
307
|
+
rootPath: string;
|
|
308
|
+
createdAt: number;
|
|
309
|
+
/** Byte length of the ledger at the cut. */
|
|
310
|
+
cutLedgerBytes: number;
|
|
311
|
+
/** sha256 of the ledger bytes [0..cutLedgerBytes) at the cut. */
|
|
312
|
+
cutLedgerDigest: string;
|
|
313
|
+
/** Live full records (bounded by MAX_CHECKPOINT_RECORDS). */
|
|
314
|
+
records: BackgroundDelegationRecord[];
|
|
315
|
+
/** Compact closed-record summaries, byte-budget governed. */
|
|
316
|
+
closed: BackgroundDelegationRecord[];
|
|
317
|
+
audit: DelegationCheckpointAuditSummary;
|
|
318
|
+
payloadChecksum: string;
|
|
319
|
+
}
|
|
320
|
+
export interface BackgroundDelegationManifest {
|
|
321
|
+
schemaVersion: 1;
|
|
322
|
+
sequence: number;
|
|
323
|
+
checkpointChecksum: string;
|
|
324
|
+
writerId: string;
|
|
325
|
+
rootPath: string;
|
|
326
|
+
updatedAt: number;
|
|
327
|
+
}
|
|
328
|
+
export declare const _checkpointInternals: {
|
|
329
|
+
renameWithRetry: (from: string, to: string) => void;
|
|
330
|
+
renameOnce: (from: string, to: string) => void;
|
|
331
|
+
syncSleep: (ms: number) => void;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* True when a record still owns an unsettled worktree (mirrors
|
|
335
|
+
* init-orphan-recovery's protection predicate — exported so both sites share
|
|
336
|
+
* ONE definition; drift here changes which worktrees orphan cleanup protects).
|
|
337
|
+
*/
|
|
338
|
+
export declare function isUnsettledWorktreeOwner(record: BackgroundDelegationRecord): boolean;
|
|
339
|
+
export interface CompactBackgroundDelegationsResult {
|
|
340
|
+
status: 'compacted' | 'skipped' | 'uncertain';
|
|
341
|
+
reason?: string;
|
|
342
|
+
sequence?: number;
|
|
343
|
+
tailBytes?: number;
|
|
344
|
+
checkpointBytes?: number;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Compact the delegation ledger: checkpoint the folded authoritative state,
|
|
348
|
+
* publish it via the manifest, and roll the ledger to the post-cut tail.
|
|
349
|
+
* Runs under the store lock (issue #2034 requirement 1).
|
|
350
|
+
*/
|
|
351
|
+
export declare function compactBackgroundDelegations(directory: string, options?: {
|
|
352
|
+
force?: boolean;
|
|
353
|
+
}): Promise<CompactBackgroundDelegationsResult>;
|
|
254
354
|
/**
|
|
255
355
|
* Read and fold the store to the latest snapshot per correlationId. Lock-free and
|
|
256
|
-
* defensive: a missing file yields an empty list, and malformed/partial lines are
|
|
257
|
-
* (never throws). Records are returned in first-seen correlationId order.
|
|
356
|
+
* defensive: a missing file yields an empty list, and malformed/partial lines are
|
|
357
|
+
* skipped (never throws). Records are returned in first-seen correlationId order.
|
|
358
|
+
*
|
|
359
|
+
* Checkpoint-aware (issue #2034): when a published checkpoint exists, the fold is
|
|
360
|
+
* checkpoint summaries + the bounded transition tail. When the authoritative
|
|
361
|
+
* state is uncertain (invalid checkpoint/manifest with a rolled tail), this
|
|
362
|
+
* returns [] — the strict recovery scan is the fail-closed authority.
|
|
258
363
|
*
|
|
259
|
-
* Cost: O(
|
|
260
|
-
*
|
|
261
|
-
* concurrent background delegations, and the on-disk log is small).
|
|
364
|
+
* Cost: O(checkpoint + tail lines) per call. The tail is bounded by the
|
|
365
|
+
* compaction high-water mark in normal operation.
|
|
262
366
|
*/
|
|
263
367
|
export declare function readDelegations(directory: string): BackgroundDelegationRecord[];
|
|
264
368
|
/**
|
|
265
|
-
* Strict startup-recovery view of the primary
|
|
369
|
+
* Strict startup-recovery view of the primary store. Unlike the ordinary
|
|
266
370
|
* advisory reader, this never treats unreadable, oversized, or malformed owner
|
|
267
371
|
* data as absence: destructive orphan cleanup must fail closed on uncertainty.
|
|
372
|
+
* Checkpoint-aware: folds checkpoint + the applicable bounded tail region and
|
|
373
|
+
* rejects corrupt or ambiguous cuts (issue #2034). Remains synchronous —
|
|
374
|
+
* callers depend on it.
|
|
268
375
|
*/
|
|
269
376
|
export declare function scanDelegationsForRecovery(directory: string): RecoveryOwnershipScanResult<BackgroundDelegationRecord>;
|
|
270
377
|
/** Returns the folded record for a correlationId, or null. Lock-free read. */
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
shouldRunOnStartup,
|
|
13
13
|
writeBackupArtifact,
|
|
14
14
|
writeDoctorArtifact
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
} from "./index-evvbmbbv.js";
|
|
16
|
+
import"./index-3q9w6e6v.js";
|
|
17
17
|
import"./index-jqsfsqbx.js";
|
|
18
18
|
import"./index-z6xqpmqg.js";
|
|
19
19
|
import"./index-zjygnfay.js";
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
4
|
+
} from "./index-j1scj25g.js";
|
|
5
|
+
import"./index-d45yrzkg.js";
|
|
6
|
+
import"./index-evvbmbbv.js";
|
|
7
|
+
import"./index-3v3dxf75.js";
|
|
8
8
|
import"./index-134d35c1.js";
|
|
9
9
|
import"./index-b6e016tv.js";
|
|
10
10
|
import"./index-4q9vfav6.js";
|
|
11
11
|
import"./index-k92cagmt.js";
|
|
12
12
|
import"./index-y8552snf.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-mw6p3nt6.js";
|
|
14
14
|
import"./index-xmzmeknp.js";
|
|
15
15
|
import"./index-c8s9a3zh.js";
|
|
16
16
|
import"./index-9ss2m4rs.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-jvbfrwt2.js";
|
|
18
18
|
import"./index-74hpm6sh.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
19
|
+
import"./index-269b52r3.js";
|
|
20
|
+
import"./index-vb9cpaz4.js";
|
|
21
|
+
import"./index-zv4pwyas.js";
|
|
22
|
+
import"./index-0ck3e366.js";
|
|
23
23
|
import"./index-556ja8an.js";
|
|
24
24
|
import"./index-gdd4jt6b.js";
|
|
25
25
|
import"./index-zsrtt42s.js";
|
|
26
26
|
import"./index-k3cxyk66.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-4fda8kkw.js";
|
|
28
|
+
import"./index-tfkfyshg.js";
|
|
29
29
|
import"./index-8fwhhayc.js";
|
|
30
30
|
import"./index-q1exe2b3.js";
|
|
31
31
|
import"./index-7sy3aa9m.js";
|
|
32
32
|
import"./index-4905hd2m.js";
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
33
|
+
import"./index-ez18gjk2.js";
|
|
34
|
+
import"./index-1pr8x10a.js";
|
|
35
35
|
import"./index-gprxjmm7.js";
|
|
36
36
|
import"./index-n832052r.js";
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
37
|
+
import"./index-d45d4zyq.js";
|
|
38
|
+
import"./index-3q9w6e6v.js";
|
|
39
39
|
import"./index-rn0eq85g.js";
|
|
40
40
|
import"./index-4rhhvd1a.js";
|
|
41
41
|
import"./index-jqsfsqbx.js";
|
|
42
42
|
import"./index-z6xqpmqg.js";
|
|
43
43
|
import"./index-zjygnfay.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-ewzmjm7m.js";
|
|
45
45
|
import"./index-tq5s07ta.js";
|
|
46
46
|
import"./index-rtry5xyf.js";
|
|
47
|
-
import"./index-
|
|
47
|
+
import"./index-jqabjy7t.js";
|
|
48
48
|
import"./index-ae75rja9.js";
|
|
49
49
|
import"./index-w7x7qxz2.js";
|
|
50
50
|
import"./index-erfnw81g.js";
|
|
@@ -14,50 +14,50 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
17
|
+
} from "./index-j1scj25g.js";
|
|
18
|
+
import"./index-d45yrzkg.js";
|
|
19
|
+
import"./index-evvbmbbv.js";
|
|
20
|
+
import"./index-3v3dxf75.js";
|
|
21
21
|
import"./index-134d35c1.js";
|
|
22
22
|
import"./index-b6e016tv.js";
|
|
23
23
|
import"./index-4q9vfav6.js";
|
|
24
24
|
import"./index-k92cagmt.js";
|
|
25
25
|
import"./index-y8552snf.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-mw6p3nt6.js";
|
|
27
27
|
import"./index-xmzmeknp.js";
|
|
28
28
|
import"./index-c8s9a3zh.js";
|
|
29
29
|
import"./index-9ss2m4rs.js";
|
|
30
|
-
import"./index-
|
|
30
|
+
import"./index-jvbfrwt2.js";
|
|
31
31
|
import"./index-74hpm6sh.js";
|
|
32
|
-
import"./index-
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
32
|
+
import"./index-269b52r3.js";
|
|
33
|
+
import"./index-vb9cpaz4.js";
|
|
34
|
+
import"./index-zv4pwyas.js";
|
|
35
|
+
import"./index-0ck3e366.js";
|
|
36
36
|
import"./index-556ja8an.js";
|
|
37
37
|
import"./index-gdd4jt6b.js";
|
|
38
38
|
import"./index-zsrtt42s.js";
|
|
39
39
|
import"./index-k3cxyk66.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-4fda8kkw.js";
|
|
41
|
+
import"./index-tfkfyshg.js";
|
|
42
42
|
import"./index-8fwhhayc.js";
|
|
43
43
|
import"./index-q1exe2b3.js";
|
|
44
44
|
import"./index-7sy3aa9m.js";
|
|
45
45
|
import"./index-4905hd2m.js";
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
46
|
+
import"./index-ez18gjk2.js";
|
|
47
|
+
import"./index-1pr8x10a.js";
|
|
48
48
|
import"./index-gprxjmm7.js";
|
|
49
49
|
import"./index-n832052r.js";
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
50
|
+
import"./index-d45d4zyq.js";
|
|
51
|
+
import"./index-3q9w6e6v.js";
|
|
52
52
|
import"./index-rn0eq85g.js";
|
|
53
53
|
import"./index-4rhhvd1a.js";
|
|
54
54
|
import"./index-jqsfsqbx.js";
|
|
55
55
|
import"./index-z6xqpmqg.js";
|
|
56
56
|
import"./index-zjygnfay.js";
|
|
57
|
-
import"./index-
|
|
57
|
+
import"./index-ewzmjm7m.js";
|
|
58
58
|
import"./index-tq5s07ta.js";
|
|
59
59
|
import"./index-rtry5xyf.js";
|
|
60
|
-
import"./index-
|
|
60
|
+
import"./index-jqabjy7t.js";
|
|
61
61
|
import"./index-ae75rja9.js";
|
|
62
62
|
import"./index-w7x7qxz2.js";
|
|
63
63
|
import"./index-erfnw81g.js";
|
package/dist/cli/{evidence-summary-service-yjr0662r.js → evidence-summary-service-79mtxzhd.js}
RENAMED
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
loadPlanJsonOnly,
|
|
7
7
|
mergeDurableGateEntriesFromEvidence,
|
|
8
8
|
readDurableGateEvidence
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-3v3dxf75.js";
|
|
10
10
|
import"./index-134d35c1.js";
|
|
11
11
|
import"./index-k92cagmt.js";
|
|
12
12
|
import"./index-y8552snf.js";
|
|
13
13
|
import"./index-9ss2m4rs.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
import"./index-jvbfrwt2.js";
|
|
15
|
+
import"./index-0ck3e366.js";
|
|
16
16
|
import"./index-556ja8an.js";
|
|
17
17
|
import"./index-zsrtt42s.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-tfkfyshg.js";
|
|
19
19
|
import"./index-q1exe2b3.js";
|
|
20
20
|
import"./index-gprxjmm7.js";
|
|
21
21
|
import"./index-n832052r.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
22
|
+
import"./index-d45d4zyq.js";
|
|
23
|
+
import"./index-3q9w6e6v.js";
|
|
24
24
|
import"./index-rn0eq85g.js";
|
|
25
25
|
import"./index-4rhhvd1a.js";
|
|
26
26
|
import"./index-jqsfsqbx.js";
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
reduceTaskWorkflowSnapshot,
|
|
18
18
|
transitionTaskWorkflowEvidence,
|
|
19
19
|
withTaskEvidenceTransaction
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-jvbfrwt2.js";
|
|
21
21
|
import"./index-556ja8an.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-tfkfyshg.js";
|
|
23
23
|
import"./index-rn0eq85g.js";
|
|
24
24
|
import"./index-4rhhvd1a.js";
|
|
25
25
|
import"./index-jqsfsqbx.js";
|