crysk 0.7.0 → 0.8.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.
Files changed (133) hide show
  1. package/README.md +27 -23
  2. package/dist/SKILL-1q3658n0.md +74 -0
  3. package/dist/SKILL-25j4q9b8.md +143 -0
  4. package/dist/SKILL-4747bhne.md +143 -0
  5. package/dist/SKILL-4jc3sv23.md +74 -0
  6. package/dist/SKILL-c0492rch.md +540 -0
  7. package/dist/SKILL-d1nzkhhr.md +74 -0
  8. package/dist/SKILL-f8p7kvx0.md +143 -0
  9. package/dist/SKILL-gxd45g38.md +553 -0
  10. package/dist/SKILL-rec41991.md +66 -0
  11. package/dist/SKILL-zze8zj5g.md +536 -0
  12. package/dist/cli.js +24658 -24654
  13. package/dist/index.js +492 -463
  14. package/dist/opencode-ci-qrcv7a99.md +106 -0
  15. package/dist/opencode-ci-rdpcc7xc.md +106 -0
  16. package/dist/opencode-ci-yt0k74t0.md +106 -0
  17. package/dist/workflow-andv2dvm.yml +158 -0
  18. package/package.json +1 -1
  19. package/prompts/default/PROVENANCE.md +1 -0
  20. package/skills/crysk/SKILL.md +6 -6
  21. package/skills/crysk-ci-setup/SKILL.md +32 -33
  22. package/skills/crysk-ci-setup/assets/workflow.yml +5 -10
  23. package/skills/crysk-ci-setup/references/ci-admission.md +5 -5
  24. package/skills/crysk-ci-setup/references/opencode-ci.md +6 -6
  25. package/skills/crysk-loop/SKILL.md +37 -54
  26. package/skills/crysk-pr/SKILL.md +1 -1
  27. package/src/asset-manifest.ts +0 -6
  28. package/src/assets.ts +1 -4
  29. package/src/brand.ts +20 -30
  30. package/src/ci/gates.ts +155 -201
  31. package/src/ci/outcome.ts +4 -31
  32. package/src/ci/platform-limits.ts +135 -0
  33. package/src/ci/platform-report.ts +212 -126
  34. package/src/ci/platform.ts +28 -26
  35. package/src/ci/reporter.ts +25 -26
  36. package/src/ci/review-admission.ts +1 -2
  37. package/src/ci/review-levels.ts +12 -53
  38. package/src/ci/setup.ts +96 -66
  39. package/src/ci/trace-bundle.ts +11 -27
  40. package/src/ci/trace-transcripts.ts +4 -6
  41. package/src/ci/trigger.ts +3 -5
  42. package/src/cli.ts +6 -5
  43. package/src/commands/ci-setup-questions.ts +2 -55
  44. package/src/commands/ci-setup.ts +2 -26
  45. package/src/commands/triage.ts +131 -38
  46. package/src/commands/usage.ts +0 -1
  47. package/src/compare/compare.ts +3 -3
  48. package/src/compare/floor-test.ts +30 -201
  49. package/src/config/config.ts +6 -30
  50. package/src/diversity/accounting.ts +0 -26
  51. package/src/diversity/benchmark.ts +1 -17
  52. package/src/diversity/identity.ts +0 -14
  53. package/src/diversity/pipeline-integration.ts +0 -29
  54. package/src/doctor.ts +3 -6
  55. package/src/execution/claude-session-trace.ts +7 -2
  56. package/src/execution/contracts.ts +15 -9
  57. package/src/execution/harness.ts +165 -187
  58. package/src/execution/spend-limiter.ts +39 -131
  59. package/src/execution/usage-facts.ts +397 -0
  60. package/src/execution/usage-normalized.ts +33 -86
  61. package/src/harness/materiality-judge.ts +0 -5
  62. package/src/harness/pipeline-plan.ts +0 -3
  63. package/src/harness/replay-rows.ts +0 -5
  64. package/src/harness/route-runner.ts +2 -2
  65. package/src/harness/single-step.ts +3 -9
  66. package/src/index.ts +1 -1
  67. package/src/mcp/preflight.ts +2 -2
  68. package/src/model/catalog.ts +1 -3
  69. package/src/model/free-discovery.ts +11 -78
  70. package/src/model/model-name.ts +14 -4
  71. package/src/model/profiles/claude.ts +1 -2
  72. package/src/model/profiles/openai.ts +1 -2
  73. package/src/model/profiles.ts +1 -2
  74. package/src/model/provider-capabilities.ts +16 -55
  75. package/src/model/routing.ts +39 -36
  76. package/src/pr/admission.ts +6 -6
  77. package/src/pr/answered-findings.ts +8 -4
  78. package/src/pr/ci-publish.ts +0 -2
  79. package/src/pr/discovery.ts +4 -25
  80. package/src/pr/plan.ts +40 -121
  81. package/src/pr/pr-status.ts +14 -2
  82. package/src/pr/preflight.ts +15 -12
  83. package/src/pr/publish-outcome.ts +1 -19
  84. package/src/pr/review-pr.ts +10 -47
  85. package/src/pr/target.ts +76 -82
  86. package/src/production-runtime.ts +52 -114
  87. package/src/progress.ts +0 -54
  88. package/src/rereview/prepare.ts +4 -1
  89. package/src/rereview/state.ts +1 -1
  90. package/src/review/boundary.ts +4 -8
  91. package/src/review/drafts.ts +3 -3
  92. package/src/review/findings-conformance.ts +1 -1
  93. package/src/review/findings.ts +0 -4
  94. package/src/review/pipeline.ts +57 -395
  95. package/src/review/preflight.ts +162 -201
  96. package/src/review/prompt-set.ts +0 -2
  97. package/src/review/report.ts +2 -162
  98. package/src/review/review.ts +16 -65
  99. package/src/review/route-preflight.ts +3 -35
  100. package/src/review/run.ts +37 -73
  101. package/src/review/size-gate.ts +3 -3
  102. package/src/review/spec.ts +6 -11
  103. package/src/review/step-runner.ts +4 -4
  104. package/src/runner-authority.ts +10 -9
  105. package/src/security/credential-broker.ts +5 -6
  106. package/src/server/preflight.ts +0 -1
  107. package/src/server/server.ts +17 -6
  108. package/src/store/activity.ts +1 -2
  109. package/src/store/backfill-preflight.ts +0 -3
  110. package/src/store/backfill.ts +0 -1
  111. package/src/store/metrics-preflight.ts +4 -14
  112. package/src/store/metrics.ts +5 -5
  113. package/src/store/preflight.ts +0 -13
  114. package/src/store/store.ts +11 -12
  115. package/src/transport-registry.ts +6 -30
  116. package/src/transports/claude-code-cli.ts +149 -215
  117. package/src/transports/opencode-client.ts +4 -24
  118. package/src/transports/opencode-sdk.ts +17 -112
  119. package/src/triage/plain-reply.ts +37 -0
  120. package/src/ui/activity.ts +1 -6
  121. package/src/ui/config-edit.ts +14 -67
  122. package/src/ui/config.ts +3 -8
  123. package/src/ui/plan.ts +11 -198
  124. package/src/ui/progress.ts +3 -49
  125. package/src/ui/result.ts +18 -77
  126. package/src/ui/review-menu.ts +3 -12
  127. package/src/ui/select.ts +9 -79
  128. package/src/updater.ts +1 -1
  129. package/src/usage.ts +1 -7
  130. package/prompts/default/deep-review-parity.md +0 -152
  131. package/prompts/scout.md +0 -140
  132. package/src/ci/platform-estimate.ts +0 -111
  133. package/src/review/scout.ts +0 -323
