crysk 0.0.0 → 0.3.1
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/LICENSE +176 -0
- package/README.md +611 -3
- package/bin/pr-hero.js +166 -0
- package/config/models/anthropic.json +5 -0
- package/dist/SKILL-7e3725zn.md +496 -0
- package/dist/SKILL-7q35wcaz.md +66 -0
- package/dist/SKILL-9at22381.md +74 -0
- package/dist/SKILL-ex2hxxh3.md +134 -0
- package/dist/SKILL-y8rv8msh.md +134 -0
- package/dist/SKILL-ygka1bs0.md +515 -0
- package/dist/adjudicator-dtg2axnh.md +86 -0
- package/dist/admission-config.example-a9vqmmad.json +9 -0
- package/dist/ci-admission-camfbx2b.md +122 -0
- package/dist/ci-admission-qk9r9taq.md +124 -0
- package/dist/cli.js +42501 -0
- package/dist/consolidate-ac0mnfyj.md +24 -0
- package/dist/deep-review-lifecycle-m698ybjp.md +362 -0
- package/dist/deep-review-logic-a6b1gczf.md +156 -0
- package/dist/deep-review-parity-0ec904db.md +120 -0
- package/dist/deep-review-reliability-qyakbjb9.md +125 -0
- package/dist/deep-review-resilience-3tz8y26e.md +118 -0
- package/dist/index.js +20190 -0
- package/dist/opencode-ci-7b0be64p.md +141 -0
- package/dist/review-refuter-j4e9gezy.md +71 -0
- package/dist/scout-yvp153q7.md +140 -0
- package/dist/summarizer-zca44nxa.md +18 -0
- package/dist/workflow-w1g9szna.yml +151 -0
- package/package.json +81 -4
- package/prompts/consolidate.md +24 -0
- package/prompts/default/PROVENANCE.md +18 -0
- package/prompts/default/deep-review-lifecycle.md +362 -0
- package/prompts/default/deep-review-logic.md +156 -0
- package/prompts/default/deep-review-parity.md +120 -0
- package/prompts/default/deep-review-reliability.md +125 -0
- package/prompts/default/deep-review-resilience.md +118 -0
- package/prompts/default/review-refuter.md +71 -0
- package/prompts/scout.md +140 -0
- package/prompts/summarizer.md +18 -0
- package/skills/crysk/SKILL.md +74 -0
- package/skills/crysk-ci-setup/SKILL.md +134 -0
- package/skills/crysk-ci-setup/assets/admission-config.example.json +9 -0
- package/skills/crysk-ci-setup/assets/workflow.yml +151 -0
- package/skills/crysk-ci-setup/references/ci-admission.md +124 -0
- package/skills/crysk-ci-setup/references/opencode-ci.md +141 -0
- package/skills/crysk-loop/SKILL.md +515 -0
- package/skills/crysk-loop/adjudicator.md +86 -0
- package/skills/crysk-pr/SKILL.md +66 -0
- package/src/agent-env.ts +1084 -0
- package/src/asset-manifest.ts +83 -0
- package/src/assets.d.ts +6 -0
- package/src/assets.ts +183 -0
- package/src/brand-paths.ts +155 -0
- package/src/brand.ts +255 -0
- package/src/ci/admission-ledger.ts +350 -0
- package/src/ci/classify-error.ts +73 -0
- package/src/ci/cli-record.ts +271 -0
- package/src/ci/force-comment.ts +39 -0
- package/src/ci/gates.ts +945 -0
- package/src/ci/outcome.ts +2181 -0
- package/src/ci/override.ts +187 -0
- package/src/ci/publish.ts +1639 -0
- package/src/ci/reporter.ts +626 -0
- package/src/ci/review-admission.ts +910 -0
- package/src/ci/review-levels.ts +310 -0
- package/src/ci/review-policy.ts +18 -0
- package/src/ci/review-risk.ts +184 -0
- package/src/ci/setup.ts +844 -0
- package/src/ci/trigger.ts +1353 -0
- package/src/cli.ts +348 -0
- package/src/commands/activity.ts +67 -0
- package/src/commands/ci-setup-questions.ts +397 -0
- package/src/commands/ci-setup.ts +381 -0
- package/src/commands/config.ts +99 -0
- package/src/commands/doctor.ts +108 -0
- package/src/commands/init.ts +139 -0
- package/src/commands/mcp.ts +10 -0
- package/src/commands/menu.ts +129 -0
- package/src/commands/post.ts +302 -0
- package/src/commands/skills.ts +83 -0
- package/src/commands/status.ts +173 -0
- package/src/commands/triage.ts +342 -0
- package/src/commands/uninstall.ts +37 -0
- package/src/commands/upgrade.ts +214 -0
- package/src/commands/usage.ts +98 -0
- package/src/compare/compare.ts +28 -0
- package/src/compare/floor-test.ts +471 -0
- package/src/compare/martian-adapter.ts +80 -0
- package/src/config/config.ts +267 -0
- package/src/corpus/corpus.ts +1094 -0
- package/src/corpus/preflight.ts +1789 -0
- package/src/diversity/accounting.ts +90 -0
- package/src/diversity/adjudication.ts +145 -0
- package/src/diversity/admission.ts +60 -0
- package/src/diversity/benchmark.ts +195 -0
- package/src/diversity/clustering.ts +285 -0
- package/src/diversity/errors.ts +7 -0
- package/src/diversity/identity.ts +285 -0
- package/src/diversity/index.ts +11 -0
- package/src/diversity/pipeline-integration.ts +448 -0
- package/src/diversity/projection.ts +57 -0
- package/src/diversity/self-contained.ts +68 -0
- package/src/diversity/target-validation.ts +179 -0
- package/src/doctor-migration.ts +209 -0
- package/src/doctor.ts +723 -0
- package/src/errors.ts +83 -0
- package/src/execution/admission.ts +75 -0
- package/src/execution/atomic-write.ts +35 -0
- package/src/execution/attempt-evidence.ts +415 -0
- package/src/execution/bucket-id.ts +136 -0
- package/src/execution/concurrency-limiter.ts +175 -0
- package/src/execution/contracts.ts +443 -0
- package/src/execution/failure-classification.ts +42 -0
- package/src/execution/failure-policy.ts +240 -0
- package/src/execution/harness.ts +2548 -0
- package/src/execution/settlement.ts +348 -0
- package/src/execution/spawned-process.ts +66 -0
- package/src/execution/spend-limiter.ts +424 -0
- package/src/execution/step-artifacts.ts +55 -0
- package/src/execution/usage-normalized.ts +469 -0
- package/src/git/git.ts +396 -0
- package/src/git/identity.ts +64 -0
- package/src/git/refs.ts +140 -0
- package/src/home-preflight.ts +443 -0
- package/src/home.ts +243 -0
- package/src/ignore-file.ts +336 -0
- package/src/ignore-read.ts +118 -0
- package/src/index.ts +34 -0
- package/src/legacy-launchd.ts +29 -0
- package/src/mcp/mcp.ts +150 -0
- package/src/mcp/preflight.ts +407 -0
- package/src/menu-context.ts +192 -0
- package/src/model/catalog.ts +251 -0
- package/src/model/exec-snapshots.ts +390 -0
- package/src/model/free-discovery.ts +302 -0
- package/src/model/provider-capabilities.ts +814 -0
- package/src/model/routing.ts +600 -0
- package/src/pr/admission.ts +984 -0
- package/src/pr/answered-findings.ts +169 -0
- package/src/pr/ci-admission-gate.ts +743 -0
- package/src/pr/ci-publish.ts +76 -0
- package/src/pr/discovery.ts +432 -0
- package/src/pr/inline.ts +507 -0
- package/src/pr/plan.ts +366 -0
- package/src/pr/posting.ts +115 -0
- package/src/pr/pr-status.ts +845 -0
- package/src/pr/pr.ts +3642 -0
- package/src/pr/preflight.ts +1031 -0
- package/src/pr/publish-outcome.ts +361 -0
- package/src/pr/range.ts +119 -0
- package/src/pr/reverts-preflight.ts +606 -0
- package/src/pr/reverts.ts +377 -0
- package/src/pr/review-pr.ts +927 -0
- package/src/pr/status.ts +154 -0
- package/src/pr/target.ts +388 -0
- package/src/pr/teardown.ts +437 -0
- package/src/pr/worktree-setup.ts +60 -0
- package/src/production-runtime.ts +1877 -0
- package/src/progress.ts +487 -0
- package/src/rereview/adjudicate.ts +89 -0
- package/src/rereview/classify.ts +362 -0
- package/src/rereview/identity.ts +211 -0
- package/src/rereview/plan.ts +308 -0
- package/src/rereview/prepare.ts +1025 -0
- package/src/rereview/state.ts +767 -0
- package/src/rereview/verify.ts +241 -0
- package/src/review/boundary.ts +105 -0
- package/src/review/consolidate.ts +246 -0
- package/src/review/dedupe.ts +368 -0
- package/src/review/drafts.ts +448 -0
- package/src/review/findings-conformance.ts +120 -0
- package/src/review/findings.ts +714 -0
- package/src/review/pipeline.ts +3977 -0
- package/src/review/preflight.ts +3575 -0
- package/src/review/prompt-set.ts +177 -0
- package/src/review/proof-refs.ts +187 -0
- package/src/review/report.ts +1821 -0
- package/src/review/review.ts +490 -0
- package/src/review/root-cause.ts +120 -0
- package/src/review/route-preflight.ts +289 -0
- package/src/review/run.ts +601 -0
- package/src/review/scout.ts +323 -0
- package/src/review/size-gate.ts +595 -0
- package/src/review/spec.ts +235 -0
- package/src/review/step-runner.ts +233 -0
- package/src/runner-authority.ts +596 -0
- package/src/security/binding-policy.ts +115 -0
- package/src/security/credential-broker.ts +773 -0
- package/src/security/evidence-redaction.ts +62 -0
- package/src/security/execution-authority.ts +27 -0
- package/src/security/redact.ts +71 -0
- package/src/security/workspace-read-broker.ts +466 -0
- package/src/server/client.ts +190 -0
- package/src/server/preflight.ts +217 -0
- package/src/server/server.ts +327 -0
- package/src/signal-handler.ts +50 -0
- package/src/store/activity.ts +413 -0
- package/src/store/backfill-preflight.ts +49 -0
- package/src/store/backfill.ts +141 -0
- package/src/store/gc-preflight.ts +206 -0
- package/src/store/gc.ts +424 -0
- package/src/store/metrics-preflight.ts +229 -0
- package/src/store/metrics.ts +236 -0
- package/src/store/preflight.ts +748 -0
- package/src/store/store.ts +693 -0
- package/src/system-tools.ts +355 -0
- package/src/transport-registry.ts +1124 -0
- package/src/transports/claude-code-cli.ts +1348 -0
- package/src/transports/opencode-admission.ts +515 -0
- package/src/transports/opencode-client.ts +3328 -0
- package/src/transports/opencode-evidence.ts +557 -0
- package/src/transports/opencode-mcp.ts +248 -0
- package/src/transports/opencode-sdk.ts +2294 -0
- package/src/transports/opencode-server.ts +535 -0
- package/src/triage/adjudication.ts +113 -0
- package/src/triage/reply.ts +125 -0
- package/src/triage/triage.ts +255 -0
- package/src/ui/activity.ts +173 -0
- package/src/ui/config-edit.ts +816 -0
- package/src/ui/config.ts +462 -0
- package/src/ui/menu.ts +1325 -0
- package/src/ui/plan.ts +1039 -0
- package/src/ui/primitives.ts +300 -0
- package/src/ui/progress.ts +298 -0
- package/src/ui/result.ts +552 -0
- package/src/ui/review-menu.ts +312 -0
- package/src/ui/select.ts +528 -0
- package/src/ui/tree.ts +178 -0
- package/src/uninstaller.ts +479 -0
- package/src/updater.ts +836 -0
- package/src/usage.ts +77 -0
- package/src/watch/preflight.ts +1389 -0
- package/src/watch/watch.ts +1235 -0
- package/src/wizard.ts +877 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# OpenCode in CI — operator procedure
|
|
2
|
+
|
|
3
|
+
Read this when the operator wants OpenCode, DeepSeek, mixed Claude+OpenCode, or GitHub `OPENCODE_AUTH_JSON` / `CRYSK_ROUTING`. Full narrative: `docs/github-actions.md` (section **OpenCode in CI**).
|
|
4
|
+
|
|
5
|
+
Do **not** print, `cat`, or log credential values. Inspect **keys and `type` only**.
|
|
6
|
+
|
|
7
|
+
## Two GitHub boxes
|
|
8
|
+
|
|
9
|
+
| GitHub box | Name | Holds |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| **Secrets** (hidden) | `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY` | Claude. Unchanged. |
|
|
12
|
+
| **Secrets** | `OPENCODE_AUTH_JSON` | One JSON object: the OpenCode `auth.json` store (or a **CI-only** subset). Cap 48 KB. |
|
|
13
|
+
| **Variables** (public) | `CRYSK_ROUTING` | Routing object only (`default` / `mappings` / `disabled`). No credentials. Cap 48 KB. Quoted in workflow `with.routing`. |
|
|
14
|
+
|
|
15
|
+
Do **not** create `OPENAI_API_KEY`, `DEEPSEEK_API_KEY`, or any other per-provider GitHub secret. The Action has no per-provider inputs. Provider tokens live **inside** `OPENCODE_AUTH_JSON`.
|
|
16
|
+
|
|
17
|
+
Unset both OpenCode names = Claude-only CI.
|
|
18
|
+
|
|
19
|
+
## Local store (metadata only)
|
|
20
|
+
|
|
21
|
+
Default path: `$XDG_DATA_HOME/opencode/auth.json` or `~/.local/share/opencode/auth.json`.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python3 - <<'PY'
|
|
25
|
+
import json, os
|
|
26
|
+
p = os.path.join(os.environ.get("XDG_DATA_HOME") or os.path.join(os.path.expanduser("~"), ".local", "share"), "opencode", "auth.json")
|
|
27
|
+
print("exists", os.path.isfile(p))
|
|
28
|
+
if not os.path.isfile(p):
|
|
29
|
+
raise SystemExit(0)
|
|
30
|
+
with open(p) as f:
|
|
31
|
+
data = json.load(f)
|
|
32
|
+
print("providers", ",".join(sorted(data)))
|
|
33
|
+
for name, rec in data.items():
|
|
34
|
+
t = rec.get("type") if isinstance(rec, dict) else "?"
|
|
35
|
+
print(f"{name} type={t}")
|
|
36
|
+
PY
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If the store is missing, have the operator authenticate the **CI provider** in OpenCode locally first (`opencode` auth/login for that provider). Do not collect the key in chat.
|
|
40
|
+
|
|
41
|
+
## What may go in the blob
|
|
42
|
+
|
|
43
|
+
| `auth.json` entry | CI |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Non-openai `type: "api"` (tested: **deepseek**) | Executable metered path. Default spend ceiling applies. |
|
|
46
|
+
| `openai` `type: "api"` | **Refuse.** Engine maps `openai` to ChatGPT OAuth; a pay-as-you-go key is not remapped. |
|
|
47
|
+
| `openai` `type: "oauth"` | Do **not** put a personal ChatGPT session in a repository secret. |
|
|
48
|
+
| Several OpenCode providers in **one run** | Out of scope (#195). One OpenCode provider per run. |
|
|
49
|
+
| `claude-code` + **one** OpenCode provider | Legal. Keep a Claude secret and one OpenCode API record. |
|
|
50
|
+
|
|
51
|
+
If the personal store has extra providers (ChatGPT OAuth, zai, …), **do not upload it whole**. Write a 0600 temp object with **only** the CI provider, `gh secret set` from that file, delete the temp file.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# After writing a 0600 CI-only auth.json (deepseek-only). Never cat it.
|
|
55
|
+
gh secret set OPENCODE_AUTH_JSON < /path/to/ci-only-auth.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`gh` missing/unauthenticated: Settings → Secrets and variables → Actions. Paste the JSON into secret `OPENCODE_AUTH_JSON`. Never paste it into the workflow YAML or the chat.
|
|
59
|
+
|
|
60
|
+
## Routing is logical model, not role
|
|
61
|
+
|
|
62
|
+
`CRYSK_ROUTING` maps **logical model identity** (`sonnet`, `haiku`), not hunter vs refuter.
|
|
63
|
+
|
|
64
|
+
Default prompt set:
|
|
65
|
+
|
|
66
|
+
| Step | Logical model |
|
|
67
|
+
|---|---|
|
|
68
|
+
| Hunters | `sonnet` |
|
|
69
|
+
| Refuter | `opus` |
|
|
70
|
+
| Summarizer | `haiku` |
|
|
71
|
+
|
|
72
|
+
A mapping moves only the steps whose logical model it names: a `sonnet` mapping moves the hunters and leaves the refuter alone. An alias with **no** mapping and **no** `default` route currently falls through to the Claude CLI (`claude-code` / `direct`), so that step needs Claude credentials in the run. A `default` route covers every alias, the refuter included.
|
|
73
|
+
|
|
74
|
+
| Routing shape | Hunters (`sonnet`) | Refuter (`opus`) |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `default` route only | default route | default route (same model as the hunters) |
|
|
77
|
+
| Only a `sonnet` mapping to OpenCode | OpenCode | Claude CLI (needs a Claude secret) |
|
|
78
|
+
| `sonnet` and `opus` mappings to OpenCode | OpenCode | OpenCode |
|
|
79
|
+
|
|
80
|
+
OpenCode does not resolve Crysk aliases. Any `opencode` route for `sonnet`/`opus`/`haiku` **must** set `modelSnapshot` to the provider model id. Confirm with `opencode models` (optionally `opencode models <provider>`). Do not guess `deepseek-chat` if the CLI lists `deepseek-v4-flash` / `deepseek-v4-pro`.
|
|
81
|
+
|
|
82
|
+
`gateway`: `"configured"` for OpenCode; `"direct"` for Claude CLI.
|
|
83
|
+
|
|
84
|
+
Do not wrap the variable in `{"routing": ...}`. Do not put keys in the variable (it is public).
|
|
85
|
+
|
|
86
|
+
### OpenCode-only (all logicals)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
gh variable set CRYSK_ROUTING --body '{"default":{"backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-flash"}}'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Replace `deepseek-v4-flash` with an id `opencode models` actually lists. The `default` route covers hunters (`sonnet`) and the refuter (`opus`) alike, so the refuter runs on this same model.
|
|
93
|
+
|
|
94
|
+
### Mixed: OpenCode default + Claude summarizer (legal DATA mix)
|
|
95
|
+
|
|
96
|
+
Hunters (`sonnet`) and refuter (`opus`) → the OpenCode default route, one API provider. Summarizer (`haiku`) → Claude.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
gh variable set CRYSK_ROUTING --body '{"default":{"backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-flash"},"mappings":[{"logical":"haiku","backend":"claude-code","provider":"anthropic","gateway":"direct"}]}'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Keep `CLAUDE_CODE_OAUTH_TOKEN` (or `ANTHROPIC_API_KEY`) for the Claude mapping. Presence of `OPENCODE_AUTH_JSON` still applies the metered ceiling.
|
|
103
|
+
|
|
104
|
+
### Mixed: OpenCode hunters + Claude refuter (legal DATA mix)
|
|
105
|
+
|
|
106
|
+
Map **only** `sonnet`. Hunters go to OpenCode; the unmapped `opus` refuter and the `haiku` summarizer (on unless `summary.enabled` is false) fall through to the Claude CLI (current behavior), so keep a Claude secret next to `OPENCODE_AUTH_JSON`.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
gh variable set CRYSK_ROUTING --body '{"mappings":[{"logical":"sonnet","backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-flash"}]}'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Do **not** use this shape in an OpenCode-only run (no Claude secret): the refuter and the summarizer are still routed to the Claude CLI and have no credentials to run them. For OpenCode-only, use the `default` route above, or map all three aliases (`sonnet`, `opus`, `haiku`), each with its own `modelSnapshot` (`opencode models` ids, same single OpenCode provider):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
gh variable set CRYSK_ROUTING --body '{"mappings":[{"logical":"sonnet","backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-flash"},{"logical":"opus","backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-pro"},{"logical":"haiku","backend":"opencode","provider":"deepseek","gateway":"configured","modelSnapshot":"deepseek-v4-flash"}]}'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Workflow
|
|
119
|
+
|
|
120
|
+
Generated `with:` must keep:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
routing: "${{ vars.CRYSK_ROUTING || vars.PRHERO_ROUTING }}"
|
|
124
|
+
opencode-auth: ${{ secrets.OPENCODE_AUTH_JSON }}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Quotes around the routing var are load-bearing (unset → empty string). Re-scaffold with `crysk setup --ci --force` if an old template lacks them.
|
|
128
|
+
|
|
129
|
+
The Action installs OpenCode CLI **1.18.30** in its **own** step when `opencode-auth` is non-empty **or** routing contains `opencode`. Never `latest`. Claude-only (both OpenCode inputs empty / no `opencode` in routing) skips that install.
|
|
130
|
+
|
|
131
|
+
## Fail-closed edges
|
|
132
|
+
|
|
133
|
+
- Fork pushes still skip (no secrets); a maintainer's `/crysk review` comment reviews a fork.
|
|
134
|
+
- OpenCode-only (only `OPENCODE_AUTH_JSON`) counts as a credential and reviews.
|
|
135
|
+
- No credential at all fails the run red, with the `gh secret set` commands in the step summary.
|
|
136
|
+
- Claude credentials + OpenCode routing **without** `OPENCODE_AUTH_JSON` starts then **fails**.
|
|
137
|
+
- Invalid routing/auth JSON fails loud.
|
|
138
|
+
|
|
139
|
+
## After setting DATA
|
|
140
|
+
|
|
141
|
+
Open a **same-repo** PR (fork pushes skip). Confirm the review job materializes person-layer `$HOME/.crysk/config.json` and 0600 auth, and that spend notices show metered when the OpenCode file is present.
|