crysk 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -22
- package/dist/SKILL-1q3658n0.md +74 -0
- package/dist/SKILL-25j4q9b8.md +143 -0
- package/dist/SKILL-32cmme3j.md +143 -0
- package/dist/SKILL-4747bhne.md +143 -0
- package/dist/SKILL-4jc3sv23.md +74 -0
- package/dist/SKILL-c0492rch.md +540 -0
- package/dist/SKILL-d1nzkhhr.md +74 -0
- package/dist/SKILL-f8p7kvx0.md +143 -0
- package/dist/SKILL-gxd45g38.md +553 -0
- package/dist/SKILL-rec41991.md +66 -0
- package/dist/SKILL-zze8zj5g.md +536 -0
- package/dist/adjudicator-eckqh14e.md +78 -0
- package/dist/ci-admission-qn797a6c.md +128 -0
- package/dist/cli.js +18608 -18523
- package/dist/consolidate-4xw1pkg7.md +24 -0
- package/dist/deep-review-logic-dgr112y1.md +196 -0
- package/dist/deep-review-logic-fck5z4xe.md +197 -0
- package/dist/deep-review-logic-h1fpamfh.md +192 -0
- package/dist/deep-review-logic-m4vk5683.md +196 -0
- package/dist/deep-review-logic-z63kmgmc.md +157 -0
- package/dist/deep-review-parity-7x7s5d81.md +148 -0
- package/dist/deep-review-parity-9wxmynsc.md +115 -0
- package/dist/deep-review-parity-bwwe7cx6.md +152 -0
- package/dist/deep-review-parity-e50pw3pk.md +117 -0
- package/dist/deep-review-parity-ennmm9m1.md +151 -0
- package/{prompts/default/deep-review-parity.md → dist/deep-review-parity-h7y6y2he.md} +14 -16
- package/dist/deep-review-parity-xg6wy69c.md +151 -0
- package/dist/deep-review-reliability-6h3c4gmw.md +125 -0
- package/dist/deep-review-reliability-dcjab69x.md +122 -0
- package/dist/deep-review-reliability-ec7b5pbk.md +159 -0
- package/dist/deep-review-reliability-hvasvmt9.md +153 -0
- package/dist/deep-review-reliability-mjnayxmt.md +158 -0
- package/dist/deep-review-reliability-mm7fnayf.md +124 -0
- package/dist/deep-review-reliability-xk4xvc2w.md +158 -0
- package/dist/deep-review-resilience-0esd5qeh.md +148 -0
- package/dist/deep-review-resilience-envgcmpy.md +115 -0
- package/dist/deep-review-resilience-fgx8ythf.md +151 -0
- package/dist/deep-review-resilience-mq5qa6ad.md +152 -0
- package/dist/deep-review-resilience-pwh1gawp.md +151 -0
- package/dist/deep-review-resilience-s9n21dkx.md +117 -0
- package/dist/deep-review-resilience-vz4qskea.md +119 -0
- package/dist/deep-review-security-1vwjdc9q.md +205 -0
- package/dist/deep-review-security-x1cc1z00.md +205 -0
- package/dist/index.js +590 -485
- package/dist/opencode-ci-jc8mf4wn.md +106 -0
- package/dist/opencode-ci-qrcv7a99.md +106 -0
- package/dist/opencode-ci-rdpcc7xc.md +106 -0
- package/dist/opencode-ci-yt0k74t0.md +106 -0
- package/dist/review-refuter-7qffwtzz.md +77 -0
- package/dist/verifier-tyh8r45v.md +40 -0
- package/dist/verifier-xf4xj701.md +40 -0
- package/dist/workflow-andv2dvm.yml +158 -0
- package/package.json +1 -1
- package/prompts/consolidate.md +1 -1
- package/prompts/default/PROVENANCE.md +6 -0
- package/prompts/default/deep-review-logic.md +56 -15
- package/prompts/default/deep-review-reliability.md +64 -30
- package/prompts/default/deep-review-resilience.md +71 -37
- package/prompts/default/deep-review-security.md +205 -0
- package/prompts/default/review-refuter.md +1 -1
- package/prompts/verifier.md +40 -0
- package/skills/crysk/SKILL.md +6 -6
- package/skills/crysk-ci-setup/SKILL.md +32 -33
- package/skills/crysk-ci-setup/assets/workflow.yml +5 -10
- package/skills/crysk-ci-setup/references/ci-admission.md +5 -5
- package/skills/crysk-ci-setup/references/opencode-ci.md +6 -6
- package/skills/crysk-loop/SKILL.md +37 -54
- package/skills/crysk-loop/adjudicator.md +10 -18
- package/skills/crysk-pr/SKILL.md +1 -1
- package/src/asset-manifest.ts +6 -6
- package/src/assets.ts +4 -4
- package/src/brand.ts +20 -30
- package/src/ci/gates.ts +155 -192
- package/src/ci/outcome.ts +4 -31
- package/src/ci/platform-limits.ts +135 -0
- package/src/ci/platform-report.ts +212 -126
- package/src/ci/platform.ts +28 -26
- package/src/ci/reporter.ts +25 -26
- package/src/ci/review-admission.ts +1 -2
- package/src/ci/review-levels.ts +12 -53
- package/src/ci/setup.ts +96 -66
- package/src/ci/trace-bundle.ts +11 -27
- package/src/ci/trace-transcripts.ts +4 -6
- package/src/ci/trigger.ts +3 -5
- package/src/cli.ts +6 -5
- package/src/commands/ci-setup-questions.ts +2 -55
- package/src/commands/ci-setup.ts +2 -26
- package/src/commands/triage.ts +131 -38
- package/src/commands/usage.ts +0 -1
- package/src/compare/compare.ts +3 -3
- package/src/compare/floor-test.ts +30 -201
- package/src/compare/hunter-exam.ts +631 -0
- package/src/config/config.ts +6 -30
- package/src/diversity/accounting.ts +0 -26
- package/src/diversity/benchmark.ts +1 -17
- package/src/diversity/identity.ts +0 -14
- package/src/diversity/pipeline-integration.ts +0 -29
- package/src/doctor.ts +3 -6
- package/src/execution/claude-session-trace.ts +7 -2
- package/src/execution/contracts.ts +15 -9
- package/src/execution/harness.ts +165 -187
- package/src/execution/spend-limiter.ts +39 -131
- package/src/execution/usage-facts.ts +397 -0
- package/src/execution/usage-normalized.ts +33 -86
- package/src/harness/materiality-judge.ts +0 -5
- package/src/harness/pipeline-plan.ts +0 -3
- package/src/harness/replay-rows.ts +0 -5
- package/src/harness/route-runner.ts +2 -2
- package/src/harness/single-step.ts +3 -9
- package/src/index.ts +1 -1
- package/src/mcp/preflight.ts +2 -2
- package/src/model/catalog.ts +1 -3
- package/src/model/free-discovery.ts +11 -78
- package/src/model/model-name.ts +16 -5
- package/src/model/profiles/claude.ts +1 -2
- package/src/model/profiles/openai.ts +1 -2
- package/src/model/profiles.ts +2 -3
- package/src/model/provider-capabilities.ts +16 -55
- package/src/model/routing.ts +39 -36
- package/src/pr/admission.ts +6 -6
- package/src/pr/answered-findings.ts +8 -4
- package/src/pr/ci-publish.ts +0 -2
- package/src/pr/discovery.ts +4 -25
- package/src/pr/plan.ts +40 -121
- package/src/pr/pr-status.ts +14 -2
- package/src/pr/pr.ts +1 -1
- package/src/pr/preflight.ts +44 -15
- package/src/pr/publish-outcome.ts +1 -19
- package/src/pr/review-pr.ts +15 -47
- package/src/pr/target.ts +76 -82
- package/src/production-runtime.ts +52 -114
- package/src/progress.ts +0 -54
- package/src/rereview/prepare.ts +4 -1
- package/src/rereview/state.ts +1 -1
- package/src/rereview/verify.ts +15 -9
- package/src/review/boundary.ts +5 -8
- package/src/review/drafts.ts +3 -3
- package/src/review/findings-conformance.ts +1 -1
- package/src/review/findings.ts +0 -4
- package/src/review/pipeline.ts +194 -407
- package/src/review/preflight.ts +175 -201
- package/src/review/prompt-set.ts +1 -2
- package/src/review/report.ts +2 -162
- package/src/review/review.ts +25 -74
- package/src/review/route-preflight.ts +19 -35
- package/src/review/run.ts +37 -73
- package/src/review/size-gate.ts +3 -3
- package/src/review/spec.ts +6 -11
- package/src/review/step-runner.ts +4 -4
- package/src/runner-authority.ts +10 -9
- package/src/security/credential-broker.ts +5 -6
- package/src/server/preflight.ts +0 -1
- package/src/server/server.ts +17 -6
- package/src/store/activity.ts +1 -2
- package/src/store/backfill-preflight.ts +0 -3
- package/src/store/backfill.ts +0 -1
- package/src/store/metrics-preflight.ts +4 -14
- package/src/store/metrics.ts +5 -5
- package/src/store/preflight.ts +0 -13
- package/src/store/store.ts +11 -12
- package/src/transport-registry.ts +6 -30
- package/src/transports/claude-code-cli.ts +149 -215
- package/src/transports/opencode-client.ts +4 -24
- package/src/transports/opencode-sdk.ts +17 -112
- package/src/triage/plain-reply.ts +37 -0
- package/src/ui/activity.ts +1 -6
- package/src/ui/config-edit.ts +14 -67
- package/src/ui/config.ts +3 -8
- package/src/ui/plan.ts +11 -198
- package/src/ui/progress.ts +3 -49
- package/src/ui/result.ts +18 -77
- package/src/ui/review-menu.ts +3 -12
- package/src/ui/select.ts +9 -79
- package/src/updater.ts +1 -1
- package/src/usage.ts +1 -7
- package/prompts/scout.md +0 -140
- package/src/ci/platform-estimate.ts +0 -111
- package/src/review/scout.ts +0 -323
package/src/review/preflight.ts
CHANGED
|
@@ -95,28 +95,27 @@ export interface CliOptions {
|
|
|
95
95
|
out?: string;
|
|
96
96
|
// Gotchas describe the REPO, not the commit under review, so they must be
|
|
97
97
|
// supplyable from outside the reviewed tree — see the note in cli.ts. The
|
|
98
|
-
// same is true of the config:
|
|
99
|
-
//
|
|
100
|
-
//
|
|
98
|
+
// same is true of the config: the suspicion priors are a property of the
|
|
99
|
+
// project, and requiring them in-tree silently drops them on any tree you
|
|
100
|
+
// cannot add a file to.
|
|
101
101
|
gotchas?: string;
|
|
102
102
|
config?: string;
|
|
103
103
|
model?: string;
|
|
104
104
|
// Summary activation is tri-state at parse time: undefined means no flag,
|
|
105
105
|
// so review can apply flag > config > the default-on setting.
|
|
106
106
|
summary?: boolean;
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
|
|
107
|
+
// Flags of removed features that the command line still carried, once each,
|
|
108
|
+
// in first-seen order: the scout stage, and the dollar limits that moved to
|
|
109
|
+
// the Crysk platform (`--budget-usd`, `--billing`). They are accepted and
|
|
110
|
+
// have no effect; the shell prints one warning per entry
|
|
111
|
+
// (removedFlagWarnings).
|
|
112
|
+
removedFlags?: string[];
|
|
110
113
|
// `--shared-prefix` / `--no-shared-prefix`. Undefined means the default,
|
|
111
114
|
// which is ON (see resolveSharedPrefix).
|
|
112
115
|
sharedPrefix?: boolean;
|
|
113
|
-
// Independent model knob (§3.7), and NOT exercised by M6 — the whole
|
|
114
|
-
// control corpus is sonnet, so ratifying this is ratifying a flag, not a
|
|
115
|
-
// second variable. `--model` still outranks it (the JD override rule).
|
|
116
|
-
scoutModel?: string;
|
|
117
116
|
// Item 7: widen discovery to full B..H on a re-review. Default OFF — a
|
|
118
117
|
// second push is delta-scoped unless asked otherwise. Verification,
|
|
119
|
-
// triage, and classification still run (R2-C5). Review-only
|
|
118
|
+
// triage, and classification still run (R2-C5). Review-only.
|
|
120
119
|
full: boolean;
|
|
121
120
|
// T5b: with --pr --ci, also have the CI adjudicator rule on each pending
|
|
122
121
|
// dismissal of a blocking finding. Set by a /crysk recheck comment. Absent
|
|
@@ -242,19 +241,19 @@ export interface CliOptions {
|
|
|
242
241
|
repoExplicit?: boolean;
|
|
243
242
|
// ROADMAP Pillar 3 (GitHub Actions CI). `ci` is the EXPLICIT flag only —
|
|
244
243
|
// `isCiEnvironment()` ORs it with the GITHUB_ACTIONS/CI env vars, which
|
|
245
|
-
// parseArgs (pure, no process.env read) cannot see.
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
244
|
+
// parseArgs (pure, no process.env read) cannot see. `stepSummary` requires
|
|
245
|
+
// `--ci` at parse time (the `--post`-requires-`--pr` precedent above): a
|
|
246
|
+
// summary toggle for a mode that never activates would be exactly the
|
|
247
|
+
// "silently dropped intention" the --bug-labels guard already refuses
|
|
248
|
+
// elsewhere in this file.
|
|
250
249
|
//
|
|
251
250
|
// Phase 4 (CI Scaffolding) gave `--ci` a SECOND, command-scoped meaning:
|
|
252
251
|
// on `review` it activates the CI headless shell (requires --pr); on
|
|
253
252
|
// `setup` it means "scaffold .github/workflows/crysk.yml instead of
|
|
254
253
|
// running the interactive wizard" — see `ci init`'s dedicated command
|
|
255
254
|
// below for the same scaffolding without touching `setup`'s wizard
|
|
256
|
-
// default. `
|
|
257
|
-
// `--ci` specifically (checked below), since
|
|
255
|
+
// default. `stepSummary` still requires the REVIEW reading of
|
|
256
|
+
// `--ci` specifically (checked below), since it means nothing to
|
|
258
257
|
// scaffolding.
|
|
259
258
|
ci?: boolean;
|
|
260
259
|
// `ci init` — the same scaffolding as `setup --ci`, as its own command.
|
|
@@ -262,25 +261,19 @@ export interface CliOptions {
|
|
|
262
261
|
// as a literal union (not a bare boolean) so a future `ci status` has
|
|
263
262
|
// somewhere to go without a breaking change.
|
|
264
263
|
ciSubcommand?: "init";
|
|
265
|
-
//
|
|
266
|
-
// warning — there is nothing to disable). <= 0, GIVEN explicitly, disables
|
|
267
|
-
// the ceiling too, but DOES warn: see ci/gates.ts's
|
|
268
|
-
// budgetDisabledWarningMessage for why the two are not the same state.
|
|
269
|
-
budgetUsd?: number;
|
|
270
|
-
// Tri-state like `summary`/`scout`: unset means "the shell's own default
|
|
264
|
+
// Tri-state like `summary`: unset means "the shell's own default
|
|
271
265
|
// (on)", so `--step-summary` and `--no-step-summary` stay distinguishable
|
|
272
266
|
// from "nobody said".
|
|
273
267
|
stepSummary?: boolean;
|
|
274
268
|
// S4: the commit-status gate for a `review --ci` run, required at parse time
|
|
275
|
-
// like
|
|
276
|
-
// on blocking findings, a size or
|
|
269
|
+
// like stepSummary. `gate` (the CI default) turns the pr-hero commit status red
|
|
270
|
+
// on blocking findings, a size or limits skip, and a crash; `advisory` keeps
|
|
277
271
|
// today's posture. Unset means the run resolves it (resolveCiMode, pr/preflight).
|
|
278
272
|
ciMode?: "gate" | "advisory";
|
|
279
|
-
// `setup --ci` / `ci init` only: the re-review preset
|
|
280
|
-
//
|
|
281
|
-
//
|
|
273
|
+
// `setup --ci` / `ci init` only: the re-review preset, for an agent that
|
|
274
|
+
// already asked the person. --ci-mode also applies there; together they
|
|
275
|
+
// replace the questions setup asks in a terminal.
|
|
282
276
|
reviewLevel?: "minimal" | "balanced" | "thorough" | "manual";
|
|
283
|
-
billing?: "subscription" | "api";
|
|
284
277
|
}
|
|
285
278
|
|
|
286
279
|
// design.md 3.1's literal formula: Boolean(GITHUB_ACTIONS || CI || --ci).
|
|
@@ -332,15 +325,14 @@ Usage:
|
|
|
332
325
|
crysk review [options] Review a branch (zero flags inside a configured repo)
|
|
333
326
|
crysk init [options] Scaffold <repo>/.crysk/config.json, and a root REVIEW.md when the repo has no review instructions
|
|
334
327
|
crysk setup [options] Run interactive onboarding wizard
|
|
335
|
-
crysk setup --ci [--force] [--level <l>] [--ci-mode <m>]
|
|
328
|
+
crysk setup --ci [--force] [--level <l>] [--ci-mode <m>]
|
|
336
329
|
Scaffold .github/workflows/crysk.yml (or update
|
|
337
330
|
an existing pr-hero.yml) instead
|
|
338
331
|
of the wizard. Refuses to overwrite an existing
|
|
339
332
|
workflow unless --force is passed. Asks how CI
|
|
340
333
|
re-reviews (in a terminal) or takes the flags:
|
|
341
334
|
--level minimal|balanced|thorough|manual,
|
|
342
|
-
--ci-mode gate|advisory,
|
|
343
|
-
subscription|api, --budget-usd (api only),
|
|
335
|
+
--ci-mode gate|advisory,
|
|
344
336
|
--max-changed-lines (default 4000).
|
|
345
337
|
Writes the level to .crysk/config.json and
|
|
346
338
|
prints a summary. Then checks gh and, in a
|
|
@@ -367,13 +359,15 @@ Usage:
|
|
|
367
359
|
and posts nothing (the only way to preview a
|
|
368
360
|
plan, since --pr --dry-run returns before any
|
|
369
361
|
findings exist)
|
|
370
|
-
crysk triage reply --pr <n> --from <run-dir> --finding <id> --tag <tag>
|
|
362
|
+
crysk triage reply --pr <n> [--from <run-dir>] --finding <id> --tag <tag>
|
|
371
363
|
--body-file <path> [--verdict <v>] [--issue <n>] [--dry-run]
|
|
372
364
|
Post one triage reply. The driver resolves the
|
|
373
365
|
parent from the posted <!-- crysk-finding
|
|
374
366
|
marker (never path/line), renders the marker +
|
|
375
367
|
badge, posts, and resolves the inline review
|
|
376
368
|
thread. --body-file is reasoning prose only.
|
|
369
|
+
Without --from, the finding is read off the PR
|
|
370
|
+
by its R### id (crysk status --pr <n> --json).
|
|
377
371
|
--dry-run prints the parent and posts nothing
|
|
378
372
|
crysk status --pr <n> [--wait] [--json]
|
|
379
373
|
Read the PR's crysk gate, posted findings and
|
|
@@ -434,7 +428,7 @@ Usage:
|
|
|
434
428
|
crysk gc uninstall Unload and remove that launchd agent
|
|
435
429
|
crysk gc status Read-only: whether the GC agent is installed
|
|
436
430
|
crysk usage [--all] Print the observability store's per-run rows
|
|
437
|
-
(
|
|
431
|
+
(tokens, findings) for the current
|
|
438
432
|
checkout's origin — every review, local and
|
|
439
433
|
PR, auto-ingests into it. --all shows every
|
|
440
434
|
origin instead of just this one. Read-only, $0
|
|
@@ -521,8 +515,8 @@ Options:
|
|
|
521
515
|
gotchas.md, else none); supply it from outside to review
|
|
522
516
|
a tree you cannot dirty
|
|
523
517
|
--config <file> Local config (default: <repo>/.crysk/config.json) with
|
|
524
|
-
agents_dir, default_base
|
|
525
|
-
|
|
518
|
+
agents_dir, default_base and suspicion_priors,
|
|
519
|
+
optional summary settings, and
|
|
526
520
|
optional max_verification_steps (re-review verify cap;
|
|
527
521
|
default 8; 0 pauses verification), and optional
|
|
528
522
|
max_concurrent_steps (cap on steps in flight at once;
|
|
@@ -534,12 +528,6 @@ Options:
|
|
|
534
528
|
their effort go in "models" in ~/.crysk/config.json
|
|
535
529
|
--summary Enable the engine-owned PR summary (default)
|
|
536
530
|
--no-summary Disable the engine-owned PR summary
|
|
537
|
-
--scout review only: run the diff-only scout stage before the
|
|
538
|
-
hunters, biasing their scan with unverified leads.
|
|
539
|
-
EXPERIMENTAL and off by default — the A/B that decides
|
|
540
|
-
whether it earns its cost has not run yet
|
|
541
|
-
--scout-model <m> Model for the scout stage (default: the run's model).
|
|
542
|
-
Requires --scout
|
|
543
531
|
--no-shared-prefix review only: turn off the shared hunter prefix. By
|
|
544
532
|
default the patch and output contract sit in each
|
|
545
533
|
hunter's system prompt, identical across hunters, and the
|
|
@@ -568,7 +556,7 @@ Options:
|
|
|
568
556
|
--interval <min> watch install and gc install: minutes between launchd
|
|
569
557
|
ticks (watch default: ${DEFAULT_WATCH_INTERVAL_MIN};
|
|
570
558
|
gc default: ${DEFAULT_GC_INTERVAL_MIN})
|
|
571
|
-
--dry-run Resolve, preflight, print the plan
|
|
559
|
+
--dry-run Resolve, preflight, print the plan,
|
|
572
560
|
then exit without spawning anything. For watch --once:
|
|
573
561
|
print what would be skipped/launched and why, touching
|
|
574
562
|
nothing
|
|
@@ -585,16 +573,16 @@ Options:
|
|
|
585
573
|
--ci-mode <gate|advisory>
|
|
586
574
|
With review --ci only. gate (the default): the
|
|
587
575
|
crysk commit status is failure on blocking findings
|
|
588
|
-
and on a size or
|
|
576
|
+
and on a size or limits skip, and error on a crash.
|
|
589
577
|
advisory: the status stays success whatever the
|
|
590
578
|
findings, as before
|
|
591
579
|
--force Review even when CI would skip: the size gate, the
|
|
592
|
-
review-policy admission rules, and the
|
|
580
|
+
review-policy admission rules, and the platform limits.
|
|
593
581
|
On GitHub, comment /crysk review on the PR to pass
|
|
594
582
|
this flag from Actions. An interactive TTY already
|
|
595
583
|
offers the size-gate choice as a menu; this flag is
|
|
596
584
|
the unattended hatch. Does NOT imply --yes — the
|
|
597
|
-
|
|
585
|
+
confirmation prompt still asks. With setup --ci /
|
|
598
586
|
ci init: overwrite the existing review workflow
|
|
599
587
|
(.github/workflows/crysk.yml or pr-hero.yml) instead
|
|
600
588
|
of refusing
|
|
@@ -623,6 +611,41 @@ Exit codes of a review (findings never change them):
|
|
|
623
611
|
3 the review is incomplete: a step failed (a hunter, the refuter,
|
|
624
612
|
verify, adjudicate, or the time ceiling). Run it again.`;
|
|
625
613
|
|
|
614
|
+
// The scout stage was removed. Its flags, its config key and its model role
|
|
615
|
+
// keep being accepted so no existing command line, config file or stored
|
|
616
|
+
// profile starts failing; each does nothing and says so, once (S2).
|
|
617
|
+
const SCOUT_REMOVED = "is ignored: the scout stage was removed";
|
|
618
|
+
|
|
619
|
+
// The parity hunter was removed from the product the same way: the config key,
|
|
620
|
+
// the `models.hunter.parity` role and a leftover `deep-review-parity.md` in a
|
|
621
|
+
// custom prompt directory are still accepted, do nothing, and say so once.
|
|
622
|
+
export const PARITY_REMOVED = "is ignored: the parity hunter was removed";
|
|
623
|
+
|
|
624
|
+
// The dollar limits moved to the Crysk platform (platform-owned-cost S7), so
|
|
625
|
+
// the flags that set them are retired the same way: `--budget-usd` set a
|
|
626
|
+
// ceiling, and `--billing` only chose whether setup wrote one.
|
|
627
|
+
const REMOVED_FLAG_NOTES: Readonly<Record<string, string>> = {
|
|
628
|
+
"--budget-usd":
|
|
629
|
+
"is ignored: dollar limits moved to the Crysk platform (Review > Limits in the dashboard)",
|
|
630
|
+
"--billing":
|
|
631
|
+
"is ignored: dollar limits moved to the Crysk platform, so setup no longer asks how the review is paid",
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
// What the shell prints, as `warning: <line>`, for every flag of a removed
|
|
635
|
+
// feature a command line carried. Pure: the shells decide where it goes.
|
|
636
|
+
export function removedFlagWarnings(
|
|
637
|
+
options: Pick<CliOptions, "removedFlags">,
|
|
638
|
+
): string[] {
|
|
639
|
+
return (options.removedFlags ?? []).map(
|
|
640
|
+
(flag) => `${flag} ${REMOVED_FLAG_NOTES[flag] ?? SCOUT_REMOVED}`,
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function noteRemovedFlag(options: CliOptions, flag: string): void {
|
|
645
|
+
const seen = options.removedFlags ?? [];
|
|
646
|
+
if (!seen.includes(flag)) options.removedFlags = [...seen, flag];
|
|
647
|
+
}
|
|
648
|
+
|
|
626
649
|
const VALUE_FLAGS = new Set([
|
|
627
650
|
"--repo",
|
|
628
651
|
"--base",
|
|
@@ -763,12 +786,8 @@ export function parseArgs(argv: string[]): ParsedCli {
|
|
|
763
786
|
options.summary = false;
|
|
764
787
|
continue;
|
|
765
788
|
}
|
|
766
|
-
if (arg === "--scout") {
|
|
767
|
-
options
|
|
768
|
-
continue;
|
|
769
|
-
}
|
|
770
|
-
if (arg === "--no-scout") {
|
|
771
|
-
options.scout = false;
|
|
789
|
+
if (arg === "--scout" || arg === "--no-scout") {
|
|
790
|
+
noteRemovedFlag(options, arg);
|
|
772
791
|
continue;
|
|
773
792
|
}
|
|
774
793
|
if (arg === "--no-shared-prefix") {
|
|
@@ -1074,28 +1093,18 @@ export function parseArgs(argv: string[]): ParsedCli {
|
|
|
1074
1093
|
);
|
|
1075
1094
|
}
|
|
1076
1095
|
// The adjudicator's verdicts are posted only by the CI shell, so the flag is a
|
|
1077
|
-
// no-op anywhere else. Same reasoning as --
|
|
1096
|
+
// no-op anywhere else. Same reasoning as --step-summary below.
|
|
1078
1097
|
if (options.adjudicate && !(options.ci && command === "review")) {
|
|
1079
1098
|
throw new CliUsageError("--adjudicate only applies with review --ci");
|
|
1080
1099
|
}
|
|
1081
1100
|
// Same "silently dropped intention" reasoning as --post/--pr above: a
|
|
1082
|
-
//
|
|
1083
|
-
//
|
|
1084
|
-
//
|
|
1085
|
-
//
|
|
1086
|
-
//
|
|
1087
|
-
// the ceiling into the workflow they scaffold.
|
|
1101
|
+
// summary toggle for a mode that never turns on would be a flag the
|
|
1102
|
+
// operator believes changed a run it did not. Scoped to `review`'s reading
|
|
1103
|
+
// of --ci specifically now that `setup --ci` exists — it means nothing to
|
|
1104
|
+
// scaffolding. `setup --ci` and `ci init` read the gate mode too: they
|
|
1105
|
+
// write it into the workflow they scaffold.
|
|
1088
1106
|
const scaffolding = (options.ci && command === "setup") || command === "ci";
|
|
1089
|
-
|
|
1090
|
-
options.budgetUsd !== undefined &&
|
|
1091
|
-
!(options.ci && command === "review") &&
|
|
1092
|
-
!scaffolding
|
|
1093
|
-
) {
|
|
1094
|
-
throw new CliUsageError(
|
|
1095
|
-
"--budget-usd only applies with review --ci, setup --ci or ci init",
|
|
1096
|
-
);
|
|
1097
|
-
}
|
|
1098
|
-
// S4: the gate mode is a review reading of --ci, like budgetUsd. Without
|
|
1107
|
+
// S4: the gate mode is a review reading of --ci, like stepSummary. Without
|
|
1099
1108
|
// it the flag would name a mode that never runs.
|
|
1100
1109
|
if (
|
|
1101
1110
|
options.ciMode !== undefined &&
|
|
@@ -1106,18 +1115,8 @@ export function parseArgs(argv: string[]): ParsedCli {
|
|
|
1106
1115
|
"--ci-mode only applies with review --ci, setup --ci or ci init",
|
|
1107
1116
|
);
|
|
1108
1117
|
}
|
|
1109
|
-
if (
|
|
1110
|
-
(
|
|
1111
|
-
!scaffolding
|
|
1112
|
-
) {
|
|
1113
|
-
throw new CliUsageError(
|
|
1114
|
-
"--level and --billing only apply with setup --ci or ci init",
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
if (options.billing === "subscription" && options.budgetUsd !== undefined) {
|
|
1118
|
-
throw new CliUsageError(
|
|
1119
|
-
"--budget-usd does not apply with --billing subscription: a subscription review spends quota, not dollars",
|
|
1120
|
-
);
|
|
1118
|
+
if (options.reviewLevel !== undefined && !scaffolding) {
|
|
1119
|
+
throw new CliUsageError("--level only applies with setup --ci or ci init");
|
|
1121
1120
|
}
|
|
1122
1121
|
if (
|
|
1123
1122
|
options.stepSummary !== undefined &&
|
|
@@ -1135,29 +1134,9 @@ export function parseArgs(argv: string[]): ParsedCli {
|
|
|
1135
1134
|
'the "ci" command requires a subcommand: "ci init"',
|
|
1136
1135
|
);
|
|
1137
1136
|
}
|
|
1138
|
-
// The scout is a `review` stage and nothing else reads either flag.
|
|
1139
|
-
// Rejected elsewhere rather than ignored, the --from guard's reasoning: a
|
|
1140
|
-
// flag that parses and then does nothing is an operator believing they
|
|
1141
|
-
// changed a run they did not.
|
|
1142
|
-
if (
|
|
1143
|
-
command !== "review" &&
|
|
1144
|
-
(options.scout !== undefined || options.scoutModel)
|
|
1145
|
-
) {
|
|
1146
|
-
throw new CliUsageError(
|
|
1147
|
-
"--scout and --scout-model only apply to the review command",
|
|
1148
|
-
);
|
|
1149
|
-
}
|
|
1150
1137
|
if (command !== "review" && options.full) {
|
|
1151
1138
|
throw new CliUsageError("--full only applies to the review command");
|
|
1152
1139
|
}
|
|
1153
|
-
// A model for a stage that will not run is the same silent no-op, one level
|
|
1154
|
-
// down — and the likeliest way to produce it is believing the model flag
|
|
1155
|
-
// turns the stage on.
|
|
1156
|
-
if (options.scoutModel !== undefined && !options.scout) {
|
|
1157
|
-
throw new CliUsageError(
|
|
1158
|
-
"--scout-model sets the model for the scout stage, so it requires --scout",
|
|
1159
|
-
);
|
|
1160
|
-
}
|
|
1161
1140
|
// `status` (ROADMAP S9) reads one PR and writes nothing, so its whole surface is --pr <n>
|
|
1162
1141
|
// and --json. Every other flag is refused here, not ignored: a flag that parses and then
|
|
1163
1142
|
// does nothing is an operator believing they changed a read they did not (the --from
|
|
@@ -1201,7 +1180,8 @@ export function parseArgs(argv: string[]): ParsedCli {
|
|
|
1201
1180
|
if (options.pr === undefined) {
|
|
1202
1181
|
throw new CliUsageError(`${command} requires --pr <n>`);
|
|
1203
1182
|
}
|
|
1204
|
-
|
|
1183
|
+
// triage-without-skill S2: triage reply reads the finding off the PR when no run directory is given.
|
|
1184
|
+
if (command === "post" && options.from === undefined) {
|
|
1205
1185
|
throw new CliUsageError(`${command} requires --from <run-dir>`);
|
|
1206
1186
|
}
|
|
1207
1187
|
} else if (options.from !== undefined) {
|
|
@@ -1429,7 +1409,7 @@ function applyValueFlag(
|
|
|
1429
1409
|
options.model = value;
|
|
1430
1410
|
return;
|
|
1431
1411
|
case "--scout-model":
|
|
1432
|
-
options
|
|
1412
|
+
noteRemovedFlag(options, flag);
|
|
1433
1413
|
return;
|
|
1434
1414
|
case "--from":
|
|
1435
1415
|
options.from = value;
|
|
@@ -1452,18 +1432,12 @@ function applyValueFlag(
|
|
|
1452
1432
|
case "--max-changed-files":
|
|
1453
1433
|
options.maxChangedFiles = parseLimit(flag, value);
|
|
1454
1434
|
return;
|
|
1455
|
-
//
|
|
1456
|
-
//
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
const parsed = Number(value);
|
|
1461
|
-
if (!Number.isFinite(parsed)) {
|
|
1462
|
-
throw new CliUsageError(`--budget-usd must be a number, got: ${value}`);
|
|
1463
|
-
}
|
|
1464
|
-
options.budgetUsd = parsed;
|
|
1435
|
+
// Retired with the dollar limits (platform-owned-cost S7): the value is
|
|
1436
|
+
// read and dropped, whatever it is, and the flag is announced once.
|
|
1437
|
+
case "--budget-usd":
|
|
1438
|
+
case "--billing":
|
|
1439
|
+
noteRemovedFlag(options, flag);
|
|
1465
1440
|
return;
|
|
1466
|
-
}
|
|
1467
1441
|
case "--ci-mode": {
|
|
1468
1442
|
if (value !== "gate" && value !== "advisory") {
|
|
1469
1443
|
throw new CliUsageError(
|
|
@@ -1487,15 +1461,6 @@ function applyValueFlag(
|
|
|
1487
1461
|
options.reviewLevel = value;
|
|
1488
1462
|
return;
|
|
1489
1463
|
}
|
|
1490
|
-
case "--billing": {
|
|
1491
|
-
if (value !== "subscription" && value !== "api") {
|
|
1492
|
-
throw new CliUsageError(
|
|
1493
|
-
`--billing must be subscription or api, got: ${value}`,
|
|
1494
|
-
);
|
|
1495
|
-
}
|
|
1496
|
-
options.billing = value;
|
|
1497
|
-
return;
|
|
1498
|
-
}
|
|
1499
1464
|
case "--finding":
|
|
1500
1465
|
options.finding = value;
|
|
1501
1466
|
return;
|
|
@@ -2039,6 +2004,35 @@ const RETIRED_AGENT_HINTS: Record<string, string> = {
|
|
|
2039
2004
|
"CRYSK_EXTRA_HUNTERS=lifecycle:deep-review-lifecycle.md",
|
|
2040
2005
|
};
|
|
2041
2006
|
|
|
2007
|
+
// The other direction: a hunter that JOINED the default spec. A custom set
|
|
2008
|
+
// copied from an older default lacks its file, and "the dir does not have it"
|
|
2009
|
+
// alone reads as a broken install after an upgrade.
|
|
2010
|
+
const ADDED_AGENT_HINTS: Record<string, string> = {
|
|
2011
|
+
"deep-review-security.md":
|
|
2012
|
+
"; the security hunter was added to the default spec: copy " +
|
|
2013
|
+
"prompts/default/deep-review-security.md from the crysk package into " +
|
|
2014
|
+
"this directory",
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
// Prompt files of a removed hunter that a custom set copied from an older
|
|
2018
|
+
// default may still carry. Not a problem and never used: the directory check
|
|
2019
|
+
// lets them pass and says so once instead (ignoredAgentFileWarnings).
|
|
2020
|
+
const IGNORED_AGENT_FILES: ReadonlySet<string> = new Set([
|
|
2021
|
+
"deep-review-parity.md",
|
|
2022
|
+
]);
|
|
2023
|
+
|
|
2024
|
+
// One warning per ignored file that is present and that no agent of the spec
|
|
2025
|
+
// names, in the order of the set above. A spec that names the file uses it and
|
|
2026
|
+
// has nothing to say.
|
|
2027
|
+
function ignoredAgentFileWarnings(
|
|
2028
|
+
specFiles: readonly string[],
|
|
2029
|
+
presentFiles: readonly string[],
|
|
2030
|
+
): string[] {
|
|
2031
|
+
return [...IGNORED_AGENT_FILES]
|
|
2032
|
+
.filter((file) => presentFiles.includes(file) && !specFiles.includes(file))
|
|
2033
|
+
.map((file) => `${file} ${PARITY_REMOVED}`);
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2042
2036
|
export function agentsDirProblems(
|
|
2043
2037
|
specFiles: string[],
|
|
2044
2038
|
presentFiles: string[],
|
|
@@ -2049,12 +2043,13 @@ export function agentsDirProblems(
|
|
|
2049
2043
|
for (const file of named) {
|
|
2050
2044
|
if (!present.has(file)) {
|
|
2051
2045
|
problems.push(
|
|
2052
|
-
`the spec references "${file}" but the dir does not have it
|
|
2046
|
+
`the spec references "${file}" but the dir does not have it` +
|
|
2047
|
+
(ADDED_AGENT_HINTS[file] ?? ""),
|
|
2053
2048
|
);
|
|
2054
2049
|
}
|
|
2055
2050
|
}
|
|
2056
2051
|
for (const file of presentFiles) {
|
|
2057
|
-
if (!named.has(file)) {
|
|
2052
|
+
if (!named.has(file) && !IGNORED_AGENT_FILES.has(file)) {
|
|
2058
2053
|
problems.push(
|
|
2059
2054
|
`the dir has "${file}" but no agent in the spec references it ` +
|
|
2060
2055
|
`(it would never run)${RETIRED_AGENT_HINTS[file] ?? ""}`,
|
|
@@ -2111,10 +2106,12 @@ export function resolveAgentsDir(
|
|
|
2111
2106
|
return resolution;
|
|
2112
2107
|
}
|
|
2113
2108
|
|
|
2109
|
+
// Returns the warnings of the check that passed (ignoredAgentFileWarnings), for
|
|
2110
|
+
// the caller to print: this function is pure of any output channel.
|
|
2114
2111
|
export async function preflightAgentsDir(
|
|
2115
2112
|
agents: Pick<AgentsDirResolution, "kind" | "dir" | "files">,
|
|
2116
2113
|
specFiles: string[],
|
|
2117
|
-
): Promise<
|
|
2114
|
+
): Promise<string[]> {
|
|
2118
2115
|
const present = new Set<string>();
|
|
2119
2116
|
if (agents.kind === "bundled") {
|
|
2120
2117
|
// The manifest's keys ARE the present set, and there is nothing to scan:
|
|
@@ -2140,6 +2137,7 @@ export async function preflightAgentsDir(
|
|
|
2140
2137
|
{ cls: { kind: "prompt-set" } },
|
|
2141
2138
|
);
|
|
2142
2139
|
}
|
|
2140
|
+
return ignoredAgentFileWarnings(specFiles, [...present]);
|
|
2143
2141
|
}
|
|
2144
2142
|
|
|
2145
2143
|
// EXPERIMENT (odd/tasks/logic-hunter.md T3): benchmark-only hunter fan-out,
|
|
@@ -2181,9 +2179,10 @@ function parseExtraHunters(read: BrandEnvValue | undefined): AgentSpec[] {
|
|
|
2181
2179
|
});
|
|
2182
2180
|
}
|
|
2183
2181
|
|
|
2184
|
-
// Local mode's wiring: the
|
|
2185
|
-
//
|
|
2186
|
-
//
|
|
2182
|
+
// Local mode's wiring: the four unconditional hunters and the refuter.
|
|
2183
|
+
// Deliberately NOT defaultReviewSpec() — that one omits the logic and security
|
|
2184
|
+
// hunters and keeps the conditional parity hunter, which is the lab's legacy
|
|
2185
|
+
// wiring and no longer part of the product. Hunter keys stay inside the findings-schema v1.1.0 Hunter/specialty
|
|
2187
2186
|
// set, which validateReviewSpec enforces.
|
|
2188
2187
|
//
|
|
2189
2188
|
// `env` is injectable (defaults to `process.env`) so PRHERO_EXTRA_HUNTERS can
|
|
@@ -2202,12 +2201,7 @@ export function localReviewSpec(
|
|
|
2202
2201
|
},
|
|
2203
2202
|
{ key: "resilience", file: "deep-review-resilience.md", role: "hunter" },
|
|
2204
2203
|
{ key: "logic", file: "deep-review-logic.md", role: "hunter" },
|
|
2205
|
-
{
|
|
2206
|
-
key: "parity",
|
|
2207
|
-
file: "deep-review-parity.md",
|
|
2208
|
-
role: "hunter",
|
|
2209
|
-
trigger: "input",
|
|
2210
|
-
},
|
|
2204
|
+
{ key: "security", file: "deep-review-security.md", role: "hunter" },
|
|
2211
2205
|
// The boundary, not the three throws: assertBasenameOnly inside
|
|
2212
2206
|
// parseExtraHunters is a fourth usage throw of the same parse (T2d-1).
|
|
2213
2207
|
...withUsageClass({ kind: "config-parse", source: "extra-hunters" }, () =>
|
|
@@ -2241,10 +2235,6 @@ export const CONFIG_DIRECTION: Record<keyof LocalConfig, ConfigDirection> = {
|
|
|
2241
2235
|
// plan card — verbatim the "wrong answer with a plausible face" failure the
|
|
2242
2236
|
// comment at the top of this file names.
|
|
2243
2237
|
default_base: "repo",
|
|
2244
|
-
// The values are paths INSIDE one repository. A global answer is meaningless
|
|
2245
|
-
// everywhere else and would silently arm or disarm the parity hunter across
|
|
2246
|
-
// every repo on the machine.
|
|
2247
|
-
parity_trigger_paths: "repo",
|
|
2248
2238
|
suspicion_priors: "repo",
|
|
2249
2239
|
// Per-field below — the two fields disagree, which is why SUMMARY_DIRECTION
|
|
2250
2240
|
// exists. This row declares the key for the known-key set; the merge
|
|
@@ -2262,10 +2252,9 @@ export const CONFIG_DIRECTION: Record<keyof LocalConfig, ConfigDirection> = {
|
|
|
2262
2252
|
max_concurrent_steps: "capped",
|
|
2263
2253
|
max_changed_lines: "capped",
|
|
2264
2254
|
max_changed_files: "capped",
|
|
2265
|
-
|
|
2266
|
-
//
|
|
2267
|
-
//
|
|
2268
|
-
// never on against the operator's global ceiling.
|
|
2255
|
+
// `capped`: switching it on adds one judge spawn per blocking finding, so a
|
|
2256
|
+
// committed file may turn it off but never on against the operator's global
|
|
2257
|
+
// ceiling.
|
|
2269
2258
|
materiality_gate: "capped",
|
|
2270
2259
|
post: "capped",
|
|
2271
2260
|
// `person`: a global floor applies to every repo, and a repo file overrides
|
|
@@ -2290,7 +2279,6 @@ export const SUMMARY_DIRECTION: Record<keyof SummaryConfig, ConfigDirection> = {
|
|
|
2290
2279
|
};
|
|
2291
2280
|
|
|
2292
2281
|
export interface LocalConfig {
|
|
2293
|
-
parity_trigger_paths: string[];
|
|
2294
2282
|
suspicion_priors: SuspicionPrior[];
|
|
2295
2283
|
// Both optional, and both exist to make `pr-hero review` a zero-flag
|
|
2296
2284
|
// command: the prompt set lives in a sibling repo, and the default branch is
|
|
@@ -2311,12 +2299,11 @@ export interface LocalConfig {
|
|
|
2311
2299
|
// `unconfirmed` (the pause switch, same shape as watch daily_cap).
|
|
2312
2300
|
max_verification_steps?: number;
|
|
2313
2301
|
// Admission cap on in-flight steps (hunter, refuter, verify, adjudicate,
|
|
2314
|
-
//
|
|
2302
|
+
// summarizer attempts). Absent means unlimited: no gate is built.
|
|
2315
2303
|
// Positive only: 0 would admit nothing and wedge every run.
|
|
2316
2304
|
max_concurrent_steps?: number;
|
|
2317
2305
|
max_changed_lines?: number;
|
|
2318
2306
|
max_changed_files?: number;
|
|
2319
|
-
scout?: boolean;
|
|
2320
2307
|
// Opt-in judge that demotes immaterial blocking findings to advisory
|
|
2321
2308
|
// (review/materiality-gate.ts). Absent means off.
|
|
2322
2309
|
materiality_gate?: boolean;
|
|
@@ -2356,16 +2343,15 @@ export interface SummarySettings {
|
|
|
2356
2343
|
}
|
|
2357
2344
|
|
|
2358
2345
|
export const EMPTY_LOCAL_CONFIG: LocalConfig = {
|
|
2359
|
-
parity_trigger_paths: [],
|
|
2360
2346
|
suspicion_priors: [],
|
|
2361
2347
|
};
|
|
2362
2348
|
|
|
2363
2349
|
// What a layer SAID, not what the engine will use — every key optional,
|
|
2364
|
-
// including the
|
|
2350
|
+
// including the array LocalConfig declares required.
|
|
2365
2351
|
//
|
|
2366
2352
|
// WHY the distinction is load-bearing rather than cosmetic: a merge whose
|
|
2367
2353
|
// input cannot represent absence has already destroyed the fact it needs to
|
|
2368
|
-
// fold on. Under LocalConfig a repo file that omits `
|
|
2354
|
+
// fold on. Under LocalConfig a repo file that omits `suspicion_priors`
|
|
2369
2355
|
// hands the merge a materialised `[]`, the fold sees the repo layer speak,
|
|
2370
2356
|
// and provenance reports `repo` for a value that file never named. That is a
|
|
2371
2357
|
// lie in pipeline.json and in `pr-hero config`, and no amount of care in the
|
|
@@ -2403,19 +2389,18 @@ const REPO_CONFIG_LABEL = ".crysk/config.json";
|
|
|
2403
2389
|
const GLOBAL_CONFIG_LABEL = "~/.crysk/config.json";
|
|
2404
2390
|
|
|
2405
2391
|
// `.crysk/config.json` is optional and every setting inside it is optional —
|
|
2406
|
-
// an absent config is a legal, complete configuration (
|
|
2407
|
-
//
|
|
2408
|
-
//
|
|
2409
|
-
//
|
|
2410
|
-
// anyone noticing, so shape violations throw.
|
|
2392
|
+
// an absent config is a legal, complete configuration (summary activation is
|
|
2393
|
+
// resolved by resolveSummary). What is NOT tolerated is a malformed one: a
|
|
2394
|
+
// typo'd key silently read as "no priors" is exactly how a setting stops
|
|
2395
|
+
// applying without anyone noticing, so shape violations throw.
|
|
2411
2396
|
// WHY summary defaults on: it is the first defaulted setting that spends
|
|
2412
2397
|
// money, and a silent opt-out would make a normal review's bill differ from
|
|
2413
2398
|
// the plan. `--no-summary` and `summary.enabled: false` are the explicit exits.
|
|
2414
2399
|
//
|
|
2415
|
-
// WHY it returns a ConfigLayer and no longer materialises the
|
|
2416
|
-
// return object used to write `
|
|
2417
|
-
// unconditionally, because LocalConfig required them.
|
|
2418
|
-
// difference between "the file said []" and "the file never mentioned it" —
|
|
2400
|
+
// WHY it returns a ConfigLayer and no longer materialises the array: the
|
|
2401
|
+
// return object used to write `suspicion_priors` (and the removed
|
|
2402
|
+
// `parity_trigger_paths`) unconditionally, because LocalConfig required them.
|
|
2403
|
+
// That destroyed the difference between "the file said []" and "the file never mentioned it" —
|
|
2419
2404
|
// and the merge downstream can only report truthful provenance for a key it
|
|
2420
2405
|
// can still see was absent. The `?? []` locals below stay exactly as they
|
|
2421
2406
|
// are: they feed the validators, and validating an absent key against the
|
|
@@ -2508,6 +2493,19 @@ function parseConfigLayer(
|
|
|
2508
2493
|
if (key === "routing") {
|
|
2509
2494
|
throw new CliUsageError(`${file}: ${REMOVED_ROUTING_MESSAGE}`);
|
|
2510
2495
|
}
|
|
2496
|
+
// The removed stage's key: still admitted in both layers (a stored person
|
|
2497
|
+
// profile, a committed repo file), never read, said out loud once per file.
|
|
2498
|
+
if (key === "scout") {
|
|
2499
|
+
warnings?.push(`${file}: scout ${SCOUT_REMOVED}`);
|
|
2500
|
+
continue;
|
|
2501
|
+
}
|
|
2502
|
+
// The removed hunter's key, in either layer: it used to be refused in a
|
|
2503
|
+
// person file as a per-repo key, and telling someone to move a dead key to
|
|
2504
|
+
// another file would be wrong. Whatever the value, it is never read.
|
|
2505
|
+
if (key === "parity_trigger_paths") {
|
|
2506
|
+
warnings?.push(`${file}: parity_trigger_paths ${PARITY_REMOVED}`);
|
|
2507
|
+
continue;
|
|
2508
|
+
}
|
|
2511
2509
|
if (!KNOWN_CONFIG_KEYS.has(key)) {
|
|
2512
2510
|
throw new CliUsageError(`${file} unknown key: ${redactConfigValue(key)}`);
|
|
2513
2511
|
}
|
|
@@ -2531,15 +2529,6 @@ function parseConfigLayer(
|
|
|
2531
2529
|
);
|
|
2532
2530
|
}
|
|
2533
2531
|
}
|
|
2534
|
-
const triggers = config.parity_trigger_paths ?? [];
|
|
2535
|
-
if (
|
|
2536
|
-
!Array.isArray(triggers) ||
|
|
2537
|
-
!triggers.every((p) => typeof p === "string" && p.length > 0)
|
|
2538
|
-
) {
|
|
2539
|
-
throw new CliUsageError(
|
|
2540
|
-
`${file} parity_trigger_paths must be an array of non-empty strings`,
|
|
2541
|
-
);
|
|
2542
|
-
}
|
|
2543
2532
|
const priors = config.suspicion_priors ?? [];
|
|
2544
2533
|
if (!Array.isArray(priors)) {
|
|
2545
2534
|
throw new CliUsageError(`${file} suspicion_priors must be an array`);
|
|
@@ -2564,7 +2553,7 @@ function parseConfigLayer(
|
|
|
2564
2553
|
const profile = parseProfile(config.profile, file);
|
|
2565
2554
|
const summaryParse = parseSummaryConfig(config.summary, file);
|
|
2566
2555
|
const summary = summaryParse?.summary;
|
|
2567
|
-
let models = parseModels(config.models, file);
|
|
2556
|
+
let models = parseModels(config.models, file, warnings);
|
|
2568
2557
|
if (summaryParse?.initModel === true) {
|
|
2569
2558
|
if (isRepoFile) {
|
|
2570
2559
|
// L6 item 6: a repo file can no longer pick the summary model, and
|
|
@@ -2618,7 +2607,6 @@ function parseConfigLayer(
|
|
|
2618
2607
|
"max_changed_files",
|
|
2619
2608
|
file,
|
|
2620
2609
|
);
|
|
2621
|
-
const scout = parseOptionalBoolean(config.scout, "scout", file);
|
|
2622
2610
|
const materialityGate = parseOptionalBoolean(
|
|
2623
2611
|
config.materiality_gate,
|
|
2624
2612
|
"materiality_gate",
|
|
@@ -2672,9 +2660,6 @@ function parseConfigLayer(
|
|
|
2672
2660
|
file,
|
|
2673
2661
|
);
|
|
2674
2662
|
return {
|
|
2675
|
-
...(given(config.parity_trigger_paths)
|
|
2676
|
-
? { parity_trigger_paths: triggers as string[] }
|
|
2677
|
-
: {}),
|
|
2678
2663
|
...(given(config.suspicion_priors)
|
|
2679
2664
|
? { suspicion_priors: priors as SuspicionPrior[] }
|
|
2680
2665
|
: {}),
|
|
@@ -2696,7 +2681,6 @@ function parseConfigLayer(
|
|
|
2696
2681
|
...(maxChangedFiles === undefined
|
|
2697
2682
|
? {}
|
|
2698
2683
|
: { max_changed_files: maxChangedFiles }),
|
|
2699
|
-
...(scout === undefined ? {} : { scout }),
|
|
2700
2684
|
...(materialityGate === undefined
|
|
2701
2685
|
? {}
|
|
2702
2686
|
: { materiality_gate: materialityGate }),
|
|
@@ -2739,10 +2723,23 @@ function parseProfile(value: unknown, file: string): string | undefined {
|
|
|
2739
2723
|
|
|
2740
2724
|
// The `models` object (S1, S3). Its rules live in model/model-name.ts; this
|
|
2741
2725
|
// adds the file to every message, as every other key's error does.
|
|
2742
|
-
function parseModels(
|
|
2726
|
+
function parseModels(
|
|
2727
|
+
value: unknown,
|
|
2728
|
+
file: string,
|
|
2729
|
+
warnings: string[] | undefined,
|
|
2730
|
+
): ModelsConfig | undefined {
|
|
2743
2731
|
if (value === undefined) return undefined;
|
|
2744
2732
|
try {
|
|
2745
|
-
|
|
2733
|
+
const removed: string[] = [];
|
|
2734
|
+
const models = parseModelsConfig(value, (role) => removed.push(role));
|
|
2735
|
+
for (const role of removed) {
|
|
2736
|
+
warnings?.push(`${file}: models.${role} ${SCOUT_REMOVED}`);
|
|
2737
|
+
}
|
|
2738
|
+
// A models object that named only a removed role chose no routing: handing
|
|
2739
|
+
// back `{}` would read as "the person chose routing" (routingConfigured).
|
|
2740
|
+
return removed.length > 0 && Object.keys(models).length === 0
|
|
2741
|
+
? undefined
|
|
2742
|
+
: models;
|
|
2746
2743
|
} catch (error) {
|
|
2747
2744
|
if (error instanceof ModelNameError) {
|
|
2748
2745
|
throw new CliUsageError(`${file} ${error.message}`);
|
|
@@ -2954,13 +2951,6 @@ export function resolveSharedPrefix(
|
|
|
2954
2951
|
return options.sharedPrefix !== false;
|
|
2955
2952
|
}
|
|
2956
2953
|
|
|
2957
|
-
export function resolveScout(
|
|
2958
|
-
options: Pick<CliOptions, "scout">,
|
|
2959
|
-
config: Pick<ConfigLayer, "scout">,
|
|
2960
|
-
): boolean {
|
|
2961
|
-
return options.scout ?? config.scout ?? false;
|
|
2962
|
-
}
|
|
2963
|
-
|
|
2964
2954
|
// No CLI flag on purpose: the gate is opt-in through config only, so the
|
|
2965
2955
|
// merged config is the whole answer and absent means off.
|
|
2966
2956
|
export function resolveMaterialityGate(
|
|
@@ -3072,11 +3062,6 @@ export function mergeConfig(
|
|
|
3072
3062
|
CONFIG_DIRECTION.default_base,
|
|
3073
3063
|
(layer) => layer.default_base,
|
|
3074
3064
|
);
|
|
3075
|
-
const triggers = foldKey(
|
|
3076
|
-
layers,
|
|
3077
|
-
CONFIG_DIRECTION.parity_trigger_paths,
|
|
3078
|
-
(layer) => layer.parity_trigger_paths,
|
|
3079
|
-
);
|
|
3080
3065
|
const priors = foldKey(
|
|
3081
3066
|
layers,
|
|
3082
3067
|
CONFIG_DIRECTION.suspicion_priors,
|
|
@@ -3120,12 +3105,6 @@ export function mergeConfig(
|
|
|
3120
3105
|
(layer) => layer.max_changed_files,
|
|
3121
3106
|
narrowSizeLimit,
|
|
3122
3107
|
);
|
|
3123
|
-
const scout = foldKey(
|
|
3124
|
-
layers,
|
|
3125
|
-
CONFIG_DIRECTION.scout,
|
|
3126
|
-
(layer) => layer.scout,
|
|
3127
|
-
(a, b) => a && b,
|
|
3128
|
-
);
|
|
3129
3108
|
const materialityGate = foldKey(
|
|
3130
3109
|
layers,
|
|
3131
3110
|
CONFIG_DIRECTION.materiality_gate,
|
|
@@ -3214,7 +3193,6 @@ export function mergeConfig(
|
|
|
3214
3193
|
// key nobody named, so the array can be handed to the resolvers without
|
|
3215
3194
|
// that fact being lost. Materialising it any earlier is what made
|
|
3216
3195
|
// provenance a lie.
|
|
3217
|
-
parity_trigger_paths: triggers.value ?? [],
|
|
3218
3196
|
suspicion_priors: priors.value ?? [],
|
|
3219
3197
|
...(agentsDir.value === undefined ? {} : { agents_dir: agentsDir.value }),
|
|
3220
3198
|
...(defaultBase.value === undefined
|
|
@@ -3238,7 +3216,6 @@ export function mergeConfig(
|
|
|
3238
3216
|
...(maxFiles.value === undefined
|
|
3239
3217
|
? {}
|
|
3240
3218
|
: { max_changed_files: maxFiles.value }),
|
|
3241
|
-
...(scout.value === undefined ? {} : { scout: scout.value }),
|
|
3242
3219
|
...(materialityGate.value === undefined
|
|
3243
3220
|
? {}
|
|
3244
3221
|
: { materiality_gate: materialityGate.value }),
|
|
@@ -3276,7 +3253,6 @@ export function mergeConfig(
|
|
|
3276
3253
|
const sources: ConfigSources = {
|
|
3277
3254
|
agents_dir: agentsDir.source,
|
|
3278
3255
|
default_base: defaultBase.source,
|
|
3279
|
-
parity_trigger_paths: triggers.source,
|
|
3280
3256
|
suspicion_priors: priors.source,
|
|
3281
3257
|
summary: { enabled: summaryEnabled.source },
|
|
3282
3258
|
models: models.source,
|
|
@@ -3286,7 +3262,6 @@ export function mergeConfig(
|
|
|
3286
3262
|
max_concurrent_steps: maxConcurrentSteps.source,
|
|
3287
3263
|
max_changed_lines: maxLines.source,
|
|
3288
3264
|
max_changed_files: maxFiles.source,
|
|
3289
|
-
scout: scout.source,
|
|
3290
3265
|
materiality_gate: materialityGate.source,
|
|
3291
3266
|
post: post.source,
|
|
3292
3267
|
post_min_severity: postMinSeverity.source,
|
|
@@ -3355,8 +3330,8 @@ export interface InitTemplateOmissions {
|
|
|
3355
3330
|
//
|
|
3356
3331
|
// `default_base` is NOT here and must never be: it is a `repo` key (D4),
|
|
3357
3332
|
// `parseGlobalConfig` rejects it by name, so no global file can supply it and
|
|
3358
|
-
// omitting it would scaffold a repo with no base ref at all. The
|
|
3359
|
-
//
|
|
3333
|
+
// omitting it would scaffold a repo with no base ref at all. The array key
|
|
3334
|
+
// (`suspicion_priors`) is `repo` for the same reason. `summary.enabled` IS here even though
|
|
3360
3335
|
// O-9's wording names only the person keys — the template hardcodes `true`,
|
|
3361
3336
|
// which is exactly the value `capped` forbids the team file from raising over
|
|
3362
3337
|
// a global `false` (judgment ledger JD-17), so seeding it against a global
|
|
@@ -3404,7 +3379,6 @@ export function initConfigTemplate(input: InitTemplateInput): string {
|
|
|
3404
3379
|
// and configures nothing, which is a line whose only effect is to make
|
|
3405
3380
|
// the next reader wonder what it does.
|
|
3406
3381
|
...(Object.keys(summary).length === 0 ? {} : { summary }),
|
|
3407
|
-
parity_trigger_paths: [],
|
|
3408
3382
|
suspicion_priors: [],
|
|
3409
3383
|
},
|
|
3410
3384
|
null,
|