audit-tools 0.34.6 → 0.34.8

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.
Files changed (38) hide show
  1. package/dist/audit/cli/auditStep.d.ts +7 -1
  2. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  3. package/dist/audit/cli/auditStep.js +1 -4
  4. package/dist/audit/cli/auditStep.js.map +1 -1
  5. package/dist/audit/cli/dispatch/types.d.ts +9 -0
  6. package/dist/audit/cli/dispatch/types.d.ts.map +1 -1
  7. package/dist/audit/cli/dispatch.d.ts +13 -0
  8. package/dist/audit/cli/dispatch.d.ts.map +1 -1
  9. package/dist/audit/cli/dispatch.js +24 -0
  10. package/dist/audit/cli/dispatch.js.map +1 -1
  11. package/dist/audit/cli/nextStepCommand.d.ts +1 -1
  12. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  13. package/dist/audit/cli/nextStepCommand.js +36 -5
  14. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  15. package/dist/audit/cli/nextStepHelpers.d.ts +60 -0
  16. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  17. package/dist/audit/cli/nextStepHelpers.js +283 -45
  18. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  19. package/dist/audit/cli/prompts.d.ts +2 -0
  20. package/dist/audit/cli/prompts.d.ts.map +1 -1
  21. package/dist/audit/cli/prompts.js +1 -0
  22. package/dist/audit/cli/prompts.js.map +1 -1
  23. package/dist/audit/cli/rollingAuditDispatch.d.ts +13 -1
  24. package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
  25. package/dist/audit/cli/rollingAuditDispatch.js +60 -5
  26. package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
  27. package/dist/audit/types/designAssessment.d.ts +22 -0
  28. package/dist/audit/types/designAssessment.d.ts.map +1 -1
  29. package/dist/shared/dispatch/admissionLoop.d.ts +30 -10
  30. package/dist/shared/dispatch/admissionLoop.d.ts.map +1 -1
  31. package/dist/shared/dispatch/admissionLoop.js +20 -3
  32. package/dist/shared/dispatch/admissionLoop.js.map +1 -1
  33. package/dist/shared/dispatch/dispatchQuotaContract.d.ts +7 -7
  34. package/dist/shared/quota/claimRegistry.d.ts +11 -0
  35. package/dist/shared/quota/claimRegistry.d.ts.map +1 -1
  36. package/dist/shared/quota/claimRegistry.js +26 -0
  37. package/dist/shared/quota/claimRegistry.js.map +1 -1
  38. package/package.json +6 -6
@@ -9,11 +9,13 @@ import { type ObligationDef } from "audit-tools/shared";
9
9
  import type { AnalyzerSetting, GraphEdge, SessionConfig } from "audit-tools/shared";
10
10
  import { type ArtifactBundle } from "../io/artifacts.js";
11
11
  import type { AuditState } from "../types/auditState.js";
12
+ import type { RejectedDesignReviewSubmission } from "../types/designAssessment.js";
12
13
  import { type AdvanceAuditResult } from "../orchestrator/advance.js";
13
14
  import type { ProviderConfirmationGateState } from "../orchestrator/advanceTypes.js";
14
15
  import { decideNextStep } from "../orchestrator/nextStep.js";
15
16
  import type { AnalyzerPlanEntry } from "../extractors/analyzers/types.js";
16
17
  import type { ActiveReviewRun } from "../supervisor/operatorHandoff.js";
18
+ import { runAuditStep } from "./auditStep.js";
17
19
  import type { ExternalAcquisitionAdvanceOptions } from "../orchestrator/acquisitionExecutor.js";
18
20
  /**
19
21
  * Skip the design-review enrichment when the host quota wall has persisted past the
@@ -257,6 +259,8 @@ type GraphEnrichmentBranchResult = {
257
259
  */
258
260
  export declare function handleGraphEnrichmentBranch(params: Pick<NextStepParams, "root" | "artifactsDir" | "graphLlmEdgeReasoning" | "since">, bundle: ArtifactBundle, state: AuditState, analyzersRef: {
259
261
  value: Record<string, AnalyzerSetting> | undefined;
262
+ }, deps?: {
263
+ runStep?: typeof runAuditStep;
260
264
  }): Promise<GraphEnrichmentBranchResult>;
