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
|
@@ -13,26 +13,26 @@ Load when the user asks to:
|
|
|
13
13
|
- Add Crysk to GitHub Actions CI, scaffold `.github/workflows/crysk.yml`, or configure secrets. No local install is needed: the workflow file is the whole install.
|
|
14
14
|
- Configure the models per role in CI, or **OpenCode** (`CRYSK_MODELS`, `CRYSK_OPENCODE_*` secrets, DeepSeek, mixed Claude+OpenCode, fallbacks).
|
|
15
15
|
- Move a workflow off the removed inputs (`CRYSK-INPUT-REMOVED`: `claude-token`, `anthropic-api-key`, `opencode-auth` with the `OPENCODE_AUTH_JSON` secret, `routing` with the `CRYSK_ROUTING` variable).
|
|
16
|
-
- Tune CI
|
|
17
|
-
- Retrigger a skipped CI review (size, admission, or
|
|
16
|
+
- Tune CI re-review / admission policy and the size gate. Dollar limits are not a workflow or repo setting: the Crysk platform owns them (dashboard, Review > Limits).
|
|
17
|
+
- Retrigger a skipped CI review (size, admission, or platform cost limit) without running the review locally.
|
|
18
18
|
- Reduce review noise: fewer comments (`post_min_severity`) or fewer blocking findings that are real but improbable (`materiality_gate`).
|
|
19
19
|
|
|
20
20
|
## Hard Rules
|
|
21
21
|
|
|
22
22
|
- **Zero secret leakage:** NEVER print, `cat`, commit, or log API keys, tokens, or an OpenCode `auth.json` record. Reference `${{ secrets.* }}` names only. Inspect `auth.json` **keys and `type` only**.
|
|
23
23
|
- **One `CRYSK_*` secret per credential, nothing else:** `CRYSK_CLAUDE_OAUTH_TOKEN` (subscription), `CRYSK_CLAUDE_API_KEY`, `CRYSK_OPENCODE_<P>_API_KEY` per OpenCode provider, `CRYSK_OPENCODE_OPENAI_OAUTH` for an OpenAI subscription. The workflow names each one in its `crysk-secrets` block, never `toJSON(secrets)`. The old `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_API_KEY` and `OPENCODE_AUTH_JSON` secrets and the `CRYSK_ROUTING` variable are read by nothing. Models per role go in the public variable `CRYSK_MODELS` (no credentials in it), the Claude order in `CRYSK_CREDENTIALS`, the OpenCode providers in `CRYSK_OPENCODE_PROVIDERS`.
|
|
24
|
-
- **No install needed:** run every Crysk command as `npx -y crysk <command>` (Node is enough; the package brings its own Bun). A global `crysk` on PATH is the same command. CI itself needs no local CLI at all: the workflow runs the action. `npx -y crysk skills install` installs the Crysk, triage, and CI-setup skills into every detected coding agent, with no TTY and no MCP or launchd registration (neither is needed for the CI loop, and npx's temporary cache refuses them).
|
|
25
|
-
- **Deterministic scaffolding:** Run `npx -y crysk setup --ci` (or `npx -y crysk ci init`) with the interview's flags. It writes the one workflow file, `.github/workflows/crysk.yml` (a repo that already has `pr-hero.yml` keeps it: `--force` rewrites it in place, and setup refuses to add a second file beside it). Do not fabricate it from memory. Fallback: copy `assets/workflow.yml`. Never scaffold a `pr-hero-force.yml`; it is retired.
|
|
24
|
+
- **No install needed:** run every Crysk command as `npx -y crysk@0.8.0 <command>` (Node is enough; the package brings its own Bun). A global `crysk` on PATH is the same command. CI itself needs no local CLI at all: the workflow runs the action. `npx -y crysk@0.8.0 skills install` installs the Crysk, triage, and CI-setup skills into every detected coding agent, with no TTY and no MCP or launchd registration (neither is needed for the CI loop, and npx's temporary cache refuses them).
|
|
25
|
+
- **Deterministic scaffolding:** Run `npx -y crysk@0.8.0 setup --ci` (or `npx -y crysk@0.8.0 ci init`) with the interview's flags. It writes the one workflow file, `.github/workflows/crysk.yml` (a repo that already has `pr-hero.yml` keeps it: `--force` rewrites it in place, and setup refuses to add a second file beside it). Do not fabricate it from memory. Fallback: copy `assets/workflow.yml`. Never scaffold a `pr-hero-force.yml`; it is retired.
|
|
26
26
|
- **`fetch-depth: 0` is mandatory** on `actions/checkout@v4`.
|
|
27
|
-
- **Gate mode:** the `crysk` commit status is the required check (the legacy `pr-hero` status is no longer posted). The scaffold writes `mode: gate` explicitly: blocking findings, a size or
|
|
27
|
+
- **Gate mode:** the `crysk` commit status is the required check (the legacy `pr-hero` status is no longer posted). The scaffold writes `mode: gate` explicitly: blocking findings, a size or platform-limit skip, and a crash set it red. Every review rule that skips a push (low-risk delta, once per PR, `/crysk stop`, the attempt budget used up, `manual_only`) carries the last verdict; answered blocking findings turn a carried red green, marked unverified. Under the attempt budget used up or `manual_only`, that green is held `pending` instead, so a push past the budget or under `manual_only` never turns green without a `/crysk review` or a `/crysk override`. `mode: advisory` keeps it green for a finished review. The job's exit code stays `0` on findings either way, so do not gate on the job.
|
|
28
28
|
- **Required permissions:** `contents: read`, `pull-requests: write`, `issues: write`, `statuses: write`, **`checks: write`**, **`actions: read`** (the admission gate lists past runs; a private repo 403s without it). Template in `assets/workflow.yml` includes all six.
|
|
29
|
-
- **Retrigger is a PR comment: `gh pr comment <n> --body "/crysk review"`.** GitHub Actions runs the review on the runner with `--force`. The comment must be exactly `/crysk review` (or `/crysk review --full`; `/pr-hero
|
|
29
|
+
- **Retrigger is a PR comment: `gh pr comment <n> --body "/crysk review"`.** GitHub Actions runs the review on the runner with `--force`. The comment must be exactly `/crysk review` (or `/crysk review --full`; see the `/crysk` vs `/pr-hero` bullet for a workflow scaffolded before the rename), and its author needs write access; the action refuses anyone else. Do not run `crysk review --force` locally when the review should happen in CI. `gh run rerun` on a skipped run re-evaluates the gates and does not force. In this repo a comment run checks out the PR head commit before `uses: ./`, so it runs the PR's own engine, not the default branch's.
|
|
30
30
|
- **`/crysk recheck` re-reviews the head and asks the CI adjudicator to rule on pending dismissals.** It is `/crysk review` plus `--adjudicate`, with the same permission check and reaction; refused on fork pull requests. See `docs/github-actions.md` ("Rechecking a dismissal").
|
|
31
31
|
- **`/crysk stop` stops automatic reviews on the PR.** Post it before a push that should not be reviewed: CI admission skips every later automatic review, carrying the last verdict, until a `/crysk review` or `/crysk recheck` comment. It counts only from a user with write access (checked at admission), starts no run, and never turns the gate green. See `docs/github-actions.md` ("Stopping automatic reviews").
|
|
32
32
|
- **`--force` never widens discovery; `--full` does.** When a prior review of the same head was hollow or wrong and re-runs report "No changes to discover", comment `/crysk review --full`. It passes `--full`, which re-discovers the whole PR range.
|
|
33
33
|
- **When the comment trigger takes effect:** GitHub reads a comment-triggered workflow from the **default branch** (for this repo, `main`, not `dev`), so `/crysk review` works only once the workflow file (`crysk.yml`, or `pr-hero.yml` in a repo set up before the rename) with its `issue_comment` trigger is merged there; a user repo also needs an action release that handles the comment, through the `@v0` it pins.
|
|
34
|
-
- **`/crysk` vs `/pr-hero`:** the commands are `/crysk review`, `/crysk recheck`, `/crysk override` and `/crysk stop`; the
|
|
35
|
-
- **Legacy scaffolds:** a `pr-hero.yml` scaffolded before the comment trigger has no `issue_comment` listener, so a comment does nothing. There, use `gh workflow run pr-hero-force.yml -f pr=<n>` (add `-f full=true` to re-discover), or re-scaffold with `npx -y crysk ci init --force`, which leaves `pr-hero-force.yml` in place.
|
|
34
|
+
- **`/crysk` vs `/pr-hero`:** the commands are `/crysk review`, `/crysk recheck`, `/crysk override` and `/crysk stop`; the `/pr-hero …` spelling is no longer a command. A `pr-hero.yml` scaffolded before the rename filters only `/pr-hero …`, so no comment starts anything there: re-run `npx -y crysk@0.8.0 ci init --force` to accept `/crysk …`, which also moves the workflow to the `CRYSK_*` secrets.
|
|
35
|
+
- **Legacy scaffolds:** a `pr-hero.yml` scaffolded before the comment trigger has no `issue_comment` listener, so a comment does nothing. There, use `gh workflow run pr-hero-force.yml -f pr=<n>` (add `-f full=true` to re-discover), or re-scaffold with `npx -y crysk@0.8.0 ci init --force`, which leaves `pr-hero-force.yml` in place.
|
|
36
36
|
- **Minimum action version:** this workflow listens to comments, and only an action release that ships the comment handling checks the command and the commenter's write access. An older action reviews on ANY comment starting with `/crysk review`, from anyone who can comment. Never pair this workflow with an older action; a pinned tag or sha must be at or after that release.
|
|
37
37
|
- **Older heads (this repo):** a comment run loads the PR head's own `action.yml`, so on a head from before the comment handling it reviews without reading the comment (no force, no `--full`); merge or rebase the PR onto a base that has it first.
|
|
38
38
|
- **Trust (this repo):** a comment run runs the PR head's code, including its `bun install`, with the workflow's secrets, so write access is checked twice: by the workflow's pre-checkout step (fail closed, before any head code runs) and again by the head's `action.yml`.
|
|
@@ -50,28 +50,28 @@ Load when the user asks to:
|
|
|
50
50
|
| Credential: Claude | **`CRYSK_CLAUDE_OAUTH_TOKEN`** — subscription (`claude setup-token` only, NOT keychain). **`CRYSK_CLAUDE_API_KEY`** — pay-as-you-go. Both set: the subscription runs unless `CRYSK_CREDENTIALS` is `{"claude": ["api_key", "subscription"]}`. |
|
|
51
51
|
| Credential: OpenCode | Read `references/opencode-ci.md`. One `CRYSK_OPENCODE_<P>_API_KEY` per provider + `CRYSK_MODELS` + `CRYSK_OPENCODE_PROVIDERS`. Any `CRYSK_*` credential counts; with none, the run fails red with the `gh secret set` commands. |
|
|
52
52
|
| openai in CI | `CRYSK_OPENCODE_OPENAI_API_KEY` runs metered; `CRYSK_OPENCODE_OPENAI_OAUTH` (base64 of the `openai` record of OpenCode's `auth.json`) is the ChatGPT subscription and wins when both are set. `_OAUTH` works for openai only. |
|
|
53
|
-
| Workflow red with `CRYSK-INPUT-REMOVED` | It still passes `claude-token`, `anthropic-api-key`, `opencode-auth` or `routing`. `npx -y crysk ci init --force`, then set the `CRYSK_*` secrets and variables it prints. |
|
|
54
|
-
| Different models per step | `CRYSK_MODELS` maps roles to lists: `default`, `hunter.<key>`, `refuter`, `consolidate`, `
|
|
53
|
+
| Workflow red with `CRYSK-INPUT-REMOVED` | It still passes `claude-token`, `anthropic-api-key`, `opencode-auth` or `routing`. `npx -y crysk@0.8.0 ci init --force`, then set the `CRYSK_*` secrets and variables it prints. |
|
|
54
|
+
| Different models per step | `CRYSK_MODELS` maps roles to lists: `default`, `hunter.<key>`, `refuter`, `consolidate`, `summary`, `judge`. Any role left on a `claude:` model needs a Claude secret; OpenCode-only = every role on OpenCode, e.g. `{"default": ["opencode:deepseek/deepseek-v4-flash"]}` (`references/opencode-ci.md`). |
|
|
55
55
|
| Several OpenCode providers in one run | Supported: up to 5 providers through the workflow's slots, each model on its own provider's secret, as primary or fallback. |
|
|
56
56
|
| OpenCode CLI pin | Action installs **1.18.30** iff the setup step wrote an OpenCode auth file OR the models in effect name `opencode:`. Never `latest`. |
|
|
57
57
|
| Fork PRs | Their pushes skip (no secrets). A user with write access comments `/crysk review`, and that run (base context, with secrets) reviews the fork head. Review `if` never reads `secrets`; the action checks for a `CRYSK_*` credential in `crysk-secrets` (or a login file already on the runner). |
|
|
58
|
-
|
|
|
58
|
+
| Size and cost gates | Size defaults: `max-changed-lines: 4000` and `max-changed-files: 50` on metered routes only (the run chose `CRYSK_CLAUDE_API_KEY`, **or** an OpenCode auth file was built); a Claude subscription route has no size limit unless the workflow or `.crysk/config.json` sets one. Dollar limits are not an engine default and not a workflow input: the Crysk platform owns the per-review and per-month limits (dashboard, Review > Limits), the engine only skips an API-key run (`skipped-budget`, comment `/crysk review` to force) when the platform's estimate is over them, and a subscription or free run is never skipped for cost. `budget-usd`, `--budget-usd` and `--billing` are retired: accepted, no effect, one warning; remove them. |
|
|
59
59
|
| Existing workflow | `setup --ci` skips; ask before `--force` |
|
|
60
60
|
| First-time admission | Recommend `ci_admission_observe_only: true` — `references/ci-admission.md` |
|
|
61
|
-
| User wants max CI spend | Lower `ci_max_attempts` and/or raise `ci_rereview_min_score
|
|
61
|
+
| User wants max CI spend | Lower `ci_max_attempts` and/or raise `ci_rereview_min_score`; for a dollar cap, point them at the platform dashboard (Review > Limits), which applies to API-key runs |
|
|
62
62
|
| Custom bot posts findings | Add login to `ci_trusted_actors` |
|
|
63
63
|
| Too many advisory comments on PRs | Raise the posting floor: `post_min_severity: "blocking"` in `.crysk/config.json` posts only blocking findings (`"warning"`, the recommended floor setup writes, hides advisory suggestions only). Blocking findings always post; the gate is unchanged. |
|
|
64
|
-
| Blocking findings that are real but improbable keep PRs red ("an edge case that never happens") | Offer `materiality_gate: true` in `.crysk/config.json` (opt-in, off by default). An isolated judge checks each blocking finding against Crysk's posting policy; one judged not material under normal use posts as advisory and does not block. Security, credential and data-loss findings are never demoted, and any judge failure keeps the finding blocking. Cost: one sonnet call per blocking finding (about 1 per PR, roughly
|
|
64
|
+
| Blocking findings that are real but improbable keep PRs red ("an edge case that never happens") | Offer `materiality_gate: true` in `.crysk/config.json` (opt-in, off by default). An isolated judge checks each blocking finding against Crysk's posting policy; one judged not material under normal use posts as advisory and does not block. Security, credential and data-loss findings are never demoted, and any judge failure keeps the finding blocking. Cost: one sonnet call per blocking finding (about 1 per PR, roughly +10 s per review; the platform shows what it cost). Pair it with `post_min_severity: "blocking"` to hide the demoted ones entirely. |
|
|
65
65
|
| `materiality_gate` is on but nothing is ever demoted | Read the `materiality` record in the run's `pipeline.json` (in the `crysk-run-*` artifact). `unsupported_route`: the judge runs only on `claude:sonnet-latest` or `claude:opus-latest`, so a `models.judge` in `CRYSK_MODELS` that lists neither stands it down; remove that role or list one of the two. `ceiling`: the pipeline ceiling left no room for one judge wave (about 9 minutes). `ran` with `judged: 0`: the run had no blocking finding the safety guard leaves unprotected, so there was nothing to judge. `skipped` on a re-review with no new commits to review is expected (the judge is left out when nothing new is hunted). `skipped` anywhere else means the key did not reach the run: the repo config must be on the PR's base branch (CI reads it from there) and a global config must not set it `false` (the key is capped). |
|
|
66
|
-
| CI skipped (size, admission, or
|
|
66
|
+
| CI skipped (size, admission, or platform cost limit) | `gh pr comment <n> --body "/crysk review"`. The review runs on GitHub Actions. Do not run `crysk review --force` locally for this. For a cost-limit skip, the comment names the limit; raising it is a dashboard setting (Review > Limits). Legacy scaffold (no `issue_comment` trigger): `gh workflow run pr-hero-force.yml -f pr=<n>`. |
|
|
67
67
|
| Gate is red with blocking findings the team accepts | `gh pr comment <n> --body "/crysk override"` (write access, same-repo PRs only, valid for that head only; a same-head `/crysk review` keeps it red). |
|
|
68
68
|
| Prior review of the same head was hollow or wrong; re-runs say "No changes to discover" | `gh pr comment <n> --body "/crysk review --full"`. A plain `/crysk review` keeps the narrowed discovery. |
|
|
69
|
-
| Gate red: `crysk: review partial (N of M hunters failed, set abc123) — /
|
|
70
|
-
| Gate red: `crysk: review partial again (N of M hunters failed, set abc123) — fix the failing route or /
|
|
71
|
-
| Gate error: `CRYSK-CANCELLED: not reviewed — /
|
|
69
|
+
| Gate red: `crysk: review partial (N of M hunters failed, set abc123) — /crysk review retries it` | Some hunters failed and nothing blocking was found. `gh pr comment <n> --body "/crysk review"`. If the same hunters fail every run, fix their route (model, credential) or override. |
|
|
70
|
+
| Gate red: `crysk: review partial again (N of M hunters failed, set abc123) — fix the failing route or /crysk override` | The previous review of this head was partial with the same hunters failing, so a retry already failed the same way. Fix the failing hunter's route (model, credential), or `gh pr comment <n> --body "/crysk override"`. `crysk status` answers `override-or-fix`. |
|
|
71
|
+
| Gate error: `CRYSK-CANCELLED: not reviewed — /crysk review reviews this head` | The review run was cancelled (a newer push, or by hand). Comment `/crysk review` to review the head. |
|
|
72
72
|
| `CRYSK-MODEL-UNAVAILABLE` (lead "Provider <name>:") | Every hunter's route names a model the provider does not serve. Fix the model id in `CRYSK_MODELS` (check `opencode models <provider>`). |
|
|
73
73
|
| `CRYSK-CRED-UNUSABLE` ("The route <provider>/<model> has no usable credential record") | No `CRYSK_OPENCODE_<P>_API_KEY` reached the run for that provider: set it, add its token to `CRYSK_OPENCODE_PROVIDERS`, or move that model elsewhere in `CRYSK_MODELS`. |
|
|
74
|
-
| `CRYSK-CONFIG-INVALID` naming the `models` or `credentials` input | `CRYSK_MODELS` or `CRYSK_CREDENTIALS` is not valid JSON or breaks a rule (the step's log names the entry). Check the same object locally under `models` / `credentials` in `~/.crysk/config.json` with `npx -y crysk config`, then set the variable again. |
|
|
74
|
+
| `CRYSK-CONFIG-INVALID` naming the `models` or `credentials` input | `CRYSK_MODELS` or `CRYSK_CREDENTIALS` is not valid JSON or breaks a rule (the step's log names the entry). Check the same object locally under `models` / `credentials` in `~/.crysk/config.json` with `npx -y crysk@0.8.0 config`, then set the variable again. |
|
|
75
75
|
| Blocking findings answered `dismissed`, gate still red | `gh pr comment <n> --body "/crysk recheck"`: the CI adjudicator rules on each dismissal (at most 5 per run). On `upheld`, comment `/crysk review`: that next review stops counting it. `deferred` / `misclassified` never clear the gate. |
|
|
76
76
|
| Gate error: `CRYSK-GOTCHAS-MISSING` ("the review instructions file (REVIEW.md or .crysk/gotchas.md) is empty or still the scaffold") | Write real facts into that file and delete the `human-attention-required` marker line (or delete the file to review with the default guidance), commit it to the default branch, then comment `/crysk review`. |
|
|
77
77
|
| Gate error: `CRYSK-HUNTERS-FAILED` (every hunter failed) | Check the route and credential first (the `CRYSK-CRED-UNUSABLE` and `CRYSK-MODEL-UNAVAILABLE` rows). Free OpenCode models fail intermittently: comment `/crysk review` to retry. |
|
|
@@ -87,39 +87,38 @@ Before step 4, ask the human these questions in their language. Use the native q
|
|
|
87
87
|
- **Thorough**: review every push, up to 4 automatic passes. Most coverage, most cost.
|
|
88
88
|
- **Manual**: nothing automatic after the first review; every re-review starts with `/crysk review`.
|
|
89
89
|
2. **Gate or advisory**: gate turns the `crysk` check red on blocking findings (require it in branch protection to block merges); advisory keeps it green.
|
|
90
|
-
3. **
|
|
91
|
-
|
|
92
|
-
- **API key** (`CRYSK_CLAUDE_API_KEY` or an OpenCode provider): ask for the spend ceiling per review in USD (default 10, `0` = none).
|
|
93
|
-
4. **Changed-lines threshold**: a PR with more changed lines is skipped, not reviewed. Ask on any billing (default 4000, `0` = no limit, only if they say so): unlike the budget it matters on a subscription too, where an unset threshold means no limit at all.
|
|
94
|
-
5. **Advanced settings**: name them, then ask whether to review them now. Each keeps a working default if skipped:
|
|
90
|
+
3. **Changed-lines threshold**: a PR with more changed lines is skipped, not reviewed (default 4000, `0` = no limit, only if they say so). It applies on any route: where nothing else is set, a Claude subscription route has no limit at all.
|
|
91
|
+
4. **Advanced settings**: name them, then ask whether to review them now. Each keeps a working default if skipped:
|
|
95
92
|
- score weights: blocking 2, advisory 1 (integers >= 1; `ci_blocking_weight`, `ci_advisory_weight`), and the score floor 4 (`ci_rereview_min_score`); used only by the risk-aware and thresholded policies;
|
|
96
93
|
- observe only (`ci_admission_observe_only`): log what the rules would skip, but review every push; good for one PR cycle;
|
|
97
94
|
- trusted actors (`ci_trusted_actors`): extra GitHub logins whose Crysk markers count;
|
|
98
95
|
- changed-files limit (`max_changed_files`): a PR touching more files is skipped; unset = none on a subscription, 50 on an API key;
|
|
99
96
|
- exclusions: patterns in `.cryskignore` (gitignore syntax) the review never reads;
|
|
100
97
|
- posting floor (`post_min_severity`): `suggestion` posts everything, `warning` (recommended, and what setup writes when the key is absent) hides advisory suggestions, `blocking` posts only blocking findings. Hidden findings are counted in the summary comment, and the gate is unchanged;
|
|
101
|
-
- materiality gate (`materiality_gate`, off unless they say yes): blocking findings that are real but not material under normal use are posted as advisory instead of blocking, judged by an isolated sonnet call per blocking finding against Crysk's posting policy; security, credential and data-loss findings are never demoted. Tell them the cost (about one call per PR,
|
|
98
|
+
- materiality gate (`materiality_gate`, off unless they say yes): blocking findings that are real but not material under normal use are posted as advisory instead of blocking, judged by an isolated sonnet call per blocking finding against Crysk's posting policy; security, credential and data-loss findings are never demoted. Tell them the cost (about one call per PR, +10 s; the platform dashboard shows what it cost), that it runs on Claude only (`claude:sonnet-latest`, or `claude:opus-latest` through `models.judge`), so it needs a Claude secret, and the known limit: on a re-review, a finding that already blocked on an earlier push still counts toward the gate.
|
|
102
99
|
|
|
103
|
-
**
|
|
100
|
+
**Not a setup question: dollar limits.** Setup no longer asks how CI pays or for a spend ceiling, and writes no `budget-usd`. Tell the human that the per-review and per-month cost limits belong to the Crysk platform (dashboard, Review > Limits), that they apply only to runs that bill an API key (`CRYSK_CLAUDE_API_KEY`, an OpenCode API-key provider, or `api_key` first in `CRYSK_CREDENTIALS`), and that a Claude subscription run is never skipped for cost. Which secret to set is the credential question of the Execution Steps, not a budget question.
|
|
101
|
+
|
|
102
|
+
**On a re-run** (`.crysk/config.json` already has re-review keys, or the workflow already exists), first show the human the current values (`npx -y crysk@0.8.0 config`) and offer **Keep current settings** for the level and for the line threshold. When they keep them, omit `--level` / `--max-changed-lines`: passing a flag overwrites that group, including a tuned `max_verification_steps`.
|
|
104
103
|
|
|
105
104
|
Then pass the answers to the scaffold as flags, never as hand-written YAML:
|
|
106
105
|
|
|
107
106
|
```bash
|
|
108
|
-
npx -y crysk setup --ci --level <minimal|balanced|thorough|manual> --ci-mode <gate|advisory> --
|
|
107
|
+
npx -y crysk@0.8.0 setup --ci --level <minimal|balanced|thorough|manual> --ci-mode <gate|advisory> --max-changed-lines <n>
|
|
109
108
|
```
|
|
110
109
|
|
|
111
|
-
It writes the workflow, merges the level's keys into `.crysk/config.json` (keeping other keys), and prints a summary of every setting. **Never run it without these flags**: with none it applies balanced and gate, and its summary says nobody chose them. Write any advanced answers into `.crysk/config.json` (and `.cryskignore`) afterwards. The summary `setup --ci` printed predates those edits, so when there were any, show the human the effective settings from `npx -y crysk config` instead. Otherwise show the printed summary, including any `Changed` and `Kept existing` lines: on a re-run (for example `--force` to refresh an old workflow) only the groups a flag names are overwritten, and keys nobody chose stay as the file had them; the workflow keeps its old `mode`
|
|
110
|
+
It writes the workflow, merges the level's keys into `.crysk/config.json` (keeping other keys), and prints a summary of every setting. **Never run it without these flags**: with none it applies balanced and gate, and its summary says nobody chose them. `--billing` and `--budget-usd` are retired: accepted, no effect, one warning, so never pass them. Write any advanced answers into `.crysk/config.json` (and `.cryskignore`) afterwards. The summary `setup --ci` printed predates those edits, so when there were any, show the human the effective settings from `npx -y crysk@0.8.0 config` instead. Otherwise show the printed summary, including any `Changed` and `Kept existing` lines: on a re-run (for example `--force` to refresh an old workflow) only the groups a flag names are overwritten, and keys nobody chose stay as the file had them; the workflow keeps its old `mode` unless `--ci-mode` is passed, and a `budget-usd` line it still carried is dropped. In a terminal, every question defaults to the repository's current value. Details: `references/ci-admission.md`.
|
|
112
111
|
|
|
113
112
|
## Execution Steps
|
|
114
113
|
|
|
115
114
|
1. **Inspect repo:** `git rev-parse --is-inside-work-tree`, `git remote get-url origin`, `gh auth status`.
|
|
116
115
|
2. **Credential path:** Claude-only → skip OpenCode. OpenCode or mix → **read `references/opencode-ci.md`** and execute it (models per role, one secret per provider, the providers variable).
|
|
117
116
|
3. **Claude secret (if used):** `gh secret set CRYSK_CLAUDE_OAUTH_TOKEN` or `CRYSK_CLAUDE_API_KEY` (secure input, never print).
|
|
118
|
-
4. **Workflow:** run the interview above, then `npx -y crysk setup --ci` with its flags. It writes `.github/workflows/crysk.yml` (or rewrites an existing `pr-hero.yml` in place) and the level keys in `.crysk/config.json`, and its next steps print the `gh secret set` / `gh variable set` commands for the person's `~/.crysk/config.json` (models, credentials, OpenCode providers); run the ones the human agrees to. Confirm `checks: write` and `actions: read`, both `pull_request` and `issue_comment` triggers, the `crysk-secrets: |` block and the `models` / `credentials` lines. `--force` if an old template lacks them (an old `credentials` job, a missing `issue_comment` trigger, or `claude-token` / `routing` lines mean it predates the current workflow).
|
|
119
|
-
5. **Review instructions (optional, recommended before the first review):** if the default branch has neither a root `REVIEW.md` nor `.crysk/gotchas.md`, run `npx -y crysk init` in the clone; it scaffolds `REVIEW.md` (an existing `.crysk/gotchas.md` is kept, and no `REVIEW.md` is written beside it). The agent writes the facts from the repository it has in context, not from the template: the deliberate oddity that looks like a bug, the invariant enforced outside the diff, the ownership rule a newcomer would break. The hunters and the refuter read the file as facts; the "Not blocking here" section is applied only by the materiality judge (`materiality_gate: true`, blocking findings only, and only to style, naming, test-hygiene, generated-code and dev-script findings), so fill it only when the human asked for that gate, and delete it otherwise. Delete the `human-attention-required` marker line (Crysk refuses to review while it is there), then commit the file to the default branch. With no file the review runs on the default guidance; an empty or scaffold file fails the run `CRYSK-GOTCHAS-MISSING`.
|
|
117
|
+
4. **Workflow:** run the interview above, then `npx -y crysk@0.8.0 setup --ci` with its flags. It writes `.github/workflows/crysk.yml` (or rewrites an existing `pr-hero.yml` in place) and the level keys in `.crysk/config.json`, and its next steps print the `gh secret set` / `gh variable set` commands for the person's `~/.crysk/config.json` (models, credentials, OpenCode providers); run the ones the human agrees to. Confirm `checks: write` and `actions: read`, both `pull_request` and `issue_comment` triggers, the `crysk-secrets: |` block and the `models` / `credentials` lines. `--force` if an old template lacks them (an old `credentials` job, a missing `issue_comment` trigger, or `claude-token` / `routing` lines mean it predates the current workflow).
|
|
118
|
+
5. **Review instructions (optional, recommended before the first review):** if the default branch has neither a root `REVIEW.md` nor `.crysk/gotchas.md`, run `npx -y crysk@0.8.0 init` in the clone; it scaffolds `REVIEW.md` (an existing `.crysk/gotchas.md` is kept, and no `REVIEW.md` is written beside it). The agent writes the facts from the repository it has in context, not from the template: the deliberate oddity that looks like a bug, the invariant enforced outside the diff, the ownership rule a newcomer would break. The hunters and the refuter read the file as facts; the "Not blocking here" section is applied only by the materiality judge (`materiality_gate: true`, blocking findings only, and only to style, naming, test-hygiene, generated-code and dev-script findings), so fill it only when the human asked for that gate, and delete it otherwise. Delete the `human-attention-required` marker line (Crysk refuses to review while it is there), then commit the file to the default branch. With no file the review runs on the default guidance; an empty or scaffold file fails the run `CRYSK-GOTCHAS-MISSING`.
|
|
120
119
|
6. **Require the check:** in branch protection, require the `crysk` status check (the gate), not the `review` job. The legacy `pr-hero` status is no longer posted, so a repository that still requires it is blocked until the rule moves to `crysk`. A private repository on GitHub Free cannot require status checks (HTTP 403): report that the gate is advisory there. With `gh`, and only after asking the human: read the current protection first (`gh api repos/<o>/<r>/branches/<default>/protection`), because the PUT replaces all of it; then `gh api -X PUT repos/<o>/<r>/branches/<default>/protection` with `required_status_checks` contexts `["crysk"]`.
|
|
121
|
-
7. **Advanced settings:** write the answers from interview question
|
|
122
|
-
8. **Verify:** `npx -y crysk doctor`. `git status`. Confirm no echoed secret, and when OpenCode is on, that every `opencode:` model id in `CRYSK_MODELS` is one `opencode models <provider>` lists and each provider's token is in `CRYSK_OPENCODE_PROVIDERS`.
|
|
120
|
+
7. **Advanced settings:** write the answers from interview question 4 into `.crysk/config.json` (and `.cryskignore`), including `post_min_severity` when they chose a floor other than `warning` and `materiality_gate: true` only when they said yes; commit both to the default branch, and to any other branch PRs target (CI reads the config from the PR's base branch, so it applies from the next PR after the merge). **No `models` or `credentials` key there** (the repo parser refuses them). `npx -y crysk@0.8.0 config` to verify.
|
|
121
|
+
8. **Verify:** `npx -y crysk@0.8.0 doctor`. `git status`. Confirm no echoed secret, and when OpenCode is on, that every `opencode:` model id in `CRYSK_MODELS` is one `opencode models <provider>` lists and each provider's token is in `CRYSK_OPENCODE_PROVIDERS`.
|
|
123
122
|
9. **Deploy:** Offer commit. Open a **same-repo** test PR (forks skip).
|
|
124
123
|
|
|
125
124
|
## Output Contract
|
|
@@ -128,8 +127,8 @@ Report:
|
|
|
128
127
|
- Secret status (set or manual link). Names only: which `CRYSK_*` secrets exist (`gh secret list`). Never values.
|
|
129
128
|
- Models (if set): the `CRYSK_MODELS` and `CRYSK_CREDENTIALS` JSON (no credentials in them), and for OpenCode the `CRYSK_OPENCODE_PROVIDERS` tokens and that each model id matches `opencode models <provider>`.
|
|
130
129
|
- Workflow path (`crysk.yml`, or the pre-rename `pr-hero.yml`; both present means two reviews per PR, delete one) and whether `checks: write`, `actions: read`, the `issue_comment` trigger, the `crysk-secrets` block and the `models` / `credentials` lines are present, with no removed input left.
|
|
131
|
-
- The review settings summary `setup --ci` printed (level, gate,
|
|
132
|
-
- `npx -y crysk doctor` / `npx -y crysk config` outcome.
|
|
130
|
+
- The review settings summary `setup --ci` printed (level, gate, size threshold, advanced settings), and which ones the human chose, including the posting floor (`post_min_severity`) and whether `materiality_gate` is on. Say that dollar limits are set in the platform dashboard (Review > Limits), not here. Confirm repo `.crysk/config.json` has no `models` or `credentials` key.
|
|
131
|
+
- `npx -y crysk@0.8.0 doctor` / `npx -y crysk@0.8.0 config` outcome.
|
|
133
132
|
- Whether the default branch has a real `REVIEW.md` or `.crysk/gotchas.md` (no `human-attention-required` marker line), or neither (reviews run on the default guidance).
|
|
134
133
|
- Whether `crysk` is a required check (or only the legacy `pr-hero`, which should move to `crysk`), or that the repository cannot require one (private repository on GitHub Free).
|
|
135
134
|
- Next steps: merge the workflow to the default branch (the comment trigger needs it there), open a same-repo test PR, when to turn off observe-only. If CI skipped, the override is `gh pr comment <n> --body "/crysk review"`.
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
# no cost, and records who did it. A comment that is exactly
|
|
11
11
|
# `/crysk recheck` reviews the head and asks the CI adjudicator to rule on
|
|
12
12
|
# pending dismissals of blocking findings. The action parses the comment and
|
|
13
|
-
# refuses a commenter without write access.
|
|
14
|
-
# of these commands still work for one version.
|
|
13
|
+
# refuses a commenter without write access.
|
|
15
14
|
name: Crysk Review
|
|
16
15
|
|
|
17
16
|
on:
|
|
@@ -50,18 +49,14 @@ jobs:
|
|
|
50
49
|
# fork's head.
|
|
51
50
|
#
|
|
52
51
|
# A comment starts the job only when it BEGINS with `/crysk review`,
|
|
53
|
-
# `/crysk recheck` or `/crysk override
|
|
54
|
-
# of the three). The action then requires an exact match after
|
|
52
|
+
# `/crysk recheck` or `/crysk override`. The action then requires an exact match after
|
|
55
53
|
# trimming, so a near-miss such as "/crysk review please" starts a job the
|
|
56
54
|
# action ends without reviewing or overriding.
|
|
57
55
|
if: >-
|
|
58
56
|
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
|
|
59
57
|
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk review')) ||
|
|
60
58
|
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk recheck')) ||
|
|
61
|
-
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk override'))
|
|
62
|
-
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/pr-hero review')) ||
|
|
63
|
-
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/pr-hero recheck')) ||
|
|
64
|
-
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/pr-hero override'))
|
|
59
|
+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk override'))
|
|
65
60
|
# Job-level and keyed on the pull request number. A workflow-level group
|
|
66
61
|
# on `github.head_ref || github.ref` put every comment on every pull
|
|
67
62
|
# request into ONE group, because head_ref is empty on issue_comment, so
|
|
@@ -76,7 +71,7 @@ jobs:
|
|
|
76
71
|
#
|
|
77
72
|
# GitHub keeps one PENDING run per group, and a newer run replaces it. So
|
|
78
73
|
# a comment enters the pull request's group only when it starts with
|
|
79
|
-
# /crysk review, /crysk recheck or /crysk override
|
|
74
|
+
# /crysk review, /crysk recheck or /crysk override, and GitHub associates its author
|
|
80
75
|
# with the repository as OWNER, MEMBER or COLLABORATOR; every other comment
|
|
81
76
|
# gets its own group. Without that, anyone who can comment could replace a
|
|
82
77
|
# maintainer's queued review with a run the action then refuses. The job
|
|
@@ -97,7 +92,7 @@ jobs:
|
|
|
97
92
|
# other event gets a unique per-run group for the same reason, so a
|
|
98
93
|
# skipped job can never cancel or replace a review.
|
|
99
94
|
concurrency:
|
|
100
|
-
group: ${{ ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (startsWith(github.event.comment.body, '/crysk review') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || (startsWith(github.event.comment.body, '/crysk recheck') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || (startsWith(github.event.comment.body, '/crysk override') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
|
|
95
|
+
group: ${{ ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (startsWith(github.event.comment.body, '/crysk review') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || (startsWith(github.event.comment.body, '/crysk recheck') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || (startsWith(github.event.comment.body, '/crysk override') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))) && format('pr-hero-review-{0}', github.event.pull_request.number || github.event.issue.number) || format('pr-hero-noop-{0}', github.run_id) }}
|
|
101
96
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
102
97
|
runs-on: ubuntu-latest
|
|
103
98
|
# Backstop for a HUNG runner, not a second review budget. Crysk already
|
|
@@ -32,7 +32,7 @@ Read this when configuring `.crysk/config.json` during CI setup. Full operator d
|
|
|
32
32
|
|
|
33
33
|
## Review levels (what setup --ci asks)
|
|
34
34
|
|
|
35
|
-
`setup --ci` (and `ci init`) asks for a level and always writes its keys. An agent asks the human and passes `--level`, `--ci-mode
|
|
35
|
+
`setup --ci` (and `ci init`) asks for a level and always writes its keys. An agent asks the human and passes `--level`, `--ci-mode` and `--max-changed-lines`; a terminal user gets the same questions from the CLI; with neither, `balanced` and `gate` apply and the summary says nobody chose them.
|
|
36
36
|
|
|
37
37
|
| Level | `ci_review_policy` | `ci_max_attempts` | `ci_rereview_min_score` | `max_verification_steps` |
|
|
38
38
|
|---|---|---|---|---|
|
|
@@ -41,11 +41,11 @@ Read this when configuring `.crysk/config.json` during CI setup. Full operator d
|
|
|
41
41
|
| `thorough` | `every_push` | 4 | (unset) | 8 |
|
|
42
42
|
| `manual` | `manual_only` | 1 | (unset) | 8 |
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Dollar limits: setup does not ask how CI pays and writes no `budget-usd`. The per-review and per-month cost limits belong to the Crysk platform (dashboard, Review > Limits); the engine only skips a run that bills an API key (`CRYSK_CLAUDE_API_KEY`, which `credentials.claude` decides, or an OpenCode API-key provider) when the platform's estimate is over them, and a subscription run is never skipped for cost. `--billing` and `--budget-usd` are retired: accepted, no effect, one warning each, and `--billing` no longer implies anything about the workflow.
|
|
45
45
|
|
|
46
|
-
Re-runs: a group (the level's keys, or `max_changed_lines`) is overwritten only when someone chose it this run (a flag or a terminal answer); otherwise it fills the file only if absent, and setup prints `Changed` and `Kept existing` lines. A `--force` refresh keeps the old workflow's `mode` and `budget-usd`
|
|
46
|
+
Re-runs: a group (the level's keys, or `max_changed_lines`) is overwritten only when someone chose it this run (a flag or a terminal answer); otherwise it fills the file only if absent, and setup prints `Changed` and `Kept existing` lines. A `--force` refresh keeps the old workflow's `mode` unless a flag names it and drops a `budget-usd` line it still carried, and in a terminal every question defaults to the current value (a tuned level that matches no preset gets a "Keep current settings" option).
|
|
47
47
|
|
|
48
|
-
Size threshold: `max_changed_lines` is always written (default 4000, `--max-changed-lines`, `0` = no limit).
|
|
48
|
+
Size threshold: `max_changed_lines` is always written (default 4000, `--max-changed-lines`, `0` = no limit). It applies on any route: left unset, a subscription route reviews a PR of any size.
|
|
49
49
|
|
|
50
50
|
Posting floor: setup writes `post_min_severity: "warning"` only when the repo config has no value, so a re-run never replaces a chosen floor. `warning` hides advisory suggestions, `blocking` hides every advisory finding, `suggestion` (or unset) posts everything. Hidden findings are counted in the summary comment. The gate is unchanged, since a blocking finding always posts; admission scores only posted findings, so a hidden one never triggers a re-review.
|
|
51
51
|
|
|
@@ -111,7 +111,7 @@ gh pr comment <n> --body "/crysk review"
|
|
|
111
111
|
|
|
112
112
|
`/crysk review --full` also re-discovers the whole range. The comment must be exactly one of those two, and it works only once the workflow file (`crysk.yml`, or `pr-hero.yml` in a repo set up before the rename; with its `issue_comment` trigger) is on the default branch.
|
|
113
113
|
|
|
114
|
-
It bypasses the size gate, the admission rules (same commit, `once_per_pr`, score, low-risk delta, exhausted attempts, `manual_only`), and the
|
|
114
|
+
It bypasses the size gate, the admission rules (same commit, `once_per_pr`, score, low-risk delta, exhausted attempts, `manual_only`), and the platform's cost limits (the platform sends none for a forced run). It does not reset the ledger.
|
|
115
115
|
|
|
116
116
|
Who can force: anyone with write access to the repository; a comment from anyone else is refused. A fork PR is reviewed only this way, since its own pushes are skipped. `gh run rerun` on a skipped run re-evaluates the gates and does not force.
|
|
117
117
|
|
|
@@ -21,7 +21,7 @@ Unset `CRYSK_MODELS` = Claude-only CI.
|
|
|
21
21
|
|
|
22
22
|
## Fastest path: `crysk ci init`
|
|
23
23
|
|
|
24
|
-
If the operator already has `models` in `~/.crysk/config.json`, `npx -y crysk ci init` (or `setup --ci`) prints every `gh secret set` / `gh variable set` command for it: the Claude secret, one `CRYSK_OPENCODE_<P>_API_KEY` per provider (plus the `_OAUTH` line for openai), `CRYSK_MODELS`, `CRYSK_CREDENTIALS` and `CRYSK_OPENCODE_PROVIDERS`. It never runs them. It refuses, writing nothing, when the models name more than 5 OpenCode providers. Run the commands the human agrees to; `gh secret set` asks for each value, so it never appears in the chat.
|
|
24
|
+
If the operator already has `models` in `~/.crysk/config.json`, `npx -y crysk@0.8.0 ci init` (or `setup --ci`) prints every `gh secret set` / `gh variable set` command for it: the Claude secret, one `CRYSK_OPENCODE_<P>_API_KEY` per provider (plus the `_OAUTH` line for openai), `CRYSK_MODELS`, `CRYSK_CREDENTIALS` and `CRYSK_OPENCODE_PROVIDERS`. It never runs them. It refuses, writing nothing, when the models name more than 5 OpenCode providers. Run the commands the human agrees to; `gh secret set` asks for each value, so it never appears in the chat.
|
|
25
25
|
|
|
26
26
|
## Models per role
|
|
27
27
|
|
|
@@ -30,9 +30,9 @@ If the operator already has `models` in `~/.crysk/config.json`, `npx -y crysk ci
|
|
|
30
30
|
| Role | Steps |
|
|
31
31
|
|---|---|
|
|
32
32
|
| `default` | every role not listed (not the judge) |
|
|
33
|
-
| `hunter.<key>` | one hunter: `logic`, `
|
|
33
|
+
| `hunter.<key>` | one hunter: `logic`, `reliability`, `resilience`, `security` |
|
|
34
34
|
| `refuter` | refuter, re-review verifier, CI adjudicator |
|
|
35
|
-
| `consolidate`, `
|
|
35
|
+
| `consolidate`, `summary` | those steps |
|
|
36
36
|
| `judge` | materiality judge: only `claude:sonnet-latest` or `claude:opus-latest`, never `default` |
|
|
37
37
|
|
|
38
38
|
Model names: `claude:sonnet-latest` / `opus-latest` / `haiku-latest` / `fable-latest` (newest), a full `claude:claude-…` id (pinned), or `opencode:<provider>/<model>`. There is no `modelSnapshot`, `gateway` or alias mapping any more: the provider's model id is part of the name. Confirm the id with `opencode models <provider>`; do not guess `deepseek-chat` if the CLI lists `deepseek-v4-flash` / `deepseek-v4-pro`. An entry may be `{"model": "...", "effort": "..."}`; on OpenCode the effort must be one of the model's variants (`opencode models <provider> --verbose`), or the review stops before spending.
|
|
@@ -53,7 +53,7 @@ Every step runs on DeepSeek. Without a Claude secret, keep `materiality_gate` of
|
|
|
53
53
|
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-flash", "claude:sonnet-latest"], "refuter": ["claude:opus-latest"], "summary": ["claude:haiku-latest"]}'
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Keep `CRYSK_CLAUDE_OAUTH_TOKEN` (or `CRYSK_CLAUDE_API_KEY`) beside the DeepSeek secret. The OpenCode auth file
|
|
56
|
+
Keep `CRYSK_CLAUDE_OAUTH_TOKEN` (or `CRYSK_CLAUDE_API_KEY`) beside the DeepSeek secret. The OpenCode auth file makes the run count as metered, so the platform's dollar limits (dashboard, Review > Limits) can skip it.
|
|
57
57
|
|
|
58
58
|
### Two OpenCode providers
|
|
59
59
|
|
|
@@ -89,7 +89,7 @@ models: ${{ vars.CRYSK_MODELS }}
|
|
|
89
89
|
credentials: ${{ vars.CRYSK_CREDENTIALS }}
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
Copy it from `assets/workflow.yml` or re-scaffold with `npx -y crysk ci init --force`; never write it from memory. An unused slot renders as `CRYSK_OPENCODE__API_KEY=` and is skipped.
|
|
92
|
+
Copy it from `assets/workflow.yml` or re-scaffold with `npx -y crysk@0.8.0 ci init --force`; never write it from memory. An unused slot renders as `CRYSK_OPENCODE__API_KEY=` and is skipped.
|
|
93
93
|
|
|
94
94
|
The Action installs OpenCode CLI **1.18.30** in its **own** step when the setup step built an OpenCode auth file **or** the models in effect name `opencode:`. Never `latest`. Claude-only skips that install.
|
|
95
95
|
|
|
@@ -103,4 +103,4 @@ The Action installs OpenCode CLI **1.18.30** in its **own** step when the setup
|
|
|
103
103
|
|
|
104
104
|
## After setting DATA
|
|
105
105
|
|
|
106
|
-
Open a **same-repo** PR (fork pushes skip). In the review job's log, the setup step prints one notice per OpenCode provider naming the secret it used
|
|
106
|
+
Open a **same-repo** PR (fork pushes skip). In the review job's log, the setup step prints one notice per OpenCode provider naming the secret it used. A run that bills an API key is the one the platform's dollar limits can skip; what it cost is in the platform dashboard.
|
|
@@ -35,14 +35,14 @@ comment — almost always an inline review comment on Files changed.
|
|
|
35
35
|
Every command below runs through `npx`, so nothing has to be installed on the machine first:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npx -y crysk <command> ...
|
|
38
|
+
npx -y crysk@0.8.0 <command> ...
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`npx` needs only Node. Crysk's package brings its own Bun runtime, and when that is
|
|
42
42
|
unavailable it uses a `bun` already on PATH. `-y` skips npx's install prompt, which an agent
|
|
43
43
|
cannot answer. If `crysk` is already on PATH (a global install), `crysk <command>` is the
|
|
44
44
|
same command. Do not install Crysk just to triage a PR. To put these skills into another coding
|
|
45
|
-
agent on the machine, run `npx -y crysk skills install` (non-interactive; `--force` overwrites local edits).
|
|
45
|
+
agent on the machine, run `npx -y crysk@0.8.0 skills install` (non-interactive; `--force` overwrites local edits).
|
|
46
46
|
|
|
47
47
|
You also need `gh`, authenticated as a user with write access to the repository: the driver posts
|
|
48
48
|
through it, and you comment `/crysk recheck` and `/crysk review` through it.
|
|
@@ -127,11 +127,11 @@ Later review passes hunt only the push delta. Once the real defects from pass 1
|
|
|
127
127
|
|
|
128
128
|
The opposite happens when a repository's workflow policy (`once_per_pr`, `thresholded`, `risk_aware` below the score floor, `ci_max_attempts` exhausted, or the size gate) suppresses an automatic review on a push that **genuinely changed load-bearing code**:
|
|
129
129
|
- Under `once_per_pr`, `thresholded`, or `risk_aware`, a skipped push can inherit a carried `success` status from `report.head`, so `next_action` reads `"done"` even though `report.head !== head` (the commits `report.head..head` were never reviewed).
|
|
130
|
-
- Under `ci_max_attempts` or `manual_only`, a red carries the same way, and a green is held `pending` ("crysk: waiting for a manual review"), so `next_action` reads `"override-or-fix"`. Under the size or
|
|
130
|
+
- Under `ci_max_attempts` or `manual_only`, a red carries the same way, and a green is held `pending` ("crysk: waiting for a manual review"), so `next_action` reads `"override-or-fix"`. Under the size gate or the platform's cost limits (the skip comment says which), the automatic run is blocked and the head is red. Either way `report.head !== head`.
|
|
131
131
|
|
|
132
132
|
Whenever `report.head !== head`, inspect `git diff <report.head>..<head>`:
|
|
133
133
|
- If that unreviewed delta introduced **new business logic, state-machine or concurrency changes, auth/security/isolation edits, or a non-trivial refactor** (for example, fixing a finding required redesigning a function rather than adding a guard), an extra review **is** justified:
|
|
134
|
-
- When `next_action` is `"review"` or `"override-or-fix"` (and within the forced-run bound below), trigger `gh pr comment <n> --body "/crysk review"` and subscribe with `npx -y crysk status --pr <n> --wait --json` — or, if `next_action` is `"done"` on a carried green status (or the forced-run bound is reached), explicitly **recommend running `/crysk review`** to the user and name the exact files/changes in `report.head..head` that warrant a fresh pass before merging.
|
|
134
|
+
- When `next_action` is `"review"` or `"override-or-fix"` (and within the forced-run bound below), trigger `gh pr comment <n> --body "/crysk review"` and subscribe with `npx -y crysk@0.8.0 status --pr <n> --wait --json` — or, if `next_action` is `"done"` on a carried green status (or the forced-run bound is reached), explicitly **recommend running `/crysk review`** to the user and name the exact files/changes in `report.head..head` that warrant a fresh pass before merging.
|
|
135
135
|
|
|
136
136
|
### C. Suspecting a flawed integration or design (stop patching, rethink the root cause)
|
|
137
137
|
|
|
@@ -149,11 +149,12 @@ Suspect a flawed integration or architecture when **either** of these signals ap
|
|
|
149
149
|
|
|
150
150
|
## Which command spelling to post
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
`crysk
|
|
152
|
+
Post the `/crysk` form: `/crysk review`, `/crysk recheck`, `/crysk override`, `/crysk stop`. The
|
|
153
|
+
legacy `/pr-hero …` spelling is no longer a command, and a comment that uses it starts nothing. A
|
|
154
|
+
workflow set up before the rename (`pr-hero.yml`) may still filter only `/pr-hero` in its `if:`, so a
|
|
155
|
+
`/crysk` comment starts nothing there either: check the workflow once per PR, and when it lacks
|
|
156
|
+
`'/crysk review'`, tell the maintainer to re-scaffold it with `npx -y crysk@0.8.0 ci init --force`
|
|
157
|
+
instead of posting any command.
|
|
157
158
|
|
|
158
159
|
```bash
|
|
159
160
|
for f in crysk.yml pr-hero.yml; do
|
|
@@ -161,10 +162,6 @@ for f in crysk.yml pr-hero.yml; do
|
|
|
161
162
|
done; exit 1
|
|
162
163
|
```
|
|
163
164
|
|
|
164
|
-
Exit 0 means the workflow accepts `/crysk`: post the `/crysk` form. Otherwise post the same
|
|
165
|
-
command with `/pr-hero` in place of `/crysk`. If the workflow lives under another file name,
|
|
166
|
-
read that file instead.
|
|
167
|
-
|
|
168
165
|
## The loop, end to end
|
|
169
166
|
|
|
170
167
|
**Run this as a continuous autonomous loop (`while next_action !== "done"`).** Never end your turn or stop to ask the human for permission between `triage`, fixing code, `git push`, `recheck`, `review`, and waiting for CI to finish. Stop only when `next_action === "done"` or one of the hard escalation stops below triggers (repeated gate/runner failure, 6 forced runs on one head, 2 consecutive `inconclusive` heads, a suspected flawed design (### C), or `override-or-fix` with nothing left you can fix).
|
|
@@ -172,7 +169,7 @@ read that file instead.
|
|
|
172
169
|
0. **Subscribe to and read the PR's settled state.** Run:
|
|
173
170
|
|
|
174
171
|
```bash
|
|
175
|
-
npx -y crysk status --pr <n> --wait --json
|
|
172
|
+
npx -y crysk@0.8.0 status --pr <n> --wait --json
|
|
176
173
|
```
|
|
177
174
|
|
|
178
175
|
It is read-only (reads GitHub through `gh`, writes nothing) and **deterministic**:
|
|
@@ -200,7 +197,7 @@ read that file instead.
|
|
|
200
197
|
another review" above. A load-bearing delta justifies `/crysk review` (within the forced-run
|
|
201
198
|
bound), then step 0 with `--wait`; otherwise exit the loop and tell the maintainer the PR
|
|
202
199
|
waits for `/crysk review` or `/crysk override`;
|
|
203
|
-
- the head was size- or
|
|
200
|
+
- the head was size- or cost-limit-skipped (the gate description starts "crysk skipped the
|
|
204
201
|
review", or "pr-hero skipped the review" on a status an older action wrote): comment `/crysk review`, then run step 0 with `--wait`;
|
|
205
202
|
- the review is "partial again" with the same hunters failing: fix the failing hunter's route
|
|
206
203
|
(model or credential), or ask a maintainer to override;
|
|
@@ -215,11 +212,10 @@ read that file instead.
|
|
|
215
212
|
verified it) is done too: report the PR ready to merge and say the fixes were not verified by a review. Before exiting, check whether `report.head && report.head !== head` (a green status carried over an unreviewed push under `once_per_pr`, `thresholded`, or `risk_aware`): if `git diff <report.head>..<head>` contains non-trivial logic or risky changes ("Requesting or suggesting another review" above), recommend `/crysk review` naming those changes; otherwise exit the loop and report that the PR is ready to merge.
|
|
216
213
|
|
|
217
214
|
**Bound the forced runs.** `/crysk review` and `/crysk recheck` each run a full paid review
|
|
218
|
-
that bypasses the size,
|
|
215
|
+
that bypasses the size, platform cost-limit and admission gates (`ci_max_attempts` included), and a gate
|
|
219
216
|
`error` (expired token, missing credential, crash) makes step 0 say `review` again forever.
|
|
220
217
|
Before posting either, count the ones already on this head, never from memory: the comments in
|
|
221
|
-
`gh pr view <n> --json comments` whose body is exactly `/crysk review
|
|
222
|
-
or their legacy spellings `/pr-hero review` and `/pr-hero recheck` (both still start a run), and whose `createdAt` is at or after the oldest `crysk` or `pr-hero` status on the head
|
|
218
|
+
`gh pr view <n> --json comments` whose body is exactly `/crysk review` or `/crysk recheck`, and whose `createdAt` is at or after the oldest `crysk` or `pr-hero` status on the head
|
|
223
219
|
(`gh api "repos/{owner}/{repo}/commits/<head>/statuses?per_page=100" --jq '[.[] | select(.context == "crysk" or .context == "pr-hero")] | last.created_at'`;
|
|
224
220
|
no status yet means none counted). Each reason step 0 gives gets its command once per head:
|
|
225
221
|
one `/crysk review` each for a skipped head, a partial review, a used-up budget, a gate
|
|
@@ -258,10 +254,14 @@ current head:
|
|
|
258
254
|
file and run:
|
|
259
255
|
|
|
260
256
|
```bash
|
|
261
|
-
npx -y crysk triage reply --pr <n> --from <run-dir> --finding F00N \
|
|
257
|
+
npx -y crysk@0.8.0 triage reply --pr <n> --from <run-dir> --finding F00N \
|
|
262
258
|
--tag <tag> --body-file <reasoning.md> [--verdict <v>] [--issue <n>]
|
|
263
259
|
```
|
|
264
260
|
|
|
261
|
+
With no run directory on the machine (a CI review, a cloud agent), drop
|
|
262
|
+
`--from` and pass the `R###` id `crysk status --pr <n> --json` lists:
|
|
263
|
+
`triage reply --pr <n> --finding R00N ...`.
|
|
264
|
+
|
|
265
265
|
The driver resolves the parent from the posted `<!-- crysk-finding`
|
|
266
266
|
marker (never a comment id, never the nearest line), prepends the triage
|
|
267
267
|
marker and the visible badge, posts the reply, records the triage event
|
|
@@ -274,13 +274,13 @@ current head:
|
|
|
274
274
|
`--verdict` from the adjudicator. `--issue` is optional and only valid
|
|
275
275
|
with `--tag deferred`.
|
|
276
276
|
6. **Advance the loop in one batch once all findings on this head are answered:**
|
|
277
|
-
- **If you made clean code fixes (`applied` or unthreaded blocking fixes):** if you decided this push needs no further review ("Stopping diminishing returns", rule 4), post `/crysk stop` before pushing, and after the push do **not** wait for a re-review: none will run. Report that the fixes are pushed and the PR is ready to merge: the gate carries the last verdict, and every blocking finding you answered before the push turns a carried red green, marked `fixes unverified`. Only a finding left `deferred` or `misclassified` still needs a maintainer's `/crysk override`. Otherwise, commit and `git push` all fixes in a single push, then immediately run `npx -y crysk status --pr <n> --wait --json` to subscribe to the re-review on the new head. Do **not** run `/crysk recheck` before pushing: a new push invalidates prior-head recheck rulings and wastes a CI run.
|
|
278
|
-
- **If no code changes were needed:** run `npx -y crysk status --pr <n> --wait --json` and execute its `next_action` (`recheck` when blocking findings were `dismissed`, or `done` when the gate is already green).
|
|
277
|
+
- **If you made clean code fixes (`applied` or unthreaded blocking fixes):** if you decided this push needs no further review ("Stopping diminishing returns", rule 4), post `/crysk stop` before pushing, and after the push do **not** wait for a re-review: none will run. Report that the fixes are pushed and the PR is ready to merge: the gate carries the last verdict, and every blocking finding you answered before the push turns a carried red green, marked `fixes unverified`. Only a finding left `deferred` or `misclassified` still needs a maintainer's `/crysk override`. Otherwise, commit and `git push` all fixes in a single push, then immediately run `npx -y crysk@0.8.0 status --pr <n> --wait --json` to subscribe to the re-review on the new head. Do **not** run `/crysk recheck` before pushing: a new push invalidates prior-head recheck rulings and wastes a CI run.
|
|
278
|
+
- **If no code changes were needed:** run `npx -y crysk@0.8.0 status --pr <n> --wait --json` and execute its `next_action` (`recheck` when blocking findings were `dismissed`, or `done` when the gate is already green).
|
|
279
279
|
|
|
280
280
|
*(Note: The MCP server is strictly read-only for querying runs, findings, and
|
|
281
281
|
past triage records via `crysk_get_triage` and `crysk_get_findings`. All
|
|
282
282
|
mutations — posting comments, resolving threads, and updating the database —
|
|
283
|
-
must be performed via `npx -y crysk triage reply`.)*
|
|
283
|
+
must be performed via `npx -y crysk@0.8.0 triage reply`.)*
|
|
284
284
|
|
|
285
285
|
**Greptile re-review:** Greptile updates its existing PR comment in place —
|
|
286
286
|
it does not post a second one. Do not wait for a new Greptile comment to
|
|
@@ -296,13 +296,13 @@ adjudicator. When step 0 says `recheck`:
|
|
|
296
296
|
blocking finding whose newest reply is `dismissed` (at most 5 per run), an adjudicator in CI that
|
|
297
297
|
reads your argument and the repository at that head. You may comment it yourself: you only supply
|
|
298
298
|
the argument, the CI adjudicator rules. (`/crysk override` is the opposite: never yours to post.)
|
|
299
|
-
2. Wait with `npx -y crysk status --pr <n> --wait --json` until the run settles. Each ruling is a reply on the finding's thread,
|
|
299
|
+
2. Wait with `npx -y crysk@0.8.0 status --pr <n> --wait --json` until the run settles. Each ruling is a reply on the finding's thread,
|
|
300
300
|
from `github-actions[bot]` (the Crysk App's bot on a platform-managed repository), whose first line is
|
|
301
301
|
`<!-- crysk-adjudication verdict=<v> reply=<your reply's id> head=<sha> -->`. Step 0's
|
|
302
302
|
`ci_verdict` reads it for you.
|
|
303
303
|
3. Act on the verdict:
|
|
304
304
|
- `upheld`: the dismissal stands. The recheck run itself does not change its own count; step 0
|
|
305
|
-
now says `review`. Comment `/crysk review`, then run `npx -y crysk status --pr <n> --wait --json`, and that review no longer counts the finding.
|
|
305
|
+
now says `review`. Comment `/crysk review`, then run `npx -y crysk@0.8.0 status --pr <n> --wait --json`, and that review no longer counts the finding.
|
|
306
306
|
- `rejected`: the finding stands. Re-read the adjudicator's evidence. Fix it, or, if you still hold
|
|
307
307
|
it is wrong, ask a human (they may override). Do not re-post the same argument.
|
|
308
308
|
- `inconclusive`: the repository did not settle it either way. On the same head you cannot post
|
|
@@ -401,7 +401,7 @@ adjudicator that inherited your context would simply agree with itself.
|
|
|
401
401
|
|
|
402
402
|
The adjudicator returns exactly one of `upheld`, `rejected`, or `inconclusive` — see
|
|
403
403
|
`adjudicator.md` for what each means and the burden-of-proof rule behind them. Pass that
|
|
404
|
-
exact word as `--verdict` on `npx -y crysk triage reply` (and mention it in the reasoning
|
|
404
|
+
exact word as `--verdict` on `npx -y crysk@0.8.0 triage reply` (and mention it in the reasoning
|
|
405
405
|
prose). The driver writes it on the marker; the escalation rule reads it back from there.
|
|
406
406
|
|
|
407
407
|
## One adjudication per finding per HEAD
|
|
@@ -443,38 +443,21 @@ under Greptile on Musive #1724. Do not do that. Do not reply on
|
|
|
443
443
|
`<!-- crysk-report -->` either: that is the summary, including Outside Diff.
|
|
444
444
|
|
|
445
445
|
`--from` is the Crysk run directory that produced these findings (`findings.json`). `--finding`
|
|
446
|
-
is the finding id (`F001`, …) from that file — never a comment id.
|
|
446
|
+
is the finding id (`F001`, …) from that file — never a comment id. Without `--from`, `--finding`
|
|
447
|
+
is the PR's stable `R###` id instead (below).
|
|
447
448
|
|
|
448
|
-
**When the review ran in CI, that directory is not on your machine
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
**When the review ran in CI, that directory is not on your machine: leave `--from` out.** The
|
|
450
|
+
driver then reads the finding off the pull request itself, and `--finding` is the finding's stable
|
|
451
|
+
`R###` id: the `id` of the row in `npx -y crysk@0.8.0 status --pr <n> --json` (`findings[]`), which
|
|
452
|
+
the summary comment shows too. Nothing has to be downloaded:
|
|
452
453
|
|
|
453
454
|
```bash
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
# Each line printed is "<run-id> <artifact-name>": download with the name on the same line.
|
|
457
|
-
for NAME in crysk-run-<pr>-<head-sha> pr-hero-run-<pr>-<head-sha>; do
|
|
458
|
-
gh api "repos/{owner}/{repo}/actions/artifacts?name=$NAME" \
|
|
459
|
-
--jq '[.artifacts[] | select(.expired | not)] | sort_by(.created_at) | reverse | .[] | "\(.workflow_run.id) \(.name)"'
|
|
460
|
-
done
|
|
461
|
-
gh run download <run-id> -n <artifact-name> -D "crysk-run-<run-id>"
|
|
455
|
+
npx -y crysk@0.8.0 triage reply --pr <n> --finding R00N \
|
|
456
|
+
--tag <tag> --body-file <reasoning.md> [--verdict <v>] [--issue <n>]
|
|
462
457
|
```
|
|
463
458
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
a branch listing never shows it, and that run usually holds the findings. Several runs can upload
|
|
467
|
-
the same name for one head (the automatic review, then a forced review or recheck; `overwrite: true`
|
|
468
|
-
in `action.yml` only dedupes within one run). Try the candidates newest first and keep the first one
|
|
469
|
-
`npx -y crysk triage reply ... --dry-run` binds (its success line starts with `plan: reply to`; do not match on "marker match", which the "no posted … marker matches" error also contains). Download each candidate
|
|
470
|
-
into its own fresh directory, as above: reusing one directory mixes `findings.json` from one run
|
|
471
|
-
with the patches of another, and the bind then judges files no single run wrote.
|
|
472
|
-
|
|
473
|
-
Then pass `--from crysk-run-<run-id>` for the candidate that bound. `gh run download` unpacks the run directory's *contents*, so the
|
|
474
|
-
`--from` target is the directory you downloaded into — not a `pr-<n>-<sha>-1` path inside it. If
|
|
475
|
-
the artifact is missing (a size- or budget-gated review writes no run directory, and so does a
|
|
476
|
-
run where every hunter died), you have no `--from` input: say so and stop rather than inventing
|
|
477
|
-
one. Full detail: `docs/github-actions.md` → "Triaging a CI review".
|
|
459
|
+
If the driver says the PR has no posted finding with that id, the finding lives only in the summary
|
|
460
|
+
(or was never posted): stop. Full detail: `docs/github-actions.md` → "Triaging a CI review".
|
|
478
461
|
|
|
479
462
|
The posted body looks like this (driver-owned; shown so you know what a human will see):
|
|
480
463
|
|
|
@@ -535,12 +518,12 @@ this PR. The engine typed it wrong, not the code.
|
|
|
535
518
|
never does.
|
|
536
519
|
- The adjudicator never sees your reasoning context — only the finding, your argument, and the
|
|
537
520
|
repo.
|
|
538
|
-
- Never call `gh` to post or resolve a triage reply. Run `npx -y crysk triage reply`. (Commenting
|
|
521
|
+
- Never call `gh` to post or resolve a triage reply. Run `npx -y crysk@0.8.0 triage reply`. (Commenting
|
|
539
522
|
`/crysk recheck` or `/crysk review` with `gh pr comment` is not a triage reply, and is how you ask for them.)
|
|
540
523
|
If that command posted the reply and then failed to resolve, re-run the
|
|
541
524
|
**same** command — same-head skip retries resolve only. Do not `gh`.
|
|
542
525
|
- Never triage a finding that only exists under `### Comments Outside Diff` in the
|
|
543
|
-
summary. It has no thread this slice (W2). If `npx -y crysk triage reply` reports no
|
|
526
|
+
summary. It has no thread this slice (W2). If `npx -y crysk@0.8.0 triage reply` reports no
|
|
544
527
|
matching marker, stop.
|
|
545
528
|
- `dismissed`, `deferred`, and `misclassified` without `--verdict` are malformed. `applied` WITH
|
|
546
529
|
`--verdict` is equally malformed.
|