crysk 0.6.1 → 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 (179) hide show
  1. package/README.md +28 -22
  2. package/dist/SKILL-1q3658n0.md +74 -0
  3. package/dist/SKILL-25j4q9b8.md +143 -0
  4. package/dist/SKILL-32cmme3j.md +143 -0
  5. package/dist/SKILL-4747bhne.md +143 -0
  6. package/dist/SKILL-4jc3sv23.md +74 -0
  7. package/dist/SKILL-c0492rch.md +540 -0
  8. package/dist/SKILL-d1nzkhhr.md +74 -0
  9. package/dist/SKILL-f8p7kvx0.md +143 -0
  10. package/dist/SKILL-gxd45g38.md +553 -0
  11. package/dist/SKILL-rec41991.md +66 -0
  12. package/dist/SKILL-zze8zj5g.md +536 -0
  13. package/dist/adjudicator-eckqh14e.md +78 -0
  14. package/dist/ci-admission-qn797a6c.md +128 -0
  15. package/dist/cli.js +18608 -18523
  16. package/dist/consolidate-4xw1pkg7.md +24 -0
  17. package/dist/deep-review-logic-dgr112y1.md +196 -0
  18. package/dist/deep-review-logic-fck5z4xe.md +197 -0
  19. package/dist/deep-review-logic-h1fpamfh.md +192 -0
  20. package/dist/deep-review-logic-m4vk5683.md +196 -0
  21. package/dist/deep-review-logic-z63kmgmc.md +157 -0
  22. package/dist/deep-review-parity-7x7s5d81.md +148 -0
  23. package/dist/deep-review-parity-9wxmynsc.md +115 -0
  24. package/dist/deep-review-parity-bwwe7cx6.md +152 -0
  25. package/dist/deep-review-parity-e50pw3pk.md +117 -0
  26. package/dist/deep-review-parity-ennmm9m1.md +151 -0
  27. package/{prompts/default/deep-review-parity.md → dist/deep-review-parity-h7y6y2he.md} +14 -16
  28. package/dist/deep-review-parity-xg6wy69c.md +151 -0
  29. package/dist/deep-review-reliability-6h3c4gmw.md +125 -0
  30. package/dist/deep-review-reliability-dcjab69x.md +122 -0
  31. package/dist/deep-review-reliability-ec7b5pbk.md +159 -0
  32. package/dist/deep-review-reliability-hvasvmt9.md +153 -0
  33. package/dist/deep-review-reliability-mjnayxmt.md +158 -0
  34. package/dist/deep-review-reliability-mm7fnayf.md +124 -0
  35. package/dist/deep-review-reliability-xk4xvc2w.md +158 -0
  36. package/dist/deep-review-resilience-0esd5qeh.md +148 -0
  37. package/dist/deep-review-resilience-envgcmpy.md +115 -0
  38. package/dist/deep-review-resilience-fgx8ythf.md +151 -0
  39. package/dist/deep-review-resilience-mq5qa6ad.md +152 -0
  40. package/dist/deep-review-resilience-pwh1gawp.md +151 -0
  41. package/dist/deep-review-resilience-s9n21dkx.md +117 -0
  42. package/dist/deep-review-resilience-vz4qskea.md +119 -0
  43. package/dist/deep-review-security-1vwjdc9q.md +205 -0
  44. package/dist/deep-review-security-x1cc1z00.md +205 -0
  45. package/dist/index.js +590 -485
  46. package/dist/opencode-ci-jc8mf4wn.md +106 -0
  47. package/dist/opencode-ci-qrcv7a99.md +106 -0
  48. package/dist/opencode-ci-rdpcc7xc.md +106 -0
  49. package/dist/opencode-ci-yt0k74t0.md +106 -0
  50. package/dist/review-refuter-7qffwtzz.md +77 -0
  51. package/dist/verifier-tyh8r45v.md +40 -0
  52. package/dist/verifier-xf4xj701.md +40 -0
  53. package/dist/workflow-andv2dvm.yml +158 -0
  54. package/package.json +1 -1
  55. package/prompts/consolidate.md +1 -1
  56. package/prompts/default/PROVENANCE.md +6 -0
  57. package/prompts/default/deep-review-logic.md +56 -15
  58. package/prompts/default/deep-review-reliability.md +64 -30
  59. package/prompts/default/deep-review-resilience.md +71 -37
  60. package/prompts/default/deep-review-security.md +205 -0
  61. package/prompts/default/review-refuter.md +1 -1
  62. package/prompts/verifier.md +40 -0
  63. package/skills/crysk/SKILL.md +6 -6
  64. package/skills/crysk-ci-setup/SKILL.md +32 -33
  65. package/skills/crysk-ci-setup/assets/workflow.yml +5 -10
  66. package/skills/crysk-ci-setup/references/ci-admission.md +5 -5
  67. package/skills/crysk-ci-setup/references/opencode-ci.md +6 -6
  68. package/skills/crysk-loop/SKILL.md +37 -54
  69. package/skills/crysk-loop/adjudicator.md +10 -18
  70. package/skills/crysk-pr/SKILL.md +1 -1
  71. package/src/asset-manifest.ts +6 -6
  72. package/src/assets.ts +4 -4
  73. package/src/brand.ts +20 -30
  74. package/src/ci/gates.ts +155 -192
  75. package/src/ci/outcome.ts +4 -31
  76. package/src/ci/platform-limits.ts +135 -0
  77. package/src/ci/platform-report.ts +212 -126
  78. package/src/ci/platform.ts +28 -26
  79. package/src/ci/reporter.ts +25 -26
  80. package/src/ci/review-admission.ts +1 -2
  81. package/src/ci/review-levels.ts +12 -53
  82. package/src/ci/setup.ts +96 -66
  83. package/src/ci/trace-bundle.ts +11 -27
  84. package/src/ci/trace-transcripts.ts +4 -6
  85. package/src/ci/trigger.ts +3 -5
  86. package/src/cli.ts +6 -5
  87. package/src/commands/ci-setup-questions.ts +2 -55
  88. package/src/commands/ci-setup.ts +2 -26
  89. package/src/commands/triage.ts +131 -38
  90. package/src/commands/usage.ts +0 -1
  91. package/src/compare/compare.ts +3 -3
  92. package/src/compare/floor-test.ts +30 -201
  93. package/src/compare/hunter-exam.ts +631 -0
  94. package/src/config/config.ts +6 -30
  95. package/src/diversity/accounting.ts +0 -26
  96. package/src/diversity/benchmark.ts +1 -17
  97. package/src/diversity/identity.ts +0 -14
  98. package/src/diversity/pipeline-integration.ts +0 -29
  99. package/src/doctor.ts +3 -6
  100. package/src/execution/claude-session-trace.ts +7 -2
  101. package/src/execution/contracts.ts +15 -9
  102. package/src/execution/harness.ts +165 -187
  103. package/src/execution/spend-limiter.ts +39 -131
  104. package/src/execution/usage-facts.ts +397 -0
  105. package/src/execution/usage-normalized.ts +33 -86
  106. package/src/harness/materiality-judge.ts +0 -5
  107. package/src/harness/pipeline-plan.ts +0 -3
  108. package/src/harness/replay-rows.ts +0 -5
  109. package/src/harness/route-runner.ts +2 -2
  110. package/src/harness/single-step.ts +3 -9
  111. package/src/index.ts +1 -1
  112. package/src/mcp/preflight.ts +2 -2
  113. package/src/model/catalog.ts +1 -3
  114. package/src/model/free-discovery.ts +11 -78
  115. package/src/model/model-name.ts +16 -5
  116. package/src/model/profiles/claude.ts +1 -2
  117. package/src/model/profiles/openai.ts +1 -2
  118. package/src/model/profiles.ts +2 -3
  119. package/src/model/provider-capabilities.ts +16 -55
  120. package/src/model/routing.ts +39 -36
  121. package/src/pr/admission.ts +6 -6
  122. package/src/pr/answered-findings.ts +8 -4
  123. package/src/pr/ci-publish.ts +0 -2
  124. package/src/pr/discovery.ts +4 -25
  125. package/src/pr/plan.ts +40 -121
  126. package/src/pr/pr-status.ts +14 -2
  127. package/src/pr/pr.ts +1 -1
  128. package/src/pr/preflight.ts +44 -15
  129. package/src/pr/publish-outcome.ts +1 -19
  130. package/src/pr/review-pr.ts +15 -47
  131. package/src/pr/target.ts +76 -82
  132. package/src/production-runtime.ts +52 -114
  133. package/src/progress.ts +0 -54
  134. package/src/rereview/prepare.ts +4 -1
  135. package/src/rereview/state.ts +1 -1
  136. package/src/rereview/verify.ts +15 -9
  137. package/src/review/boundary.ts +5 -8
  138. package/src/review/drafts.ts +3 -3
  139. package/src/review/findings-conformance.ts +1 -1
  140. package/src/review/findings.ts +0 -4
  141. package/src/review/pipeline.ts +194 -407
  142. package/src/review/preflight.ts +175 -201
  143. package/src/review/prompt-set.ts +1 -2
  144. package/src/review/report.ts +2 -162
  145. package/src/review/review.ts +25 -74
  146. package/src/review/route-preflight.ts +19 -35
  147. package/src/review/run.ts +37 -73
  148. package/src/review/size-gate.ts +3 -3
  149. package/src/review/spec.ts +6 -11
  150. package/src/review/step-runner.ts +4 -4
  151. package/src/runner-authority.ts +10 -9
  152. package/src/security/credential-broker.ts +5 -6
  153. package/src/server/preflight.ts +0 -1
  154. package/src/server/server.ts +17 -6
  155. package/src/store/activity.ts +1 -2
  156. package/src/store/backfill-preflight.ts +0 -3
  157. package/src/store/backfill.ts +0 -1
  158. package/src/store/metrics-preflight.ts +4 -14
  159. package/src/store/metrics.ts +5 -5
  160. package/src/store/preflight.ts +0 -13
  161. package/src/store/store.ts +11 -12
  162. package/src/transport-registry.ts +6 -30
  163. package/src/transports/claude-code-cli.ts +149 -215
  164. package/src/transports/opencode-client.ts +4 -24
  165. package/src/transports/opencode-sdk.ts +17 -112
  166. package/src/triage/plain-reply.ts +37 -0
  167. package/src/ui/activity.ts +1 -6
  168. package/src/ui/config-edit.ts +14 -67
  169. package/src/ui/config.ts +3 -8
  170. package/src/ui/plan.ts +11 -198
  171. package/src/ui/progress.ts +3 -49
  172. package/src/ui/result.ts +18 -77
  173. package/src/ui/review-menu.ts +3 -12
  174. package/src/ui/select.ts +9 -79
  175. package/src/updater.ts +1 -1
  176. package/src/usage.ts +1 -7
  177. package/prompts/scout.md +0 -140
  178. package/src/ci/platform-estimate.ts +0 -111
  179. package/src/review/scout.ts +0 -323