261
265
  type BranchActionResult = {
262
266
  action: "continue";
@@ -289,6 +293,62 @@ type BranchActionResult = {
289
293
  bundle: ArtifactBundle;
290
294
  };
291
295
  };
296
+ type ConsumeArrayIncomingResult<T> = {
297
+ status: "absent";
298
+ } | {
299
+ status: "ok";
300
+ value: T[];
301
+ path: string;
302
+ } | {
303
+ status: "quarantined";
304
+ quarantinePath: string;
305
+ originalFilename: string;
306
+ reason: string;
307
+ };
308
+ /**
309
+ * Read a JSON `incoming/` file expected to be an array (or a top-level object
310
+ * wrapping exactly one array-valued property, the tolerant unwrap). Accepts
311
+ * either shape and deletes the source file; any other shape is quarantined
312
+ * (never unlinked-and-discarded) and reported with a reason.
313
+ */
314
+ export declare function consumeArrayIncoming<T>(artifactsDir: string, filename: string): Promise<ConsumeArrayIncomingResult<T>>;
315
+ type ConsumeObjectIncomingResult = {
316
+ status: "absent";
317
+ } | {
318
+ status: "ok";
319
+ value: Record<string, unknown>;
320
+ path: string;
321
+ } | {
322
+ status: "quarantined";
323
+ quarantinePath: string;
324
+ reason: string;
325
+ };
326
+ /**
327
+ * Read a JSON `incoming/` file expected to be a plain top-level object (a
328
+ * key → value map, e.g. analyzer-decisions.json). A non-object value — null,
329
+ * an array, a bare primitive — is quarantined with a stderr diagnostic rather
330
+ * than left lingering in `incoming/` (where it used to make the emitting step
331
+ * re-ask silently forever). Unlike `consumeArrayIncoming`, an accepted file is
332
+ * NOT deleted here — the caller unlinks after applying, so a crash mid-apply
333
+ * retains the submission for the retry.
334
+ */
335
+ export declare function consumeObjectIncoming(artifactsDir: string, filename: string): Promise<ConsumeObjectIncomingResult>;
336
+ /**
337
+ * Render the host-facing notice for a pending quarantined edge-reasoning
338
+ * submission, naming the quarantined file and the shape error — so the
339
+ * re-emitted edge_reasoning step tells the host its prior submission was
340
+ * rejected and why, rather than silently asking again. Returns `undefined`
341
+ * when there is nothing to report.
342
+ */
343
+ export declare function renderEdgeReasoningRejectionNotice(artifactsDir: string): Promise<string | undefined>;
344
+ /**
345
+ * Render a host-facing notice for any pending quarantined design-review
346
+ * submissions matching the given passes, naming the quarantined file and the
347
+ * shape error — so a re-emitted design-review step tells the host its prior
348
+ * submission was rejected and why, rather than silently asking again.
349
+ * Returns `undefined` when there is nothing to report.
350
+ */
351
+ export declare function renderDesignReviewRejectionNotice(bundle: ArtifactBundle, passes: readonly RejectedDesignReviewSubmission["pass"][]): string | undefined;
292
352
  export declare function handleDesignReviewBranch(params: Pick<NextStepParams, "artifactsDir">, bundle: ArtifactBundle, state: AuditState): Promise<BranchActionResult>;
293
353
  /** The common action shape all four `runOmittableGate`-driven branches return. */
