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.
- package/README.md +28 -22
- package/dist/SKILL-1q3658n0.md +74 -0
- package/dist/SKILL-25j4q9b8.md +143 -0
- package/dist/SKILL-32cmme3j.md +143 -0
- package/dist/SKILL-4747bhne.md +143 -0
- package/dist/SKILL-4jc3sv23.md +74 -0
- package/dist/SKILL-c0492rch.md +540 -0
- package/dist/SKILL-d1nzkhhr.md +74 -0
- package/dist/SKILL-f8p7kvx0.md +143 -0
- package/dist/SKILL-gxd45g38.md +553 -0
- package/dist/SKILL-rec41991.md +66 -0
- package/dist/SKILL-zze8zj5g.md +536 -0
- package/dist/adjudicator-eckqh14e.md +78 -0
- package/dist/ci-admission-qn797a6c.md +128 -0
- package/dist/cli.js +18608 -18523
- package/dist/consolidate-4xw1pkg7.md +24 -0
- package/dist/deep-review-logic-dgr112y1.md +196 -0
- package/dist/deep-review-logic-fck5z4xe.md +197 -0
- package/dist/deep-review-logic-h1fpamfh.md +192 -0
- package/dist/deep-review-logic-m4vk5683.md +196 -0
- package/dist/deep-review-logic-z63kmgmc.md +157 -0
- package/dist/deep-review-parity-7x7s5d81.md +148 -0
- package/dist/deep-review-parity-9wxmynsc.md +115 -0
- package/dist/deep-review-parity-bwwe7cx6.md +152 -0
- package/dist/deep-review-parity-e50pw3pk.md +117 -0
- package/dist/deep-review-parity-ennmm9m1.md +151 -0
- package/{prompts/default/deep-review-parity.md → dist/deep-review-parity-h7y6y2he.md} +14 -16
- package/dist/deep-review-parity-xg6wy69c.md +151 -0
- package/dist/deep-review-reliability-6h3c4gmw.md +125 -0
- package/dist/deep-review-reliability-dcjab69x.md +122 -0
- package/dist/deep-review-reliability-ec7b5pbk.md +159 -0
- package/dist/deep-review-reliability-hvasvmt9.md +153 -0
- package/dist/deep-review-reliability-mjnayxmt.md +158 -0
- package/dist/deep-review-reliability-mm7fnayf.md +124 -0
- package/dist/deep-review-reliability-xk4xvc2w.md +158 -0
- package/dist/deep-review-resilience-0esd5qeh.md +148 -0
- package/dist/deep-review-resilience-envgcmpy.md +115 -0
- package/dist/deep-review-resilience-fgx8ythf.md +151 -0
- package/dist/deep-review-resilience-mq5qa6ad.md +152 -0
- package/dist/deep-review-resilience-pwh1gawp.md +151 -0
- package/dist/deep-review-resilience-s9n21dkx.md +117 -0
- package/dist/deep-review-resilience-vz4qskea.md +119 -0
- package/dist/deep-review-security-1vwjdc9q.md +205 -0
- package/dist/deep-review-security-x1cc1z00.md +205 -0
- package/dist/index.js +590 -485
- package/dist/opencode-ci-jc8mf4wn.md +106 -0
- package/dist/opencode-ci-qrcv7a99.md +106 -0
- package/dist/opencode-ci-rdpcc7xc.md +106 -0
- package/dist/opencode-ci-yt0k74t0.md +106 -0
- package/dist/review-refuter-7qffwtzz.md +77 -0
- package/dist/verifier-tyh8r45v.md +40 -0
- package/dist/verifier-xf4xj701.md +40 -0
- package/dist/workflow-andv2dvm.yml +158 -0
- package/package.json +1 -1
- package/prompts/consolidate.md +1 -1
- package/prompts/default/PROVENANCE.md +6 -0
- package/prompts/default/deep-review-logic.md +56 -15
- package/prompts/default/deep-review-reliability.md +64 -30
- package/prompts/default/deep-review-resilience.md +71 -37
- package/prompts/default/deep-review-security.md +205 -0
- package/prompts/default/review-refuter.md +1 -1
- package/prompts/verifier.md +40 -0
- package/skills/crysk/SKILL.md +6 -6
- package/skills/crysk-ci-setup/SKILL.md +32 -33
- package/skills/crysk-ci-setup/assets/workflow.yml +5 -10
- package/skills/crysk-ci-setup/references/ci-admission.md +5 -5
- package/skills/crysk-ci-setup/references/opencode-ci.md +6 -6
- package/skills/crysk-loop/SKILL.md +37 -54
- package/skills/crysk-loop/adjudicator.md +10 -18
- package/skills/crysk-pr/SKILL.md +1 -1
- package/src/asset-manifest.ts +6 -6
- package/src/assets.ts +4 -4
- package/src/brand.ts +20 -30
- package/src/ci/gates.ts +155 -192
- package/src/ci/outcome.ts +4 -31
- package/src/ci/platform-limits.ts +135 -0
- package/src/ci/platform-report.ts +212 -126
- package/src/ci/platform.ts +28 -26
- package/src/ci/reporter.ts +25 -26
- package/src/ci/review-admission.ts +1 -2
- package/src/ci/review-levels.ts +12 -53
- package/src/ci/setup.ts +96 -66
- package/src/ci/trace-bundle.ts +11 -27
- package/src/ci/trace-transcripts.ts +4 -6
- package/src/ci/trigger.ts +3 -5
- package/src/cli.ts +6 -5
- package/src/commands/ci-setup-questions.ts +2 -55
- package/src/commands/ci-setup.ts +2 -26
- package/src/commands/triage.ts +131 -38
- package/src/commands/usage.ts +0 -1
- package/src/compare/compare.ts +3 -3
- package/src/compare/floor-test.ts +30 -201
- package/src/compare/hunter-exam.ts +631 -0
- package/src/config/config.ts +6 -30
- package/src/diversity/accounting.ts +0 -26
- package/src/diversity/benchmark.ts +1 -17
- package/src/diversity/identity.ts +0 -14
- package/src/diversity/pipeline-integration.ts +0 -29
- package/src/doctor.ts +3 -6
- package/src/execution/claude-session-trace.ts +7 -2
- package/src/execution/contracts.ts +15 -9
- package/src/execution/harness.ts +165 -187
- package/src/execution/spend-limiter.ts +39 -131
- package/src/execution/usage-facts.ts +397 -0
- package/src/execution/usage-normalized.ts +33 -86
- package/src/harness/materiality-judge.ts +0 -5
- package/src/harness/pipeline-plan.ts +0 -3
- package/src/harness/replay-rows.ts +0 -5
- package/src/harness/route-runner.ts +2 -2
- package/src/harness/single-step.ts +3 -9
- package/src/index.ts +1 -1
- package/src/mcp/preflight.ts +2 -2
- package/src/model/catalog.ts +1 -3
- package/src/model/free-discovery.ts +11 -78
- package/src/model/model-name.ts +16 -5
- package/src/model/profiles/claude.ts +1 -2
- package/src/model/profiles/openai.ts +1 -2
- package/src/model/profiles.ts +2 -3
- package/src/model/provider-capabilities.ts +16 -55
- package/src/model/routing.ts +39 -36
- package/src/pr/admission.ts +6 -6
- package/src/pr/answered-findings.ts +8 -4
- package/src/pr/ci-publish.ts +0 -2
- package/src/pr/discovery.ts +4 -25
- package/src/pr/plan.ts +40 -121
- package/src/pr/pr-status.ts +14 -2
- package/src/pr/pr.ts +1 -1
- package/src/pr/preflight.ts +44 -15
- package/src/pr/publish-outcome.ts +1 -19
- package/src/pr/review-pr.ts +15 -47
- package/src/pr/target.ts +76 -82
- package/src/production-runtime.ts +52 -114
- package/src/progress.ts +0 -54
- package/src/rereview/prepare.ts +4 -1
- package/src/rereview/state.ts +1 -1
- package/src/rereview/verify.ts +15 -9
- package/src/review/boundary.ts +5 -8
- package/src/review/drafts.ts +3 -3
- package/src/review/findings-conformance.ts +1 -1
- package/src/review/findings.ts +0 -4
- package/src/review/pipeline.ts +194 -407
- package/src/review/preflight.ts +175 -201
- package/src/review/prompt-set.ts +1 -2
- package/src/review/report.ts +2 -162
- package/src/review/review.ts +25 -74
- package/src/review/route-preflight.ts +19 -35
- package/src/review/run.ts +37 -73
- package/src/review/size-gate.ts +3 -3
- package/src/review/spec.ts +6 -11
- package/src/review/step-runner.ts +4 -4
- package/src/runner-authority.ts +10 -9
- package/src/security/credential-broker.ts +5 -6
- package/src/server/preflight.ts +0 -1
- package/src/server/server.ts +17 -6
- package/src/store/activity.ts +1 -2
- package/src/store/backfill-preflight.ts +0 -3
- package/src/store/backfill.ts +0 -1
- package/src/store/metrics-preflight.ts +4 -14
- package/src/store/metrics.ts +5 -5
- package/src/store/preflight.ts +0 -13
- package/src/store/store.ts +11 -12
- package/src/transport-registry.ts +6 -30
- package/src/transports/claude-code-cli.ts +149 -215
- package/src/transports/opencode-client.ts +4 -24
- package/src/transports/opencode-sdk.ts +17 -112
- package/src/triage/plain-reply.ts +37 -0
- package/src/ui/activity.ts +1 -6
- package/src/ui/config-edit.ts +14 -67
- package/src/ui/config.ts +3 -8
- package/src/ui/plan.ts +11 -198
- package/src/ui/progress.ts +3 -49
- package/src/ui/result.ts +18 -77
- package/src/ui/review-menu.ts +3 -12
- package/src/ui/select.ts +9 -79
- package/src/updater.ts +1 -1
- package/src/usage.ts +1 -7
- package/prompts/scout.md +0 -140
- package/src/ci/platform-estimate.ts +0 -111
- package/src/review/scout.ts +0 -323
package/src/ci/setup.ts
CHANGED
|
@@ -76,6 +76,11 @@ import {
|
|
|
76
76
|
parseModelsConfig,
|
|
77
77
|
} from "#model/model-name";
|
|
78
78
|
import { MODEL_PROFILES, profileModels } from "#model/profiles";
|
|
79
|
+
import {
|
|
80
|
+
agentModelRole,
|
|
81
|
+
agentStepKey,
|
|
82
|
+
type ResolvedRoutePlan,
|
|
83
|
+
} from "#model/routing";
|
|
79
84
|
import { parseGlobalConfig, parseLocalConfig } from "#review/preflight";
|
|
80
85
|
import { commandForms } from "../brand";
|
|
81
86
|
import {
|
|
@@ -114,43 +119,19 @@ export const LEGACY_CI_WORKFLOW_RELATIVE_PATH = LEGACY_WORKFLOW_RELATIVE_PATH;
|
|
|
114
119
|
// PR that changes it.
|
|
115
120
|
export interface CiWorkflowTemplateOptions {
|
|
116
121
|
actionRef?: string;
|
|
117
|
-
// Repo-local override for the action's own `
|
|
118
|
-
// means "say nothing and inherit the
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
// Since issue #156 that inherited default is a POLICY, not a number:
|
|
123
|
-
// action.yml's `budget-usd` default is empty, and the CLI resolves the
|
|
124
|
-
// ceiling from the route's billing mode (ci/gates.ts's
|
|
125
|
-
// `resolveCiBudgetCeiling`) — no ceiling on a Claude subscription, a default
|
|
126
|
-
// ceiling on a metered ANTHROPIC_API_KEY route. Inheriting is therefore
|
|
127
|
-
// strictly better than it was: a scaffolded repo now gets a ceiling exactly
|
|
128
|
-
// when a ceiling means something.
|
|
122
|
+
// Repo-local override for the action's own `max-changed-lines` default.
|
|
123
|
+
// Omitted means "say nothing and inherit the route-derived limit" (none on a
|
|
124
|
+
// subscription, 4000 on a metered key; resolveCiSizeLimits), which every
|
|
125
|
+
// scaffolded repo gets and decides for itself.
|
|
129
126
|
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
// way to say so, and that is the only thing an explicit value now means.
|
|
134
|
-
budgetUsd?: string;
|
|
135
|
-
// Repo-local override for the action's own `max-changed-lines` default, and
|
|
136
|
-
// omitted for the same reason as `budgetUsd`: a scaffolded repo inherits
|
|
137
|
-
// the route-derived limit (none on a subscription, 4000 on a metered key;
|
|
138
|
-
// resolveCiSizeLimits) and decides for itself. THIS repo raises it because its
|
|
139
|
-
// own slices routinely land near the line — D1-10c was skipped at 1023,
|
|
140
|
-
// twenty-three lines over, and a skipped review is indistinguishable from a
|
|
141
|
-
// clean one to anyone reading the checks.
|
|
127
|
+
// THIS repo raises it because its own slices routinely land near the line:
|
|
128
|
+
// D1-10c was skipped at 1023, twenty-three lines over, and a skipped review is
|
|
129
|
+
// indistinguishable from a clean one to anyone reading the checks.
|
|
142
130
|
//
|
|
143
131
|
// Raising it costs little and risks little HERE. It is a COST gate, never a
|
|
144
132
|
// quality one — the size<->quality question is unmeasured in this project
|
|
145
133
|
// (`scripts/scope-probe.ts`), so this number is not a claim that pr-hero
|
|
146
134
|
// reviews a 1500-line diff as well as a 300-line one.
|
|
147
|
-
//
|
|
148
|
-
// Since issue #156 it is also the ONLY gate bounding a self-review's scope
|
|
149
|
-
// here, which is what the number has to be read against: this comment used
|
|
150
|
-
// to lean on `budget-usd` as "the real spend ceiling, which still refuses
|
|
151
|
-
// the work outright". On this repo's subscription route it never was — it
|
|
152
|
-
// gated `estimate.high`, a token-derived figure, against $0.00 of real
|
|
153
|
-
// cash.
|
|
154
135
|
maxChangedLines?: string;
|
|
155
136
|
// The files half of the size gate, emitted right after the lines input.
|
|
156
137
|
maxChangedFiles?: string;
|
|
@@ -189,17 +170,7 @@ export const DEFAULT_CI_ACTION_REF = "cryskai/crysk@v0";
|
|
|
189
170
|
// leave the committed workflow and the tests disagreeing about what "ours"
|
|
190
171
|
// means. Nothing a scaffolded repo receives passes through here.
|
|
191
172
|
//
|
|
192
|
-
// `
|
|
193
|
-
// it used to be "15.00", because a self-review's diff grows against the base
|
|
194
|
-
// every time a finding is answered, so an iterating PR walked toward the
|
|
195
|
-
// ceiling exactly when the check mattered most. Issue #156 dropped it on the
|
|
196
|
-
// promise that the route's billing mode would apply no ceiling on this repo's
|
|
197
|
-
// Claude subscription. That promise did not hold here: the route resolved as
|
|
198
|
-
// metered, and #326 (and earlier PRs) skipped at the $10 metered default on
|
|
199
|
-
// an `estimate.high` that is not this route's cash cost. A subscription has
|
|
200
|
-
// no dollar cost to cap, so this repo opts out explicitly; fixing the
|
|
201
|
-
// billing-mode resolution itself is a separate issue. `maxChangedLines`
|
|
202
|
-
// stays: that gate is real on any route.
|
|
173
|
+
// `maxChangedLines` stays: that gate is real on any route.
|
|
203
174
|
//
|
|
204
175
|
// `cryskSecrets` names the Claude pair (U5): the action stops a run that passes the
|
|
205
176
|
// removed inputs, so this repo's own review passes CRYSK_* secrets. The repository
|
|
@@ -207,7 +178,6 @@ export const DEFAULT_CI_ACTION_REF = "cryskai/crysk@v0";
|
|
|
207
178
|
export const OWN_CI_WORKFLOW_OPTIONS: CiWorkflowTemplateOptions = {
|
|
208
179
|
actionRef: "./",
|
|
209
180
|
maxChangedLines: "5000",
|
|
210
|
-
budgetUsd: "0",
|
|
211
181
|
mode: "gate",
|
|
212
182
|
forceEngineFromPr: true,
|
|
213
183
|
cryskSecrets: ["CRYSK_CLAUDE_OAUTH_TOKEN", "CRYSK_CLAUDE_API_KEY"],
|
|
@@ -294,12 +264,6 @@ export function generateCiWorkflowTemplate(
|
|
|
294
264
|
): string {
|
|
295
265
|
const actionRef = options.actionRef ?? DEFAULT_CI_ACTION_REF;
|
|
296
266
|
const pinEngine = options.forceEngineFromPr === true;
|
|
297
|
-
const budgetLine =
|
|
298
|
-
options.budgetUsd === undefined
|
|
299
|
-
? ""
|
|
300
|
-
: `\n budget-usd: ${options.budgetUsd}`;
|
|
301
|
-
// Emitted before `budget-usd` to mirror action.yml's own declaration order,
|
|
302
|
-
// so the generated file reads in the same sequence as the inputs it sets.
|
|
303
267
|
const sizeGateLine =
|
|
304
268
|
options.maxChangedLines === undefined
|
|
305
269
|
? ""
|
|
@@ -405,24 +369,19 @@ export function generateCiWorkflowTemplate(
|
|
|
405
369
|
|
|
406
370
|
`
|
|
407
371
|
: "";
|
|
408
|
-
// One clause per command
|
|
409
|
-
// has no regex, so the legacy /pr-hero forms are listed beside /crysk ones.
|
|
372
|
+
// One clause per command form: an Actions expression has no regex.
|
|
410
373
|
const commandBodies = [
|
|
411
374
|
REVIEW_COMMAND,
|
|
412
375
|
RECHECK_COMMAND,
|
|
413
376
|
OVERRIDE_COMMAND,
|
|
414
377
|
].flatMap(commandForms);
|
|
415
|
-
const
|
|
416
|
-
...commandBodies.filter((c) => c.startsWith("/crysk")),
|
|
417
|
-
...commandBodies.filter((c) => !c.startsWith("/crysk")),
|
|
418
|
-
];
|
|
419
|
-
const ifCommentClauses = newNamesFirst
|
|
378
|
+
const ifCommentClauses = commandBodies
|
|
420
379
|
.map(
|
|
421
380
|
(c) =>
|
|
422
381
|
`(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '${c}'))`,
|
|
423
382
|
)
|
|
424
383
|
.join(" ||\n ");
|
|
425
|
-
const groupCommentClauses =
|
|
384
|
+
const groupCommentClauses = commandBodies
|
|
426
385
|
.map(
|
|
427
386
|
(c) =>
|
|
428
387
|
`(startsWith(github.event.comment.body, '${c}') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))`,
|
|
@@ -451,8 +410,7 @@ export function generateCiWorkflowTemplate(
|
|
|
451
410
|
# no cost, and records who did it. A comment that is exactly
|
|
452
411
|
# \`/crysk recheck\` reviews the head and asks the CI adjudicator to rule on
|
|
453
412
|
# pending dismissals of blocking findings. The action parses the comment and
|
|
454
|
-
# refuses a commenter without write access.
|
|
455
|
-
# of these commands still work for one version.
|
|
413
|
+
# refuses a commenter without write access.
|
|
456
414
|
name: Crysk Review
|
|
457
415
|
|
|
458
416
|
on:
|
|
@@ -491,8 +449,7 @@ jobs:
|
|
|
491
449
|
# fork's head.
|
|
492
450
|
#
|
|
493
451
|
# A comment starts the job only when it BEGINS with \`/crysk review\`,
|
|
494
|
-
# \`/crysk recheck\` or \`/crysk override
|
|
495
|
-
# of the three). The action then requires an exact match after
|
|
452
|
+
# \`/crysk recheck\` or \`/crysk override\`. The action then requires an exact match after
|
|
496
453
|
# trimming, so a near-miss such as "/crysk review please" starts a job the
|
|
497
454
|
# action ends without reviewing or overriding.
|
|
498
455
|
if: >-
|
|
@@ -512,7 +469,7 @@ jobs:
|
|
|
512
469
|
#
|
|
513
470
|
# GitHub keeps one PENDING run per group, and a newer run replaces it. So
|
|
514
471
|
# a comment enters the pull request's group only when it starts with
|
|
515
|
-
# /crysk review, /crysk recheck or /crysk override
|
|
472
|
+
# /crysk review, /crysk recheck or /crysk override, and GitHub associates its author
|
|
516
473
|
# with the repository as OWNER, MEMBER or COLLABORATOR; every other comment
|
|
517
474
|
# gets its own group. Without that, anyone who can comment could replace a
|
|
518
475
|
# maintainer's queued review with a run the action then refuses. The job
|
|
@@ -562,7 +519,7 @@ ${gateStep} - name: Checkout${checkoutGate}
|
|
|
562
519
|
uses: ${actionRef}
|
|
563
520
|
with:
|
|
564
521
|
github-token: \${{ secrets.GITHUB_TOKEN }}
|
|
565
|
-
${credentialWithLines(options)}${sizeGateLine}${filesGateLine}${
|
|
522
|
+
${credentialWithLines(options)}${sizeGateLine}${filesGateLine}${modeLine}
|
|
566
523
|
`;
|
|
567
524
|
}
|
|
568
525
|
|
|
@@ -573,7 +530,7 @@ export interface RunCiSetupOptions {
|
|
|
573
530
|
// What the person chose in setup --ci; absent keeps the template's defaults.
|
|
574
531
|
template?: Pick<
|
|
575
532
|
CiWorkflowTemplateOptions,
|
|
576
|
-
"mode" | "
|
|
533
|
+
"mode" | "maxChangedLines" | "maxChangedFiles"
|
|
577
534
|
>;
|
|
578
535
|
}
|
|
579
536
|
|
|
@@ -894,10 +851,10 @@ export function openCodeProvidersOfPerson(person: {
|
|
|
894
851
|
// resolved routes, any step or fallback, binds an API key, by the same rule the
|
|
895
852
|
// run binds it with (credentialKindForRoute over the secret manifest's names, the
|
|
896
853
|
// provider literal without one). `providers` comes from the run's own route plan,
|
|
897
|
-
// so every source routing reads counts (`models`, `--model`,
|
|
854
|
+
// so every source routing reads counts (`models`, `--model`, a
|
|
898
855
|
// spec model, a prompt's frontmatter, the engine's defaults). Undefined means the
|
|
899
856
|
// routes could not be resolved here: the auth file decides, the old rule, which
|
|
900
|
-
// keeps the
|
|
857
|
+
// keeps the route metered. The file alone is not enough otherwise: it also exists for a
|
|
901
858
|
// ChatGPT subscription, after an earlier run on a runner whose HOME persists, or
|
|
902
859
|
// from a local `opencode auth login`. And no file means no credential for a
|
|
903
860
|
// per-token route, as before: a free `opencode/*` model stays unmetered.
|
|
@@ -920,6 +877,79 @@ export function openCodeRoutesBillMetered(input: {
|
|
|
920
877
|
);
|
|
921
878
|
}
|
|
922
879
|
|
|
880
|
+
// The key modelRoleBilling records a plan step under when no `models` key covers
|
|
881
|
+
// it. Not a role name the platform sends, so it never adds to the API share.
|
|
882
|
+
const UNMAPPED_STEP = "(unmapped step)";
|
|
883
|
+
|
|
884
|
+
// Which of the run's model roles bill an API key (S17), keyed like the engine's
|
|
885
|
+
// `models` config (`hunter.<specialty>`, `refuter`, `summary`, `consolidate`,
|
|
886
|
+
// `judge`). A role is the route its step resolved to, so what `models.default`
|
|
887
|
+
// covers is already in it. A role bills an API key when any route it can take,
|
|
888
|
+
// a fallback included, does: a Claude route when the run's chosen Claude
|
|
889
|
+
// credential is an API key, an OpenCode route by the rule the run binds it
|
|
890
|
+
// with (openCodeRoutesBillMetered). The platform prices each role and the
|
|
891
|
+
// limits gate sums the ones that bill here, because only the engine knows how a
|
|
892
|
+
// run is billed. Undefined when the plan could not be built: the gate then
|
|
893
|
+
// compares the whole estimate.
|
|
894
|
+
export function modelRoleBilling(input: {
|
|
895
|
+
plan: ResolvedRoutePlan | undefined;
|
|
896
|
+
agents: readonly {
|
|
897
|
+
readonly key: string;
|
|
898
|
+
readonly role: string;
|
|
899
|
+
readonly specialty?: string;
|
|
900
|
+
}[];
|
|
901
|
+
// The run's chosen Claude credential env (claudeRun.env).
|
|
902
|
+
claudeEnv: Readonly<Record<string, string | undefined>>;
|
|
903
|
+
authFilePresent: boolean;
|
|
904
|
+
openCodeSecretNames: readonly string[] | undefined;
|
|
905
|
+
}): ReadonlyMap<string, boolean> | undefined {
|
|
906
|
+
if (input.plan === undefined) return undefined;
|
|
907
|
+
const routeBills = (route: { backend: string; provider: string }) =>
|
|
908
|
+
route.backend === "claude-code"
|
|
909
|
+
? credentialKindForRoute(
|
|
910
|
+
"claude-code",
|
|
911
|
+
route.provider,
|
|
912
|
+
input.claudeEnv,
|
|
913
|
+
) === "provider_api_token"
|
|
914
|
+
: openCodeRoutesBillMetered({
|
|
915
|
+
providers: [route.provider],
|
|
916
|
+
authFilePresent: input.authFilePresent,
|
|
917
|
+
openCodeSecretNames: input.openCodeSecretNames,
|
|
918
|
+
});
|
|
919
|
+
const billing = new Map<string, boolean>();
|
|
920
|
+
const add = (
|
|
921
|
+
role: string,
|
|
922
|
+
routes: readonly { backend: string; provider: string }[],
|
|
923
|
+
) => {
|
|
924
|
+
billing.set(role, (billing.get(role) ?? false) || routes.some(routeBills));
|
|
925
|
+
};
|
|
926
|
+
for (const step of input.plan.steps) {
|
|
927
|
+
const routes = [step, ...(step.fallbacks ?? [])].map((s) => s.route);
|
|
928
|
+
// A step no `models` key covers still spends: recorded under a key the
|
|
929
|
+
// platform never sends, so an API-billed one keeps the run API-billed (the
|
|
930
|
+
// gate's no-API-role shortcut cannot fire) without adding to the share.
|
|
931
|
+
add(stepModelRole(step.stepKey, input.agents) ?? UNMAPPED_STEP, routes);
|
|
932
|
+
}
|
|
933
|
+
// The materiality judge is counted only when it is in the plan (the gate on,
|
|
934
|
+
// its `materiality` step above): an idle judge bills nothing, and counting its
|
|
935
|
+
// Claude route would mark a run whose roles are all on a subscription as
|
|
936
|
+
// API-billed through an unused Claude key (#551 R001). A `judge` key the
|
|
937
|
+
// platform still sends then has no role here and counts as API.
|
|
938
|
+
return billing;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// The `models` key a plan step reads, or undefined for a step no key covers.
|
|
942
|
+
function stepModelRole(
|
|
943
|
+
stepKey: string,
|
|
944
|
+
agents: readonly { key: string; role: string; specialty?: string }[],
|
|
945
|
+
): string | undefined {
|
|
946
|
+
if (stepKey === "summarizer") return "summary";
|
|
947
|
+
if (stepKey === "consolidate") return "consolidate";
|
|
948
|
+
if (stepKey === "materiality") return "judge";
|
|
949
|
+
const agent = agents.find((a) => agentStepKey(a) === stepKey);
|
|
950
|
+
return agent === undefined ? undefined : agentModelRole(agent);
|
|
951
|
+
}
|
|
952
|
+
|
|
923
953
|
interface OpenCodeAuthAssembly {
|
|
924
954
|
// provider id -> its auth.json record.
|
|
925
955
|
readonly records: Record<string, Record<string, unknown>>;
|
package/src/ci/trace-bundle.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// - a root span `invoke_workflow crysk.review` for the run;
|
|
9
9
|
// - a child `invoke_agent <step>` per pipeline step;
|
|
10
10
|
// - under it a `chat <model>` per attempt, carrying the model, provider, token
|
|
11
|
-
// usage (inclusive of cache and reasoning, as the conventions count it)
|
|
12
|
-
//
|
|
11
|
+
// usage (inclusive of cache and reasoning, as the conventions count it),
|
|
12
|
+
// so a backend sees each model call once;
|
|
13
13
|
// - under that an `execute_tool <tool>` per tool call the model made.
|
|
14
14
|
// Engine facts ride as `crysk.*` attributes with snake_case keys. Every leaf of
|
|
15
15
|
// each pipeline.json step lands on its step span (crysk.step.*), every leaf of
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
redactSessionDocument,
|
|
42
42
|
redactSessionText,
|
|
43
43
|
} from "../execution/claude-session-trace";
|
|
44
|
-
import { metadataOnlyFinding } from "./platform-report";
|
|
44
|
+
import { metadataOnlyFinding, stepRole } from "./platform-report";
|
|
45
45
|
import {
|
|
46
46
|
type ChatMessage,
|
|
47
47
|
type Conversation,
|
|
@@ -482,8 +482,8 @@ function sumKnown(...values: unknown[]): number | undefined {
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
// The engine's usage leaves are disjoint; the conventions count input with its
|
|
485
|
-
// cache and output with its reasoning.
|
|
486
|
-
//
|
|
485
|
+
// cache and output with its reasoning. No price is attached: the platform
|
|
486
|
+
// prices the run from the usage facts.
|
|
487
487
|
function writeUsage(attrs: Attributes, usage: Record<string, unknown>): void {
|
|
488
488
|
const tokens = isRecord(usage.tokens) ? usage.tokens : {};
|
|
489
489
|
attrs.number(
|
|
@@ -511,29 +511,9 @@ function writeUsage(attrs: Attributes, usage: Record<string, unknown>): void {
|
|
|
511
511
|
tokens.inputCacheWrite,
|
|
512
512
|
);
|
|
513
513
|
attrs.number("gen_ai.usage.reasoning.output_tokens", tokens.outputReasoning);
|
|
514
|
-
const listCost =
|
|
515
|
-
usage.billingMode === "subscription"
|
|
516
|
-
? num(usage.notionalCostUsd)
|
|
517
|
-
: usage.billingMode === "metered"
|
|
518
|
-
? num(usage.cashCostUsd)
|
|
519
|
-
: undefined;
|
|
520
|
-
attrs.number("gen_ai.usage.cost", listCost);
|
|
521
514
|
attrs.flatten("crysk.usage", usage);
|
|
522
515
|
}
|
|
523
516
|
|
|
524
|
-
function stepRole(pipeline: unknown, name: string): string {
|
|
525
|
-
const plan =
|
|
526
|
-
isRecord(pipeline) && isRecord(pipeline.route_plan)
|
|
527
|
-
? pipeline.route_plan
|
|
528
|
-
: undefined;
|
|
529
|
-
const planned = Array.isArray(plan?.steps)
|
|
530
|
-
? plan.steps.filter(isRecord).find((step) => step.stepKey === name)
|
|
531
|
-
: undefined;
|
|
532
|
-
const role = str(planned?.role);
|
|
533
|
-
if (role !== undefined) return role;
|
|
534
|
-
return name.split(/[-.]/)[0] ?? name;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
517
|
function pipelineSteps(pipeline: unknown): Record<string, unknown>[] {
|
|
538
518
|
return isRecord(pipeline) && Array.isArray(pipeline.steps)
|
|
539
519
|
? pipeline.steps.filter(isRecord)
|
|
@@ -922,7 +902,12 @@ function build(
|
|
|
922
902
|
attrs.text("gen_ai.operation.name", "invoke_agent");
|
|
923
903
|
attrs.text("gen_ai.agent.name", step.name);
|
|
924
904
|
attrs.text("crysk.step.role", stepRole(run.pipeline, step.name));
|
|
925
|
-
if (meta !== undefined)
|
|
905
|
+
if (meta !== undefined) {
|
|
906
|
+
// `usage_facts` (one tuple per model request) travels in the run report to the
|
|
907
|
+
// platform; flattened here it would be hundreds of attributes per attempt.
|
|
908
|
+
const { usage_facts: _usageFacts, ...stepAttrs } = meta;
|
|
909
|
+
attrs.flatten("crysk.step", stepAttrs);
|
|
910
|
+
}
|
|
926
911
|
attrs.text("crysk.step.name", step.name);
|
|
927
912
|
attrs.text("crysk.model.effort", str(meta?.effort));
|
|
928
913
|
const status = str(meta?.status);
|
|
@@ -1098,7 +1083,6 @@ function writeTurnUsage(attrs: Attributes, turn: Turn): void {
|
|
|
1098
1083
|
turn.cacheWriteTokens,
|
|
1099
1084
|
);
|
|
1100
1085
|
attrs.number("gen_ai.usage.reasoning.output_tokens", turn.reasoningTokens);
|
|
1101
|
-
attrs.number("gen_ai.usage.cost", turn.costUsd);
|
|
1102
1086
|
}
|
|
1103
1087
|
|
|
1104
1088
|
function toolSpan(
|
|
@@ -46,8 +46,8 @@ export interface ToolCall {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// One model call of an agent loop (#511): an OpenCode attempt is dozens of
|
|
49
|
-
// these, one assistant message each, and each message records its own times
|
|
50
|
-
//
|
|
49
|
+
// these, one assistant message each, and each message records its own times
|
|
50
|
+
// and tokens. Token counts are OpenCode's disjoint leaves.
|
|
51
51
|
export interface Turn {
|
|
52
52
|
startMs?: number;
|
|
53
53
|
endMs?: number;
|
|
@@ -60,7 +60,6 @@ export interface Turn {
|
|
|
60
60
|
reasoningTokens?: number;
|
|
61
61
|
cacheReadTokens?: number;
|
|
62
62
|
cacheWriteTokens?: number;
|
|
63
|
-
costUsd?: number;
|
|
64
63
|
// What the turn answered. Content only: withoutContent drops it.
|
|
65
64
|
message?: ChatMessage;
|
|
66
65
|
}
|
|
@@ -454,8 +453,8 @@ function count(value: unknown): number | undefined {
|
|
|
454
453
|
: undefined;
|
|
455
454
|
}
|
|
456
455
|
|
|
457
|
-
// An assistant message's own record: `time.created`/`completed` in epoch ms
|
|
458
|
-
// `tokens` {input, output, reasoning, cache: {read, write}}
|
|
456
|
+
// An assistant message's own record: `time.created`/`completed` in epoch ms
|
|
457
|
+
// and `tokens` {input, output, reasoning, cache: {read, write}}.
|
|
459
458
|
// A message still being written has no `completed` time.
|
|
460
459
|
function openCodeTurn(info: Record<string, unknown>): Turn {
|
|
461
460
|
const time = isRecord(info.time) ? info.time : {};
|
|
@@ -471,7 +470,6 @@ function openCodeTurn(info: Record<string, unknown>): Turn {
|
|
|
471
470
|
["reasoningTokens", count(tokens.reasoning)],
|
|
472
471
|
["cacheReadTokens", count(cache.read)],
|
|
473
472
|
["cacheWriteTokens", count(cache.write)],
|
|
474
|
-
["costUsd", count(info.cost)],
|
|
475
473
|
];
|
|
476
474
|
const turn: Record<string, unknown> = {};
|
|
477
475
|
for (const [key, value] of leaves) if (value !== undefined) turn[key] = value;
|
package/src/ci/trigger.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// The consumer workflow calls the action on `pull_request` and
|
|
5
5
|
// `issue_comment`, and its job `if:` already drops fork pull requests and
|
|
6
|
-
// comments that do not start with `/crysk review
|
|
6
|
+
// comments that do not start with `/crysk review`. This module decides it
|
|
7
7
|
// all again anyway. A workflow is a file the consumer owns and edits, so a
|
|
8
8
|
// prefix filter there is a cost saving, never the security boundary: the
|
|
9
9
|
// command match, the commenter's permission and the credential check all
|
|
@@ -47,8 +47,7 @@ import {
|
|
|
47
47
|
parseCryskSecrets,
|
|
48
48
|
} from "./crysk-secrets";
|
|
49
49
|
|
|
50
|
-
// Commands are written in the
|
|
51
|
-
// also accept the legacy `/pr-hero` spelling for one version.
|
|
50
|
+
// Commands are written in the `/crysk` form, the only one the matchers in ../brand accept.
|
|
52
51
|
export const REVIEW_COMMAND = "/crysk review";
|
|
53
52
|
export const REVIEW_FULL_COMMAND = "/crysk review --full";
|
|
54
53
|
// The review, plus the CI adjudicator's rulings on pending dismissals (docs/github-actions.md,
|
|
@@ -257,8 +256,7 @@ export function parseReviewCommand(
|
|
|
257
256
|
|
|
258
257
|
// A comment that asks for something. Both kinds are permission-gated, so the
|
|
259
258
|
// comment kind (and not the command) decides whether the lookup runs.
|
|
260
|
-
// `text` is what the commenter typed (trimmed)
|
|
261
|
-
// command echoes the spelling they used, `/crysk` or the legacy `/pr-hero`.
|
|
259
|
+
// `text` is what the commenter typed (trimmed).
|
|
262
260
|
type CommentCommand =
|
|
263
261
|
| { kind: "review"; full: boolean; adjudicate: boolean; text: string }
|
|
264
262
|
| { kind: "override"; text: string };
|
package/src/cli.ts
CHANGED
|
@@ -72,6 +72,7 @@ import {
|
|
|
72
72
|
HELP_TEXT,
|
|
73
73
|
parseArgs,
|
|
74
74
|
preflightAgentsDir,
|
|
75
|
+
removedFlagWarnings,
|
|
75
76
|
resolveAgentsDir,
|
|
76
77
|
} from "#review/preflight";
|
|
77
78
|
import { CliError, CliUsageError } from "./errors";
|
|
@@ -80,7 +81,6 @@ export { createRunDir, preflightAgentsDir, resolveAgentsDir };
|
|
|
80
81
|
|
|
81
82
|
import {
|
|
82
83
|
type ProductionRoutePlanResult,
|
|
83
|
-
pipelineScoutInput,
|
|
84
84
|
pipelineSummarizerInput,
|
|
85
85
|
resolveProductionRoutePlanAtConfirm,
|
|
86
86
|
resolveRoutePlanAtConfirm,
|
|
@@ -88,7 +88,6 @@ import {
|
|
|
88
88
|
|
|
89
89
|
export {
|
|
90
90
|
type ProductionRoutePlanResult,
|
|
91
|
-
pipelineScoutInput,
|
|
92
91
|
pipelineSummarizerInput,
|
|
93
92
|
resolveProductionRoutePlanAtConfirm,
|
|
94
93
|
resolveRoutePlanAtConfirm,
|
|
@@ -100,7 +99,6 @@ import { gcCommand } from "#store/gc";
|
|
|
100
99
|
import {
|
|
101
100
|
type ConfigProvenance,
|
|
102
101
|
configProvenanceOf,
|
|
103
|
-
dryRunHunterCount,
|
|
104
102
|
type PlanContext,
|
|
105
103
|
type PrPlanContext,
|
|
106
104
|
planDetails,
|
|
@@ -112,7 +110,6 @@ import {
|
|
|
112
110
|
export {
|
|
113
111
|
type ConfigProvenance,
|
|
114
112
|
configProvenanceOf,
|
|
115
|
-
dryRunHunterCount,
|
|
116
113
|
type PlanContext,
|
|
117
114
|
type PrPlanContext,
|
|
118
115
|
planDetails,
|
|
@@ -166,7 +163,6 @@ export async function main(argv: string[]): Promise<number> {
|
|
|
166
163
|
repo: ".",
|
|
167
164
|
head: DEFAULT_HEAD_REF,
|
|
168
165
|
hopBudget: DEFAULT_HOP_BUDGET,
|
|
169
|
-
scout: false,
|
|
170
166
|
full: false,
|
|
171
167
|
dryRun: false,
|
|
172
168
|
yes: false,
|
|
@@ -193,6 +189,11 @@ export async function main(argv: string[]): Promise<number> {
|
|
|
193
189
|
await reportFatalCiErrorIfInJobStep(error);
|
|
194
190
|
return 2;
|
|
195
191
|
}
|
|
192
|
+
// Flags of the removed scout stage are accepted and do nothing; each says so
|
|
193
|
+
// once, whatever the command, before anything runs.
|
|
194
|
+
for (const line of removedFlagWarnings(parsed.options)) {
|
|
195
|
+
log(`warning: ${line}`);
|
|
196
|
+
}
|
|
196
197
|
if (parsed.command === "help") {
|
|
197
198
|
log(HELP_TEXT);
|
|
198
199
|
return 0;
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// for them when an agent runs it. The answers are plain data (CiSetupChoices);
|
|
3
3
|
// src/ci/review-levels.ts turns them into config keys and workflow inputs.
|
|
4
4
|
|
|
5
|
-
import { CI_DEFAULT_METERED_BUDGET_USD } from "#ci/gates";
|
|
6
5
|
import {
|
|
7
6
|
DEFAULT_CI_ADVISORY_WEIGHT,
|
|
8
7
|
DEFAULT_CI_BLOCKING_WEIGHT,
|
|
9
8
|
} from "#ci/review-admission";
|
|
10
9
|
import {
|
|
11
10
|
type AdvancedChoices,
|
|
12
|
-
type Billing,
|
|
13
11
|
type CiSetupChoices,
|
|
14
12
|
type CurrentSettings,
|
|
15
13
|
DEFAULT_MAX_CHANGED_LINES,
|
|
@@ -46,31 +44,18 @@ export interface SetupPrompter {
|
|
|
46
44
|
export function choicesFromFlags(
|
|
47
45
|
options: Pick<
|
|
48
46
|
CliOptions,
|
|
49
|
-
| "
|
|
50
|
-
| "ciMode"
|
|
51
|
-
| "billing"
|
|
52
|
-
| "budgetUsd"
|
|
53
|
-
| "maxChangedLines"
|
|
54
|
-
| "maxChangedFiles"
|
|
47
|
+
"reviewLevel" | "ciMode" | "maxChangedLines" | "maxChangedFiles"
|
|
55
48
|
>,
|
|
56
49
|
): CiSetupChoices | undefined {
|
|
57
50
|
const given =
|
|
58
51
|
options.reviewLevel !== undefined ||
|
|
59
52
|
options.ciMode !== undefined ||
|
|
60
|
-
options.billing !== undefined ||
|
|
61
|
-
options.budgetUsd !== undefined ||
|
|
62
53
|
options.maxChangedLines !== undefined ||
|
|
63
54
|
options.maxChangedFiles !== undefined;
|
|
64
55
|
if (!given) return undefined;
|
|
65
|
-
const billing: Billing | undefined =
|
|
66
|
-
options.billing ?? (options.budgetUsd !== undefined ? "api" : undefined);
|
|
67
56
|
return {
|
|
68
57
|
level: options.reviewLevel ?? DEFAULT_REVIEW_LEVEL,
|
|
69
58
|
mode: options.ciMode ?? "gate",
|
|
70
|
-
...(billing === undefined ? {} : { billing }),
|
|
71
|
-
...(options.budgetUsd === undefined
|
|
72
|
-
? {}
|
|
73
|
-
: { budgetUsd: options.budgetUsd }),
|
|
74
59
|
maxChangedLines: options.maxChangedLines ?? DEFAULT_MAX_CHANGED_LINES,
|
|
75
60
|
advanced:
|
|
76
61
|
options.maxChangedFiles === undefined
|
|
@@ -82,7 +67,6 @@ export function choicesFromFlags(
|
|
|
82
67
|
level: options.reviewLevel !== undefined,
|
|
83
68
|
maxChangedLines: options.maxChangedLines !== undefined,
|
|
84
69
|
mode: options.ciMode !== undefined,
|
|
85
|
-
billing: billing !== undefined,
|
|
86
70
|
},
|
|
87
71
|
};
|
|
88
72
|
}
|
|
@@ -139,7 +123,6 @@ export async function askChoices(
|
|
|
139
123
|
level: true,
|
|
140
124
|
maxChangedLines: true,
|
|
141
125
|
mode: true,
|
|
142
|
-
billing: true,
|
|
143
126
|
};
|
|
144
127
|
const cfg = current.config;
|
|
145
128
|
|
|
@@ -186,45 +169,9 @@ export async function askChoices(
|
|
|
186
169
|
current.workflow.mode ?? "gate",
|
|
187
170
|
);
|
|
188
171
|
|
|
189
|
-
choices.billing = await prompter.choose<Billing>(
|
|
190
|
-
"How will CI pay for reviews?",
|
|
191
|
-
[
|
|
192
|
-
{
|
|
193
|
-
value: "subscription",
|
|
194
|
-
label: "Claude subscription",
|
|
195
|
-
description:
|
|
196
|
-
"CRYSK_CLAUDE_OAUTH_TOKEN. Reviews spend quota, not dollars.",
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
value: "api",
|
|
200
|
-
label: "API key",
|
|
201
|
-
description:
|
|
202
|
-
"CRYSK_CLAUDE_API_KEY or an OpenCode provider's CRYSK_OPENCODE_* key. Reviews are billed per token.",
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
current.workflow.budgetUsd === undefined ? "subscription" : "api",
|
|
206
|
-
);
|
|
207
|
-
if (choices.billing === "subscription") {
|
|
208
|
-
say(
|
|
209
|
-
" No spend ceiling, and nothing to write: a subscription review spends quota, not dollars, and CI applies no ceiling while the run uses CRYSK_CLAUDE_OAUTH_TOKEN and no OpenCode model with its CRYSK_OPENCODE_* secret. A run on CRYSK_CLAUDE_API_KEY (no subscription set, or api_key first in credentials.claude) or an OpenCode model with its CRYSK_OPENCODE_* secret brings back the $10 ceiling.",
|
|
210
|
-
);
|
|
211
|
-
} else {
|
|
212
|
-
choices.budgetUsd = await askValue(
|
|
213
|
-
prompter,
|
|
214
|
-
"Spend ceiling per review in USD (0 = none)",
|
|
215
|
-
current.workflow.budgetUsd ?? String(CI_DEFAULT_METERED_BUDGET_USD),
|
|
216
|
-
(raw) => {
|
|
217
|
-
const n = Number(raw);
|
|
218
|
-
return raw !== "" && Number.isFinite(n) && n >= 0 ? n : undefined;
|
|
219
|
-
},
|
|
220
|
-
say,
|
|
221
|
-
"Enter a number, 0 or more, for example 10 or 7.5.",
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
172
|
say();
|
|
226
173
|
say(
|
|
227
|
-
"Size threshold: a PR with more changed lines than this is skipped, not reviewed. It applies on any
|
|
174
|
+
"Size threshold: a PR with more changed lines than this is skipped, not reviewed. It applies on any route: without it a subscription reviews any size.",
|
|
228
175
|
);
|
|
229
176
|
choices.maxChangedLines = await askValue(
|
|
230
177
|
prompter,
|
package/src/commands/ci-setup.ts
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
opencodeSecretToken,
|
|
8
8
|
} from "#ci/crysk-secrets";
|
|
9
9
|
import {
|
|
10
|
-
budgetInput,
|
|
11
10
|
type CiSetupChoices,
|
|
12
11
|
type CurrentSettings,
|
|
13
12
|
configPlan,
|
|
@@ -302,15 +301,6 @@ async function resolveChoices(
|
|
|
302
301
|
if (!choices.chosen.mode && current.workflow.mode !== undefined) {
|
|
303
302
|
choices.mode = current.workflow.mode;
|
|
304
303
|
}
|
|
305
|
-
const oldBudget = Number(current.workflow.budgetUsd);
|
|
306
|
-
if (
|
|
307
|
-
!choices.chosen.billing &&
|
|
308
|
-
current.workflow.budgetUsd !== undefined &&
|
|
309
|
-
Number.isFinite(oldBudget)
|
|
310
|
-
) {
|
|
311
|
-
choices.billing = "api";
|
|
312
|
-
choices.budgetUsd = oldBudget;
|
|
313
|
-
}
|
|
314
304
|
return choices;
|
|
315
305
|
}
|
|
316
306
|
|
|
@@ -380,7 +370,6 @@ export async function ciSetupCommand(
|
|
|
380
370
|
|
|
381
371
|
const current = await readCurrentSettings(repoRoot, target);
|
|
382
372
|
const choices = await resolveChoices(options, deps, current);
|
|
383
|
-
const budget = budgetInput(choices);
|
|
384
373
|
// The config first: it is the write that can refuse (an invalid existing
|
|
385
374
|
// file, a value the review parser rejects), and refusing before the workflow
|
|
386
375
|
// is written leaves the repository as it was.
|
|
@@ -403,7 +392,6 @@ export async function ciSetupCommand(
|
|
|
403
392
|
force: options.force,
|
|
404
393
|
template: {
|
|
405
394
|
mode: choices.mode,
|
|
406
|
-
...(budget === undefined ? {} : { budgetUsd: budget }),
|
|
407
395
|
// Size inputs a person set by hand in the old workflow. setup never
|
|
408
396
|
// writes them (it writes the config keys), so a refresh carries them
|
|
409
397
|
// over; the action gives a workflow input precedence over the config.
|
|
@@ -467,21 +455,9 @@ export async function ciSetupCommand(
|
|
|
467
455
|
log(`${next()} Commit ${workflowRelative} and ${repoDirName}/config.json`);
|
|
468
456
|
// The CRYSK_* names the scaffolded workflow reads (S8); gh asks for the value.
|
|
469
457
|
log(
|
|
470
|
-
`${next()} Add a repository secret:
|
|
471
|
-
choices.billing === "subscription"
|
|
472
|
-
? "CRYSK_CLAUDE_OAUTH_TOKEN (create the value with `claude setup-token`)"
|
|
473
|
-
: choices.billing === "api"
|
|
474
|
-
? "CRYSK_CLAUDE_API_KEY (or the CRYSK_OPENCODE_* key of the OpenCode provider your models use)"
|
|
475
|
-
: "CRYSK_CLAUDE_OAUTH_TOKEN (create the value with `claude setup-token`) or CRYSK_CLAUDE_API_KEY"
|
|
476
|
-
}`,
|
|
477
|
-
);
|
|
478
|
-
log(
|
|
479
|
-
` $ gh secret set ${
|
|
480
|
-
choices.billing === "api"
|
|
481
|
-
? "CRYSK_CLAUDE_API_KEY"
|
|
482
|
-
: "CRYSK_CLAUDE_OAUTH_TOKEN"
|
|
483
|
-
}`,
|
|
458
|
+
`${next()} Add a repository secret: CRYSK_CLAUDE_OAUTH_TOKEN (create the value with \`claude setup-token\`) or CRYSK_CLAUDE_API_KEY`,
|
|
484
459
|
);
|
|
460
|
+
log(" $ gh secret set CRYSK_CLAUDE_OAUTH_TOKEN");
|
|
485
461
|
if (variables.openCodeTokens.length > 0) {
|
|
486
462
|
log(
|
|
487
463
|
`${next()} Add the API key of each OpenCode provider your models in ${variables.configLabel} use:`,
|