crysk 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -23
- package/dist/SKILL-1q3658n0.md +74 -0
- package/dist/SKILL-25j4q9b8.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/cli.js +24658 -24654
- package/dist/index.js +492 -463
- 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/workflow-andv2dvm.yml +158 -0
- package/package.json +1 -1
- package/prompts/default/PROVENANCE.md +1 -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-pr/SKILL.md +1 -1
- package/src/asset-manifest.ts +0 -6
- package/src/assets.ts +1 -4
- package/src/brand.ts +20 -30
- package/src/ci/gates.ts +155 -201
- 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/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 +14 -4
- package/src/model/profiles/claude.ts +1 -2
- package/src/model/profiles/openai.ts +1 -2
- package/src/model/profiles.ts +1 -2
- 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/preflight.ts +15 -12
- package/src/pr/publish-outcome.ts +1 -19
- package/src/pr/review-pr.ts +10 -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/review/boundary.ts +4 -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 +57 -395
- package/src/review/preflight.ts +162 -201
- package/src/review/prompt-set.ts +0 -2
- package/src/review/report.ts +2 -162
- package/src/review/review.ts +16 -65
- package/src/review/route-preflight.ts +3 -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/default/deep-review-parity.md +0 -152
- package/prompts/scout.md +0 -140
- package/src/ci/platform-estimate.ts +0 -111
- package/src/review/scout.ts +0 -323
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# OpenCode in CI — operator procedure
|
|
2
|
+
|
|
3
|
+
Read this when the operator wants OpenCode, DeepSeek, mixed Claude+OpenCode, fallback models, or different models per step in GitHub Actions. Full narrative: `docs/github-actions.md` (sections **OpenCode in CI** and **`CRYSK_*` secrets**); model rules: `docs/configuration.md` (section **Models**).
|
|
4
|
+
|
|
5
|
+
Do **not** print, `cat`, or log credential values. Inspect **keys and `type` only**.
|
|
6
|
+
|
|
7
|
+
## What goes where
|
|
8
|
+
|
|
9
|
+
| GitHub box | Name | Holds |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| **Secrets** (hidden) | `CRYSK_CLAUDE_OAUTH_TOKEN` or `CRYSK_CLAUDE_API_KEY` | Claude, when any step runs a `claude:` model. |
|
|
12
|
+
| **Secrets** | `CRYSK_OPENCODE_<P>_API_KEY` | One per OpenCode provider the models name. `<P>` is the provider id upper case, `-` and `.` as `_` (`deepseek` → `DEEPSEEK`, `github-copilot` → `GITHUB_COPILOT`). |
|
|
13
|
+
| **Secrets** | `CRYSK_OPENCODE_OPENAI_OAUTH` | Only for an OpenAI (ChatGPT) subscription: the `openai` record of OpenCode's `auth.json`, base64 on one line. |
|
|
14
|
+
| **Variables** (public) | `CRYSK_MODELS` | The `models` object: role → ordered list of models. No credentials. |
|
|
15
|
+
| **Variables** | `CRYSK_OPENCODE_PROVIDERS` | JSON array of the `<P>` tokens whose API keys the workflow forwards, at most 5, e.g. `["DEEPSEEK"]`. |
|
|
16
|
+
| **Variables** | `CRYSK_CREDENTIALS` (optional) | The Claude order, e.g. `{"claude": ["api_key", "subscription"]}`. Unset: subscription first. |
|
|
17
|
+
|
|
18
|
+
Do **not** create `OPENAI_API_KEY`, `DEEPSEEK_API_KEY`, or any other secret outside the `CRYSK_*` names: the workflow forwards only the names in its `crysk-secrets` block, never `toJSON(secrets)`. The old `OPENCODE_AUTH_JSON` secret and `CRYSK_ROUTING` variable are read by nothing, and the `opencode-auth` / `routing` inputs that carried them stop the run (`CRYSK-INPUT-REMOVED`).
|
|
19
|
+
|
|
20
|
+
Unset `CRYSK_MODELS` = Claude-only CI.
|
|
21
|
+
|
|
22
|
+
## Fastest path: `crysk ci init`
|
|
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.
|
|
25
|
+
|
|
26
|
+
## Models per role
|
|
27
|
+
|
|
28
|
+
`CRYSK_MODELS` maps a **role** to a list of one to three models, tried in order (the next one only on a provider failure: rate limit, quota, network, timeout, model unavailable):
|
|
29
|
+
|
|
30
|
+
| Role | Steps |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `default` | every role not listed (not the judge) |
|
|
33
|
+
| `hunter.<key>` | one hunter: `logic`, `reliability`, `resilience`, `security` |
|
|
34
|
+
| `refuter` | refuter, re-review verifier, CI adjudicator |
|
|
35
|
+
| `consolidate`, `summary` | those steps |
|
|
36
|
+
| `judge` | materiality judge: only `claude:sonnet-latest` or `claude:opus-latest`, never `default` |
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
40
|
+
### OpenCode-only
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-flash"]}'
|
|
44
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
45
|
+
gh secret set CRYSK_OPENCODE_DEEPSEEK_API_KEY
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Every step runs on DeepSeek. Without a Claude secret, keep `materiality_gate` off: the judge runs only on Claude.
|
|
49
|
+
|
|
50
|
+
### OpenCode hunters, Claude refuter and summarizer, Claude fallback
|
|
51
|
+
|
|
52
|
+
```bash
|
|
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
|
+
```
|
|
55
|
+
|
|
56
|
+
Keep `CRYSK_CLAUDE_OAUTH_TOKEN` (or `CRYSK_CLAUDE_API_KEY`) beside the DeepSeek secret. The OpenCode auth file still applies the metered ceiling.
|
|
57
|
+
|
|
58
|
+
### Two OpenCode providers
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-pro", "opencode:openai/gpt-5"]}'
|
|
62
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Each model runs on its own provider's secret, through its own OpenCode server. Here OpenAI is the ChatGPT subscription through `CRYSK_OPENCODE_OPENAI_OAUTH`, which has its own fixed line, so only DeepSeek needs a token; for an OpenAI API key instead, list `"OPENAI"` too and set `CRYSK_OPENCODE_OPENAI_API_KEY`.
|
|
66
|
+
|
|
67
|
+
## OpenAI
|
|
68
|
+
|
|
69
|
+
| Secret | CI |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `CRYSK_OPENCODE_OPENAI_API_KEY` | Metered API key. Runs. |
|
|
72
|
+
| `CRYSK_OPENCODE_OPENAI_OAUTH` | The ChatGPT subscription. Wins when both are set. |
|
|
73
|
+
| `_OAUTH` for any other provider the models use | **Refused**, naming the secret. Use that provider's `_API_KEY`. |
|
|
74
|
+
|
|
75
|
+
Setting the subscription (the record keeps its refresh token, so OpenCode renews the access token during a run; the renewed token is not saved, so re-run this after an `opencode auth login`):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
jq -c .openai ~/.local/share/opencode/auth.json | base64 -w0 | gh secret set CRYSK_OPENCODE_OPENAI_OAUTH # on macOS, drop -w0
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Ask the human before putting a personal ChatGPT session in a repository secret: anyone who can change the workflow on the default branch can use it.
|
|
82
|
+
|
|
83
|
+
## Workflow
|
|
84
|
+
|
|
85
|
+
The scaffold's `with:` must keep the `crysk-secrets: |` block (the fixed Claude and OpenAI lines plus the five `CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[i] }}_API_KEY=…` slots) and:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
models: ${{ vars.CRYSK_MODELS }}
|
|
89
|
+
credentials: ${{ vars.CRYSK_CREDENTIALS }}
|
|
90
|
+
```
|
|
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.
|
|
93
|
+
|
|
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
|
+
|
|
96
|
+
## Fail-closed edges
|
|
97
|
+
|
|
98
|
+
- Fork pushes still skip (no secrets); a maintainer's `/crysk review` comment reviews a fork.
|
|
99
|
+
- OpenCode-only (only `CRYSK_OPENCODE_*` secrets) counts as a credential and reviews, as long as no step runs a `claude:` model.
|
|
100
|
+
- No credential at all fails the run red, with the `gh secret set` commands in the step summary.
|
|
101
|
+
- An OpenCode model whose provider has no secret starts, then **fails** for the missing record (unless the provider serves that model free).
|
|
102
|
+
- A `CRYSK_MODELS` or `CRYSK_CREDENTIALS` value the parser refuses fails the run (`CRYSK-CONFIG-INVALID`), naming the input, never its content.
|
|
103
|
+
|
|
104
|
+
## After setting DATA
|
|
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, and the spend notices show metered when the OpenCode auth file is present.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# OpenCode in CI — operator procedure
|
|
2
|
+
|
|
3
|
+
Read this when the operator wants OpenCode, DeepSeek, mixed Claude+OpenCode, fallback models, or different models per step in GitHub Actions. Full narrative: `docs/github-actions.md` (sections **OpenCode in CI** and **`CRYSK_*` secrets**); model rules: `docs/configuration.md` (section **Models**).
|
|
4
|
+
|
|
5
|
+
Do **not** print, `cat`, or log credential values. Inspect **keys and `type` only**.
|
|
6
|
+
|
|
7
|
+
## What goes where
|
|
8
|
+
|
|
9
|
+
| GitHub box | Name | Holds |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| **Secrets** (hidden) | `CRYSK_CLAUDE_OAUTH_TOKEN` or `CRYSK_CLAUDE_API_KEY` | Claude, when any step runs a `claude:` model. |
|
|
12
|
+
| **Secrets** | `CRYSK_OPENCODE_<P>_API_KEY` | One per OpenCode provider the models name. `<P>` is the provider id upper case, `-` and `.` as `_` (`deepseek` → `DEEPSEEK`, `github-copilot` → `GITHUB_COPILOT`). |
|
|
13
|
+
| **Secrets** | `CRYSK_OPENCODE_OPENAI_OAUTH` | Only for an OpenAI (ChatGPT) subscription: the `openai` record of OpenCode's `auth.json`, base64 on one line. |
|
|
14
|
+
| **Variables** (public) | `CRYSK_MODELS` | The `models` object: role → ordered list of models. No credentials. |
|
|
15
|
+
| **Variables** | `CRYSK_OPENCODE_PROVIDERS` | JSON array of the `<P>` tokens whose API keys the workflow forwards, at most 5, e.g. `["DEEPSEEK"]`. |
|
|
16
|
+
| **Variables** | `CRYSK_CREDENTIALS` (optional) | The Claude order, e.g. `{"claude": ["api_key", "subscription"]}`. Unset: subscription first. |
|
|
17
|
+
|
|
18
|
+
Do **not** create `OPENAI_API_KEY`, `DEEPSEEK_API_KEY`, or any other secret outside the `CRYSK_*` names: the workflow forwards only the names in its `crysk-secrets` block, never `toJSON(secrets)`. The old `OPENCODE_AUTH_JSON` secret and `CRYSK_ROUTING` variable are read by nothing, and the `opencode-auth` / `routing` inputs that carried them stop the run (`CRYSK-INPUT-REMOVED`).
|
|
19
|
+
|
|
20
|
+
Unset `CRYSK_MODELS` = Claude-only CI.
|
|
21
|
+
|
|
22
|
+
## Fastest path: `crysk ci init`
|
|
23
|
+
|
|
24
|
+
If the operator already has `models` in `~/.crysk/config.json`, `npx -y crysk@0.7.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
|
+
|
|
26
|
+
## Models per role
|
|
27
|
+
|
|
28
|
+
`CRYSK_MODELS` maps a **role** to a list of one to three models, tried in order (the next one only on a provider failure: rate limit, quota, network, timeout, model unavailable):
|
|
29
|
+
|
|
30
|
+
| Role | Steps |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `default` | every role not listed (not the judge) |
|
|
33
|
+
| `hunter.<key>` | one hunter: `logic`, `reliability`, `resilience`, `security` |
|
|
34
|
+
| `refuter` | refuter, re-review verifier, CI adjudicator |
|
|
35
|
+
| `consolidate`, `summary` | those steps |
|
|
36
|
+
| `judge` | materiality judge: only `claude:sonnet-latest` or `claude:opus-latest`, never `default` |
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
40
|
+
### OpenCode-only
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-flash"]}'
|
|
44
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
45
|
+
gh secret set CRYSK_OPENCODE_DEEPSEEK_API_KEY
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Every step runs on DeepSeek. Without a Claude secret, keep `materiality_gate` off: the judge runs only on Claude.
|
|
49
|
+
|
|
50
|
+
### OpenCode hunters, Claude refuter and summarizer, Claude fallback
|
|
51
|
+
|
|
52
|
+
```bash
|
|
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
|
+
```
|
|
55
|
+
|
|
56
|
+
Keep `CRYSK_CLAUDE_OAUTH_TOKEN` (or `CRYSK_CLAUDE_API_KEY`) beside the DeepSeek secret. The OpenCode auth file still applies the metered ceiling.
|
|
57
|
+
|
|
58
|
+
### Two OpenCode providers
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-pro", "opencode:openai/gpt-5"]}'
|
|
62
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Each model runs on its own provider's secret, through its own OpenCode server. Here OpenAI is the ChatGPT subscription through `CRYSK_OPENCODE_OPENAI_OAUTH`, which has its own fixed line, so only DeepSeek needs a token; for an OpenAI API key instead, list `"OPENAI"` too and set `CRYSK_OPENCODE_OPENAI_API_KEY`.
|
|
66
|
+
|
|
67
|
+
## OpenAI
|
|
68
|
+
|
|
69
|
+
| Secret | CI |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `CRYSK_OPENCODE_OPENAI_API_KEY` | Metered API key. Runs. |
|
|
72
|
+
| `CRYSK_OPENCODE_OPENAI_OAUTH` | The ChatGPT subscription. Wins when both are set. |
|
|
73
|
+
| `_OAUTH` for any other provider the models use | **Refused**, naming the secret. Use that provider's `_API_KEY`. |
|
|
74
|
+
|
|
75
|
+
Setting the subscription (the record keeps its refresh token, so OpenCode renews the access token during a run; the renewed token is not saved, so re-run this after an `opencode auth login`):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
jq -c .openai ~/.local/share/opencode/auth.json | base64 -w0 | gh secret set CRYSK_OPENCODE_OPENAI_OAUTH # on macOS, drop -w0
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Ask the human before putting a personal ChatGPT session in a repository secret: anyone who can change the workflow on the default branch can use it.
|
|
82
|
+
|
|
83
|
+
## Workflow
|
|
84
|
+
|
|
85
|
+
The scaffold's `with:` must keep the `crysk-secrets: |` block (the fixed Claude and OpenAI lines plus the five `CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[i] }}_API_KEY=…` slots) and:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
models: ${{ vars.CRYSK_MODELS }}
|
|
89
|
+
credentials: ${{ vars.CRYSK_CREDENTIALS }}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Copy it from `assets/workflow.yml` or re-scaffold with `npx -y crysk@0.7.0 ci init --force`; never write it from memory. An unused slot renders as `CRYSK_OPENCODE__API_KEY=` and is skipped.
|
|
93
|
+
|
|
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
|
+
|
|
96
|
+
## Fail-closed edges
|
|
97
|
+
|
|
98
|
+
- Fork pushes still skip (no secrets); a maintainer's `/crysk review` comment reviews a fork.
|
|
99
|
+
- OpenCode-only (only `CRYSK_OPENCODE_*` secrets) counts as a credential and reviews, as long as no step runs a `claude:` model.
|
|
100
|
+
- No credential at all fails the run red, with the `gh secret set` commands in the step summary.
|
|
101
|
+
- An OpenCode model whose provider has no secret starts, then **fails** for the missing record (unless the provider serves that model free).
|
|
102
|
+
- A `CRYSK_MODELS` or `CRYSK_CREDENTIALS` value the parser refuses fails the run (`CRYSK-CONFIG-INVALID`), naming the input, never its content.
|
|
103
|
+
|
|
104
|
+
## After setting DATA
|
|
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, and the spend notices show metered when the OpenCode auth file is present.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# OpenCode in CI — operator procedure
|
|
2
|
+
|
|
3
|
+
Read this when the operator wants OpenCode, DeepSeek, mixed Claude+OpenCode, fallback models, or different models per step in GitHub Actions. Full narrative: `docs/github-actions.md` (sections **OpenCode in CI** and **`CRYSK_*` secrets**); model rules: `docs/configuration.md` (section **Models**).
|
|
4
|
+
|
|
5
|
+
Do **not** print, `cat`, or log credential values. Inspect **keys and `type` only**.
|
|
6
|
+
|
|
7
|
+
## What goes where
|
|
8
|
+
|
|
9
|
+
| GitHub box | Name | Holds |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| **Secrets** (hidden) | `CRYSK_CLAUDE_OAUTH_TOKEN` or `CRYSK_CLAUDE_API_KEY` | Claude, when any step runs a `claude:` model. |
|
|
12
|
+
| **Secrets** | `CRYSK_OPENCODE_<P>_API_KEY` | One per OpenCode provider the models name. `<P>` is the provider id upper case, `-` and `.` as `_` (`deepseek` → `DEEPSEEK`, `github-copilot` → `GITHUB_COPILOT`). |
|
|
13
|
+
| **Secrets** | `CRYSK_OPENCODE_OPENAI_OAUTH` | Only for an OpenAI (ChatGPT) subscription: the `openai` record of OpenCode's `auth.json`, base64 on one line. |
|
|
14
|
+
| **Variables** (public) | `CRYSK_MODELS` | The `models` object: role → ordered list of models. No credentials. |
|
|
15
|
+
| **Variables** | `CRYSK_OPENCODE_PROVIDERS` | JSON array of the `<P>` tokens whose API keys the workflow forwards, at most 5, e.g. `["DEEPSEEK"]`. |
|
|
16
|
+
| **Variables** | `CRYSK_CREDENTIALS` (optional) | The Claude order, e.g. `{"claude": ["api_key", "subscription"]}`. Unset: subscription first. |
|
|
17
|
+
|
|
18
|
+
Do **not** create `OPENAI_API_KEY`, `DEEPSEEK_API_KEY`, or any other secret outside the `CRYSK_*` names: the workflow forwards only the names in its `crysk-secrets` block, never `toJSON(secrets)`. The old `OPENCODE_AUTH_JSON` secret and `CRYSK_ROUTING` variable are read by nothing, and the `opencode-auth` / `routing` inputs that carried them stop the run (`CRYSK-INPUT-REMOVED`).
|
|
19
|
+
|
|
20
|
+
Unset `CRYSK_MODELS` = Claude-only CI.
|
|
21
|
+
|
|
22
|
+
## Fastest path: `crysk ci init`
|
|
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.
|
|
25
|
+
|
|
26
|
+
## Models per role
|
|
27
|
+
|
|
28
|
+
`CRYSK_MODELS` maps a **role** to a list of one to three models, tried in order (the next one only on a provider failure: rate limit, quota, network, timeout, model unavailable):
|
|
29
|
+
|
|
30
|
+
| Role | Steps |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `default` | every role not listed (not the judge) |
|
|
33
|
+
| `hunter.<key>` | one hunter: `logic`, `parity`, `reliability`, `resilience`, `security` |
|
|
34
|
+
| `refuter` | refuter, re-review verifier, CI adjudicator |
|
|
35
|
+
| `consolidate`, `summary` | those steps |
|
|
36
|
+
| `judge` | materiality judge: only `claude:sonnet-latest` or `claude:opus-latest`, never `default` |
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
40
|
+
### OpenCode-only
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-flash"]}'
|
|
44
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
45
|
+
gh secret set CRYSK_OPENCODE_DEEPSEEK_API_KEY
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Every step runs on DeepSeek. Without a Claude secret, keep `materiality_gate` off: the judge runs only on Claude.
|
|
49
|
+
|
|
50
|
+
### OpenCode hunters, Claude refuter and summarizer, Claude fallback
|
|
51
|
+
|
|
52
|
+
```bash
|
|
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
|
+
```
|
|
55
|
+
|
|
56
|
+
Keep `CRYSK_CLAUDE_OAUTH_TOKEN` (or `CRYSK_CLAUDE_API_KEY`) beside the DeepSeek secret. The OpenCode auth file still applies the metered ceiling.
|
|
57
|
+
|
|
58
|
+
### Two OpenCode providers
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gh variable set CRYSK_MODELS --body '{"default": ["opencode:deepseek/deepseek-v4-pro", "opencode:openai/gpt-5"]}'
|
|
62
|
+
gh variable set CRYSK_OPENCODE_PROVIDERS --body '["DEEPSEEK"]'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Each model runs on its own provider's secret, through its own OpenCode server. Here OpenAI is the ChatGPT subscription through `CRYSK_OPENCODE_OPENAI_OAUTH`, which has its own fixed line, so only DeepSeek needs a token; for an OpenAI API key instead, list `"OPENAI"` too and set `CRYSK_OPENCODE_OPENAI_API_KEY`.
|
|
66
|
+
|
|
67
|
+
## OpenAI
|
|
68
|
+
|
|
69
|
+
| Secret | CI |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `CRYSK_OPENCODE_OPENAI_API_KEY` | Metered API key. Runs. |
|
|
72
|
+
| `CRYSK_OPENCODE_OPENAI_OAUTH` | The ChatGPT subscription. Wins when both are set. |
|
|
73
|
+
| `_OAUTH` for any other provider the models use | **Refused**, naming the secret. Use that provider's `_API_KEY`. |
|
|
74
|
+
|
|
75
|
+
Setting the subscription (the record keeps its refresh token, so OpenCode renews the access token during a run; the renewed token is not saved, so re-run this after an `opencode auth login`):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
jq -c .openai ~/.local/share/opencode/auth.json | base64 -w0 | gh secret set CRYSK_OPENCODE_OPENAI_OAUTH # on macOS, drop -w0
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Ask the human before putting a personal ChatGPT session in a repository secret: anyone who can change the workflow on the default branch can use it.
|
|
82
|
+
|
|
83
|
+
## Workflow
|
|
84
|
+
|
|
85
|
+
The scaffold's `with:` must keep the `crysk-secrets: |` block (the fixed Claude and OpenAI lines plus the five `CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[i] }}_API_KEY=…` slots) and:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
models: ${{ vars.CRYSK_MODELS }}
|
|
89
|
+
credentials: ${{ vars.CRYSK_CREDENTIALS }}
|
|
90
|
+
```
|
|
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.
|
|
93
|
+
|
|
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
|
+
|
|
96
|
+
## Fail-closed edges
|
|
97
|
+
|
|
98
|
+
- Fork pushes still skip (no secrets); a maintainer's `/crysk review` comment reviews a fork.
|
|
99
|
+
- OpenCode-only (only `CRYSK_OPENCODE_*` secrets) counts as a credential and reviews, as long as no step runs a `claude:` model.
|
|
100
|
+
- No credential at all fails the run red, with the `gh secret set` commands in the step summary.
|
|
101
|
+
- An OpenCode model whose provider has no secret starts, then **fails** for the missing record (unless the provider serves that model free).
|
|
102
|
+
- A `CRYSK_MODELS` or `CRYSK_CREDENTIALS` value the parser refuses fails the run (`CRYSK-CONFIG-INVALID`), naming the input, never its content.
|
|
103
|
+
|
|
104
|
+
## After setting DATA
|
|
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, and the spend notices show metered when the OpenCode auth file is present.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Generated by `crysk setup --ci` (or `crysk ci init`).
|
|
2
|
+
# Customize freely — re-running setup will not overwrite this file again
|
|
3
|
+
# unless you pass --force.
|
|
4
|
+
#
|
|
5
|
+
# This one file is the whole install. It reviews every push to a pull
|
|
6
|
+
# request. A pull request comment that is exactly `/crysk review` runs the
|
|
7
|
+
# review again with the skip gates bypassed, and `/crysk review --full`
|
|
8
|
+
# also re-discovers the whole range. A comment that is exactly
|
|
9
|
+
# `/crysk override` turns the gate green on that head with no review and
|
|
10
|
+
# no cost, and records who did it. A comment that is exactly
|
|
11
|
+
# `/crysk recheck` reviews the head and asks the CI adjudicator to rule on
|
|
12
|
+
# pending dismissals of blocking findings. The action parses the comment and
|
|
13
|
+
# refuses a commenter without write access.
|
|
14
|
+
name: Crysk Review
|
|
15
|
+
|
|
16
|
+
on:
|
|
17
|
+
pull_request:
|
|
18
|
+
types: [opened, synchronize, reopened]
|
|
19
|
+
# GitHub runs a comment-triggered workflow from the DEFAULT branch's copy
|
|
20
|
+
# of this file, never the pull request's. The comment trigger works only
|
|
21
|
+
# once this file is merged there; until then a comment starts nothing.
|
|
22
|
+
issue_comment:
|
|
23
|
+
types: [created]
|
|
24
|
+
|
|
25
|
+
# pull-requests: write lets Crysk post inline comments and a step summary.
|
|
26
|
+
# contents: read is enough for actions/checkout. issues: write lets it
|
|
27
|
+
# resolve/reply on review threads (GitHub models PR conversations as issues).
|
|
28
|
+
# checks: write persists the durable CI admission attempt ledger (WU-02).
|
|
29
|
+
# actions: read lets the admission gate list this workflow's past runs; a
|
|
30
|
+
# public repo serves that without the scope, a private one returns HTTP 403.
|
|
31
|
+
permissions:
|
|
32
|
+
actions: read
|
|
33
|
+
contents: read
|
|
34
|
+
pull-requests: write
|
|
35
|
+
issues: write
|
|
36
|
+
statuses: write
|
|
37
|
+
checks: write
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
review:
|
|
41
|
+
# This `if` routes events; it never checks credentials. The secrets
|
|
42
|
+
# context is unreadable in a job-level `if`, so the action detects a
|
|
43
|
+
# missing credential itself and fails the run with the commands that
|
|
44
|
+
# fix it, instead of a skipped job that reads as a clean review.
|
|
45
|
+
#
|
|
46
|
+
# Fork pull_request runs are skipped: GitHub gives them no secrets, so
|
|
47
|
+
# they could never authenticate. A maintainer comments `/crysk review`
|
|
48
|
+
# instead, and that run (base-branch context, with secrets) reviews the
|
|
49
|
+
# fork's head.
|
|
50
|
+
#
|
|
51
|
+
# A comment starts the job only when it BEGINS with `/crysk review`,
|
|
52
|
+
# `/crysk recheck` or `/crysk override`. The action then requires an exact match after
|
|
53
|
+
# trimming, so a near-miss such as "/crysk review please" starts a job the
|
|
54
|
+
# action ends without reviewing or overriding.
|
|
55
|
+
if: >-
|
|
56
|
+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
|
|
57
|
+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk review')) ||
|
|
58
|
+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk recheck')) ||
|
|
59
|
+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/crysk override'))
|
|
60
|
+
# Job-level and keyed on the pull request number. A workflow-level group
|
|
61
|
+
# on `github.head_ref || github.ref` put every comment on every pull
|
|
62
|
+
# request into ONE group, because head_ref is empty on issue_comment, so
|
|
63
|
+
# any comment anywhere could cancel any in-flight review.
|
|
64
|
+
#
|
|
65
|
+
# Only a new push cancels. The group filter is a prefix, so a near-miss
|
|
66
|
+
# comment can claim the pull request's group too; cancelling there would
|
|
67
|
+
# kill a paid in-flight review before the action ignored the comment. A
|
|
68
|
+
# comment run queues instead. A push never waits: it cancels whatever is
|
|
69
|
+
# running, a forced comment run included, because the head it reviewed
|
|
70
|
+
# is gone (comment again on the new head).
|
|
71
|
+
#
|
|
72
|
+
# GitHub keeps one PENDING run per group, and a newer run replaces it. So
|
|
73
|
+
# a comment enters the pull request's group only when it starts with
|
|
74
|
+
# /crysk review, /crysk recheck or /crysk override, and GitHub associates its author
|
|
75
|
+
# with the repository as OWNER, MEMBER or COLLABORATOR; every other comment
|
|
76
|
+
# gets its own group. Without that, anyone who can comment could replace a
|
|
77
|
+
# maintainer's queued review with a run the action then refuses. The job
|
|
78
|
+
# `if:` above does NOT check the association: a writer GitHub reports
|
|
79
|
+
# under another one (a private org member shown as CONTRIBUTOR) still
|
|
80
|
+
# runs, because the action checks the real permission, just in its own
|
|
81
|
+
# group. KNOWN GAP: an associated author's later comment (a writer's
|
|
82
|
+
# near-miss or second real command, or a read-only member's or
|
|
83
|
+
# collaborator's refused one) still replaces a comment run waiting
|
|
84
|
+
# behind a running review, and `--full` followed by a plain
|
|
85
|
+
# `/crysk review` loses the `--full`; comment again to recover. A
|
|
86
|
+
# writer reported under another association runs unserialized, beside
|
|
87
|
+
# any review already running.
|
|
88
|
+
#
|
|
89
|
+
# A fork's push never enters the pull request's group: its job is skipped
|
|
90
|
+
# above, and if a skipped job still claimed the group, the fork author's
|
|
91
|
+
# push would cancel a maintainer's in-flight review of that fork. Every
|
|
92
|
+
# other event gets a unique per-run group for the same reason, so a
|
|
93
|
+
# skipped job can never cancel or replace a review.
|
|
94
|
+
concurrency:
|
|
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) }}
|
|
96
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
# Backstop for a HUNG runner, not a second review budget. Crysk already
|
|
99
|
+
# enforces its own 75-minute whole-pipeline ceiling, which closes
|
|
100
|
+
# artifacts and reports before exiting; a CI bound at or below that would
|
|
101
|
+
# kill the job first and throw away the salvage. Above it, this only ever
|
|
102
|
+
# fires when the process is genuinely stuck.
|
|
103
|
+
timeout-minutes: 90
|
|
104
|
+
steps:
|
|
105
|
+
- name: Checkout
|
|
106
|
+
uses: actions/checkout@v4
|
|
107
|
+
with:
|
|
108
|
+
# fetch-depth: 0 is load-bearing, not cosmetic: Crysk computes
|
|
109
|
+
# the pull request's diff range and commit ancestry from full git
|
|
110
|
+
# history. actions/checkout's default is a SHALLOW clone, which
|
|
111
|
+
# cannot produce an accurate diff or blame — trimming this line
|
|
112
|
+
# does not fail loudly, it makes reviews silently miss context.
|
|
113
|
+
fetch-depth: 0
|
|
114
|
+
|
|
115
|
+
- name: Run Crysk
|
|
116
|
+
# The id keeps this step's outputs (`status`, `run-dir`, ...)
|
|
117
|
+
# readable from any step you add below.
|
|
118
|
+
# The action uploads the run directory as an artifact itself, so
|
|
119
|
+
# `crysk triage reply --from` has an input in CI (see action.yml).
|
|
120
|
+
id: pr-hero
|
|
121
|
+
uses: cryskai/crysk@v0
|
|
122
|
+
with:
|
|
123
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
124
|
+
# The Crysk credentials: one CRYSK_* secret per line, each named
|
|
125
|
+
# explicitly (never the whole secrets context, which would hand the
|
|
126
|
+
# action every secret of the repository). A secret the repository does not have
|
|
127
|
+
# arrives empty and counts as absent, so every line stays. With
|
|
128
|
+
# both Claude secrets set, credentials.claude picks one (the subscription first).
|
|
129
|
+
# CRYSK_CLAUDE_OAUTH_TOKEN — from `claude setup-token`: a long-lived
|
|
130
|
+
# (~1 year) token that draws on your Claude subscription. The
|
|
131
|
+
# session token `/login` leaves in the keychain expires in hours.
|
|
132
|
+
# CRYSK_CLAUDE_API_KEY — pay-as-you-go key (billed per token).
|
|
133
|
+
# CRYSK_OPENCODE_OPENAI_OAUTH — an OpenAI (ChatGPT) subscription for
|
|
134
|
+
# OpenCode: the openai record of OpenCode's auth.json, base64 on one line.
|
|
135
|
+
# CRYSK_OPENCODE_<PROVIDER>_API_KEY — an OpenCode provider's API key,
|
|
136
|
+
# <PROVIDER> being its id uppercased with - and . as _. The 5
|
|
137
|
+
# lines after the fixed ones forward the providers listed in
|
|
138
|
+
# vars.CRYSK_OPENCODE_PROVIDERS (a JSON array, e.g. ["DEEPSEEK"]);
|
|
139
|
+
# an unused line renders as CRYSK_OPENCODE__API_KEY= and is skipped.
|
|
140
|
+
# `crysk ci init` prints the commands that set these secrets and variables.
|
|
141
|
+
crysk-secrets: |
|
|
142
|
+
CRYSK_CLAUDE_OAUTH_TOKEN=${{ secrets.CRYSK_CLAUDE_OAUTH_TOKEN }}
|
|
143
|
+
CRYSK_CLAUDE_API_KEY=${{ secrets.CRYSK_CLAUDE_API_KEY }}
|
|
144
|
+
CRYSK_OPENCODE_OPENAI_OAUTH=${{ secrets.CRYSK_OPENCODE_OPENAI_OAUTH }}
|
|
145
|
+
CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[0] }}_API_KEY=${{ secrets[format('CRYSK_OPENCODE_{0}_API_KEY', fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[0])] }}
|
|
146
|
+
CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[1] }}_API_KEY=${{ secrets[format('CRYSK_OPENCODE_{0}_API_KEY', fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[1])] }}
|
|
147
|
+
CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[2] }}_API_KEY=${{ secrets[format('CRYSK_OPENCODE_{0}_API_KEY', fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[2])] }}
|
|
148
|
+
CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[3] }}_API_KEY=${{ secrets[format('CRYSK_OPENCODE_{0}_API_KEY', fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[3])] }}
|
|
149
|
+
CRYSK_OPENCODE_${{ fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[4] }}_API_KEY=${{ secrets[format('CRYSK_OPENCODE_{0}_API_KEY', fromJSON(vars.CRYSK_OPENCODE_PROVIDERS || '[]')[4])] }}
|
|
150
|
+
# The models per role and the Claude credential order, as JSON, from
|
|
151
|
+
# repository variables. Unset, every role runs the default Claude model
|
|
152
|
+
# and the subscription is tried first.
|
|
153
|
+
models: ${{ vars.CRYSK_MODELS }}
|
|
154
|
+
credentials: ${{ vars.CRYSK_CREDENTIALS }}
|
|
155
|
+
# The model profile (claude or openai) from a repository variable.
|
|
156
|
+
# Unset, the claude profile. models still wins role by role.
|
|
157
|
+
profile: ${{ vars.CRYSK_PROFILE }}
|
|
158
|
+
mode: gate
|
package/package.json
CHANGED
|
@@ -22,4 +22,5 @@
|
|
|
22
22
|
- **Modifications (2026-11-15, finding contract):** Body change in all four hunter prompts. Each prompt's own severity section (`## 6. No-Self-Filter Mandate` in logic, resilience and parity; `### Severity — answer the hypothetical, then stop` in reliability) is replaced by one `Finding contract` section, byte-identical in the four (`test/review/bundled-prompts-finding-contract.test.ts`). It says what a finding consists of (fact, trigger, consequence, in that order, and which links were read), defines `severity` by the consequence taken as if the trigger happens, and defines `evidence_class` and `causal_disposition`, which no hunter but reliability defined before although the tier rule reads both. Decided by the owner on 2026-11-15: the consequence sets severity; an irreversible consequence or a security boundary crossed is `BLOCKER` even when the trigger is uncommon, as long as a user or a caller can cause it; `WARNING` is for wrong behaviour that can be recovered from and needs a condition the claim names. Removed with the old sections: a ladder written for a user interface ("stuck spinner, wrong rendered values, dead control"), "latent-until-triggered → `WARNING`", and "emit the finding anyway", which the engine's read requirement contradicts. Reliability keeps its two worked calibrations after the contract. No schema field is added: the three links are a writing rule for `claim`. Revised the same day after the review of the first version: the severity rule is stated in two steps (an irreversible or security consequence is `BLOCKER` whatever the trigger; otherwise ordinary operation gives `CRITICAL` and a named condition gives `WARNING`), because "from the third link alone" contradicted a ladder that separated two levels by the trigger; and three lines outside the section that gave `claim` another shape, put likelihood in `evidence_class`, or sent a defect in unchanged code to `pre-existing` were brought in line with it. A second review pass found two more of the same kind, and the rest of the four prompts was then read line by line for it: the noise rules of parity and resilience ("distinguish diff-introduced from pre-existing risk and down-weight the latter") now name `causal_disposition` and say not to lower severity for it; and the contract says that being unsure a trigger happens is not a named condition, which reliability's first worked calibration now repeats instead of calling that doubt "the trigger link". The same pass showed a hole in step 1: an irreversible consequence whose trigger no user or caller causes (a dependency failing part-way through a write) fell through to `WARNING`; the trigger is now anything that can happen in the running system, a failure the system has to expect included. Left as it is, for the division-of-labour slice: "weigh fix cost against realistic benefit" in parity and resilience.
|
|
23
23
|
- **Additions (2026-11-15, security hunter):** New file `deep-review-security.md`, key `security`, written for this set (it has no upstream). It runs on every review, beside reliability, resilience and logic. Its question is whether a change lets someone do or see what they are not entitled to, asked of every changed hunk in four parts: outside input reaching something that interprets it, an operation on something that belongs to someone, a control the change removes or steps around, a secret outside its place. It lists what it does not report (input only a trusted party can supply, values the system produced, a control that holds, hardening with no path, dependencies, tests and placeholders, style). It carries the shared `Finding contract` section, byte-identical to the other hunters, and reports under the existing category 4, so the findings schema does not change. The other five prompts are byte-identical. Measured the day it was written, single runs: 5 of 5 planted defects found and rated blocking, 0 of 4 correct look-alikes reported, and 0 findings on 7 changes with no security defect. Read those numbers with their limit: the six synthetic cases were built by an agent that did not see the prompt, but their defects and look-alikes were specified by the prompt's author, and the prompt names the same shapes, so on them the result is in-sample (the prompt follows its own text; it says nothing about other shapes). The independent sample is six real commits from four projects: one path-escape defect found, five changes with no security defect left alone. On the four synthetic defects the logic hunter also found 4 of 4, so these cases show no defect the set missed before; what the new hunter adds beyond them is not measured. In one full local review of one of those cases all four always-on hunters reported the planted defect, the merge step folded them into one finding and the refuter corroborated it; the new hunter was 13% of that review's notional cost.
|
|
24
24
|
- **Modifications (2026-11-16, refuter, own history removed):** Body change in `review-refuter.md` only, one clause deleted: "Both alternatives are errors, and this project has made both." now reads "Both alternatives are errors." The clause told a model reviewing another repository about this engine's own past. No verdict rule, mandate or output contract changed. Guarded by `test/review/bundled-prompts-self-contained.test.ts`.
|
|
25
|
+
- **Removals (2026-11-16, parity retired):** Removed `deep-review-parity.md` from the bundled set, and its hunter from the product's review spec. It was the only conditional hunter: it ran only when a repository declared `parity_trigger_paths`, and no repository does, so no review ran it. The four remaining hunter prompts and `review-refuter.md` are byte-identical. A copy left in a custom `agents_dir` is ignored with a warning. The entries above that name the file are history. Guarded by `test/parity-removal-compat.test.ts` and `test/assets.test.ts` (the manifest and `prompts/default/` agree).
|
|
25
26
|
- **Verification:** The freeze was verified via `bun run refuter-probe` and `bun run fixture-eval`. The stripped revision passed `bun run refuter-probe` on 2026-08-24 (3 replicates x 4 arms, 12/12 verdicts matched: `corroborated`, `refuted` on both false-claim arms, `downgraded-latent`; refuter model `sonnet`, refuter cost $0.8222). `bun run fixture-eval` has not been re-run for the stripped revision.
|
package/skills/crysk/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
Load when the user wants to **operate or configure Crysk on their machine or repo**:
|
|
13
13
|
- Change which model or backend a step runs on (per role, with fallbacks: OpenCode, DeepSeek, a pinned Claude version).
|
|
14
14
|
- Tune effort, caps, the size gate, `.cryskignore`, `REVIEW.md` / `gotchas.md`, or any `config.json` key.
|
|
15
|
-
- Run a review (local branch or `--pr <n>`)
|
|
15
|
+
- Run a review (local branch or `--pr <n>`) or read its artifacts. The engine prints no dollar figure; cost and cost limits live in the Crysk platform dashboard.
|
|
16
16
|
- Set up the watcher (`crysk watch`) or worktree GC (`crysk gc`).
|
|
17
17
|
- Diagnose a broken install or a refused run (`crysk doctor`, `crysk config`).
|
|
18
18
|
|
|
@@ -25,15 +25,15 @@ This skill holds the mental model and the traps, not the reference. Before actin
|
|
|
25
25
|
- `crysk --help` — the installed version's real commands and flags.
|
|
26
26
|
- The docs on GitHub (they are not shipped in the npm package): [README](https://github.com/cryskai/crysk/blob/main/README.md), [configuration.md](https://github.com/cryskai/crysk/blob/main/docs/configuration.md).
|
|
27
27
|
|
|
28
|
-
If Crysk is not on `PATH`, run every command as `npx -y crysk <command>` (Node is enough). An install from before the rename (the package used to be `pr-hero`) still answers to `pr-hero`; either command is the same program.
|
|
28
|
+
If Crysk is not on `PATH`, run every command as `npx -y crysk@0.8.0 <command>` (Node is enough). An install from before the rename (the package used to be `pr-hero`) still answers to `pr-hero`; either command is the same program.
|
|
29
29
|
|
|
30
30
|
## Mental Model
|
|
31
31
|
|
|
32
32
|
- **Two config files, owned by different people.** `~/.crysk/config.json` is the person's (never committed; `~/.prhero/config.json` on an install from before the rename — never create `~/.crysk` by hand while `~/.prhero` is in use, the CLI would switch homes); `<repo>/.crysk/config.json` is the team's (committed). `~/.crysk/watch.json` holds the watcher.
|
|
33
|
-
- **The one rule:** the repo file beats the global one, **except on capped keys** (`max_*`, and the on/off switches `summary.enabled`, `
|
|
34
|
-
- **Some keys live in exactly one layer** and the parser refuses the other by name: `models` and `credentials` are person-only; `default_base
|
|
33
|
+
- **The one rule:** the repo file beats the global one, **except on capped keys** (`max_*`, and the on/off switches `summary.enabled`, `materiality_gate`, `post`): there the team can only ask for *less*, so a committed file never enlarges a person's bill.
|
|
34
|
+
- **Some keys live in exactly one layer** and the parser refuses the other by name: `models` and `credentials` are person-only; `default_base` and `suspicion_priors` are repo-only. `--config <file>` replaces the repo layer only.
|
|
35
35
|
- **Flags always win**, and may exceed a cap (`--base`, `--agents`, `--model`, `--summary`/`--no-summary`, `--force`).
|
|
36
|
-
- **Models are assigned per role.** `models` maps a role (`default`, `hunter.<key>` per hunter, `refuter`, which also covers the re-review verifier and the CI adjudicator, `consolidate`, `
|
|
36
|
+
- **Models are assigned per role.** `models` maps a role (`default`, `hunter.<key>` per hunter, `refuter`, which also covers the re-review verifier and the CI adjudicator, `consolidate`, `summary`, `judge`) to a list of one to three models tried in order; a role not listed uses `default`. With no `models`, each step runs its prompt's model: hunters and consolidation `claude:sonnet-latest`, the refuter `claude:opus-latest`, the summarizer `claude:haiku-latest`. A model name carries its backend: `claude:<sonnet|opus|haiku|fable>-latest` (newest version), `claude:claude-…` (pinned), `opencode:<provider>/<model>`. The old `routing` key is gone and refused with the `models` form to write; `summary.model` is gone too (`"haiku"`, which `crysk init` used to write, still reads with a warning). The scout stage was removed: `--scout`, `--no-scout`, `--scout-model`, the `scout` key and `models.scout` are still accepted and ignored, each with a warning, and `crysk config set scout` is refused. The parity hunter was removed too: the `parity_trigger_paths` key, the `models.hunter.parity` role and a leftover `deep-review-parity.md` in a custom `agents_dir` are accepted and ignored with a warning (`is ignored: the parity hunter was removed`), and `crysk config set parity_trigger_paths` is refused.
|
|
37
37
|
- **Crysk never stores a credential.** It reads the Claude CLI's login, `CRYSK_CLAUDE_*` (or `ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`) variables, or OpenCode's `auth.json`, and projects an ephemeral copy into each step. A run uses one Claude credential, the first set in `credentials.claude` (default `["subscription", "api_key"]`).
|
|
38
38
|
|
|
39
39
|
## Hard Rules
|
|
@@ -61,7 +61,7 @@ If Crysk is not on `PATH`, run every command as `npx -y crysk <command>` (Node i
|
|
|
61
61
|
|
|
62
62
|
**REVIEW.md / gotchas.md** — [REVIEW.md and gotchas.md](https://github.com/cryskai/crysk/blob/main/README.md#reviewmd-and-gotchasmd): optional; a root `REVIEW.md` wins over `.crysk/gotchas.md`. A file that exists must be real: read the code and write the actual traps, then delete the `human-attention-required` marker line, or `review` and `doctor` refuse it. With neither file the review runs on the default guidance.
|
|
63
63
|
|
|
64
|
-
**Running a review** — [Commands](https://github.com/cryskai/crysk/blob/main/README.md#commands): `.crysk/` must be committed or gitignored (clean-tree gate). Expect roughly
|
|
64
|
+
**Running a review** — [Commands](https://github.com/cryskai/crysk/blob/main/README.md#commands): `.crysk/` must be committed or gitignored (clean-tree gate). Expect roughly ten minutes per typical PR. The plan and the result print no dollar figure and there is no budget flag (`--budget-usd` and `--billing` are retired: accepted, no effect, one warning): the Crysk platform prices a platform run from the usage the engine reports and owns the per-review and per-month cost limits (dashboard, Review > Limits). A standalone run has no dollar limit, so "confirming spend" is about which credential the run bills (`doctor` / `--dry-run` say so). Artifacts land in `~/.crysk/repos/<origin>/runs/<run>/`. To check or wait on a PR's CI review state deterministically ($0, via `gh`), run `pr-hero status --pr <n> [--wait] [--json]`.
|
|
65
65
|
|
|
66
66
|
**Watcher / GC** — [crysk watch](https://github.com/cryskai/crysk/blob/main/README.md#watching-prs-automatically--crysk-watch): `watch add [--post]`, preview with `watch --once --dry-run`, and only then `watch install`. `daily_cap` and `window` live in `~/.crysk/watch.json`. GC is separate: `crysk gc install`.
|
|
67
67
|
|