294
354
  type OmittableGateAction<TStepKind extends string> = {
@@ -1 +1 @@
1
- {"version":3,"file":"nextStepHelpers.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/nextStepHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,eAAe,EAEf,SAAS,EACT,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAC;AAS5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAOrF,OAAO,EAAE,cAAc,EAAyC,MAAM,6BAA6B,CAAC;AAcpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAI1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAShG;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc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,CAAC;IACvB,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,CAAA;KAAE,CAAC;IACrE,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC;;;;OAIG;IACH,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,kFAAkF;IAClF,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,iFAAiF;IACjF,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,8EAA8E;IAC9E,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AA0BD,uFAAuF;AACvF,KAAK,gBAAgB,GAAG,cAAc,CAAC;AAEvC,KAAK,kBAAkB,GAAG,aAAa,CACrC,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,CACf,CAAC;AAmHF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,CAAC,EAAE,6BAA6B,GACnC,kBAAkB,EAAE,CAuRtB;AAsXD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,cAAc,CAAC,CAqGzB"}
@@ -5,7 +5,7 @@
5
5
  * top-level cmdNextStep dispatcher, keeping each module focused on a single
6
6
  * concern.
7
7
  */
8
- import { access, unlink } from "node:fs/promises";
8
+ import { access, mkdir, readFile, rename, unlink, writeFile } from "node:fs/promises";
9
9
  import { join } from "node:path";
10
10
  import { advance, isFileMissingError, readJsonFile, writeJsonFile, readProviderConfirmationInput, } from "audit-tools/shared";
11
11
  import { loadArtifactBundle, promoteFinalAuditReport, writeCoreArtifacts, } from "../io/artifacts.js";
@@ -221,7 +221,8 @@ export async function buildTerminalStep(params, bundle, state, blockedReason) {
221
221
  * - `return` → caller should emit the embedded result to cmdNextStep.
222
222
  * - `fallthrough` → no incoming artifacts; run the deterministic executor.
223
223
  */
224
- export async function handleGraphEnrichmentBranch(params, bundle, state, analyzersRef) {
224
+ export async function handleGraphEnrichmentBranch(params, bundle, state, analyzersRef, deps = {}) {
225
+ const runStep = deps.runStep ?? runAuditStep;
225
226
  // Fold-level pause detection is single-sourced in `hostInputPause` so the drain
226
227
  // stop predicate (`nextStepPausesForHostInput`) and this fold agree EXACTLY on
227
228
  // when the analyzer-install consent / edge-reasoning turns are owed.
@@ -232,8 +233,14 @@ export async function handleGraphEnrichmentBranch(params, bundle, state, analyze
232
233
  };
233
234
  const unresolved = graphEnrichmentUnresolvedAnalyzers(bundle, pauseInputs);
234
235
  if (unresolved.length > 0) {
235
- const incoming = await tryConsumeIncoming(params.artifactsDir, "analyzer-decisions.json");
236
- if (incoming && incoming.value !== null && typeof incoming.value === "object") {
236
+ const incoming = await consumeObjectIncoming(params.artifactsDir, "analyzer-decisions.json");
237
+ if (incoming.status === "quarantined") {
238
+ // A non-object top-level value used to be neither merged, deleted, nor
239
+ // diagnosed — the file lingered in incoming/ and the analyzer_install
240
+ // step re-emitted silently forever. Quarantined + diagnosed instead.
241
+ return { action: "continue" };
242
+ }
243
+ if (incoming.status === "ok") {
237
244
  const settings = {};
238
245
  for (const [id, value] of Object.entries(incoming.value)) {
239
246
  if (value === "ephemeral" ||
@@ -274,15 +281,37 @@ export async function handleGraphEnrichmentBranch(params, bundle, state, analyze
274
281
  if (candidates.length > 0) {
275
282
  const edgeReasoningIncoming = await tryConsumeIncoming(params.artifactsDir, "edge-reasoning.json");
276
283
  if (edgeReasoningIncoming) {
277
- await runAuditStep({
284
+ // Same hazard class as the design-review quarantine fix: a malformed
285
+ // submission used to no-op silently inside applyEdgeReasoning (it never
286
+ // throws), the unconditional unlink then destroyed the file, and the
287
+ // identical edge_reasoning step re-emitted with zero signal. Tolerant-
288
+ // unwrap first (EdgeReasoningResults is a single-array-property object,
289
+ // so the same "exactly one array-valued top-level property" rule
290
+ // applies, and a bare rewrites array is accepted too); anything else is
291
+ // quarantined and named in the re-emitted step's prompt.
292
+ const unwrapped = unwrapIncomingArray(edgeReasoningIncoming.value);
293
+ if (!unwrapped.ok) {
294
+ const quarantinePath = await quarantineIncomingFile(params.artifactsDir, edgeReasoningIncoming.path, "edge-reasoning.json");
295
+ await recordEdgeReasoningRejection(params.artifactsDir, {
296
+ filename: "edge-reasoning.json",
297
+ quarantine_path: quarantinePath,
298
+ reason: unwrapped.reason,
299
+ rejected_at: new Date().toISOString(),
300
+ });
301
+ return { action: "continue" };
302
+ }
303
+ // Apply BEFORE deleting the incoming file: if runStep throws (locks,
304
+ // crash), the submission survives for the retry instead of being lost.
305
+ await runStep({
278
306
  root: params.root,
279
307
  artifactsDir: params.artifactsDir,
280
308
  analyzers: analyzersRef.value,
281
309
  graphLlmEdgeReasoning: true,
282
- edgeReasoningResultsPath: edgeReasoningIncoming.path,
310
+ edgeReasoningResults: { rewrites: unwrapped.array },
283
311
  since: params.since,
284
312
  });
285
313
  await unlink(edgeReasoningIncoming.path).catch(() => { });
314
+ await clearEdgeReasoningRejection(params.artifactsDir);
286
315
  return { action: "continue" };
287
316
  }
288
317
  return { action: "return", result: { kind: "edge_reasoning", state, bundle, candidates } };
@@ -310,45 +339,245 @@ function passIsStale(bundle, pass) {
310
339
  const snapshot = bundle.design_review_snapshots?.[pass];
311
340
  return snapshot ? isDesignReviewStale(snapshot, bundle) : false;
312
341
  }
342
+ /** Human-readable description of why an incoming value is neither an array nor a single-array-wrapped object. */
343
+ function describeIncomingShapeMismatch(value) {
344
+ if (value === null)
345
+ return "null";
346
+ if (Array.isArray(value))
347
+ return "an array"; // reachable from consumeObjectIncoming (an array is not a key→value map)
348
+ const t = typeof value;
349
+ if (t !== "object")
350
+ return `a bare ${t}`;
351
+ const entries = Object.entries(value);
352
+ if (entries.length === 0)
353
+ return "an empty object";
354
+ const arrayKeys = entries.filter(([, v]) => Array.isArray(v)).map(([k]) => k);
355
+ const allKeys = entries.map(([k]) => k).join(", ");
356
+ if (arrayKeys.length === 0) {
357
+ return `an object with no array-valued properties (keys: ${allKeys})`;
358
+ }
359
+ return (`an object with ${arrayKeys.length} array-valued propert${arrayKeys.length === 1 ? "y" : "ies"} ` +
360
+ `out of ${entries.length} total key(s) (${allKeys}) — exactly one top-level array property is ` +
361
+ `required for the tolerant unwrap`);
362
+ }
363
+ /**
364
+ * Move a malformed incoming submission to `<artifactsDir>/quarantine/` rather
365
+ * than deleting it. Falls back to copy+unlink if `rename` fails (e.g. a
366
+ * cross-device incoming/ mount) so the content is never lost.
367
+ */
368
+ async function quarantineIncomingFile(artifactsDir, filePath, originalFilename) {
369
+ const quarantineDir = join(artifactsDir, "quarantine");
370
+ await mkdir(quarantineDir, { recursive: true });
371
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
372
+ const quarantinePath = join(quarantineDir, `${originalFilename}.${timestamp}.json`);
373
+ try {
374
+ await rename(filePath, quarantinePath);
375
+ }
376
+ catch {
377
+ try {
378
+ const content = await readFile(filePath, "utf8");
379
+ await writeFile(quarantinePath, content, "utf8");
380
+ }
381
+ catch {
382
+ // Best-effort: nothing left to quarantine if even the read failed.
383
+ }
384
+ await unlink(filePath).catch(() => { });
385
+ }
386
+ return quarantinePath;
387
+ }
388
+ /**
389
+ * The single tolerant-unwrap rule: a bare array is accepted as-is; a top-level
390
+ * object wrapping exactly one array-valued property is unambiguous and is
391
+ * accepted as that array. Anything else fails with a shape description.
392
+ * Single-sourced so `consumeArrayIncoming` and the edge-reasoning gate cannot
393
+ * drift on what shapes are accepted.
394
+ */
395
+ function unwrapIncomingArray(value) {
396
+ if (Array.isArray(value))
397
+ return { ok: true, array: value };
398
+ if (value !== null && typeof value === "object") {
399
+ const entries = Object.entries(value);
400
+ if (entries.length === 1 && Array.isArray(entries[0][1])) {
401
+ return { ok: true, array: entries[0][1] };
402
+ }
403
+ }
404
+ return { ok: false, reason: describeIncomingShapeMismatch(value) };
405
+ }
406
+ /**
407
+ * Read a JSON `incoming/` file expected to be an array (or a top-level object
408
+ * wrapping exactly one array-valued property, the tolerant unwrap). Accepts
409
+ * either shape and deletes the source file; any other shape is quarantined
410
+ * (never unlinked-and-discarded) and reported with a reason.
411
+ */
412
+ export async function consumeArrayIncoming(artifactsDir, filename) {
413
+ const incoming = await tryConsumeIncoming(artifactsDir, filename);
414
+ if (!incoming)
415
+ return { status: "absent" };
416
+ const { value, path } = incoming;
417
+ const unwrapped = unwrapIncomingArray(value);
418
+ if (unwrapped.ok) {
419
+ await unlink(path).catch(() => { });
420
+ return { status: "ok", value: unwrapped.array, path };
421
+ }
422
+ const quarantinePath = await quarantineIncomingFile(artifactsDir, path, filename);
423
+ return { status: "quarantined", quarantinePath, originalFilename: filename, reason: unwrapped.reason };
424
+ }
425
+ /**
426
+ * Read a JSON `incoming/` file expected to be a plain top-level object (a
427
+ * key → value map, e.g. analyzer-decisions.json). A non-object value — null,
428
+ * an array, a bare primitive — is quarantined with a stderr diagnostic rather
429
+ * than left lingering in `incoming/` (where it used to make the emitting step
430
+ * re-ask silently forever). Unlike `consumeArrayIncoming`, an accepted file is
431
+ * NOT deleted here — the caller unlinks after applying, so a crash mid-apply
432
+ * retains the submission for the retry.
433
+ */
434
+ export async function consumeObjectIncoming(artifactsDir, filename) {
435
+ const incoming = await tryConsumeIncoming(artifactsDir, filename);
436
+ if (!incoming)
437
+ return { status: "absent" };
438
+ const { value, path } = incoming;
439
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
440
+ return { status: "ok", value: value, path };
441
+ }
442
+ const reason = describeIncomingShapeMismatch(value);
443
+ const quarantinePath = await quarantineIncomingFile(artifactsDir, path, filename);
444
+ process.stderr.write(`[audit-code] ${filename} quarantined to ${quarantinePath}: expected a JSON object, got ${reason}. ` +
445
+ `Fix the shape and resubmit.\n`);
446
+ return { status: "quarantined", quarantinePath, reason };
447
+ }
448
+ function edgeReasoningRejectionPath(artifactsDir) {
449
+ return join(artifactsDir, "quarantine", "edge-reasoning.rejection.json");
450
+ }
451
+ async function recordEdgeReasoningRejection(artifactsDir, rejection) {
452
+ await mkdir(join(artifactsDir, "quarantine"), { recursive: true });
453
+ await writeJsonFile(edgeReasoningRejectionPath(artifactsDir), rejection);
454
+ }
455
+ async function clearEdgeReasoningRejection(artifactsDir) {
456
+ await unlink(edgeReasoningRejectionPath(artifactsDir)).catch(() => { });
457
+ }
458
+ /**
459
+ * Render the host-facing notice for a pending quarantined edge-reasoning
460
+ * submission, naming the quarantined file and the shape error — so the
461
+ * re-emitted edge_reasoning step tells the host its prior submission was
462
+ * rejected and why, rather than silently asking again. Returns `undefined`
463
+ * when there is nothing to report.
464
+ */
465
+ export async function renderEdgeReasoningRejectionNotice(artifactsDir) {
466
+ let rejection;
467
+ try {
468
+ rejection = await readJsonFile(edgeReasoningRejectionPath(artifactsDir));
469
+ }
470
+ catch (error) {
471
+ if (isFileMissingError(error))
472
+ return undefined;
473
+ throw error;
474
+ }
475
+ return [
476
+ "## Prior submission rejected",
477
+ "",
478
+ "Your last edge-reasoning submission did not match the expected shape and was " +
479
+ "quarantined (not applied, not silently discarded). Fix the shape and resubmit:",
480
+ "",
481
+ `- \`${rejection.filename}\` quarantined to \`${rejection.quarantine_path}\` (${rejection.rejected_at}): ${rejection.reason}`,
482
+ "",
483
+ 'Expected shape: {"rewrites":[{"from":"...","to":"...","kind":"...","reason":"..."}]} — ' +
484
+ "a bare JSON array of rewrites is also accepted.",
485
+ ].join("\n");
486
+ }
487
+ /**
488
+ * Record a quarantined design-review submission on `design_assessment` (and
489
+ * persist immediately) so the note survives the same-call `continue`
490
+ * re-derivation. A no-op when `design_assessment` doesn't exist yet — in
491
+ * practice unreachable, since `design_assessment_current` is a
492
+ * higher-priority obligation than either design-review pass (PRIORITY in
493
+ * nextStep.ts), so `design_assessment` always exists by the time this branch
494
+ * runs.
495
+ */
496
+ async function recordRejectedDesignReviewSubmission(artifactsDir, existing, pass, quarantined) {
497
+ if (!existing)
498
+ return;
499
+ const entry = {
500
+ pass,
501
+ filename: quarantined.originalFilename,
502
+ quarantine_path: quarantined.quarantinePath,
503
+ reason: quarantined.reason,
504
+ rejected_at: new Date().toISOString(),
505
+ };
506
+ existing.rejected_submissions = [
507
+ ...(existing.rejected_submissions ?? []).filter((r) => r.pass !== pass),
508
+ entry,
509
+ ];
510
+ await writeJsonFile(join(artifactsDir, "design_assessment.json"), existing);
511
+ }
512
+ /**
513
+ * Render a host-facing notice for any pending quarantined design-review
514
+ * submissions matching the given passes, naming the quarantined file and the
515
+ * shape error — so a re-emitted design-review step tells the host its prior
516
+ * submission was rejected and why, rather than silently asking again.
517
+ * Returns `undefined` when there is nothing to report.
518
+ */
519
+ export function renderDesignReviewRejectionNotice(bundle, passes) {
520
+ const rejected = (bundle.design_assessment?.rejected_submissions ?? []).filter((r) => passes.includes(r.pass));
521
+ if (rejected.length === 0)
522
+ return undefined;
523
+ const lines = [
524
+ "## Prior submission rejected",
525
+ "",
526
+ "Your last submission for this pass did not match the expected shape and was " +
527
+ "quarantined (not merged, not silently discarded). Fix the shape and resubmit:",
528
+ "",
529
+ ];
530
+ for (const r of rejected) {
531
+ lines.push(`- **${r.pass}** — \`${r.filename}\` quarantined to \`${r.quarantine_path}\` (${r.rejected_at}): ${r.reason}`);
532
+ }
533
+ lines.push("", "Expected shape: a JSON array of findings, or a top-level object wrapping exactly " +
534
+ 'one array-valued property (e.g. `{"findings": [...]}`).');
535
+ return lines.join("\n");
536
+ }
313
537
  export async function handleDesignReviewBranch(params, bundle, state) {
314
538
  const existing = bundle.design_assessment;
315
- // Legacy: consume old combined findings file. Always unlink when present to
316
- // prevent accumulation, even when design_assessment is absent (COR-68f07c3e).
317
- const legacyIncoming = await tryConsumeIncoming(params.artifactsDir, "design-review-findings.json");
318
- if (legacyIncoming) {
319
- await unlink(legacyIncoming.path).catch(() => { });
320
- if (Array.isArray(legacyIncoming.value) && existing) {
321
- existing.review_findings = groundDesignFindings(legacyIncoming.value, bundle.repo_manifest);
539
+ // Legacy: consume old combined findings file. Tolerant-unwrap or quarantine
540
+ // (never a bare unconditional delete) see the quarantine block comment above.
541
+ const legacyResult = await consumeArrayIncoming(params.artifactsDir, "design-review-findings.json");
542
+ if (legacyResult.status === "quarantined") {
543
+ await recordRejectedDesignReviewSubmission(params.artifactsDir, existing, "legacy", legacyResult);
544
+ return { action: "continue" };
545
+ }
546
+ if (legacyResult.status === "ok") {
547
+ if (existing) {
548
+ existing.review_findings = groundDesignFindings(legacyResult.value, bundle.repo_manifest);
322
549
  existing.reviewed = true;
550
+ existing.rejected_submissions = (existing.rejected_submissions ?? []).filter((r) => r.pass !== "legacy");
323
551
  await writeJsonFile(join(params.artifactsDir, "design_assessment.json"), existing);
324
552
  return { action: "continue" };
325
553
  }
326
- // File consumed (deleted) but no target to merge into — keep folding.
554
+ // File consumed but no target to merge into — keep folding.
327
555
  return { action: "continue" };
328
556
  }
557
+ // absent: fall through to the contract/conceptual check.
329
558
  // New: consume contract-findings and/or conceptual-findings independently.
330
- const contractIncoming = await tryConsumeIncoming(params.artifactsDir, "design-review-contract-findings.json");
331
- const conceptualIncoming = await tryConsumeIncoming(params.artifactsDir, "design-review-conceptual-findings.json");
559
+ const contractResult = await consumeArrayIncoming(params.artifactsDir, "design-review-contract-findings.json");
560
+ const conceptualResult = await consumeArrayIncoming(params.artifactsDir, "design-review-conceptual-findings.json");
332
561
  let consumed = false;
333
- // Always delete incoming files when present; only merge data when existing
334
- // design_assessment is present (COR-68f07c3e).
335
- if (contractIncoming) {
336
- await unlink(contractIncoming.path).catch(() => { });
337
- if (Array.isArray(contractIncoming.value) && existing) {
338
- existing.contract_findings = groundDesignFindings(contractIncoming.value, bundle.repo_manifest);
339
- existing.contract_reviewed = true;
340
- consumed = true;
341
- }
562
+ if (contractResult.status === "quarantined") {
563
+ await recordRejectedDesignReviewSubmission(params.artifactsDir, existing, "contract", contractResult);
342
564
  }
343
- if (conceptualIncoming) {
344
- await unlink(conceptualIncoming.path).catch(() => { });
345
- if (Array.isArray(conceptualIncoming.value) && existing) {
346
- existing.conceptual_findings = groundDesignFindings(conceptualIncoming.value, bundle.repo_manifest);
347
- existing.conceptual_reviewed = true;
348
- consumed = true;
349
- }
565
+ else if (contractResult.status === "ok" && existing) {
566
+ existing.contract_findings = groundDesignFindings(contractResult.value, bundle.repo_manifest);
567
+ existing.contract_reviewed = true;
568
+ existing.rejected_submissions = (existing.rejected_submissions ?? []).filter((r) => r.pass !== "contract");
569
+ consumed = true;
570
+ }
571
+ if (conceptualResult.status === "quarantined") {
572
+ await recordRejectedDesignReviewSubmission(params.artifactsDir, existing, "conceptual", conceptualResult);
573
+ }
574
+ else if (conceptualResult.status === "ok" && existing) {
575
+ existing.conceptual_findings = groundDesignFindings(conceptualResult.value, bundle.repo_manifest);
576
+ existing.conceptual_reviewed = true;
577
+ existing.rejected_submissions = (existing.rejected_submissions ?? []).filter((r) => r.pass !== "conceptual");
578
+ consumed = true;
350
579
  }
351
- if (contractIncoming || conceptualIncoming) {
580
+ if (contractResult.status !== "absent" || conceptualResult.status !== "absent") {
352
581
  // Item C: the design-review fan-out results are in — release the host-fan-out
353
582
  // panel's leases now, before the coverage packet dispatch that follows, rather
354
583
  // than letting them linger to the 20-min TTL and depress its headroom.
@@ -362,10 +591,10 @@ export async function handleDesignReviewBranch(params, bundle, state) {
362
591
  // rather than a blind full re-run. Capture after the design_assessment write
363
592
  // so the projection reflects the persisted findings.
364
593
  const reviewedAt = new Date().toISOString();
365
- if (contractIncoming) {
594
+ if (contractResult.status === "ok") {
366
595
  await captureDesignReviewSnapshot(params.artifactsDir, "contract", existing.contract_findings ?? [], bundle, reviewedAt);
367
596
  }
368
- if (conceptualIncoming) {
597
+ if (conceptualResult.status === "ok") {
369
598
  await captureDesignReviewSnapshot(params.artifactsDir, "conceptual", existing.conceptual_findings ?? [], bundle, reviewedAt);
370
599
  }
371
600
  return { action: "continue" };
@@ -1329,23 +1558,32 @@ async function runHostDelegationObligation(bundle, ctx) {
1329
1558
  };
1330
1559
  }
1331
1560
  // Convergence guard: a pass that ingested NO new results and stranded nothing
1332
- // (every packet errored at the provider) made no net progress, and
1333
- // re-dispatching the same unchanged state would loop to the maxTransitions
1334
- // backstop. Emit the block rather than spin. Progress (ingest ran, or a strand
1335
- // terminal was recorded) `transition`s so the fold re-derives normally.
1561
+ // made no net progress, and re-dispatching the same unchanged state would loop
1562
+ // to the maxTransitions backstop. Emit the block rather than spin. Progress
1563
+ // (ingest ran, or a strand terminal was recorded) `transition`s so the fold
1564
+ // re-derives normally. Two distinct no-progress causes, honestly named:
1565
+ // pending-tasks-unavailable (peer-claimed / unfit — the completion-livelock
1566
+ // fix) vs provider-errored-on-every-packet.
1336
1567
  if (!driven.ingest && driven.stranded_ids.length === 0) {
1568
+ const reason = driven.status === "no_progress" && driven.no_progress_cause === "pending_tasks_unavailable"
1569
+ ? `In-process rolling dispatch found ${driven.pending_task_count ?? "several"} pending review ` +
1570
+ "task(s) but could plan none this round: every one is either claimed by a live peer run " +
1571
+ "(that run's results will arrive via the shared ledger; a failed run's claims release at its " +
1572
+ "drive end, or expire with the 20-minute lease) or fits no eligible pool. Stopping to avoid " +
1573
+ "a no-progress loop — re-run next-step to retry once the peer finishes or capacity returns."
1574
+ : `In-process rolling dispatch produced no results for ${driven.packet_count} ` +
1575
+ `review packet(s) (provider '${sessionConfig?.provider}' errored on every packet, and a ` +
1576
+ "bounded auto-retry did not recover); stopping to avoid a no-progress loop. " +
1577
+ "Recovery: once the backend is healthy, re-run next-step to re-dispatch; or hand the review " +
1578
+ "results in directly with `audit-code ingest-results --results <file>` (or drop AuditResult[] " +
1579
+ "files into the run's task-results/ dir, matched by task_id).";
1337
1580
  return {
1338
1581
  kind: "emit",
1339
1582
  step: {
1340
1583
  kind: "blocked",
1341
1584
  state,
1342
1585
  bundle,
1343
- reason: `In-process rolling dispatch produced no results for ${driven.packet_count} ` +
1344
- `review packet(s) (provider '${sessionConfig?.provider}' errored on every packet, and a ` +
1345
- "bounded auto-retry did not recover); stopping to avoid a no-progress loop. " +
1346
- "Recovery: once the backend is healthy, re-run next-step to re-dispatch; or hand the review " +
1347
- "results in directly with `audit-code ingest-results --results <file>` (or drop AuditResult[] " +
1348
- "files into the run's task-results/ dir, matched by task_id).",
1586
+ reason,
1349
1587
  },
1350
1588
  };
1351
1589
  }