package/src/ui/plan.ts CHANGED
@@ -6,14 +6,11 @@
6
6
 
7
7
  import { existsSync } from "node:fs";
8
8
  import path from "node:path";
9
- import type { PlatformEstimateBasis } from "#ci/platform-estimate";
10
9
  import type { EffectiveConfig } from "#config/config";
11
10
  import { exclusionLines } from "#git/git";
12
11
  import { isFullCommitId } from "#git/refs";
13
- import type { FreeRouteBilling } from "#model/free-discovery";
14
12
  import type { ResolvedRoutePlan } from "#model/routing";
15
13
  import type { PrTarget } from "#pr/preflight";
16
- import { DEFAULT_SCOUT_MODEL } from "#review/pipeline";
17
14
  import {
18
15
  type AgentsDirSource,
19
16
  type BaseRefResolution,
@@ -25,15 +22,10 @@ import {
25
22
  type SummarySettings,
26
23
  } from "#review/preflight";
27
24
  import type { ParsedAgent } from "#review/prompt-set";
28
- import {
29
- type DiffStat,
30
- type estimateCost,
31
- formatStepRoute,
32
- } from "#review/report";
25
+ import { type DiffStat, formatStepRoute } from "#review/report";
33
26
  import { type SizeGateVerdict, sizeGateLine } from "#review/size-gate";
34
27
  import type { ReviewSpec } from "#review/spec";
35
28
  import {
36
- bold,
37
29
  box,
38
30
  green,
39
31
  labelColumnWidth,
@@ -46,7 +38,6 @@ import {
46
38
  terminalWidth,
47
39
  yellow,
48
40
  } from "#ui/primitives";
49
- import { FREE_STEPS_NOTE, freeBillingMode } from "#ui/select";
50
41
 
51
42
  // C5 O-7's payload for both plan surfaces: everything the card and the
52
43
  // details view need to name a value the operator cannot see by opening their
@@ -91,7 +82,7 @@ export function configProvenanceOf(
91
82
  // capped" disagree). §3.6's reading is the one that keeps the operator
92
83
  // un-surprised: a defaulted value is byte-for-byte pre-C5 behaviour, and the
93
84
  // card already prints every one of them in a row of its own — the summarizer
94
- // row, the parity row, the priors count, the base's source tag. Tagging six
85
+ // row, the priors count, the base's source tag. Tagging five
95
86
  // defaults on every quiet repo would bury the one tag that is genuinely new
96
87
  // information. Naming every key's layer is `pr-hero config`'s job (§3.10),
97
88
  // where the whole point is the exhaustive list.
@@ -148,7 +139,6 @@ function configTags(
148
139
  ? `agents_dir ← ${provenance.agentsDirSource}`
149
140
  : undefined,
150
141
  flagged.base ? undefined : configTag("default_base", s.default_base),
151
- configTag("parity_trigger_paths", s.parity_trigger_paths),
152
142
  configTag("suspicion_priors", s.suspicion_priors),
153
143
  flagged.summary
154
144
  ? undefined
@@ -227,13 +217,10 @@ export interface PlanContext {
227
217
  runDir: string;
228
218
  config: LocalConfig;
229
219
  summary: SummarySettings;
230
- parityFires: boolean;
231
220
  codegraphAvailable: boolean;
232
- estimate: ReturnType<typeof estimateCost>;
233
- hunterCount: number;
234
221
  // The gate's ALREADY-EVALUATED verdict, carried in so the plan can print
235
- // it last. The gate is still decided by the shell, before the cost band's
236
- // confirm() — this only moves where the line lands on screen.
222
+ // it last. The gate is still decided by the shell, before the confirm
223
+ // prompt — this only moves where the line lands on screen.
237
224
  sizeGate: SizeGateVerdict;
238
225
  droppedPaths: string[];
239
226
  // C5 O-7. Optional for the reason `resolved`/`rereview` are on the PR
@@ -241,9 +228,6 @@ export interface PlanContext {
241
228
  configProvenance?: ConfigProvenance;
242
229
  // D2 PR3: Optional resolved route plan for model routing display
243
230
  routePlan?: ResolvedRoutePlan;
244
- // Free verdicts of the admitted route plan, read off the admission that already
245
- // decided them. Absent means unknown, and the estimate line keeps its band.
246
- freeRoute?: FreeRouteBilling;
247
231
  // The terminal width every row and card below is laid out against, carried
248
232
  // in exactly as ui/result.ts's ResultInput carries it. Optional so the shell
249
233
  // may leave the one sniff to the renderer's entry point; the tests ALWAYS
@@ -344,34 +328,7 @@ export function summarizerLabel(summary: SummarySettings): string {
344
328
  return summary.enabled ? "+ summarizer" : "+ summarizer disabled";
345
329
  }
346
330
 
347
- // Printed on EVERY plan, off included. The scout adds a paid stage to the
348
- // front of the run and the operator is about to confirm a band that already
349
- // counts it, so "scout: off" is information, not noise — and a stage that
350
- // only appears when it is on is a stage nobody notices arriving.
351
- function scoutRow(
352
- options: Pick<CliOptions, "scout" | "scoutModel" | "model">,
353
- routePlan?: ResolvedRoutePlan,
354
- skipped = false,
355
- ): string {
356
- const label = "scout".padEnd(12);
357
- if (!options.scout) return `${label}${"-".padEnd(8)}disabled`;
358
- if (skipped) return `${label}${NOT_RUN_THIS_PASS}`;
359
- // The same chain the pipeline resolves, printed before the money is spent:
360
- // --model > --scout-model > the engine default (the bundled prompt pins no
361
- // model, so there is no frontmatter seat to show here).
362
- const model =
363
- plannedModel(routePlan, "scout") ??
364
- options.model ??
365
- options.scoutModel ??
366
- DEFAULT_SCOUT_MODEL;
367
- return `${label}${model.padEnd(8)} diff-only, before the hunters (experimental)`;
368
- }
369
-
370
- export function scoutLabel(options: Pick<CliOptions, "scout">): string {
371
- return options.scout ? " + scout" : "";
372
- }
373
-
374
- // Lives here rather than in review/run.ts, beside the two labels it composes.
331
+ // Lives here rather than in review/run.ts, beside the label it composes.
375
332
  // It was first extracted into review/run.ts with the other shared run stages,
376
333
  // which made that domain module import #ui/plan by value while ui/plan already
377
334
  // imports #review/pipeline and #review/size-gate: no file-level cycle, but the
@@ -384,22 +341,20 @@ export function scoutLabel(options: Pick<CliOptions, "scout">): string {
384
341
  export function reviewingLine(
385
342
  hunterCount: number,
386
343
  summary: SummarySettings,
387
- options: Pick<CliOptions, "scout">,
388
344
  ): string {
389
345
  return (
390
346
  `reviewing — ${hunterCount} hunter${hunterCount === 1 ? "" : "s"} + ` +
391
- `refuter ${summarizerLabel(summary)}${scoutLabel(options)}; ` +
347
+ `refuter ${summarizerLabel(summary)}; ` +
392
348
  "comparable trees have taken " +
393
349
  "8–25 minutes"
394
350
  );
395
351
  }
396
352
 
397
353
  // The last block on screen and the only one an operator must read: the gate
398
- // verdict, then the money. Both used to sit mid-list, where the eye that had
399
- // already given up on the plan never reached them.
354
+ // verdict. It used to sit mid-list, where the eye that had already given up
355
+ // on the plan never reached it.
400
356
  interface PlanDecision {
401
357
  sizeGate: SizeGateVerdict;
402
- freeRoute?: FreeRouteBilling;
403
358
  // Set only where the verdict is an ESTIMATE rather than the gate's own
404
359
  // answer (the PR dry run's aggregate counters); printed beside it so
405
360
  // nobody reads a guess as the verdict.
@@ -410,9 +365,6 @@ interface PlanDecision {
410
365
  // "review anyway" at the size-gate menu. The plan names which hatch
411
366
  // opened so a log cannot be read as "they passed --force".
412
367
  sizeGateConfirmed?: boolean;
413
- estimate: ReturnType<typeof estimateCost>;
414
- hunterCount: number;
415
- summarizer: boolean;
416
368
  }
417
369
 
418
370
  function decisionLines(
@@ -456,66 +408,9 @@ function decisionLines(
456
408
  ),
457
409
  );
458
410
  }
459
- lines.push(
460
- ...markerRowLines(
461
- "$",
462
- planEstimateLine({
463
- estimate: d.estimate,
464
- hunterCount: d.hunterCount,
465
- summarizer: d.summarizer,
466
- ...(d.freeRoute === undefined ? {} : { freeRoute: d.freeRoute }),
467
- }),
468
- bold,
469
- styles,
470
- width,
471
- ),
472
- );
473
411
  return lines;
474
412
  }
475
413
 
476
- // The free-route wording of the estimate, shared by the plan card and the result
477
- // footer's estimate row so both print one verdict. A free route bills nothing,
478
- // so the band is relabelled as token-derived instead of read as a cost.
479
- export function freeRouteEstimateText(estimate: {
480
- low: number;
481
- high: number;
482
- }): string {
483
- const low = `$${estimate.low.toFixed(2)}`;
484
- const high = `$${estimate.high.toFixed(2)}`;
485
- return `free route (token-derived ${low} – ${high}, not billed)`;
486
- }
487
-
488
- // The estimate row's text, shared by both plan cards. The band is token-derived
489
- // whatever the route; the free verdict changes only the claim made about it. A
490
- // free route bills nothing, so a dollar figure would read as a cost, and the
491
- // band is relabelled as token-derived instead. A mix keeps the band and names
492
- // the free share. No free step (metered or subscription) is today's line,
493
- // byte-identical. The band never reads $0 – $0 here: estimateCost clamps the
494
- // hunter seats (report.ts), so a free route is "not billed", never a zero estimate.
495
- export function planEstimateLine(input: {
496
- estimate: { low: number; high: number; platform?: PlatformEstimateBasis };
497
- hunterCount: number;
498
- summarizer: boolean;
499
- freeRoute?: FreeRouteBilling;
500
- }): string {
501
- const low = `$${input.estimate.low.toFixed(2)}`;
502
- const high = `$${input.estimate.high.toFixed(2)}`;
503
- // The mode is the prompt's too (ui/select.ts freeBillingMode): the card and
504
- // the confirm read one verdict, so they cannot disagree about what is billed.
505
- const billing = freeBillingMode(input.freeRoute);
506
- if (billing === "free") {
507
- return `estimate: ${freeRouteEstimateText(input.estimate)}`;
508
- }
509
- // The platform's range is not the band, so the line says where it came from
510
- // instead of the agent count the band is built on (cryskai/platform#12).
511
- const line =
512
- input.estimate.platform === undefined
513
- ? `estimate ${low} – ${high} (${input.hunterCount} hunter(s) + refuter ` +
514
- `${input.summarizer ? "+ summarizer" : "+ summarizer disabled"})`
515
- : `estimate ${low} – ${high} (platform: ${input.estimate.platform})`;
516
- return billing === "mixed" ? `${line} ${FREE_STEPS_NOTE}` : line;
517
- }
518
-
519
414
  // Both details views' rows, with a label column DERIVED from their own labels
520
415
  // instead of inherited from row()'s fixed default.
521
416
  //
@@ -584,15 +479,6 @@ export function planDetails(ctx: PlanContext, styles: boolean): string[] {
584
479
  push("run dir", ctx.runDir);
585
480
  push("hop budget", String(ctx.options.hopBudget));
586
481
  push("summarizer", summarizerRow(ctx.summary, ctx.routePlan));
587
- push("scout", scoutRow(ctx.options, ctx.routePlan));
588
- push(
589
- "parity",
590
- ctx.config.parity_trigger_paths.length === 0
591
- ? "no parity_trigger_paths configured — the parity hunter never fires"
592
- : ctx.parityFires
593
- ? `fires (a changed path matches ${ctx.config.parity_trigger_paths.length} configured pattern(s))`
594
- : "configured, but no changed path matches — it will not fire",
595
- );
596
482
  push(
597
483
  "codegraph",
598
484
  ctx.codegraphAvailable
@@ -601,7 +487,6 @@ export function planDetails(ctx: PlanContext, styles: boolean): string[] {
601
487
  "review runs on Read/Grep/Glob alone",
602
488
  );
603
489
  push("priors", `${ctx.config.suspicion_priors.length} suspicion prior(s)`);
604
- push("estimate", ctx.estimate.basis);
605
490
  push("permissions", PERMISSIONS_NOTE);
606
491
  return [section("details", styles), ...detailRows(pairs, styles, width)];
607
492
  }
@@ -625,23 +510,13 @@ export function renderPlan(ctx: PlanContext, styles: boolean): string[] {
625
510
  ];
626
511
  let label = "AGENTS";
627
512
  for (const agent of ctx.spec.agents) {
628
- const fires =
629
- agent.role === "refuter"
630
- ? "per severe finding"
631
- : agent.trigger === undefined
632
- ? "always"
633
- : ctx.parityFires
634
- ? "triggered"
635
- : "✗ will not fire";
513
+ const fires = agent.role === "refuter" ? "per severe finding" : "always";
636
514
  lines.push(...row(label, agentRow(ctx, agent, fires), { styles, width }));
637
515
  label = "";
638
516
  }
639
517
  lines.push(
640
518
  ...row(label, summarizerRow(ctx.summary, ctx.routePlan), { styles, width }),
641
519
  );
642
- lines.push(
643
- ...row("", scoutRow(ctx.options, ctx.routePlan), { styles, width }),
644
- );
645
520
  label = "";
646
521
  lines.push(
647
522
  "",
@@ -673,10 +548,6 @@ export function renderPlan(ctx: PlanContext, styles: boolean): string[] {
673
548
  sizeGate: ctx.sizeGate,
674
549
  droppedPaths: ctx.droppedPaths,
675
550
  force: ctx.options.force,
676
- estimate: ctx.estimate,
677
- hunterCount: ctx.hunterCount,
678
- summarizer: ctx.summary.enabled,
679
- ...(ctx.freeRoute === undefined ? {} : { freeRoute: ctx.freeRoute }),
680
551
  },
681
552
  styles,
682
553
  width,
@@ -697,8 +568,6 @@ export interface PrPlanContext {
697
568
  spec: ReviewSpec;
698
569
  config: LocalConfig;
699
570
  summary: SummarySettings;
700
- estimate: ReturnType<typeof estimateCost>;
701
- hunterCount: number;
702
571
  // Same contract as PlanContext: the verdict is decided by the shell (and
703
572
  // in PR mode enforced before the run dir even exists), printed here.
704
573
  sizeGate: SizeGateVerdict;
@@ -708,9 +577,6 @@ export interface PrPlanContext {
708
577
  configProvenance?: ConfigProvenance;
709
578
  // D2 PR3: Optional resolved route plan for model routing display
710
579
  routePlan?: ResolvedRoutePlan;
711
- // Free verdicts of the admitted route plan, read off the admission that already
712
- // decided them. Absent means unknown, and the estimate line keeps its band.
713
- freeRoute?: FreeRouteBilling;
714
580
  // Set when this plan follows an interactive "Review anyway" at the
715
581
  // size-gate menu. Distinct from options.force so the decision block can
716
582
  // say "confirmed" rather than lie that --force was passed.
@@ -721,11 +587,10 @@ export interface PrPlanContext {
721
587
  baseSha: string;
722
588
  diffFromSha: string;
723
589
  diffPath: string;
724
- parityFires: boolean;
725
590
  };
726
591
  // Same contract, same reason as PlanContext.width.
727
592
  width?: number;
728
- // Item 7: queued verify steps shown as their own cost-band term (O-5a).
593
+ // Queued verify steps, shown as their own row (item 7 O-5a).
729
594
  verificationSteps?: number;
730
595
  rereview?: {
731
596
  case: string;
@@ -759,21 +624,6 @@ function prBaseSourceTag(target: PrTarget): string {
759
624
  : "PR base tip";
760
625
  }
761
626
 
762
- // Pre-fetch the parity trigger cannot be evaluated (there is no diff yet).
763
- // When triggers are configured the parity hunter MIGHT fire, so it counts:
764
- // both recorded cost overruns were under-estimates, and a band that errs
765
- // high costs a second of hesitation while one that errs low costs money.
766
- export function dryRunHunterCount(
767
- spec: ReviewSpec,
768
- config: LocalConfig,
769
- ): number {
770
- return spec.agents.filter(
771
- (a) =>
772
- a.role === "hunter" &&
773
- (a.trigger === undefined || config.parity_trigger_paths.length > 0),
774
- ).length;
775
- }
776
-
777
627
  // Predicted, not decided: the ensure step runs only after the confirm gate,
778
628
  // so the plan can promise a create but must leave reuse-vs-recreate to the
779
629
  // HEAD and cleanliness checks at run time.
@@ -864,7 +714,6 @@ export function prPlanDetails(ctx: PrPlanContext, styles: boolean): string[] {
864
714
  push("hop budget", String(ctx.options.hopBudget));
865
715
  const skipped = ctx.rereview?.skipDiscovery === true;
866
716
  push("summarizer", summarizerRow(ctx.summary, ctx.routePlan, skipped));
867
- push("scout", scoutRow(ctx.options, ctx.routePlan, skipped));
868
717
  if (ctx.rereview) {
869
718
  const last =
870
719
  ctx.rereview.lastHead === null
@@ -899,20 +748,8 @@ export function prPlanDetails(ctx: PrPlanContext, styles: boolean): string[] {
899
748
  "exists (idempotent — one comment per PR, found by its marker)",
900
749
  );
901
750
  }
902
- push(
903
- "parity",
904
- ctx.config.parity_trigger_paths.length === 0
905
- ? "no parity_trigger_paths configured — the parity hunter never fires"
906
- : ctx.resolved === undefined
907
- ? `configured (${ctx.config.parity_trigger_paths.length} ` +
908
- "pattern(s)); whether a changed path matches is decided after fetch"
909
- : ctx.resolved.parityFires
910
- ? `fires (a changed path matches ${ctx.config.parity_trigger_paths.length} configured pattern(s))`
911
- : "configured, but no changed path matches — it will not fire",
912
- );
913
751
  push("codegraph", codegraphPlanNote(ctx.worktreePath));
914
752
  push("priors", `${ctx.config.suspicion_priors.length} suspicion prior(s)`);
915
- push("estimate", ctx.estimate.basis);
916
753
  push("permissions", PERMISSIONS_NOTE);
917
754
  return [section("details", styles), ...detailRows(pairs, styles, width)];
918
755
  }
@@ -935,16 +772,7 @@ export function renderPrPlan(ctx: PrPlanContext, styles: boolean): string[] {
935
772
  ];
936
773
  let label = "AGENTS";
937
774
  for (const agent of ctx.spec.agents) {
938
- const fires =
939
- agent.role === "refuter"
940
- ? "per severe finding"
941
- : agent.trigger === undefined
942
- ? "always"
943
- : ctx.resolved === undefined
944
- ? "decided by the diff after fetch"
945
- : ctx.resolved.parityFires
946
- ? "triggered"
947
- : "✗ will not fire";
775
+ const fires = agent.role === "refuter" ? "per severe finding" : "always";
948
776
  lines.push(...row(label, agentRow(ctx, agent, fires), { styles, width }));
949
777
  label = "";
950
778
  }
@@ -959,17 +787,6 @@ export function renderPrPlan(ctx: PrPlanContext, styles: boolean): string[] {
959
787
  { styles, width },
960
788
  ),
961
789
  );
962
- lines.push(
963
- ...row(
964
- "",
965
- scoutRow(
966
- ctx.options,
967
- ctx.routePlan,
968
- ctx.rereview?.skipDiscovery === true,
969
- ),
970
- { styles, width },
971
- ),
972
- );
973
790
  if (ctx.rereview) {
974
791
  lines.push(
975
792
  ...row(
@@ -1060,10 +877,6 @@ export function renderPrPlan(ctx: PrPlanContext, styles: boolean): string[] {
1060
877
  droppedPaths: ctx.droppedPaths,
1061
878
  force: ctx.options.force,
1062
879
  ...(ctx.sizeGateConfirmed === true ? { sizeGateConfirmed: true } : {}),
1063
- estimate: ctx.estimate,
1064
- hunterCount: ctx.hunterCount,
1065
- summarizer: ctx.summary.enabled,
1066
- ...(ctx.freeRoute === undefined ? {} : { freeRoute: ctx.freeRoute }),
1067
880
  },
1068
881
  styles,
1069
882
  width,
@@ -6,19 +6,12 @@
6
6
  // line per event. I/O by nature, untested by construction — formatElapsed
7
7
  // and the progress.ts halves are the pure, tested pieces.
8
8
 
9
- import type { FreeRouteBilling } from "#model/free-discovery";
10
9
  import type { PipelineProgressEvent } from "#review/pipeline";
11
10
  import type { CliOptions } from "#review/preflight";
12
11
  import { formatElapsed } from "#review/report";
13
12
  import { type SizeGateVerdict, sizeGateDisposition } from "#review/size-gate";
14
13
  import { log, styleEnabled } from "#ui/primitives";
15
- import {
16
- type ConfirmResult,
17
- type ConfirmSpec,
18
- confirmReview,
19
- confirmSizeGate,
20
- freeBillingMode,
21
- } from "#ui/select";
14
+ import { type ConfirmResult, confirmReview, confirmSizeGate } from "#ui/select";
22
15
  import { CliError } from "../errors";
23
16
  import {
24
17
  applyProgressEvent,
@@ -199,19 +192,6 @@ export function startLineRenderer(startedAtMs: number): ProgressRenderer {
199
192
  case "summarizer-finished":
200
193
  line(`summarizer: ${finishedText(event)}`);
201
194
  return;
202
- case "scout-started":
203
- line(`scout: reading the diff (${event.model})`);
204
- return;
205
- case "scout-finished":
206
- // "unled", never "the run continues": a scout failure is not a
207
- // partial review, it is the control pipeline. Naming it as a
208
- // degradation would teach an operator to distrust a complete run.
209
- line(
210
- event.ok
211
- ? `scout: ${event.leads ?? 0} lead(s)`
212
- : "scout: failed (the hunters run unled)",
213
- );
214
- return;
215
195
  case "step-retry":
216
196
  // EVERY step, hunters and refuter alike — this is the launchd log,
217
197
  // where a retry that explains a long wall time has to be readable
@@ -232,42 +212,16 @@ export function startLineRenderer(startedAtMs: number): ProgressRenderer {
232
212
  };
233
213
  }
234
214
 
235
- // The cost band's gate. `details` is a thunk so the details view — which
215
+ // The confirm gate. `details` is a thunk so the details view — which
236
216
  // probes the filesystem — is built only if the human asks for it, and
237
217
  // `canSkipPost` is what decides whether "Review, but don't post" exists at
238
218
  // all: offering it to a run that was never going to post is a no-op dressed
239
219
  // as a choice.
240
- // The spec without its styles: a pure function of the run, so the billing
241
- // wording it carries is testable offline. The free-route count is the same one
242
- // the plan card was printed with (callers pass the same object to both).
243
- export function confirmSpecFor(
244
- low: number,
245
- high: number,
246
- canSkipPost: boolean,
247
- details: () => string[],
248
- freeRoute: FreeRouteBilling | undefined,
249
- ): Omit<ConfirmSpec, "styles"> {
250
- const billing = freeBillingMode(freeRoute);
251
- return {
252
- low,
253
- high,
254
- canSkipPost,
255
- details,
256
- ...(billing === undefined ? {} : { billing }),
257
- };
258
- }
259
-
260
220
  export function confirm(
261
- low: number,
262
- high: number,
263
221
  canSkipPost: boolean,
264
222
  details: () => string[],
265
- freeRoute?: FreeRouteBilling,
266
223
  ): Promise<ConfirmResult> {
267
- return confirmReview({
268
- ...confirmSpecFor(low, high, canSkipPost, details, freeRoute),
269
- styles: styleEnabled(),
270
- });
224
+ return confirmReview({ canSkipPost, details, styles: styleEnabled() });
271
225
  }
272
226
 
273
227
  // The size-gate override. `onBlock` runs for both the hard skip and the
package/src/ui/result.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  // inside a 400-line async shell. The mode-specific parts (worktree hint, links,
13
13
  // extra artifacts) are optional inputs, not a second renderer.
14
14
  //
15
- // WHY it prints the FINDINGS: after five minutes and $4 the terminal used to
15
+ // WHY it prints the FINDINGS: after five minutes the terminal used to
16
16
  // report counts and file paths and never once said what was found — the
17
17
  // payload was the one thing you had to leave the terminal to read. Everything
18
18
  // below the header exists to end that.
@@ -25,7 +25,6 @@ import {
25
25
  movedHeadSentence,
26
26
  } from "#review/report";
27
27
  import type { UnresolvedSpend } from "../execution/spend-limiter";
28
- import { freeRouteEstimateText } from "./plan";
29
28
  import {
30
29
  cyan,
31
30
  dim,
@@ -39,7 +38,6 @@ import {
39
38
  wrapText,
40
39
  yellow,
41
40
  } from "./primitives";
42
- import { FREE_STEPS_NOTE, type FreeBillingMode } from "./select";
43
41
 
44
42
  interface ResultWorktree {
45
43
  gitDirOwner: string;
@@ -82,27 +80,7 @@ export interface ResultInput {
82
80
  // derived here, from the same bytes that were just written to disk, so the
83
81
  // terminal and findings.json cannot disagree about what the run found.
84
82
  doc: FindingsDocument;
85
- // CASH, and only cash — the figure the header's `$X.XX` reports and the one
86
- // budget enforcement is allowed to read (§8: "Budget enforcement uses cash
87
- // only"). On a Claude subscription or a free route this is a truthful $0.00.
88
- costUsd: number;
89
- // #173 (§8: "Artifacts and reports show cash and notional totals
90
- // separately"). The list-basis figure a subscription run was NOT charged,
91
- // kept strictly apart from `costUsd` and rendered with its own label — the
92
- // design's "research comparisons may use notional only when clearly
93
- // labelled" is a rendering obligation, not just a storage one.
94
- //
95
- // Optional, and absent means NO ROW rather than a `$0.00` one: a runner that
96
- // reports no normalized usage has no list figure to show, and printing one
97
- // it never produced is the fabrication the whole usage slice exists to
98
- // prevent.
99
- notionalUsd?: number;
100
- // W3-FOOTER: the route's billing, derived by freeBillingMode from the same
101
- // free-step count the plan card prints. Absent means no free share, and the
102
- // footer keeps its subscription wording byte for byte.
103
- billing?: FreeBillingMode;
104
83
  wallMs: number;
105
- estimate: { low: number; high: number };
106
84
  // One directory plus the basenames written inside it. The full paths still
107
85
  // go to pipeline.json — three absolute paths sharing a 60-char prefix cost
108
86
  // three lines and carry one bit each (the shortPath rule, applied to the
@@ -124,10 +102,8 @@ export interface ResultInput {
124
102
  movedHeadSha?: string;
125
103
  sessionFailed: boolean;
126
104
  // D1-08 PR5b (D8): present and non-empty exactly when at least one spend
127
- // reservation ended `unresolved_remote` this run. Its presence is what
128
- // marks the header's `$X.XX` figure as a FLOOR rather than a total (the
129
- // known cost is real; the unresolved bucket's true cost is not) and what
130
- // earns the run a footer row naming the fenced bucket(s).
105
+ // reservation ended `unresolved_remote` this run. Its presence earns the
106
+ // run a footer row naming the fenced bucket(s).
131
107
  unresolved?: ResultUnresolved;
132
108
  styles: boolean;
133
109
  width?: number;
@@ -138,23 +114,22 @@ const MAX_WIDTH = 96;
138
114
  // Body indents: the marker column, then the prose column under it.
139
115
  const MARKER_INDENT = " ";
140
116
  const PROSE_INDENT = " ";
141
- // Wide enough for the longest footer label ("estimate", "worktree") plus a gap.
117
+ // Wide enough for the longest footer label ("unresolved", "worktree") plus a gap.
142
118
  const FOOTER_LABEL_WIDTH = 12;
143
119
 
144
120
  // Deliberately NOT ui/primitives.ts's box(): box truncates every body line to fit its
145
121
  // border, and the one thing this block must never truncate away is a claim.
146
122
  // So the card is a RULE — the top edge only — and the body below it is plain
147
123
  // indented text that wraps. Shape: `╭─ left ───── right ─╮`.
148
- // `spentDropped` is not cosmetic bookkeeping: when the terminal is too narrow
149
- // for both halves the counts win and the spend comes OFF the rule, so the
150
- // caller has to put it back as its own row. Reported rather than assumed,
151
- // because "the money is never dropped" is only true if somebody relocates it.
124
+ // `rightDropped` is not cosmetic bookkeeping: when the terminal is too narrow
125
+ // for both halves the counts win and the elapsed time comes OFF the rule, so
126
+ // the caller has to put it back as its own row.
152
127
  function headerRule(
153
128
  left: string,
154
129
  right: string,
155
130
  width: number,
156
131
  styles: boolean,
157
- ): { line: string; spentDropped: boolean } {
132
+ ): { line: string; rightDropped: boolean } {
158
133
  // 8 = "╭─ " + " " around the fill + " ─╮".
159
134
  const fill = width - left.length - right.length - 8;
160
135
  if (fill < 1) {
@@ -164,7 +139,7 @@ function headerRule(
164
139
  dim("╭─ ", styles) +
165
140
  shown +
166
141
  dim(` ${"─".repeat(Math.max(width - 5 - shown.length, 1))}╮`, styles),
167
- spentDropped: true,
142
+ rightDropped: true,
168
143
  };
169
144
  }
170
145
  return {
@@ -174,7 +149,7 @@ function headerRule(
174
149
  dim(` ${"─".repeat(fill)} `, styles) +
175
150
  right +
176
151
  dim(" ─╮", styles),
177
- spentDropped: false,
152
+ rightDropped: false,
178
153
  };
179
154
  }
180
155
 
@@ -403,13 +378,8 @@ export function renderResult(input: ResultInput): string[] {
403
378
  const left =
404
379
  `${status}${blocking} blocking · ${advisory} advisory · ` +
405
380
  `${refuted} refuted`;
406
- // D8: a bucket fenced by an unresolved_remote reservation means the real
407
- // cost of that bucket's attempt is UNKNOWN — printing a bare `$X.XX` there
408
- // is the exact "$0 on parse failure" collapse this slice exists to kill,
409
- // just relocated to the terminal's header line. `≥` marks it a floor.
410
381
  const hasUnresolved = (input.unresolved?.length ?? 0) > 0;
411
- const costLabel = `${hasUnresolved ? "≥" : ""}$${input.costUsd.toFixed(2)}`;
412
- const right = `${costLabel} · ${formatElapsed(input.wallMs)}`;
382
+ const right = formatElapsed(input.wallMs);
413
383
  const header = headerRule(left, right, width, styles);
414
384
  // The PR's own url, directly under the rule rather than down in the artifact
415
385
  // footer, for two reasons. It is the WHERE of everything above and below it,
@@ -470,36 +440,7 @@ export function renderResult(input: ResultInput): string[] {
470
440
  : ` · ${input.artifacts.join(" · ")}`),
471
441
  footer,
472
442
  ),
473
- // The band is kept because it is the only thing that makes an overrun
474
- // visible: both recorded cost incidents were under-estimates, and rule 6
475
- // says every live run lands in a ledger.
476
- ...row(
477
- "estimate",
478
- input.billing === "free"
479
- ? freeRouteEstimateText(input.estimate)
480
- : input.billing === "mixed"
481
- ? `$${input.estimate.low.toFixed(2)}–$${input.estimate.high.toFixed(2)} ${FREE_STEPS_NOTE}`
482
- : `$${input.estimate.low.toFixed(2)}–$${input.estimate.high.toFixed(2)}`,
483
- footer,
484
- ),
485
443
  );
486
- // #173: the second half of the §8 cash/notional split, and the reason the
487
- // header's `$0.00` on a subscription run is informative rather than broken.
488
- // Its own row, its own label, and wording that names the basis — a bare
489
- // second dollar figure beside the first is exactly the mixing §8 forbids.
490
- if (input.notionalUsd !== undefined) {
491
- lines.push(
492
- ...row(
493
- "notional",
494
- input.billing === "free"
495
- ? `$${input.notionalUsd.toFixed(2)} at list price — not charged on a free route; ` +
496
- "budget limits read the cash figure above"
497
- : `$${input.notionalUsd.toFixed(2)} at list price — not charged on a ` +
498
- "subscription; budget limits read the cash figure above",
499
- footer,
500
- ),
501
- );
502
- }
503
444
  // D8: naming the fenced bucket(s) HERE, not only in pipeline.json, is the
504
445
  // whole point of this row — see the module-level ResultUnresolved comment.
505
446
  if (hasUnresolved) {
@@ -509,18 +450,18 @@ export function renderResult(input: ResultInput): string[] {
509
450
  lines.push(
510
451
  ...row(
511
452
  "unresolved",
512
- `${input.unresolved?.length} spend reservation(s) unresolved in ` +
513
- `bucket(s) ${buckets.join(", ")} — cost above is a floor; see ` +
514
- "pipeline.json",
453
+ `${input.unresolved?.length} attempt(s) whose usage could not be ` +
454
+ `confirmed in bucket(s) ${buckets.join(", ")} — no further ` +
455
+ "attempt ran on them this run; see pipeline.json",
515
456
  footer,
516
457
  ),
517
458
  );
518
459
  }
519
460
  // The relocation headerRule reported: on a terminal too narrow for the rule
520
- // to carry both halves, what this run actually cost gets its own row instead
521
- // of disappearing with the rule's right-hand segment.
522
- if (header.spentDropped) {
523
- lines.push(...row("spent", right, footer));
461
+ // to carry both halves, the elapsed time gets its own row instead of
462
+ // disappearing with the rule's right-hand segment.
463
+ if (header.rightDropped) {
464
+ lines.push(...row("elapsed", right, footer));
524
465
  }
525
466
  if (input.worktree) {
526
467
  lines.push(