wicked-crew 0.7.31 → 0.7.32

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.
@@ -36,7 +36,7 @@
36
36
  */
37
37
  import type { Verdict } from 'wicked-ledger';
38
38
  import type { GovernanceClaim, RecordedEvent, RepoEntry, SessionView, WorkflowDef } from '../core/types.js';
39
- import type { QeAcceptanceState, QeManifestSummary } from './ledger.js';
39
+ import type { QeAcceptanceState, QeAttribution, QeManifestSummary, RunLinkage } from './ledger.js';
40
40
  import type { QeGateCache, QeGateEventEntry } from './gate-events.js';
41
41
  import type { RunConformance } from './conformance.js';
42
42
  /**
@@ -126,6 +126,19 @@ export interface AcceptanceView {
126
126
  qeRunId: string;
127
127
  } | null;
128
128
  manifest: QeManifestSummary | null;
129
+ /**
130
+ * How `verdict` was tied to THIS run (`pinned` by `?qeRun`, `stamped` with the run id by the
131
+ * writer, or a QE run inside the run's lifetime) — or `none`, with the reason naming what the
132
+ * ledger does hold. The body never serves a repo-wide "newest verdict" as the run's (F-E2E-013).
133
+ */
134
+ attribution: QeAttribution;
135
+ /** How many live verdicts the whole ledger holds, attributed or not. */
136
+ ledgerVerdicts: number;
137
+ /**
138
+ * How many QE runs are attributed to this run — the deny-dominates set `verdict` was resolved
139
+ * over (each contributes its newest verdict; any non-PASS among them denies). 0 when none.
140
+ */
141
+ attributedVerdicts: number;
129
142
  error?: string;
130
143
  } | null;
131
144
  gate: AcceptanceGateResolution;
@@ -139,8 +152,64 @@ export interface AcceptanceView {
139
152
  busEvent: QeGateEventEntry | null;
140
153
  }
141
154
  /**
142
- * Assemble the acceptance view for one crew run: read the ledger (lazy read —
143
- * the fallback that needs no bus), resolve the gate, and attach the freshest
155
+ * The frames that close a run's lifetime — one per terminal `SessionStatus` the engine defines
156
+ * (wicked-core `src/domain.rs`: `Completed`, `Failed`, `Cancelled`), spelled as the engine emits
157
+ * them (`src/event.rs` `event_to_json`: `sessionCompleted`, `sessionFailed`, `runCancelled`).
158
+ * Pinned from the source, not from memory: the first cut named a `sessionCancelled` frame the
159
+ * engine never emits, so a CANCELLED run's window never closed and any later QE PASS on the repo
160
+ * was attributed to it (review of #539, F1). `runOrphaned` is deliberately absent — an orphaned
161
+ * run is still `executing` and resumable, not finished.
162
+ */
163
+ export declare const TERMINAL_EVENT_TYPES: ReadonlySet<string>;
164
+ /**
165
+ * The terminal frames the engine will NOT resume from: `resume_run_inner` returns a `Completed` or
166
+ * `Cancelled` run's status unchanged (wicked-core `src/actor.rs`, the `Completed | Cancelled`
167
+ * early return) and re-dispatches only a `Failed` one. So once one of these is recorded the window
168
+ * is closed for good; `sessionFailed` alone can be followed by a `resumed` frame (r2 review, N1).
169
+ */
170
+ export declare const FINAL_EVENT_TYPES: ReadonlySet<string>;
171
+ /**
172
+ * The frames that prove a run is LIVE AGAIN after a non-final terminal frame — the engine emits
173
+ * each of them only for a run it is actively driving (wicked-core `src/event.rs` `event_to_json`):
174
+ * - `resumed` — emitted by `confirm_gate` when a human approves a gate (`src/actor.rs`, the only
175
+ * `CoreEvent::Resumed` emission). NOT by the failed-run resume path: `resume_run_inner` emits
176
+ * no frame of its own (r3 review, N3 — an earlier comment here claimed otherwise);
177
+ * - `unitDispatched` / `unitExecuting` / `toolExecutorDispatched` — `dispatch_unit`'s frames, the
178
+ * first thing a rescued run records after `POST /runs/:id/resume` re-dispatches its cursor unit;
179
+ * - `unitDistributed` — a (re)distribution for a unit, run-scoped and live-only as well.
180
+ * `unitDone` / `unitDenied` / `unitPlanned` are deliberately NOT here: a straggling completion or
181
+ * denial frame after a failure is not evidence the run went on (F4).
182
+ */
183
+ export declare const REOPEN_EVENT_TYPES: ReadonlySet<string>;
184
+ /**
185
+ * The crew run's lifetime as its durable event log records it — the window a QE run must have
186
+ * started inside to count as this run's evidence (F-E2E-013).
187
+ *
188
+ * `startedAt` is the capture time of the `sessionStarted` frame (the earliest frame's, for a log
189
+ * that lacks one). `finishedAt` follows the frames IN LOG ORDER: a terminal frame closes the window
190
+ * at its capture time; a later {@link REOPEN_EVENT_TYPES} frame reopens it — a FAILED run is
191
+ * resumable under the same id (`POST /runs/:id/resume` → engine `resume_run_inner`, which
192
+ * re-dispatches the cursor unit and runs the run on to its own `sessionCompleted`), so QE evidence
193
+ * recorded after the rescue is that run's, whether the run is still executing (its execution
194
+ * frames reopen the window — r3 review, N3) or has since completed (r2 review, N1).
195
+ * `sessionCompleted` / `runCancelled` are FINAL: the engine refuses to resume either, so nothing
196
+ * after them reopens the window. Any other frame is ignored — a straggling non-terminal frame
197
+ * after the end does not reopen anything (F4). A log with no terminal frame (or one whose last
198
+ * terminal frame was followed by execution) belongs to a live run, whose window stays open. A
199
+ * `null` or empty log places the run nowhere in time, so it can link nothing — and when the log
200
+ * could not be READ (`unreadable`), the linkage carries that cause so the denial names it instead
201
+ * of "no sessionStarted" (F5).
202
+ *
203
+ * Chosen over gating on `session.status`: the log is what the route already reads for this
204
+ * purpose, it needs no second engine call, and it yields the same answer — a rescued run's
205
+ * persisted status is non-terminal from its re-dispatch until its next terminal frame, which is
206
+ * exactly the span between the reopening frame and the frame that closes the scan again.
207
+ */
208
+ export declare function runWindowFromEvents(events: RecordedEvent[] | null, runId: string, unreadable?: string): RunLinkage;
209
+ /**
210
+ * Assemble the acceptance view for one crew run: read the run's event log,
211
+ * read the ledger SCOPED TO THIS RUN (a read-only canonical-JSON read — the
212
+ * fallback that needs no bus), resolve the gate, and attach the freshest
144
213
  * matching bus event when the opt-in subscription has seen one.
145
214
  */
