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
@@ -13,6 +13,7 @@ import {
13
13
  parseAdjudicationMarker,
14
14
  trustedAdjudicator,
15
15
  } from "#triage/adjudication";
16
+ import { withPlainAppliedReplies } from "#triage/plain-reply";
16
17
  import { parseTriageMarker } from "#triage/triage";
17
18
  import {
18
19
  classifyPrior,
@@ -985,10 +986,12 @@ export function enrichPriorsFromThreads(input: {
985
986
  platformActor?: string;
986
987
  }): PriorRecord[] {
987
988
  const bound = bindPriorsToPosted(input.priors, input.posted);
989
+ // triage-without-skill S1: a plain `applied` reply is the triage it implies (triage/plain-reply.ts).
990
+ const replies = withPlainAppliedReplies(input.replies);
988
991
  return input.priors.map((prior) => {
989
992
  const parent = bound.get(prior.id);
990
993
  if (parent === undefined) return prior;
991
- const thread = input.replies.filter(
994
+ const thread = replies.filter(
992
995
  (reply) => reply.in_reply_to_id === parent.id,
993
996
  );
994
997
  let triage: PriorTriage | null = prior.triage;
@@ -511,7 +511,7 @@ export function assembleLive(input: {
511
511
  // matching is a 5-line window, so a different issue can sit there, and the
512
512
  // gate fails closed.
513
513
  // A real fix leaves the count when the re-review VERIFIES it gone, and
514
- // `/pr-hero override` covers a team that accepts the finding.
514
+ // `/crysk override` covers a team that accepts the finding.
515
515
  // A self-asserted triage tag never leaves the count (S7). `misclassified`
516
516
  // lands as `re-tiered` (classifyPrior), and its tier is the author's claim,
517
517
  // not the pipeline's, so it is not evidence. A dismissal the adjudicator upheld
@@ -22,7 +22,6 @@
22
22
  // untrusted block cannot be wrapped under an invented tag name.
23
23
  export type BoundaryTag =
24
24
  | "patch"
25
- | "scout_leads"
26
25
  | "finding"
27
26
  | "findings"
28
27
  | "gotchas"
@@ -82,16 +81,13 @@ export function selectBoundaryNonce(
82
81
  );
83
82
  }
84
83
 
85
- // EMPTY CONTENT RENDERS TO THE EMPTY STRING, never to an empty tag pair. This
86
- // is load-bearing twice over: `renderLeadsBlock` already returns "" so a scout
87
- // that found nothing produces the control arm's byte-identical hunter prompt
88
- // (`review/scout.ts`'s note on M6), and an empty priors list must likewise leave no
89
- // trace in a system prompt. A `<scout_leads nonce></scout_leads nonce>` pair
90
- // would break both.
84
+ // EMPTY CONTENT RENDERS TO THE EMPTY STRING, never to an empty tag pair: an
85
+ // empty priors list must leave no trace in a system prompt, and a
86
+ // `<priors nonce></priors nonce>` pair would be one.
91
87
  //
92
88
  // Throwing on a forged nonce is the last line of defence, not the first: every
93
89
  // block whose content can arrive after the nonce was committed is guarded by
94
- // the driver before it reaches here (see `runScout` and `runRefuter`), because
90
+ // the driver before it reaches here (see `runRefuter`), because
95
91
  // a throw at prompt-composition time would kill a paid run. A throw that does
96
92
  // escape means a block reached composition unguarded — which is a defect to
97
93
  // see, not one to paper over by shipping a forgeable boundary.
@@ -41,11 +41,11 @@ export interface HunterDraft {
41
41
  // not invent a failure, and must not invent a pass by stamping a 0 it did
42
42
  // not see. OpenCode stamps the count (including 0). Claude Code derives it from
43
43
  // the CLI result's `num_turns` (#299) and omits it when that is not a valid
44
- // integer. Scout is out of this rule because the engine forces `tools: []`.
44
+ // integer.
45
45
  //
46
46
  // Only a parsed `{ findings: [...] }` can trip it. The refuter and verifier
47
- // emit `results`, the summarizer `prose`/`score`, and the scout a bare lead
48
- // list; none of them has a `findings` array, so none of them is reached.
47
+ // emit `results` and the summarizer `prose`/`score`; none has a `findings`
48
+ // array, so none of them is reached.
49
49
  export function isVacuousHunt(input: {
50
50
  readonly tools: readonly string[];
51
51
  readonly toolInvocations: number | undefined;
@@ -21,7 +21,7 @@ const FINDING_V11_BAD_HUNTER =
21
21
  '{"id":"F001","category":1,"path":"src/a.ts","line":1,"severity":"BLOCKER","evidence_class":"deterministic","refuter_verdict":"not_submitted","causal_disposition":"introduced","claim":"x","proof_refs":[],"hunter":"Security","tier":"blocking","hops_used":0,"hop_trail":[],"dedupe_key":"k"}';
22
22
 
23
23
  const TELEMETRY =
24
- '{"index_ms":1,"index_mode":"fresh","index_disk_mb":1,"wall_ms":1,"tokens_in":1,"tokens_out":1,"tokens_total":2,"cost_usd_est":0.1}';
24
+ '{"index_ms":1,"index_mode":"fresh","index_disk_mb":1,"wall_ms":1,"tokens_in":1,"tokens_out":1,"tokens_total":2}';
25
25
 
26
26
  function envelope(
27
27
  schemaVersion: string,
@@ -112,10 +112,6 @@ export interface Telemetry {
112
112
  tokens_in: number;
113
113
  tokens_out: number;
114
114
  tokens_total: number;
115
- cost_usd_est: number;
116
- // True when at least one spend reservation ended unresolved_remote — the
117
- // reported cost is a floor of known spend, not a closed total.
118
- cost_usd_est_is_floor?: boolean;
119
115
  // Engine v2 populates this per step (it runs one session per agent). The
120
116
  // original best-effort caveat (reconciliation R3) still applies to v1
121
117
  // documents: absence must never fail validation.