@@ -56,7 +56,6 @@ function sumDefinedLeaves(
56
56
  interface TerminalUsage {
57
57
  readonly inputTokens?: number;
58
58
  readonly outputTokens?: number;
59
- readonly costUsd?: number;
60
59
  readonly cacheReadTokens?: number;
61
60
  readonly cacheWriteTokens?: number;
62
61
  readonly reasoningTokens?: number;
@@ -215,7 +214,6 @@ export type OpenCodeClientEvent =
215
214
  readonly final?: boolean;
216
215
  readonly inputTokens?: number;
217
216
  readonly outputTokens?: number;
218
- readonly costUsd?: number;
219
217
  // OpenCode's disjoint-additive token leaves (see opencode-client.ts
220
218
  // StepUsage). Optional: a route that reports only input/output omits them.
221
219
  readonly cacheReadTokens?: number;
@@ -626,14 +624,12 @@ function errorMessage(error: unknown): string {
626
624
  }
627
625
 
628
626
  // Session creation failing means no attempt ever reached the provider —
629
- // genuine zero cost, not "unavailable" (which would misfile a $0 refusal as
630
- // an unresolved spend now that PR5b's spend ledger does read completeness).
627
+ // genuinely no usage, not "unavailable" (which would misfile a refusal as an
628
+ // unresolved spend now that the spend ledger reads completeness).
631
629
  //
632
630
  // 2026-09-02: it carries the ROUTE's billing mode like every other usage
633
- // record here, metered included. That is safe precisely because `tokens` is
634
- // empty — `settlementFromUsage`'s metered-zero rule gates on output tokens,
635
- // so this stays settleable at 0 while a metered attempt that actually
636
- // produced output does not.
631
+ // record here, metered included, so a retry that sums this with a spawned
632
+ // attempt keeps one credential class.
637
633
  function noSessionUsage(
638
634
  wallMs: number,
639
635
  billingMode: UsageBillingMode,
@@ -643,8 +639,6 @@ function noSessionUsage(
643
639
  tokens: {},
644
640
  completeness: "complete",
645
641
  billingMode,
646
- costSource: "provider",
647
- cashCostUsd: 0,
648
642
  };
649
643
  }
650
644
 
@@ -770,7 +764,7 @@ export class OpenCodeSdkTransport implements ProviderTransport {
770
764
 
771
765
  // §11/D1-09 honesty: every unimplemented feature is claimed false with a
772
766
  // non-blocking issue, never assumed green — hence status "degraded", not
773
- // "ready". The real adapter, credential route, and pricing table are D1-11.
767
+ // "ready". The real adapter and credential route are D1-11.
774
768
  async capabilities(
775
769
  input?: OpenCodeCapabilitiesInput,
776
770
  ): Promise<ProviderCapabilityReport> {
@@ -799,45 +793,6 @@ export class OpenCodeSdkTransport implements ProviderTransport {
799
793
  },
800
794
  billing: {
801
795
  mode: "subscription",
802
- // 2026-09-02: `true`, because this transport reports PROVIDER COST.
803
- //
804
- // The design's metered rule (§8, docs/multi-runtime-model-diversity-
805
- // design.md line 461) is a disjunction and its order is the point:
806
- // "Metered routes require provider cost or a versioned rate-table
807
- // calculation." Provider cost is named FIRST — it is the primary
808
- // path; the rate table is the fallback for a transport that reports
809
- // nothing. `tokenPricingAvailable` in production-runtime.ts has read
810
- // both disjuncts since #137.
811
- //
812
- // This transport satisfies the first one. The OpenCode SDK's
813
- // `AssistantMessage` carries a NON-OPTIONAL `cost: number` (and so
814
- // does `StepFinishPart`); `opencode-client.ts` reads it off every
815
- // assistant message, this file accumulates it across the turn, and
816
- // the outcome's usage carries it as `cashCostUsd` with
817
- // `costSource: "provider"`. That is a provider-reported cost for
818
- // whatever model the route named, with no table involved — which is
819
- // why it holds for all of models.dev, not the two providers we bundle
820
- // a table for, and why it does not expire.
821
- //
822
- // What this REPLACES, because the old reasoning was not wrong so much
823
- // as aimed at the wrong disjunct: it argued that no model id is in
824
- // scope here, that the factory hands this transport only `{ client }`,
825
- // and that an Anthropic catalogue would not cover `openai/gpt-4o`
826
- // anyway. Every clause of that is true OF THE RATE TABLE, which this
827
- // transport genuinely cannot consult — and none of it bears on
828
- // provider cost, which needs no model id because the provider prices
829
- // its own call. Applying a table's limitation to the cost path left
830
- // the design's primary source unconnected, so a metered route on any
831
- // model outside the two bundled catalogues was refused as unpriceable
832
- // while the provider was reporting its price on every message.
833
- //
834
- // #197: the claim is no longer scoped to this transport. The
835
- // claude-code CLI reports `total_cost_usd`, so its transport and its
836
- // backend-wide producer now answer `true` for the same reason this
837
- // one does. The remaining `false` is transport-registry.ts's
838
- // synthetic report for a backend whose transport could not be
839
- // CONSTRUCTED — no transport, so no claim.
840
- pricingReady: true,
841
796
  },
842
797
  ...(input !== undefined
843
798
  ? {
@@ -864,23 +819,6 @@ export class OpenCodeSdkTransport implements ProviderTransport {
864
819
  "usage aggregation mode (§4.2 line 195) is fixed at runtime by the first client usage event, so no static snapshot/delta claim can be defended; usageMode is 'none'",
865
820
  blocking: false,
866
821
  },
867
- {
868
- // NOTIONAL cost, a different fact from the cash cost above: what a
869
- // subscription attempt WOULD have cost metered. No route is in
870
- // scope here to name a model, and since #197 there is no bundled
871
- // table to look one up in either — a subscription attempt's
872
- // notional figure now comes from whatever the transport reports for
873
- // the attempt, not from this report.
874
- //
875
- // #197 removed this list's OTHER `pricing_table_missing` entry,
876
- // which said no bundled table could be consulted from here: both
877
- // halves of it died with the tables, and a "missing table" issue
878
- // beside `pricingReady: true` read as a contradiction.
879
- code: "pricing_table_missing",
880
- message:
881
- "no route is in scope here, so notional cost cannot be derived for this backend's models; subscription cash cost stays 0",
882
- blocking: false,
883
- },
884
822
  ],
885
823
  };
886
824
  }
@@ -1292,7 +1230,6 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1292
1230
  // `applyUsageUpdate` is the pure snapshot-replaces/delta-accumulates state
1293
1231
  // machine, shared with every other transport that folds a usage stream.
1294
1232
  let usageState: UsageModeState | undefined;
1295
- let cashCostUsd: number | undefined;
1296
1233
  let sinkClosed = false;
1297
1234
  let closedDataPlaneEvents = 0;
1298
1235
  let pollTimeouts = 0;
@@ -1367,7 +1304,6 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1367
1304
  // onto `done` for every event a long stream delivers.
1368
1305
  const settledSignal = done.then(() => STREAM_SETTLED);
1369
1306
  let lastKnownTokens = 0;
1370
- let lastKnownCost = 0;
1371
1307
  try {
1372
1308
  for (;;) {
1373
1309
  const step = await Promise.race([iterator.next(), settledSignal]);
@@ -1376,7 +1312,7 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1376
1312
  const event = step.value;
1377
1313
  if (settled) return;
1378
1314
  // Provider-silence tripwire accounting: advance progress only on novel
1379
- // delta text or strictly advanced usage tokens/cost. Heartbeats and
1315
+ // delta text or strictly advanced usage tokens. Heartbeats and
1380
1316
  // duplicate identical usage are keepalives, not signs of real delivery.
1381
1317
  let advancedProgress = false;
1382
1318
  if (event.kind === "delta") {
@@ -1390,11 +1326,9 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1390
1326
  } else if (event.kind === "usage") {
1391
1327
  const totalTokens =
1392
1328
  (event.inputTokens ?? 0) + (event.outputTokens ?? 0);
1393
- const cost = event.costUsd ?? 0;
1394
- if (totalTokens > lastKnownTokens || cost > lastKnownCost) {
1329
+ if (totalTokens > lastKnownTokens) {
1395
1330
  advancedProgress = true;
1396
- if (totalTokens > lastKnownTokens) lastKnownTokens = totalTokens;
1397
- if (cost > lastKnownCost) lastKnownCost = cost;
1331
+ lastKnownTokens = totalTokens;
1398
1332
  }
1399
1333
  }
1400
1334
  if (advancedProgress) {
@@ -1478,15 +1412,7 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1478
1412
  }
1479
1413
  throw error;
1480
1414
  }
1481
- if (event.costUsd !== undefined) {
1482
- cashCostUsd =
1483
- event.mode === "snapshot"
1484
- ? event.costUsd
1485
- : (cashCostUsd ?? 0) + event.costUsd;
1486
- }
1487
- const usage: Partial<NormalizedTokens> & {
1488
- cashCostUsd?: number;
1489
- } = {
1415
+ const usage: Partial<NormalizedTokens> = {
1490
1416
  ...(event.inputTokens !== undefined
1491
1417
  ? { inputUncached: event.inputTokens }
1492
1418
  : {}),
@@ -1502,9 +1428,6 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1502
1428
  ...(event.reasoningTokens !== undefined
1503
1429
  ? { outputReasoning: event.reasoningTokens }
1504
1430
  : {}),
1505
- ...(event.costUsd !== undefined
1506
- ? { cashCostUsd: event.costUsd }
1507
- : {}),
1508
1431
  };
1509
1432
  const pushed = await pushGuarded({
1510
1433
  ...base(),
@@ -1989,16 +1912,10 @@ export class OpenCodeSdkTransport implements ProviderTransport {
1989
1912
 
1990
1913
  const effectiveIncomplete = usageIncomplete || terminalUsageIncomplete;
1991
1914
 
1992
- const effectiveCostUsd =
1993
- terminalUsage?.costUsd !== undefined
1994
- ? Math.max(cashCostUsd ?? 0, terminalUsage.costUsd)
1995
- : cashCostUsd;
1996
-
1997
1915
  const hasObservedUsage =
1998
1916
  usageState !== undefined ||
1999
1917
  (terminalUsage !== undefined &&
2000
- (terminalUsage.costUsd !== undefined ||
2001
- terminalUsage.inputTokens !== undefined ||
1918
+ (terminalUsage.inputTokens !== undefined ||
2002
1919
  terminalUsage.outputTokens !== undefined));
2003
1920
 
2004
1921
  outcome = {
@@ -2014,22 +1931,17 @@ export class OpenCodeSdkTransport implements ProviderTransport {
2014
1931
  : {}),
2015
1932
  finalText: effectiveFinalText,
2016
1933
  // §8: no usage event ever arriving is not a proven zero —
2017
- // "unavailable" says honestly that the cost is unknown rather than
2018
- // fabricating a $0 for a session that DID run. `usageState` defined
1934
+ // "unavailable" says honestly that the usage is unknown rather than
1935
+ // fabricating a zero for a session that DID run. `usageState` defined
2019
1936
  // means at least one usage event landed and fixed a mode, so the
2020
1937
  // leaves it accumulated are trustworthy.
2021
1938
  //
2022
- // 2026-09-02: the parenthetical here used to read "capabilities().
2023
- // protocol.usageMode is 'none' until D1-11's real SDK adapter", which
2024
- // misattributed that field. `usageMode: "none"` is not a gap waiting
2025
- // on an adapter — it is the honest static answer to a RUNTIME
1939
+ // `usageMode: "none"` in the static capability report is not a gap
1940
+ // waiting on an adapter — it is the honest static answer to a RUNTIME
2026
1941
  // question, because the aggregation mode is fixed by the first usage
2027
1942
  // event (§4.2 line 195) and no static snapshot/delta claim can be
2028
1943
  // defended before one arrives. The transport's own
2029
- // `usage_mode_client_reported` issue says exactly that. Reading the
2030
- // old wording as "usage does not arrive yet" is what made
2031
- // `pricingReady: false` look consistent with a client that has been
2032
- // reading the provider's cost off every assistant message.
1944
+ // `usage_mode_client_reported` issue says exactly that.
2033
1945
  usage: !hasObservedUsage
2034
1946
  ? promptRefusedBeforeStart(
2035
1947
  reason,
@@ -2065,16 +1977,9 @@ export class OpenCodeSdkTransport implements ProviderTransport {
2065
1977
  // any provider but `openai` runs on a `provider_api_token`
2066
1978
  // and therefore bills METERED, and the exact-binding
2067
1979
  // capability report has said so since. This record used to
2068
- // contradict it — and the contradiction is exploitable, not
2069
- // cosmetic: `settlementFromUsage`'s metered-zero rule reads
2070
- // THIS field, so a metered attempt wearing a subscription
2071
- // badge settles a provider-reported $0 as truthful.
1980
+ // contradict it, and the credential class it reports is what
1981
+ // the platform prices the run by.
2072
1982
  billingMode: this.usageBillingMode,
2073
- costSource:
2074
- effectiveCostUsd !== undefined ? "provider" : "unknown",
2075
- ...(effectiveCostUsd !== undefined
2076
- ? { cashCostUsd: effectiveCostUsd }
2077
- : {}),
2078
1983
  },
2079
1984
  // D1-07 bridge recovers watchdog_timeout from harness-set timedOut on
2080
1985
  // the outcome, not from transport notes.
@@ -0,0 +1,37 @@
1
+ import { parseFindingMarker } from "#pr/preflight";
2
+ import { parseTriageMarker, triageMarker } from "#triage/triage";
3
+
4
+ // triage-without-skill S1: a team without the crysk-loop skill answers a finding with a plain comment, and it
5
+ // must not stay blocked for that. A reply in a finding's inline thread whose text starts with the word
6
+ // "applied" (any case) reads as the marker `crysk triage reply` would have written for it: `applied` at the
7
+ // head the finding was posted on, by a human. Only `applied`: the other tags carry an adjudicator's verdict,
8
+ // which a plain comment cannot. The reply still has to pass every rule a marked one does (its author's write
9
+ // access, the staleness rule, the newest reply in the thread), because those run on the rewritten body.
10
+ const PLAIN_APPLIED = /^\s*applied\b/i;
11
+
12
+ export function isPlainApplied(body: string): boolean {
13
+ return parseTriageMarker(body) === null && PLAIN_APPLIED.test(body);
14
+ }
15
+
16
+ // The comments with each plain `applied` reply rewritten to carry the marker its finding implies. A comment
17
+ // that already carries a marker, or that does not reply to a finding comment in the same list, is left as it
18
+ // is, so applying this twice changes nothing.
19
+ export function withPlainAppliedReplies<
20
+ T extends { id?: number; body: string; in_reply_to_id?: number | null },
21
+ >(comments: readonly T[]): T[] {
22
+ const findingHeads = new Map<number, string>();
23
+ for (const comment of comments) {
24
+ if (comment.id === undefined) continue;
25
+ const marker = parseFindingMarker(comment.body);
26
+ if (marker !== null) findingHeads.set(comment.id, marker.headSha);
27
+ }
28
+ if (findingHeads.size === 0) return [...comments];
29
+ return comments.map((comment) => {
30
+ const parent = comment.in_reply_to_id;
31
+ if (parent === undefined || parent === null) return comment;
32
+ const headSha = findingHeads.get(parent);
33
+ if (headSha === undefined || !isPlainApplied(comment.body)) return comment;
34
+ const marker = triageMarker({ tag: "applied", headSha, actor: "human" });
35
+ return { ...comment, body: `${marker}\n\n${comment.body.trim()}` };
36
+ });
37
+ }
@@ -22,10 +22,6 @@ export function formatDuration(wallMs: number): string {
22
22
  return `${String(mins).padStart(2, "0")}m ${String(secs).padStart(2, "0")}s`;
23
23
  }
24
24
 
25
- export function formatCost(costUsd: number): string {
26
- return `$${costUsd.toFixed(2)}`;
27
- }
28
-
29
25
  export function formatFindingsSummary(
30
26
  blocking: number,
31
27
  advisory: number,
@@ -110,9 +106,8 @@ export function renderRunHistory(
110
106
  : "Branch review";
111
107
  const findings = formatFindingsSummary(item.blocking, item.advisory);
112
108
  const duration = formatDuration(item.wall_ms);
113
- const cost = formatCost(item.cost_usd_est);
114
109
 
115
- const line = ` ${statusIcon} ${bold(target, st)} · ${findings} · Duration: ${duration} · Cost: ${cost}`;
110
+ const line = ` ${statusIcon} ${bold(target, st)} · ${findings} · Duration: ${duration}`;
116
111
  lines.push(line);
117
112
  }
118
113
 
@@ -8,6 +8,7 @@ import {
8
8
  parseLocalConfig,
9
9
  } from "#review/preflight";
10
10
  import { resolveHomeDir, resolveRepoDir } from "../brand-paths";
11
+ import { CliError } from "../errors";
11
12
  import { redactConfigValue } from "../security/redact";
12
13
  import { bold, box, cyan, dim, sanitizeText, yellow } from "./primitives";
13
14
  import type { KeyReader } from "./select";
@@ -15,6 +16,12 @@ import type { KeyReader } from "./select";
15
16
  const SUMMARY_MODEL_GONE =
16
17
  'summary.model is gone: set the summary model per person, under models in ~/.crysk/config.json, e.g. "models": {"summary": ["claude:haiku-latest"]}';
17
18
 
19
+ // The scout stage is gone, and so is the key's meaning: writing it would plant
20
+ // a setting that does nothing. Removing a stale one (`config unset`) still works.
21
+ const SCOUT_GONE = "scout was removed: the scout stage no longer exists";
22
+ const PARITY_GONE =
23
+ "parity_trigger_paths was removed: the parity hunter no longer exists";
24
+
18
25
  export interface ConfigEntry {
19
26
  key: string;
20
27
  value: string;
@@ -54,12 +61,6 @@ export function getEditableLayerEntries(
54
61
  ? "[✓] true"
55
62
  : "[ ] false"
56
63
  : "(not set)";
57
- const scoutVal =
58
- typeof rawData.scout === "boolean"
59
- ? rawData.scout
60
- ? "[✓] true"
61
- : "[ ] false"
62
- : "(not set)";
63
64
  const postVal =
64
65
  typeof rawData.post === "boolean"
65
66
  ? rawData.post
@@ -103,13 +104,6 @@ export function getEditableLayerEntries(
103
104
  type: "boolean",
104
105
  currentRaw: summaryObj.enabled,
105
106
  },
106
- {
107
- key: "scout",
108
- value: scoutVal,
109
- desc: "Run scout reconnaissance stage",
110
- type: "boolean",
111
- currentRaw: rawData.scout,
112
- },
113
107
  {
114
108
  key: "post",
115
109
  value: postVal,
@@ -143,12 +137,6 @@ export function getEditableLayerEntries(
143
137
  ? "[✓] true"
144
138
  : "[ ] false"
145
139
  : "(not set)";
146
- const scoutVal =
147
- typeof rawData.scout === "boolean"
148
- ? rawData.scout
149
- ? "[✓] true"
150
- : "[ ] false"
151
- : "(not set)";
152
140
  const postVal =
153
141
  typeof rawData.post === "boolean"
154
142
  ? rawData.post
@@ -185,13 +173,6 @@ export function getEditableLayerEntries(
185
173
  type: "boolean",
186
174
  currentRaw: summaryObj.enabled,
187
175
  },
188
- {
189
- key: "scout",
190
- value: scoutVal,
191
- desc: "Personal scout reconnaissance ceiling",
192
- type: "boolean",
193
- currentRaw: rawData.scout,
194
- },
195
176
  {
196
177
  key: "post",
197
178
  value: postVal,
@@ -476,37 +457,11 @@ export async function setConfigValue(input: {
476
457
  }
477
458
  currentRepo.default_base = input.value.trim();
478
459
  } else if (input.key === "parity_trigger_paths") {
479
- let paths: string[];
480
- if (input.value.startsWith("[")) {
481
- try {
482
- paths = JSON.parse(input.value);
483
- } catch {
484
- throw new Error(
485
- "parity_trigger_paths must be an array of non-empty strings",
486
- );
487
- }
488
- } else {
489
- paths = input.value
490
- .split(",")
491
- .map((s) => s.trim())
492
- .filter(Boolean);
493
- }
494
- if (
495
- !Array.isArray(paths) ||
496
- paths.length === 0 ||
497
- paths.some((p) => typeof p !== "string" || p.trim().length === 0)
498
- ) {
499
- throw new Error(
500
- "parity_trigger_paths must be an array of non-empty strings",
501
- );
502
- }
503
- currentRepo.parity_trigger_paths = paths;
460
+ throw new CliError(PARITY_GONE);
504
461
  } else if (input.key === "agents_dir") {
505
462
  currentRepo.agents_dir = input.value.trim();
506
463
  } else if (input.key === "scout") {
507
- const b = input.value.toLowerCase() === "true";
508
- parsedVal = b;
509
- currentRepo.scout = b;
464
+ throw new CliError(SCOUT_GONE);
510
465
  } else if (input.key === "post") {
511
466
  const b = input.value.toLowerCase() === "true";
512
467
  parsedVal = b;
@@ -555,12 +510,6 @@ export async function setConfigValue(input: {
555
510
  merged.effective.summary?.enabled !== parsedVal
556
511
  ) {
557
512
  annotation = `written: ${parsedVal} — your effective value remains ${merged.effective.summary?.enabled}, capped by your Person layer`;
558
- } else if (
559
- input.key === "scout" &&
560
- globalLayer.scout !== undefined &&
561
- merged.effective.scout !== parsedVal
562
- ) {
563
- annotation = `written: ${parsedVal} — your effective value remains ${merged.effective.scout}, capped by your Person layer`;
564
513
  } else if (
565
514
  input.key === "post" &&
566
515
  globalLayer.post !== undefined &&
@@ -577,11 +526,10 @@ export async function setConfigValue(input: {
577
526
  }
578
527
 
579
528
  if (input.layer === "person") {
580
- if (
581
- input.key === "default_base" ||
582
- input.key === "parity_trigger_paths" ||
583
- input.key === "suspicion_priors"
584
- ) {
529
+ if (input.key === "parity_trigger_paths") {
530
+ throw new CliError(PARITY_GONE);
531
+ }
532
+ if (input.key === "default_base" || input.key === "suspicion_priors") {
585
533
  throw new Error(
586
534
  `${input.key} is a per-repo key; use --team to configure it.`,
587
535
  );
@@ -640,8 +588,7 @@ export async function setConfigValue(input: {
640
588
  } else if (input.key === "agents_dir") {
641
589
  currentPerson.agents_dir = input.value.trim();
642
590
  } else if (input.key === "scout") {
643
- const b = input.value.toLowerCase() === "true";
644
- currentPerson.scout = b;
591
+ throw new CliError(SCOUT_GONE);
645
592
  } else if (input.key === "post") {
646
593
  const b = input.value.toLowerCase() === "true";
647
594
  currentPerson.post = b;
package/src/ui/config.ts CHANGED
@@ -82,9 +82,9 @@ type ConfigRowKey = Exclude<keyof LocalConfig, "summary">;
82
82
  // "a wrong answer with a plausible face".
83
83
  const UNSET = "(unset)";
84
84
  // A layer DID name the key and named it empty. Distinct from UNSET on
85
- // purpose: `"parity_trigger_paths": []` is a repo deliberately disarming the
86
- // parity hunter, and it is the fact §3.2's parser change exists to keep
87
- // distinguishable from silence.
85
+ // purpose: `"suspicion_priors": []` is a repo deliberately naming no priors,
86
+ // and it is the fact §3.2's parser change exists to keep distinguishable from
87
+ // silence.
88
88
  const EMPTY = "(empty)";
89
89
 
90
90
  function cell(value: string | undefined, source: ConfigSource): ConfigCell {
@@ -158,10 +158,6 @@ export function configRows(
158
158
  const cells: Record<ConfigRowKey, ConfigCell> = {
159
159
  agents_dir: cell(effective.agents_dir, sources.agents_dir),
160
160
  default_base: cell(effective.default_base, sources.default_base),
161
- parity_trigger_paths: listCell(
162
- effective.parity_trigger_paths,
163
- sources.parity_trigger_paths,
164
- ),
165
161
  suspicion_priors: priorsCell(
166
162
  effective.suspicion_priors,
167
163
  sources.suspicion_priors,
@@ -185,7 +181,6 @@ export function configRows(
185
181
  effective.max_changed_files?.toString(),
186
182
  sources.max_changed_files,
187
183
  ),
188
- scout: cell(effective.scout?.toString(), sources.scout),
189
184
  materiality_gate: cell(
190
185
  effective.materiality_gate?.toString(),
191
186
  sources.materiality_gate,