146
215
  export declare function buildAcceptanceView(opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../src/qe/acceptance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,WAAW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AC,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;IACT,IAAI,EAAE,wBAAwB,CAAC;IAC/B;;;;OAIG;IACH,WAAW,EAAE,cAAc,CAAC;IAC5B,gGAAgG;IAChG,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAInD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAiD,CAAC;AAEpG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAMjD,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAC9B,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,UAAU,CAuBZ;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,WAAW,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,CAAC;CAC7D,GAAG,OAAO,CAAC,cAAc,CAAC,CAwG1B"}
@@ -38,7 +38,7 @@ import { VERDICT_VALUES } from 'wicked-ledger';
38
38
  import { basename } from 'node:path';
39
39
  import { DELIVER_PHASE_ID } from '../core/deliver.js';
40
40
  import { DELIVERABLE_FLOOR_PHASE_ID } from '../core/deliverable-floor.js';
41
- import { readAcceptanceState, summarizeManifest } from './ledger.js';
41
+ import { describeAttribution, readAcceptanceState, summarizeManifest } from './ledger.js';
42
42
  import { resolveConformance } from './conformance.js';
43
43
  /**
44
44
  * Verdict → run-status, 1:1 with garden's qe `accept` action (VERDICT_TO_STATUS)
@@ -157,10 +157,21 @@ export function resolveAcceptanceGate(required, state) {
157
157
  };
158
158
  }
159
159
  if (state.verdict === null) {
160
+ if (state.ledgerVerdicts === 0) {
161
+ return {
162
+ ...base,
163
+ satisfied: false,
164
+ reason: `QE ledger at ${state.root} records no verdict (missing ⇒ deny)`,
165
+ };
166
+ }
167
+ // The ledger has verdicts — none of them is THIS run's (F-E2E-013). A verdict that
168
+ // predates the run, or belongs to a QE run nothing ties to it, is evidence about the repo's
169
+ // past, not about this run; serving it as the run's PASS was the regression.
170
+ const why = state.attribution.kind === 'none' ? state.attribution.reason : 'not attributed';
160
171
  return {
161
172
  ...base,
162
173
  satisfied: false,
163
- reason: `QE ledger at ${state.root} records no verdict (missing ⇒ deny)`,
174
+ reason: `QE ledger at ${state.root} holds no verdict attributed to this run — ${why} (unattributed ⇒ deny)`,
164
175
  };
165
176
  }
166
177
  if (verdict === null) {
@@ -173,7 +184,13 @@ export function resolveAcceptanceGate(required, state) {
173
184
  reason: `verdict ${state.verdict.id} carries an out-of-enum value '${verdictValue}' (unrecognized ⇒ deny)`,
174
185
  };
175
186
  }
176
- const cite = `verdict ${state.verdict.id} by ${state.verdict.reviewer}`;
187
+ // HOW the verdict is this run's rides the reason (review of #539, F6): an inferred lifetime
188
+ // linkage must read differently from a writer's stamp or a caller's pin — and when several QE
189
+ // runs are attributed, the reader must know the answer was resolved deny-dominates across them.
190
+ const breadth = state.attributedVerdicts > 1
191
+ ? `; ${state.attributedVerdicts} QE runs are attributed to this run — deny-dominates across their newest verdicts`
192
+ : '';
193
+ const cite = `verdict ${state.verdict.id} by ${state.verdict.reviewer} (${describeAttribution(state.attribution)}${breadth})`;
177
194
  switch (verdict) {
178
195
  case 'PASS':
179
196
  return { ...base, satisfied: true, reason: `PASS — ${cite}` };
@@ -207,16 +224,125 @@ export function resolveAcceptanceGate(required, state) {
207
224
  }
208
225
  }
209
226
  /**
210
- * Assemble the acceptance view for one crew run: read the ledger (lazy read —
211
- * the fallback that needs no bus), resolve the gate, and attach the freshest
227
+ * The frames that close a run's lifetime — one per terminal `SessionStatus` the engine defines
228
+ * (wicked-core `src/domain.rs`: `Completed`, `Failed`, `Cancelled`), spelled as the engine emits
229
+ * them (`src/event.rs` `event_to_json`: `sessionCompleted`, `sessionFailed`, `runCancelled`).
230
+ * Pinned from the source, not from memory: the first cut named a `sessionCancelled` frame the
231
+ * engine never emits, so a CANCELLED run's window never closed and any later QE PASS on the repo
232
+ * was attributed to it (review of #539, F1). `runOrphaned` is deliberately absent — an orphaned
233
+ * run is still `executing` and resumable, not finished.
234
+ */
235
+ export const TERMINAL_EVENT_TYPES = new Set([
236
+ 'sessionCompleted',
237
+ 'sessionFailed',
238
+ 'runCancelled',
239
+ ]);
240
+ /**
241
+ * The terminal frames the engine will NOT resume from: `resume_run_inner` returns a `Completed` or
242
+ * `Cancelled` run's status unchanged (wicked-core `src/actor.rs`, the `Completed | Cancelled`
243
+ * early return) and re-dispatches only a `Failed` one. So once one of these is recorded the window
244
+ * is closed for good; `sessionFailed` alone can be followed by a `resumed` frame (r2 review, N1).
245
+ */
246
+ export const FINAL_EVENT_TYPES = new Set(['sessionCompleted', 'runCancelled']);
247
+ /**
248
+ * The frames that prove a run is LIVE AGAIN after a non-final terminal frame — the engine emits
249
+ * each of them only for a run it is actively driving (wicked-core `src/event.rs` `event_to_json`):
250
+ * - `resumed` — emitted by `confirm_gate` when a human approves a gate (`src/actor.rs`, the only
251
+ * `CoreEvent::Resumed` emission). NOT by the failed-run resume path: `resume_run_inner` emits
252
+ * no frame of its own (r3 review, N3 — an earlier comment here claimed otherwise);
253
+ * - `unitDispatched` / `unitExecuting` / `toolExecutorDispatched` — `dispatch_unit`'s frames, the
254
+ * first thing a rescued run records after `POST /runs/:id/resume` re-dispatches its cursor unit;
255
+ * - `unitDistributed` — a (re)distribution for a unit, run-scoped and live-only as well.
256
+ * `unitDone` / `unitDenied` / `unitPlanned` are deliberately NOT here: a straggling completion or
257
+ * denial frame after a failure is not evidence the run went on (F4).
258
+ */
259
+ export const REOPEN_EVENT_TYPES = new Set([
260
+ 'resumed',
261
+ 'unitDispatched',
262
+ 'unitExecuting',
263
+ 'toolExecutorDispatched',
264
+ 'unitDistributed',
265
+ ]);
266
+ /**
267
+ * The crew run's lifetime as its durable event log records it — the window a QE run must have
268
+ * started inside to count as this run's evidence (F-E2E-013).
269
+ *
270
+ * `startedAt` is the capture time of the `sessionStarted` frame (the earliest frame's, for a log
271
+ * that lacks one). `finishedAt` follows the frames IN LOG ORDER: a terminal frame closes the window
272
+ * at its capture time; a later {@link REOPEN_EVENT_TYPES} frame reopens it — a FAILED run is
273
+ * resumable under the same id (`POST /runs/:id/resume` → engine `resume_run_inner`, which
274
+ * re-dispatches the cursor unit and runs the run on to its own `sessionCompleted`), so QE evidence
275
+ * recorded after the rescue is that run's, whether the run is still executing (its execution
276
+ * frames reopen the window — r3 review, N3) or has since completed (r2 review, N1).
277
+ * `sessionCompleted` / `runCancelled` are FINAL: the engine refuses to resume either, so nothing
278
+ * after them reopens the window. Any other frame is ignored — a straggling non-terminal frame
279
+ * after the end does not reopen anything (F4). A log with no terminal frame (or one whose last
280
+ * terminal frame was followed by execution) belongs to a live run, whose window stays open. A
281
+ * `null` or empty log places the run nowhere in time, so it can link nothing — and when the log
282
+ * could not be READ (`unreadable`), the linkage carries that cause so the denial names it instead
283
+ * of "no sessionStarted" (F5).
284
+ *
285
+ * Chosen over gating on `session.status`: the log is what the route already reads for this
286
+ * purpose, it needs no second engine call, and it yields the same answer — a rescued run's
287
+ * persisted status is non-terminal from its re-dispatch until its next terminal frame, which is
288
+ * exactly the span between the reopening frame and the frame that closes the scan again.
289
+ */
290
+ export function runWindowFromEvents(events, runId, unreadable) {
291
+ if (unreadable !== undefined)
292
+ return { runId, startedAt: null, finishedAt: null, logUnreadable: unreadable };
293
+ if (events === null || events.length === 0)
294
+ return { runId, startedAt: null, finishedAt: null };
295
+ const at = (e) => typeof e.ts === 'number' && Number.isFinite(e.ts) ? e.ts : null;
296
+ const started = events.find((e) => e.type === 'sessionStarted');
297
+ let startedAt = started !== undefined ? at(started) : null;
298
+ if (startedAt === null) {
299
+ for (const e of events) {
300
+ const t = at(e);
301
+ if (t !== null && (startedAt === null || t < startedAt))
302
+ startedAt = t;
303
+ }
304
+ }
305
+ let finishedAt = null;
306
+ for (const e of events) {
307
+ if (TERMINAL_EVENT_TYPES.has(e.type)) {
308
+ finishedAt = at(e) ?? finishedAt;
309
+ if (FINAL_EVENT_TYPES.has(e.type))
310
+ break; // nothing the engine emits after these reopens the run
311
+ }
312
+ else if (REOPEN_EVENT_TYPES.has(e.type) && finishedAt !== null) {
313
+ finishedAt = null; // a failed run rescued and executing again: live until its next terminal frame
314
+ }
315
+ }
316
+ return { runId, startedAt, finishedAt };
317
+ }
318
+ /**
319
+ * Assemble the acceptance view for one crew run: read the run's event log,
320
+ * read the ledger SCOPED TO THIS RUN (a read-only canonical-JSON read — the
321
+ * fallback that needs no bus), resolve the gate, and attach the freshest
212
322
  * matching bus event when the opt-in subscription has seen one.
213
323
  */
214
324
  export async function buildAcceptanceView(opts) {
215
325
  const phases = acceptancePhaseIds(opts.workflow);
216
326
  const required = phases.length > 0;
217
- const state = opts.repo !== null
218
- ? await readAcceptanceState(opts.repo.root_path, opts.qeRunId !== undefined ? { qeRunId: opts.qeRunId } : undefined)
219
- : null;
327
+ // The run's durable event log, read FIRST: it is both the conformance section's enforcement
328
+ // record and the ledger read's linkage — a verdict is this run's only if its QE run falls inside
329
+ // the lifetime the log records (or the writer stamped the run id). An unreadable or absent log
330
+ // means an unknown window, and an unknown window links nothing (F-E2E-013).
331
+ let eventRows = null;
332
+ let eventsError;
333
+ if (opts.events !== undefined) {
334
+ try {
335
+ eventRows = await opts.events(opts.runId);
336
+ }
337
+ catch (err) {
338
+ eventRows = null; // unreadable log ⇒ unverifiable enforcement, by resolveConformance's rule
339
+ eventsError = err instanceof Error ? err.message : String(err);
340
+ }
341
+ }
342
+ const subject = opts.qeRunId !== undefined
343
+ ? { qeRunId: opts.qeRunId }
344
+ : { run: runWindowFromEvents(eventRows, opts.runId, eventsError) };
345
+ const state = opts.repo !== null ? await readAcceptanceState(opts.repo.root_path, subject) : null;
220
346
  const gate = resolveAcceptanceGate(required, state);
221
347
  // The conformance half. Loader failures are NAMED, not flattened into an empty list — the
222
348
  // section's own resolution turns "unreadable" into "not claimed clean" (deny-dominates).
@@ -233,15 +359,6 @@ export async function buildAcceptanceView(opts) {
233
359
  else {
234
360
  claimsError = 'claims loader not wired';
235
361
  }
236
- let eventRows = null;
237
- if (opts.events !== undefined) {
238
- try {
239
- eventRows = await opts.events(opts.runId);
240
- }
241
- catch {
242
- eventRows = null; // unreadable log ⇒ unverifiable enforcement, by resolveConformance's rule
243
- }
244
- }
245
362
  const conformance = resolveConformance({
246
363
  runId: opts.runId,
247
364
  claims: claimRows,
@@ -290,6 +407,9 @@ export async function buildAcceptanceView(opts) {
290
407
  }
291
408
  : null,
292
409
  manifest: state.manifest !== null ? summarizeManifest(state.manifest) : null,
410
+ attribution: state.attribution,
411
+ ledgerVerdicts: state.ledgerVerdicts,
412
+ attributedVerdicts: state.attributedVerdicts,
293
413
  ...(state.error !== undefined ? { error: state.error } : {}),
294
414
  }
295
415
  : null,
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance.js","sourceRoot":"","sources":["../../src/qe/acceptance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,g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,UAAU;wBAC/B,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW;qBAClC;oBACH,CAAC,CAAC,IAAI;gBACV,OAAO,EACL,KAAK,CAAC,OAAO,KAAK,IAAI;oBACpB,CAAC,CAAC;wBACE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;wBACpB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;wBAC9B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ;wBAChC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI;wBACpC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;wBACnC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;qBAC9B;oBACH,CAAC,CAAC,IAAI;gBACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC5E,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7D;YACH,CAAC,CAAC,IAAI;QACV,IAAI;QACJ,WAAW;QACX,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -6,15 +6,31 @@
6
6
  * this daemon owns: a DomainStore rooted at `<repo>/.wicked-qe/` (legacy
7
7
  * `<repo>/.wicked-testing/` — see qeLedgerRoot) holding `runs` and
8
8
  * `verdicts`, plus the public evidence manifest at
9
- * `<root>/evidence/<run-id>/manifest.json`. This module reads that state
10
- * through the wicked-ledger package API (public entry, no deep imports) and
11
- * never writes a domain record — the QE pipeline is the only writer.
9
+ * `<root>/evidence/<run-id>/manifest.json`.
12
10
  *
13
- * ONE deliberate mutation is allowed: `rebuildIndex()`, which regenerates the
14
- * store's DERIVED SQLite index from the canonical JSON files when the two
15
- * disagree (see `readAcceptanceState`). Canonical JSON is authoritative by the
16
- * ledger's own schema contract; the index is a cache, and rebuilding a cache
17
- * is not a write to the ledger's record of what happened.
11
+ * READ-ONLY means read-only (F-E2E-013). This module reads the ledger's
12
+ * CANONICAL JSON files directly and never opens a `DomainStore`: opening one
13
+ * is a write — `new DomainStore(root)` mkdirs the root, reaps `.tmp.*` files,
14
+ * creates `wicked-qe.db` (+ WAL/SHM) inside the checkout, runs migrations and
15
+ * a stale-run UPDATE sweep — and the index-healing `rebuildIndex()` this
16
+ * module used to call on top of that bulk-inserted every canonical row into
17
+ * the fresh index, which is where a legacy ledger's scenarios without
18
+ * `format_version` failed ("SQLite write failed … NOT NULL constraint"). A
19
+ * GET must leave the repository byte-identical. Canonical JSON is
20
+ * authoritative by the ledger's own schema contract (the SQLite index is a
21
+ * derived cache), so reading it directly loses nothing — and a record that
22
+ * cannot be parsed is surfaced as a read failure (`error`), never skipped
23
+ * into a cleaner answer.
24
+ *
25
+ * ATTRIBUTION (F-E2E-013): the gate answers about ONE crew run, so a verdict
26
+ * is served only when it can be tied to that run — see {@link ReadSubject}.
27
+ * "The newest PASS in the store" is not evidence about a run that recorded
28
+ * none (the regression: an onboarding run that failed at plan time was shown a
29
+ * two-month-old PASS from the repo's committed legacy ledger). Among the QE
30
+ * runs that ARE this run's, deny-dominates holds ACROSS them: each QE run's
31
+ * newest verdict is its current judgment, and one non-PASS among those denies
32
+ * (review of #539, F2 — a later PASS on scenario Y must not mask a FAIL on
33
+ * scenario X inside the same crew run).
18
34
  */
19
35
  import type { EvidenceManifest, RunRecord, VerdictRecord } from 'wicked-ledger';
20
36
  /**
@@ -28,6 +44,15 @@ import type { EvidenceManifest, RunRecord, VerdictRecord } from 'wicked-ledger';
28
44
  */
29
45
  export declare const DEFAULT_QE_LEDGER_DIRNAME = ".wicked-qe";
30
46
  export declare const LEGACY_QE_LEDGER_DIRNAME = ".wicked-testing";
47
+ /**
48
+ * The field a QE writer running INSIDE a governed run stamps on the ledger run
49
+ * (and/or verdict) it records: the crew run id the engine hands every worker as
50
+ * `WICKED_RUN_ID`. Canonical JSON preserves any field a writer supplies, so this
51
+ * needs no ledger schema change; a record carrying it is attributed to that run
52
+ * regardless of timing. (garden's QE runner does not stamp it yet — a wave-7
53
+ * follow-up; until then lifetime linkage below is the inferred fallback.)
54
+ */
55
+ export declare const CREW_RUN_ID_FIELD = "crew_run_id";
31
56
  /** The configured ledger dir name: `WICKED_QE_LEDGER_DIR` env override, else the default. */
32
57
  export declare function qeLedgerDirName(): string;
33
58
  /**
@@ -41,48 +66,123 @@ export declare function qeLedgerDirName(): string;
41
66
  */
42
67
  export declare function qeLedgerRoot(repoRoot: string): string;
43
68
  /**
44
- * The acceptance-relevant slice of a repo's ledger.
69
+ * The crew run a ledger read is FOR — what a verdict has to be tied to before
70
+ * it is served as that run's acceptance evidence.
71
+ */
72
+ export interface RunLinkage {
73
+ /** The crew run id (what a QE writer inside the run sees as `WICKED_RUN_ID`). */
74
+ runId: string;
75
+ /**
76
+ * Epoch millis the crew run started — its `sessionStarted` capture time from
77
+ * the durable event log. `null` when the log records no start (an unknown
78
+ * window links nothing: evidence that cannot be placed inside the run is not
79
+ * the run's evidence).
80
+ */
81
+ startedAt: number | null;
82
+ /**
83
+ * Epoch millis the run reached a terminal state — the FIRST terminal frame in
84
+ * its log (`sessionCompleted` / `sessionFailed` / `runCancelled`); `null`
85
+ * while it is live (window open).
86
+ */
87
+ finishedAt: number | null;
88
+ /**
89
+ * Set when the run's event log could not be read at all (the read binding
90
+ * threw) — a different fact from "the log records no start", with a
91
+ * different remedy, so the denial names it (review of #539, F5).
92
+ */
93
+ logUnreadable?: string;
94
+ }
95
+ /**
96
+ * What a read is scoped to: an explicit QE run (`?qeRun=<id>` — the caller
97
+ * asserts the linkage), or the crew run whose evidence is wanted.
98
+ */
99
+ export type ReadSubject = {
100
+ qeRunId: string;
101
+ } | {
102
+ run: RunLinkage;
103
+ };
104
+ /**
105
+ * How the served verdict was tied to the crew run — or why none was. Always
106
+ * populated on a found ledger; the route serves it so the answer explains itself.
107
+ */
108
+ export type QeAttribution =
109
+ /** The caller pinned the QE run (`?qeRun=`); its newest verdict is served. */
110
+ {
111
+ kind: 'pinned';
112
+ qeRunId: string;
113
+ }
114
+ /** The ledger run (or one of its verdicts) carries `crew_run_id` naming this crew run. */
115
+ | {
116
+ kind: 'stamped';
117
+ qeRunId: string;
118
+ }
119
+ /** INFERRED: the QE run started inside this crew run's recorded lifetime (not stamped by the writer). */
120
+ | {
121
+ kind: 'run-window';
122
+ qeRunId: string;
123
+ qeRunStartedAt: string;
124
+ }
125
+ /** Nothing in the ledger is this run's evidence; `reason` says what the ledger does hold. */
126
+ | {
127
+ kind: 'none';
128
+ reason: string;
129
+ };
130
+ /**
131
+ * One line a human can read on `gate.reason`: HOW the served verdict was tied to
132
+ * the run, with the inferred kind labelled as such — an operator must be able to
133
+ * tell "the writer said so" from "it happened while the run was live".
134
+ */
135
+ export declare function describeAttribution(a: QeAttribution): string;
136
+ /**
137
+ * The acceptance-relevant slice of a repo's ledger, scoped to one subject.
45
138
  *
46
139
  * `found: false` means the repo has no ledger at all (the dir is absent) —
47
140
  * a distinct fact from "a ledger with no verdicts", and the gate treats both
48
141
  * as a deny with different reasons. `error` carries a read-layer failure
49
- * (store threw); it is never set on an ordinary empty ledger.
142
+ * (unreadable dir, a record that is not valid JSON); it is never set on an
143
+ * ordinary empty ledger.
50
144
  */
51
145
  export interface QeAcceptanceState {
52
146
  /** Absolute ledger root that was read (or probed). */
53
147
  root: string;
54
148
  /** Whether the ledger root exists on disk. */
55
149
  found: boolean;
56
- /** The QE run the verdict belongs to, when resolvable. */
150
+ /** The QE run the served verdict belongs to, when resolvable. */
57
151
  run: RunRecord | null;
58
- /** The governing verdict row — newest first, the ledger's system of record. */
152
+ /**
153
+ * The governing verdict for the subject: among the attributed QE runs' newest
154
+ * verdicts, the newest non-PASS if there is one (deny-dominates), else the
155
+ * newest PASS.
156
+ */
59
157
  verdict: VerdictRecord | null;
60
158
  /** The public evidence manifest for that run, when present and parseable. */
61
159
  manifest: EvidenceManifest | null;
62
160
  /** Absolute path the manifest was read from (null when absent). */
63
161
  manifestPath: string | null;
64
- /** Read-layer failure detail (store open/read threw). */
162
+ /** How `verdict` was tied to the subject, or why nothing was. */
163
+ attribution: QeAttribution;
164
+ /** How many live verdicts the ledger holds in total — the repo-level picture the scoped read was carved from. */
165
+ ledgerVerdicts: number;
166
+ /**
167
+ * How many QE runs are attributed to the subject (each contributes its newest
168
+ * verdict to the deny-dominates set `verdict` was resolved over). 1 for a pin.
169
+ */
170
+ attributedVerdicts: number;
171
+ /** Read-layer failure detail (a record could not be read or parsed). */
65
172
  error?: string;
66
173
  }
67
174
  /**
68
- * Read the ledger's current acceptance state for a repo.
175
+ * Read the ledger's acceptance state for a repo, scoped to `subject`.
69
176
  *
70
- * The newest verdict row governs (`opts.qeRunId` narrows to one QE run's
71
- * newest verdict instead). The verdicts TABLE is the system of record — the
72
- * manifest is the public artifact built from it at run finalization, returned
73
- * here as display evidence, never as a gate input: a run can legitimately be
74
- * re-reviewed after its manifest was built, and the newer verdict row wins.
177
+ * The verdicts TABLE is the system of record — the manifest is the public
178
+ * artifact built from it at run finalization, returned here as display
179
+ * evidence, never as a gate input: a run can legitimately be re-reviewed
180
+ * after its manifest was built, and the newer verdict row wins.
75
181
  *
76
- * Index-drift healing: the store is dual-write (canonical JSON + a derived
77
- * SQLite index) and a writer that degraded to JSON-only leaves the index
78
- * behind. When the index answers "no verdicts" but canonical verdict files
79
- * exist, the index is provably stale, so it is rebuilt from JSON once and
80
- * re-read — otherwise a ledger full of evidence would read as "missing
81
- * evidence ⇒ deny", a wrong answer in the honest direction but still wrong.
182
+ * Reads canonical JSON only (see the module header): nothing under the ledger
183
+ * root is created, modified or removed by this call.
82
184
  */
83
- export declare function readAcceptanceState(repoRoot: string, opts?: {
84
- qeRunId?: string;
85
- }): Promise<QeAcceptanceState>;
185
+ export declare function readAcceptanceState(repoRoot: string, subject: ReadSubject): Promise<QeAcceptanceState>;
86
186
  /** The summary of a manifest the acceptance route serves (never the full artifact list). */
87
187
  export interface QeManifestSummary {
88
188
  manifestVersion: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/qe/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,eAAe,CAAC;AACtD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAE1D,6FAA6F;AAC7F,wBAAgB,eAAe,IAAI,MAAM,CAGxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB,+EAA+E;IAC/E,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,mEAAmE;IACnE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAaD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM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,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,iBAAiB,CAAC,CA2C5B;AAgBD,4FAA4F;AAC5F,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACzE;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,iBAAiB,CAa/E"}
package/dist/qe/ledger.js CHANGED
@@ -6,20 +6,35 @@
6
6
  * this daemon owns: a DomainStore rooted at `<repo>/.wicked-qe/` (legacy
7
7
  * `<repo>/.wicked-testing/` — see qeLedgerRoot) holding `runs` and
8
8
  * `verdicts`, plus the public evidence manifest at
9
- * `<root>/evidence/<run-id>/manifest.json`. This module reads that state
10
- * through the wicked-ledger package API (public entry, no deep imports) and
11
- * never writes a domain record — the QE pipeline is the only writer.
9
+ * `<root>/evidence/<run-id>/manifest.json`.
12
10
  *
13
- * ONE deliberate mutation is allowed: `rebuildIndex()`, which regenerates the
14
- * store's DERIVED SQLite index from the canonical JSON files when the two
15
- * disagree (see `readAcceptanceState`). Canonical JSON is authoritative by the
16
- * ledger's own schema contract; the index is a cache, and rebuilding a cache
17
- * is not a write to the ledger's record of what happened.
11
+ * READ-ONLY means read-only (F-E2E-013). This module reads the ledger's
12
+ * CANONICAL JSON files directly and never opens a `DomainStore`: opening one
13
+ * is a write — `new DomainStore(root)` mkdirs the root, reaps `.tmp.*` files,
14
+ * creates `wicked-qe.db` (+ WAL/SHM) inside the checkout, runs migrations and
15
+ * a stale-run UPDATE sweep — and the index-healing `rebuildIndex()` this
16
+ * module used to call on top of that bulk-inserted every canonical row into
17
+ * the fresh index, which is where a legacy ledger's scenarios without
18
+ * `format_version` failed ("SQLite write failed … NOT NULL constraint"). A
19
+ * GET must leave the repository byte-identical. Canonical JSON is
20
+ * authoritative by the ledger's own schema contract (the SQLite index is a
21
+ * derived cache), so reading it directly loses nothing — and a record that
22
+ * cannot be parsed is surfaced as a read failure (`error`), never skipped
23
+ * into a cleaner answer.
24
+ *
25
+ * ATTRIBUTION (F-E2E-013): the gate answers about ONE crew run, so a verdict
26
+ * is served only when it can be tied to that run — see {@link ReadSubject}.
27
+ * "The newest PASS in the store" is not evidence about a run that recorded
28
+ * none (the regression: an onboarding run that failed at plan time was shown a
29
+ * two-month-old PASS from the repo's committed legacy ledger). Among the QE
30
+ * runs that ARE this run's, deny-dominates holds ACROSS them: each QE run's
31
+ * newest verdict is its current judgment, and one non-PASS among those denies
32
+ * (review of #539, F2 — a later PASS on scenario Y must not mask a FAIL on
33
+ * scenario X inside the same crew run).
18
34
  */
19
- import { existsSync, readdirSync } from 'node:fs';
35
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
20
36
  import { readFile } from 'node:fs/promises';
21
37
  import { isAbsolute, join } from 'node:path';
22
- import { createDomainStore } from 'wicked-ledger';
23
38
  /**
24
39
  * The ledger root directory name under a repo root.
25
40
  *
@@ -31,6 +46,15 @@ import { createDomainStore } from 'wicked-ledger';
31
46
  */
32
47
  export const DEFAULT_QE_LEDGER_DIRNAME = '.wicked-qe';
33
48
  export const LEGACY_QE_LEDGER_DIRNAME = '.wicked-testing';
49
+ /**
50
+ * The field a QE writer running INSIDE a governed run stamps on the ledger run
51
+ * (and/or verdict) it records: the crew run id the engine hands every worker as
52
+ * `WICKED_RUN_ID`. Canonical JSON preserves any field a writer supplies, so this
53
+ * needs no ledger schema change; a record carrying it is attributed to that run
54
+ * regardless of timing. (garden's QE runner does not stamp it yet — a wave-7
55
+ * follow-up; until then lifetime linkage below is the inferred fallback.)
56
+ */
57
+ export const CREW_RUN_ID_FIELD = 'crew_run_id';
34
58
  /** The configured ledger dir name: `WICKED_QE_LEDGER_DIR` env override, else the default. */
35
59
  export function qeLedgerDirName() {
36
60
  const env = process.env['WICKED_QE_LEDGER_DIR']?.trim();
@@ -57,32 +81,232 @@ export function qeLedgerRoot(repoRoot) {
57
81
  return legacy;
58
82
  return current;
59
83
  }
60
- /** True when the canonical JSON dir for a table has at least one record file. */
61
- function hasCanonicalRows(root, table) {
84
+ /**
85
+ * One line a human can read on `gate.reason`: HOW the served verdict was tied to
86
+ * the run, with the inferred kind labelled as such — an operator must be able to
87
+ * tell "the writer said so" from "it happened while the run was live".
88
+ */
89
+ export function describeAttribution(a) {
90
+ switch (a.kind) {
91
+ case 'pinned':
92
+ return `pinned to QE run ${a.qeRunId} by ?qeRun — caller-asserted linkage`;
93
+ case 'stamped':
94
+ return `QE run ${a.qeRunId} is stamped ${CREW_RUN_ID_FIELD} with this run's id by the writer`;
95
+ case 'run-window':
96
+ return (`INFERRED from this run's lifetime — QE run ${a.qeRunId} started ${a.qeRunStartedAt} inside it; ` +
97
+ `not stamped by the writer`);
98
+ default:
99
+ return a.reason;
100
+ }
101
+ }
102
+ /** Read one canonical JSON record file; throws a message naming the file on anything but a valid record. */
103
+ function readRecordFile(path, label) {
104
+ let raw;
62
105
  try {
63
- return readdirSync(join(root, table)).some((f) => f.endsWith('.json') && !f.includes('.tmp.'));
106
+ raw = readFileSync(path, 'utf8');
64
107
  }
65
- catch {
66
- return false;
108
+ catch (err) {
109
+ throw new Error(`${label}: ${err instanceof Error ? err.message : String(err)}`);
110
+ }
111
+ let parsed;
112
+ try {
113
+ parsed = JSON.parse(raw);
114
+ }
115
+ catch (err) {
116
+ throw new Error(`${label}: not valid JSON (${err instanceof Error ? err.message : String(err)})`);
117
+ }
118
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
119
+ throw new Error(`${label}: not a record object`);
120
+ }
121
+ const rec = parsed;
122
+ if (typeof rec['id'] !== 'string' || rec['id'] === '') {
123
+ throw new Error(`${label}: record has no id`);
124
+ }
125
+ return rec;
126
+ }
127
+ /**
128
+ * Every live record of a table, newest first — the canonical JSON files, read
129
+ * as the ledger's own JSON-only mode reads them (`*.json`, in-flight `.tmp.*`
130
+ * files skipped, soft-deleted rows dropped, `created_at` descending). A table
131
+ * dir that does not exist is an empty table; a file that cannot be parsed is a
132
+ * read FAILURE the caller must surface, not a row to skip.
133
+ */
134
+ function listCanonical(root, table) {
135
+ const dir = join(root, table);
136
+ let names;
137
+ try {
138
+ names = readdirSync(dir);
139
+ }
140
+ catch (err) {
141
+ if (err.code === 'ENOENT')
142
+ return [];
143
+ throw new Error(`${table}/: ${err instanceof Error ? err.message : String(err)}`);
144
+ }
145
+ const rows = [];
146
+ for (const name of names) {
147
+ if (!name.endsWith('.json') || /\.tmp\.\d+$/.test(name))
148
+ continue;
149
+ const rec = readRecordFile(join(dir, name), `${table}/${name}`);
150
+ if (rec.deleted)
151
+ continue;
152
+ rows.push(rec);
153
+ }
154
+ return rows.sort((a, b) => (b.created_at || '').localeCompare(a.created_at || ''));
155
+ }
156
+ /** One live record by id, or null when its file is absent (soft-deleted reads as absent too). */
157
+ function getCanonical(root, table, id) {
158
+ const path = join(root, table, `${id}.json`);
159
+ if (!existsSync(path))
160
+ return null;
161
+ const rec = readRecordFile(path, `${table}/${id}.json`);
162
+ return rec.deleted ? null : rec;
163
+ }
164
+ /** The `crew_run_id` a writer stamped on a record, when it carries one (the typed schema has no such column; canonical JSON keeps it). */
165
+ function stampedCrewRun(rec) {
166
+ const v = rec?.[CREW_RUN_ID_FIELD];
167
+ return typeof v === 'string' && v !== '' ? v : null;
168
+ }
169
+ /** Epoch millis of an ISO timestamp, or null when it does not parse. */
170
+ function epoch(iso) {
171
+ if (typeof iso !== 'string')
172
+ return null;
173
+ const ms = Date.parse(iso);
174
+ return Number.isNaN(ms) ? null : ms;
175
+ }
176
+ /**
177
+ * Pick the verdict attributable to `subject` from the ledger's live verdicts
178
+ * (newest first), resolving each verdict's run lazily.
179
+ *
180
+ * An explicit pin serves that QE run's newest verdict. Otherwise the ledger is
181
+ * folded to one entry PER QE RUN (its newest verdict — a QE run re-reviewed
182
+ * after its manifest was built keeps the newer row, as before), and a QE run
183
+ * is ATTRIBUTED when its run row or any of its verdicts is stamped with this
184
+ * crew run's id, or when its run row is dated and that start falls inside the
185
+ * crew run's lifetime. A QE run with no dated run row is never placed by
186
+ * inference (review of #539, F3): a verdict's own `created_at` says when it
187
+ * was RECORDED, not when the QE run ran, and using it would attribute more
188
+ * eagerly, not less. Across the attributed set deny-dominates holds: the newest
189
+ * non-PASS governs when there is one, else the newest PASS (F2). Nothing else
190
+ * in the store is this run's evidence, however recent or however green.
191
+ */
192
+ function attribute(root, verdicts, subject) {
193
+ if ('qeRunId' in subject) {
194
+ const verdict = verdicts.find((v) => v.run_id === subject.qeRunId) ?? null;
195
+ if (verdict === null) {
196
+ return {
197
+ verdict: null,
198
+ run: null,
199
+ attribution: { kind: 'none', reason: `QE run ${subject.qeRunId} has no verdict recorded` },
200
+ attributedVerdicts: 0,
201
+ };
202
+ }
203
+ return {
204
+ verdict,
205
+ run: getCanonical(root, 'runs', verdict.run_id),
206
+ attribution: { kind: 'pinned', qeRunId: verdict.run_id },
207
+ attributedVerdicts: 1,
208
+ };
209
+ }
210
+ const { runId, startedAt, finishedAt, logUnreadable } = subject.run;
211
+ if (verdicts.length === 0) {
212
+ return {
213
+ verdict: null,
214
+ run: null,
215
+ attribution: { kind: 'none', reason: 'the ledger records no verdict' },
216
+ attributedVerdicts: 0,
217
+ };
218
+ }
219
+ // Fold to one entry per QE run, in newest-verdict order (verdicts are newest first, so the
220
+ // first verdict seen for a run is its newest, and Map insertion order keeps runs newest-first).
221
+ const byRun = new Map();
222
+ for (const v of verdicts) {
223
+ let entry = byRun.get(v.run_id);
224
+ if (entry === undefined) {
225
+ entry = { newest: v, run: getCanonical(root, 'runs', v.run_id), stamped: false };
226
+ byRun.set(v.run_id, entry);
227
+ }
228
+ if (stampedCrewRun(v) === runId)
229
+ entry.stamped = true;
230
+ }
231
+ for (const entry of byRun.values()) {
232
+ if (stampedCrewRun(entry.run) === runId)
233
+ entry.stamped = true;
234
+ }
235
+ const windowEnd = finishedAt ?? Date.now();
236
+ const attributed = [];
237
+ let undatedRuns = 0;
238
+ for (const [qeRunId, e] of byRun) {
239
+ if (e.stamped) {
240
+ attributed.push({ verdict: e.newest, run: e.run, attribution: { kind: 'stamped', qeRunId } });
241
+ continue;
242
+ }
243
+ if (startedAt === null)
244
+ continue;
245
+ // The QE run's own start (the row's `started_at`, else its `created_at`) is the linkage
246
+ // instant. No dated run row ⇒ no inferred linkage: this QE run can only be attributed by
247
+ // stamp or pin, and is counted so the denial can say so.
248
+ const at = epoch(e.run?.started_at) ?? epoch(e.run?.created_at);
249
+ if (at === null) {
250
+ undatedRuns++;
251
+ continue;
252
+ }
253
+ if (at >= startedAt && at <= windowEnd) {
254
+ attributed.push({
255
+ verdict: e.newest,
256
+ run: e.run,
257
+ attribution: { kind: 'run-window', qeRunId, qeRunStartedAt: new Date(at).toISOString() },
258
+ });
259
+ }
67
260
  }
261
+ if (attributed.length > 0) {
262
+ // Deny-dominates ACROSS the attributed QE runs: any newest-per-run non-PASS governs (the
263
+ // newest such, so the reason cites the latest failure); only when every attributed QE run's
264
+ // newest verdict is PASS does the newest PASS govern.
265
+ const denying = attributed.find((a) => a.verdict.verdict !== 'PASS');
266
+ const pick = denying ?? attributed[0];
267
+ return { ...pick, attributedVerdicts: attributed.length };
268
+ }
269
+ // Nothing attributed. Say what the ledger DOES hold, so the answer is checkable.
270
+ const newest = verdicts[0];
271
+ const held = `the ledger holds ${verdicts.length} verdict${verdicts.length === 1 ? '' : 's'} across ${byRun.size} QE run${byRun.size === 1 ? '' : 's'}, ` +
272
+ `newest ${newest.verdict} (${newest.id}) at ${newest.created_at}`;
273
+ const notStamped = `none is stamped with run ${runId}`;
274
+ const undated = undatedRuns > 0
275
+ ? `; ${undatedRuns} QE run${undatedRuns === 1 ? ' has' : 's have'} no dated run row and cannot be placed by inference`
276
+ : '';
277
+ const none = (reason) => ({
278
+ verdict: null,
279
+ run: null,
280
+ attribution: { kind: 'none', reason },
281
+ attributedVerdicts: 0,
282
+ });
283
+ if (logUnreadable !== undefined) {
284
+ return none(`${held}; ${notStamped}, and the run's event log could not be read (${logUnreadable}), ` +
285
+ `so no verdict can be placed inside its lifetime${undated}`);
286
+ }
287
+ if (startedAt === null) {
288
+ return none(`${held}; ${notStamped}, and the run's start is not recorded ` +
289
+ `(no sessionStarted in its event log), so no verdict can be placed inside its lifetime${undated}`);
290
+ }
291
+ const started = new Date(startedAt).toISOString();
292
+ const newestAt = epoch(newest.created_at);
293
+ const placement = newestAt !== null && newestAt < startedAt
294
+ ? `before this run started (${started})`
295
+ : `outside this run's lifetime (started ${started}${finishedAt !== null ? `, finished ${new Date(finishedAt).toISOString()}` : ', still live'})`;
296
+ return none(`${held}, recorded ${placement}; ${notStamped}${undated}`);
68
297
  }
69
298
  /**
70
- * Read the ledger's current acceptance state for a repo.
299
+ * Read the ledger's acceptance state for a repo, scoped to `subject`.
71
300
  *
72
- * The newest verdict row governs (`opts.qeRunId` narrows to one QE run's
73
- * newest verdict instead). The verdicts TABLE is the system of record — the
74
- * manifest is the public artifact built from it at run finalization, returned
75
- * here as display evidence, never as a gate input: a run can legitimately be
76
- * re-reviewed after its manifest was built, and the newer verdict row wins.
301
+ * The verdicts TABLE is the system of record — the manifest is the public
302
+ * artifact built from it at run finalization, returned here as display
303
+ * evidence, never as a gate input: a run can legitimately be re-reviewed
304
+ * after its manifest was built, and the newer verdict row wins.
77
305
  *
78
- * Index-drift healing: the store is dual-write (canonical JSON + a derived
79
- * SQLite index) and a writer that degraded to JSON-only leaves the index
80
- * behind. When the index answers "no verdicts" but canonical verdict files
81
- * exist, the index is provably stale, so it is rebuilt from JSON once and
82
- * re-read — otherwise a ledger full of evidence would read as "missing
83
- * evidence ⇒ deny", a wrong answer in the honest direction but still wrong.
306
+ * Reads canonical JSON only (see the module header): nothing under the ledger
307
+ * root is created, modified or removed by this call.
84
308
  */
85
- export async function readAcceptanceState(repoRoot, opts) {
309
+ export async function readAcceptanceState(repoRoot, subject) {
86
310
  const root = qeLedgerRoot(repoRoot);
87
311
  const state = {
88
312
  root,
@@ -91,25 +315,25 @@ export async function readAcceptanceState(repoRoot, opts) {
91
315
  verdict: null,
92
316
  manifest: null,
93
317
  manifestPath: null,
318
+ attribution: { kind: 'none', reason: 'no ledger' },
319
+ ledgerVerdicts: 0,
320
+ attributedVerdicts: 0,
94
321
  };
95
- // Probe before opening: createDomainStore CREATES its root when absent, and
96
- // a read must not install an empty ledger into a repo that never had one.
322
+ // Probe before reading: a read must not install an empty ledger into a repo
323
+ // that never had one, and a missing root is its own answer.
97
324
  if (!existsSync(root))
98
325
  return state;
99
326
  state.found = true;
100
327
  try {
101
- const store = createDomainStore({ root });
102
- const filter = opts?.qeRunId !== undefined ? { run_id: opts.qeRunId } : undefined;
103
- let verdicts = store.list('verdicts', filter);
104
- if (verdicts.length === 0 && store.mode === 'sqlite+json' && hasCanonicalRows(root, 'verdicts')) {
105
- store.rebuildIndex();
106
- verdicts = store.list('verdicts', filter);
107
- }
108
- const verdict = verdicts[0] ?? null;
109
- state.verdict = verdict;
110
- if (verdict !== null) {
111
- state.run = store.get('runs', verdict.run_id);
112
- state.manifestPath = join(root, 'evidence', verdict.run_id, 'manifest.json');
328
+ const verdicts = listCanonical(root, 'verdicts');
329
+ state.ledgerVerdicts = verdicts.length;
330
+ const picked = attribute(root, verdicts, subject);
331
+ state.verdict = picked.verdict;
332
+ state.run = picked.run;
333
+ state.attribution = picked.attribution;
334
+ state.attributedVerdicts = picked.attributedVerdicts;
335
+ if (picked.verdict !== null) {
336
+ state.manifestPath = join(root, 'evidence', picked.verdict.run_id, 'manifest.json');
113
337
  state.manifest = await readManifest(state.manifestPath);
114
338
  }
115
339
  }
@@ -118,6 +342,12 @@ export async function readAcceptanceState(repoRoot, opts) {
118
342
  // still denies (deny-dominates), but the reason must name the read failure
119
343
  // so an operator fixes the store instead of hunting for a missing run.
120
344
  state.error = err instanceof Error ? err.message : String(err);
345
+ state.verdict = null;
346
+ state.run = null;
347
+ state.manifest = null;
348
+ state.manifestPath = null;
349
+ state.attribution = { kind: 'none', reason: `the ledger could not be read: ${state.error}` };
350
+ state.attributedVerdicts = 0;
121
351
  }
122
352
  return state;
123
353
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/qe/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC;AACtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAE1D,6FAA6F;AAC7F,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,CAAC;AAC3E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,U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MAAM,CAAC,gBAAgB,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAClG,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAYD,sDAAsD;AACtD,MAAM,UAAU,iBAAiB,CAAC,QAA0B;IAC1D,OAAO;QACL,eAAe,EAAE,QAAQ,CAAC,gBAAgB;QAC1C,KAAK,EAAE,QAAQ,CAAC,MAAM;QACtB,YAAY,EAAE,OAAO,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI;QACxF,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAChF,OAAO,EAAE;YACP,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,IAAI,cAAc;YAChD,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE;YAC1C,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI,IAAI;SAClD;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew",
3
- "version": "0.7.31",
3
+ "version": "0.7.32",
4
4
  "description": "wicked-crew daemon — thin REST+WS bridge to the wicked-core engine via wicked-core-ts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,7 +37,7 @@
37
37
  "fastify": "^5.0.0",
38
38
  "pi-acp": "^0.0.32",
39
39
  "wicked-bus": "^2.3.1",
40
- "wicked-core-ts": "^0.7.22",
40
+ "wicked-core-ts": "^0.7.23",
41
41
  "wicked-ledger": "^0.4.0",
42
42
  "yaml": "^2.4.2",
43
43
  "zod": "^3.23.0"