crysk 0.3.3 → 0.5.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 +26 -17
- package/config/models/anthropic.json +1 -1
- package/dist/SKILL-dsnffnfp.md +140 -0
- package/dist/SKILL-gnrbph72.md +140 -0
- package/dist/SKILL-k4k0zn1w.md +143 -0
- package/dist/SKILL-kq0xejn3.md +553 -0
- package/dist/SKILL-qaqsbygw.md +66 -0
- package/dist/SKILL-vhb4c3vv.md +553 -0
- package/dist/SKILL-vws0aqb8.md +553 -0
- package/dist/SKILL-xpf6kmdw.md +74 -0
- package/dist/ci-admission-0ken6ehx.md +128 -0
- package/dist/ci-admission-t0f5qwth.md +128 -0
- package/dist/cli.js +3366 -1680
- package/dist/index.js +1884 -947
- package/dist/opencode-ci-ac5zksdn.md +106 -0
- package/dist/workflow-4pkyck01.yml +160 -0
- package/package.json +2 -2
- package/prompts/default/PROVENANCE.md +1 -0
- package/skills/crysk/SKILL.md +16 -16
- package/skills/crysk-ci-setup/SKILL.md +42 -39
- package/skills/crysk-ci-setup/assets/workflow.yml +31 -22
- package/skills/crysk-ci-setup/references/ci-admission.md +2 -2
- package/skills/crysk-ci-setup/references/opencode-ci.md +53 -88
- package/skills/crysk-loop/SKILL.md +20 -9
- package/skills/crysk-pr/SKILL.md +1 -1
- package/src/asset-manifest.ts +0 -4
- package/src/assets.ts +2 -2
- package/src/ci/admission-ledger.ts +4 -0
- package/src/ci/classify-error.ts +21 -24
- package/src/ci/cli-record.ts +53 -1
- package/src/ci/crysk-secrets.ts +409 -0
- package/src/ci/gates.ts +31 -42
- package/src/ci/outcome.ts +421 -330
- package/src/ci/platform-config.ts +127 -0
- package/src/ci/platform-report.ts +935 -0
- package/src/ci/platform-trace.ts +551 -0
- package/src/ci/platform.ts +465 -0
- package/src/ci/publish.ts +19 -6
- package/src/ci/reporter.ts +9 -7
- package/src/ci/review-admission.ts +8 -4
- package/src/ci/review-levels.ts +8 -7
- package/src/ci/run.ts +88 -0
- package/src/ci/setup.ts +547 -109
- package/src/ci/trace-bundle.ts +1282 -0
- package/src/ci/trace-transcripts.ts +415 -0
- package/src/ci/trigger.ts +176 -33
- package/src/cli.ts +11 -3
- package/src/commands/ci-setup-questions.ts +3 -3
- package/src/commands/ci-setup.ts +152 -6
- package/src/commands/config.ts +3 -0
- package/src/commands/doctor.ts +15 -6
- package/src/compare/loop.ts +9 -1
- package/src/compare/martian-adapter.ts +1 -1
- package/src/config/config.ts +16 -3
- package/src/diversity/clustering.ts +0 -1
- package/src/diversity/identity.ts +4 -5
- package/src/diversity/pipeline-integration.ts +1 -9
- package/src/doctor.ts +3 -3
- package/src/execution/attempt-evidence.ts +10 -5
- package/src/execution/claude-session-trace.ts +480 -0
- package/src/execution/contracts.ts +21 -4
- package/src/execution/harness.ts +105 -8
- package/src/execution/model-fallback.ts +239 -0
- package/src/execution/usage-normalized.ts +6 -4
- package/src/home-preflight.ts +1 -1
- package/src/index.ts +1 -1
- package/src/model/catalog.ts +13 -37
- package/src/model/free-discovery.ts +117 -8
- package/src/model/model-name.ts +404 -0
- package/src/model/provider-capabilities.ts +22 -7
- package/src/model/routing.ts +346 -467
- package/src/pr/admission.ts +71 -11
- package/src/pr/ci-admission-gate.ts +2 -1
- package/src/pr/finding-state-record.ts +58 -0
- package/src/pr/gate-record.ts +22 -0
- package/src/pr/inline.ts +3 -0
- package/src/pr/plan.ts +20 -4
- package/src/pr/posting.ts +4 -0
- package/src/pr/pr-status.ts +27 -7
- package/src/pr/pr.ts +39 -8
- package/src/pr/preflight.ts +44 -2
- package/src/pr/publish-outcome.ts +11 -3
- package/src/pr/review-pr.ts +20 -4
- package/src/pr/target.ts +12 -3
- package/src/production-runtime.ts +760 -331
- package/src/rereview/classify.ts +4 -0
- package/src/rereview/prepare.ts +47 -22
- package/src/rereview/state.ts +34 -8
- package/src/review/pipeline.ts +277 -101
- package/src/review/preflight.ts +201 -294
- package/src/review/report.ts +60 -40
- package/src/review/review.ts +20 -3
- package/src/review/route-preflight.ts +79 -11
- package/src/review/run.ts +28 -6
- package/src/review/scout.ts +1 -1
- package/src/review/spec.ts +3 -3
- package/src/review/step-runner.ts +70 -1
- package/src/runner-authority.ts +127 -9
- package/src/security/binding-policy.ts +1 -2
- package/src/security/claude-credential.ts +355 -0
- package/src/security/credential-broker.ts +56 -40
- package/src/security/evidence-redaction.ts +179 -4
- package/src/security/opencode-secret-manifest.ts +114 -0
- package/src/security/published-text.ts +161 -0
- package/src/security/redact.ts +45 -0
- package/src/system-tools.ts +48 -21
- package/src/transport-registry.ts +12 -2
- package/src/transports/claude-code-cli.ts +21 -2
- package/src/transports/opencode-sdk.ts +11 -9
- package/src/transports/opencode-server.ts +7 -10
- package/src/triage/triage.ts +2 -1
- package/src/ui/config-edit.ts +9 -20
- package/src/ui/config.ts +32 -27
- package/src/ui/plan.ts +76 -47
- package/src/updater.ts +10 -7
- package/prompts/default/deep-review-lifecycle.md +0 -362
package/src/ci/run.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// The Run Crysk step's entry (odd/tasks/role-model-routing.md, S8, L27, U5).
|
|
2
|
+
//
|
|
3
|
+
// The workflow passes its Crysk credentials as the `crysk-secrets` input, one
|
|
4
|
+
// `CRYSK_*=value` line per secret. action.yml pipes that input to this script on
|
|
5
|
+
// stdin (`printf '%s' "$CRYSK_SECRETS_INPUT" | CRYSK_SECRETS_INPUT= bun run.ts ...`),
|
|
6
|
+
// the way the trigger and the setup step take it, and runs bun with the variable
|
|
7
|
+
// emptied: Bun hands a child the environment it STARTED with, so a variable bun
|
|
8
|
+
// received would reach every git, gh and agent child of the review.
|
|
9
|
+
//
|
|
10
|
+
// This script parses the input with the setup step's own grammar
|
|
11
|
+
// (parseCryskSecrets), masks every value again (the setup step already did, in the
|
|
12
|
+
// same job; this keeps the mask even if a later edit reorders the steps), hands the
|
|
13
|
+
// Claude values to the credential intake (src/security/claude-credential.ts), and
|
|
14
|
+
// runs the CLI with its own arguments. Nothing is written to process.env. The
|
|
15
|
+
// OpenCode secrets are not read here: the setup step already built the OpenCode
|
|
16
|
+
// auth file and its manifest from them (U3).
|
|
17
|
+
//
|
|
18
|
+
// The intake is taken even when the input holds no Claude secret, so in the action
|
|
19
|
+
// the review reads its Claude credential only from this input (or a login on the
|
|
20
|
+
// runner), never from a job-level ANTHROPIC_API_KEY nobody passed in it.
|
|
21
|
+
|
|
22
|
+
import { runCli } from "../cli";
|
|
23
|
+
import { takeCryskClaudeSecrets } from "../security/claude-credential";
|
|
24
|
+
import {
|
|
25
|
+
inheritedOpenCodeSecretNames,
|
|
26
|
+
inheritedOpenCodeSecretWarning,
|
|
27
|
+
parseCryskSecrets,
|
|
28
|
+
} from "./crysk-secrets";
|
|
29
|
+
|
|
30
|
+
export interface CiRunDeps {
|
|
31
|
+
// The crysk-secrets input, read from stdin by the entry point below.
|
|
32
|
+
readonly cryskSecrets: string;
|
|
33
|
+
// The CLI's arguments, as the step built them (`review --pr <n> --ci --yes ...`).
|
|
34
|
+
readonly argv: readonly string[];
|
|
35
|
+
// This process's environment, read only for the names of CRYSK_OPENCODE_*
|
|
36
|
+
// variables a job set (E-f F5). Absent: nothing to warn about.
|
|
37
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
38
|
+
readonly stdout: (text: string) => void;
|
|
39
|
+
readonly runCli: (argv: string[]) => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Workflow-command data escaping, as the runner's own toolkit does it.
|
|
43
|
+
function escapeCommandData(text: string): string {
|
|
44
|
+
return text.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function runCiReview(deps: CiRunDeps): Promise<void> {
|
|
48
|
+
const parsed = parseCryskSecrets(deps.cryskSecrets);
|
|
49
|
+
for (const value of parsed.masks) {
|
|
50
|
+
deps.stdout(`::add-mask::${escapeCommandData(value)}\n`);
|
|
51
|
+
}
|
|
52
|
+
// E-f F5: action.yml cannot empty a per-provider name, and the review's children
|
|
53
|
+
// inherit this process's environment, so a job-level one is named here.
|
|
54
|
+
for (const name of inheritedOpenCodeSecretNames(deps.env ?? {})) {
|
|
55
|
+
deps.stdout(
|
|
56
|
+
`::warning title=crysk::${escapeCommandData(inheritedOpenCodeSecretWarning(name))}\n`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
takeCryskClaudeSecrets(parsed.secrets.claude);
|
|
60
|
+
await deps.runCli([...deps.argv]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// The env variable action.yml binds the input to in this step. A non-empty one
|
|
64
|
+
// here means the step was wired wrongly, and the script refuses to run.
|
|
65
|
+
const CRYSK_SECRETS_ENV = "CRYSK_SECRETS_INPUT";
|
|
66
|
+
|
|
67
|
+
if (import.meta.main) {
|
|
68
|
+
if ((process.env[CRYSK_SECRETS_ENV] ?? "") !== "") {
|
|
69
|
+
process.stderr.write(
|
|
70
|
+
`crysk: the crysk-secrets input reached run.ts through its environment, which every child it spawns would inherit; pipe it on stdin and run bun with ${CRYSK_SECRETS_ENV} empty.\n`,
|
|
71
|
+
);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
// WHY read to EOF first, before anything else: the step pipes printf into this
|
|
75
|
+
// process under `pipefail`, and a reader that exits without draining the pipe
|
|
76
|
+
// could leave printf with SIGPIPE, making the step's exit something other than
|
|
77
|
+
// the CLI's.
|
|
78
|
+
const cryskSecrets = await Bun.stdin.text();
|
|
79
|
+
await runCiReview({
|
|
80
|
+
cryskSecrets,
|
|
81
|
+
argv: process.argv.slice(2),
|
|
82
|
+
env: process.env,
|
|
83
|
+
stdout: (text) => {
|
|
84
|
+
process.stdout.write(text);
|
|
85
|
+
},
|
|
86
|
+
runCli,
|
|
87
|
+
});
|
|
88
|
+
}
|