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
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;
|
|
@@ -2049,6 +2014,25 @@ const ADDED_AGENT_HINTS: Record<string, string> = {
|
|
|
2049
2014
|
"this directory",
|
|
2050
2015
|
};
|
|
2051
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
|
+
|
|
2052
2036
|
export function agentsDirProblems(
|
|
2053
2037
|
specFiles: string[],
|
|
2054
2038
|
presentFiles: string[],
|
|
@@ -2065,7 +2049,7 @@ export function agentsDirProblems(
|
|
|
2065
2049
|
}
|
|
2066
2050
|
}
|
|
2067
2051
|
for (const file of presentFiles) {
|
|
2068
|
-
if (!named.has(file)) {
|
|
2052
|
+
if (!named.has(file) && !IGNORED_AGENT_FILES.has(file)) {
|
|
2069
2053
|
problems.push(
|
|
2070
2054
|
`the dir has "${file}" but no agent in the spec references it ` +
|
|
2071
2055
|
`(it would never run)${RETIRED_AGENT_HINTS[file] ?? ""}`,
|
|
@@ -2122,10 +2106,12 @@ export function resolveAgentsDir(
|
|
|
2122
2106
|
return resolution;
|
|
2123
2107
|
}
|
|
2124
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.
|
|
2125
2111
|
export async function preflightAgentsDir(
|
|
2126
2112
|
agents: Pick<AgentsDirResolution, "kind" | "dir" | "files">,
|
|
2127
2113
|
specFiles: string[],
|
|
2128
|
-
): Promise<
|
|
2114
|
+
): Promise<string[]> {
|
|
2129
2115
|
const present = new Set<string>();
|
|
2130
2116
|
if (agents.kind === "bundled") {
|
|
2131
2117
|
// The manifest's keys ARE the present set, and there is nothing to scan:
|
|
@@ -2151,6 +2137,7 @@ export async function preflightAgentsDir(
|
|
|
2151
2137
|
{ cls: { kind: "prompt-set" } },
|
|
2152
2138
|
);
|
|
2153
2139
|
}
|
|
2140
|
+
return ignoredAgentFileWarnings(specFiles, [...present]);
|
|
2154
2141
|
}
|
|
2155
2142
|
|
|
2156
2143
|
// EXPERIMENT (odd/tasks/logic-hunter.md T3): benchmark-only hunter fan-out,
|
|
@@ -2192,10 +2179,10 @@ function parseExtraHunters(read: BrandEnvValue | undefined): AgentSpec[] {
|
|
|
2192
2179
|
});
|
|
2193
2180
|
}
|
|
2194
2181
|
|
|
2195
|
-
// Local mode's wiring: the four unconditional hunters
|
|
2196
|
-
//
|
|
2197
|
-
//
|
|
2198
|
-
//
|
|
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
|
|
2199
2186
|
// set, which validateReviewSpec enforces.
|
|
2200
2187
|
//
|
|
2201
2188
|
// `env` is injectable (defaults to `process.env`) so PRHERO_EXTRA_HUNTERS can
|
|
@@ -2215,12 +2202,6 @@ export function localReviewSpec(
|
|
|
2215
2202
|
{ key: "resilience", file: "deep-review-resilience.md", role: "hunter" },
|
|
2216
2203
|
{ key: "logic", file: "deep-review-logic.md", role: "hunter" },
|
|
2217
2204
|
{ key: "security", file: "deep-review-security.md", role: "hunter" },
|
|
2218
|
-
{
|
|
2219
|
-
key: "parity",
|
|
2220
|
-
file: "deep-review-parity.md",
|
|
2221
|
-
role: "hunter",
|
|
2222
|
-
trigger: "input",
|
|
2223
|
-
},
|
|
2224
2205
|
// The boundary, not the three throws: assertBasenameOnly inside
|
|
2225
2206
|
// parseExtraHunters is a fourth usage throw of the same parse (T2d-1).
|
|
2226
2207
|
...withUsageClass({ kind: "config-parse", source: "extra-hunters" }, () =>
|
|
@@ -2254,10 +2235,6 @@ export const CONFIG_DIRECTION: Record<keyof LocalConfig, ConfigDirection> = {
|
|
|
2254
2235
|
// plan card — verbatim the "wrong answer with a plausible face" failure the
|
|
2255
2236
|
// comment at the top of this file names.
|
|
2256
2237
|
default_base: "repo",
|
|
2257
|
-
// The values are paths INSIDE one repository. A global answer is meaningless
|
|
2258
|
-
// everywhere else and would silently arm or disarm the parity hunter across
|
|
2259
|
-
// every repo on the machine.
|
|
2260
|
-
parity_trigger_paths: "repo",
|
|
2261
2238
|
suspicion_priors: "repo",
|
|
2262
2239
|
// Per-field below — the two fields disagree, which is why SUMMARY_DIRECTION
|
|
2263
2240
|
// exists. This row declares the key for the known-key set; the merge
|
|
@@ -2275,10 +2252,9 @@ export const CONFIG_DIRECTION: Record<keyof LocalConfig, ConfigDirection> = {
|
|
|
2275
2252
|
max_concurrent_steps: "capped",
|
|
2276
2253
|
max_changed_lines: "capped",
|
|
2277
2254
|
max_changed_files: "capped",
|
|
2278
|
-
|
|
2279
|
-
//
|
|
2280
|
-
//
|
|
2281
|
-
// 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.
|
|
2282
2258
|
materiality_gate: "capped",
|
|
2283
2259
|
post: "capped",
|
|
2284
2260
|
// `person`: a global floor applies to every repo, and a repo file overrides
|
|
@@ -2303,7 +2279,6 @@ export const SUMMARY_DIRECTION: Record<keyof SummaryConfig, ConfigDirection> = {
|
|
|
2303
2279
|
};
|
|
2304
2280
|
|
|
2305
2281
|
export interface LocalConfig {
|
|
2306
|
-
parity_trigger_paths: string[];
|
|
2307
2282
|
suspicion_priors: SuspicionPrior[];
|
|
2308
2283
|
// Both optional, and both exist to make `pr-hero review` a zero-flag
|
|
2309
2284
|
// command: the prompt set lives in a sibling repo, and the default branch is
|
|
@@ -2324,12 +2299,11 @@ export interface LocalConfig {
|
|
|
2324
2299
|
// `unconfirmed` (the pause switch, same shape as watch daily_cap).
|
|
2325
2300
|
max_verification_steps?: number;
|
|
2326
2301
|
// Admission cap on in-flight steps (hunter, refuter, verify, adjudicate,
|
|
2327
|
-
//
|
|
2302
|
+
// summarizer attempts). Absent means unlimited: no gate is built.
|
|
2328
2303
|
// Positive only: 0 would admit nothing and wedge every run.
|
|
2329
2304
|
max_concurrent_steps?: number;
|
|
2330
2305
|
max_changed_lines?: number;
|
|
2331
2306
|
max_changed_files?: number;
|
|
2332
|
-
scout?: boolean;
|
|
2333
2307
|
// Opt-in judge that demotes immaterial blocking findings to advisory
|
|
2334
2308
|
// (review/materiality-gate.ts). Absent means off.
|
|
2335
2309
|
materiality_gate?: boolean;
|
|
@@ -2369,16 +2343,15 @@ export interface SummarySettings {
|
|
|
2369
2343
|
}
|
|
2370
2344
|
|
|
2371
2345
|
export const EMPTY_LOCAL_CONFIG: LocalConfig = {
|
|
2372
|
-
parity_trigger_paths: [],
|
|
2373
2346
|
suspicion_priors: [],
|
|
2374
2347
|
};
|
|
2375
2348
|
|
|
2376
2349
|
// What a layer SAID, not what the engine will use — every key optional,
|
|
2377
|
-
// including the
|
|
2350
|
+
// including the array LocalConfig declares required.
|
|
2378
2351
|
//
|
|
2379
2352
|
// WHY the distinction is load-bearing rather than cosmetic: a merge whose
|
|
2380
2353
|
// input cannot represent absence has already destroyed the fact it needs to
|
|
2381
|
-
// fold on. Under LocalConfig a repo file that omits `
|
|
2354
|
+
// fold on. Under LocalConfig a repo file that omits `suspicion_priors`
|
|
2382
2355
|
// hands the merge a materialised `[]`, the fold sees the repo layer speak,
|
|
2383
2356
|
// and provenance reports `repo` for a value that file never named. That is a
|
|
2384
2357
|
// lie in pipeline.json and in `pr-hero config`, and no amount of care in the
|
|
@@ -2416,19 +2389,18 @@ const REPO_CONFIG_LABEL = ".crysk/config.json";
|
|
|
2416
2389
|
const GLOBAL_CONFIG_LABEL = "~/.crysk/config.json";
|
|
2417
2390
|
|
|
2418
2391
|
// `.crysk/config.json` is optional and every setting inside it is optional —
|
|
2419
|
-
// an absent config is a legal, complete configuration (
|
|
2420
|
-
//
|
|
2421
|
-
//
|
|
2422
|
-
//
|
|
2423
|
-
// 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.
|
|
2424
2396
|
// WHY summary defaults on: it is the first defaulted setting that spends
|
|
2425
2397
|
// money, and a silent opt-out would make a normal review's bill differ from
|
|
2426
2398
|
// the plan. `--no-summary` and `summary.enabled: false` are the explicit exits.
|
|
2427
2399
|
//
|
|
2428
|
-
// WHY it returns a ConfigLayer and no longer materialises the
|
|
2429
|
-
// return object used to write `
|
|
2430
|
-
// unconditionally, because LocalConfig required them.
|
|
2431
|
-
// 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" —
|
|
2432
2404
|
// and the merge downstream can only report truthful provenance for a key it
|
|
2433
2405
|
// can still see was absent. The `?? []` locals below stay exactly as they
|
|
2434
2406
|
// are: they feed the validators, and validating an absent key against the
|
|
@@ -2521,6 +2493,19 @@ function parseConfigLayer(
|
|
|
2521
2493
|
if (key === "routing") {
|
|
2522
2494
|
throw new CliUsageError(`${file}: ${REMOVED_ROUTING_MESSAGE}`);
|
|
2523
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
|
+
}
|
|
2524
2509
|
if (!KNOWN_CONFIG_KEYS.has(key)) {
|
|
2525
2510
|
throw new CliUsageError(`${file} unknown key: ${redactConfigValue(key)}`);
|
|
2526
2511
|
}
|
|
@@ -2544,15 +2529,6 @@ function parseConfigLayer(
|
|
|
2544
2529
|
);
|
|
2545
2530
|
}
|
|
2546
2531
|
}
|
|
2547
|
-
const triggers = config.parity_trigger_paths ?? [];
|
|
2548
|
-
if (
|
|
2549
|
-
!Array.isArray(triggers) ||
|
|
2550
|
-
!triggers.every((p) => typeof p === "string" && p.length > 0)
|
|
2551
|
-
) {
|
|
2552
|
-
throw new CliUsageError(
|
|
2553
|
-
`${file} parity_trigger_paths must be an array of non-empty strings`,
|
|
2554
|
-
);
|
|
2555
|
-
}
|
|
2556
2532
|
const priors = config.suspicion_priors ?? [];
|
|
2557
2533
|
if (!Array.isArray(priors)) {
|
|
2558
2534
|
throw new CliUsageError(`${file} suspicion_priors must be an array`);
|
|
@@ -2577,7 +2553,7 @@ function parseConfigLayer(
|
|
|
2577
2553
|
const profile = parseProfile(config.profile, file);
|
|
2578
2554
|
const summaryParse = parseSummaryConfig(config.summary, file);
|
|
2579
2555
|
const summary = summaryParse?.summary;
|
|
2580
|
-
let models = parseModels(config.models, file);
|
|
2556
|
+
let models = parseModels(config.models, file, warnings);
|
|
2581
2557
|
if (summaryParse?.initModel === true) {
|
|
2582
2558
|
if (isRepoFile) {
|
|
2583
2559
|
// L6 item 6: a repo file can no longer pick the summary model, and
|
|
@@ -2631,7 +2607,6 @@ function parseConfigLayer(
|
|
|
2631
2607
|
"max_changed_files",
|
|
2632
2608
|
file,
|
|
2633
2609
|
);
|
|
2634
|
-
const scout = parseOptionalBoolean(config.scout, "scout", file);
|
|
2635
2610
|
const materialityGate = parseOptionalBoolean(
|
|
2636
2611
|
config.materiality_gate,
|
|
2637
2612
|
"materiality_gate",
|
|
@@ -2685,9 +2660,6 @@ function parseConfigLayer(
|
|
|
2685
2660
|
file,
|
|
2686
2661
|
);
|
|
2687
2662
|
return {
|
|
2688
|
-
...(given(config.parity_trigger_paths)
|
|
2689
|
-
? { parity_trigger_paths: triggers as string[] }
|
|
2690
|
-
: {}),
|
|
2691
2663
|
...(given(config.suspicion_priors)
|
|
2692
2664
|
? { suspicion_priors: priors as SuspicionPrior[] }
|
|
2693
2665
|
: {}),
|
|
@@ -2709,7 +2681,6 @@ function parseConfigLayer(
|
|
|
2709
2681
|
...(maxChangedFiles === undefined
|
|
2710
2682
|
? {}
|
|
2711
2683
|
: { max_changed_files: maxChangedFiles }),
|
|
2712
|
-
...(scout === undefined ? {} : { scout }),
|
|
2713
2684
|
...(materialityGate === undefined
|
|
2714
2685
|
? {}
|
|
2715
2686
|
: { materiality_gate: materialityGate }),
|
|
@@ -2752,10 +2723,23 @@ function parseProfile(value: unknown, file: string): string | undefined {
|
|
|
2752
2723
|
|
|
2753
2724
|
// The `models` object (S1, S3). Its rules live in model/model-name.ts; this
|
|
2754
2725
|
// adds the file to every message, as every other key's error does.
|
|
2755
|
-
function parseModels(
|
|
2726
|
+
function parseModels(
|
|
2727
|
+
value: unknown,
|
|
2728
|
+
file: string,
|
|
2729
|
+
warnings: string[] | undefined,
|
|
2730
|
+
): ModelsConfig | undefined {
|
|
2756
2731
|
if (value === undefined) return undefined;
|
|
2757
2732
|
try {
|
|
2758
|
-
|
|
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;
|
|
2759
2743
|
} catch (error) {
|
|
2760
2744
|
if (error instanceof ModelNameError) {
|
|
2761
2745
|
throw new CliUsageError(`${file} ${error.message}`);
|
|
@@ -2967,13 +2951,6 @@ export function resolveSharedPrefix(
|
|
|
2967
2951
|
return options.sharedPrefix !== false;
|
|
2968
2952
|
}
|
|
2969
2953
|
|
|
2970
|
-
export function resolveScout(
|
|
2971
|
-
options: Pick<CliOptions, "scout">,
|
|
2972
|
-
config: Pick<ConfigLayer, "scout">,
|
|
2973
|
-
): boolean {
|
|
2974
|
-
return options.scout ?? config.scout ?? false;
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
2954
|
// No CLI flag on purpose: the gate is opt-in through config only, so the
|
|
2978
2955
|
// merged config is the whole answer and absent means off.
|
|
2979
2956
|
export function resolveMaterialityGate(
|
|
@@ -3085,11 +3062,6 @@ export function mergeConfig(
|
|
|
3085
3062
|
CONFIG_DIRECTION.default_base,
|
|
3086
3063
|
(layer) => layer.default_base,
|
|
3087
3064
|
);
|
|
3088
|
-
const triggers = foldKey(
|
|
3089
|
-
layers,
|
|
3090
|
-
CONFIG_DIRECTION.parity_trigger_paths,
|
|
3091
|
-
(layer) => layer.parity_trigger_paths,
|
|
3092
|
-
);
|
|
3093
3065
|
const priors = foldKey(
|
|
3094
3066
|
layers,
|
|
3095
3067
|
CONFIG_DIRECTION.suspicion_priors,
|
|
@@ -3133,12 +3105,6 @@ export function mergeConfig(
|
|
|
3133
3105
|
(layer) => layer.max_changed_files,
|
|
3134
3106
|
narrowSizeLimit,
|
|
3135
3107
|
);
|
|
3136
|
-
const scout = foldKey(
|
|
3137
|
-
layers,
|
|
3138
|
-
CONFIG_DIRECTION.scout,
|
|
3139
|
-
(layer) => layer.scout,
|
|
3140
|
-
(a, b) => a && b,
|
|
3141
|
-
);
|
|
3142
3108
|
const materialityGate = foldKey(
|
|
3143
3109
|
layers,
|
|
3144
3110
|
CONFIG_DIRECTION.materiality_gate,
|
|
@@ -3227,7 +3193,6 @@ export function mergeConfig(
|
|
|
3227
3193
|
// key nobody named, so the array can be handed to the resolvers without
|
|
3228
3194
|
// that fact being lost. Materialising it any earlier is what made
|
|
3229
3195
|
// provenance a lie.
|
|
3230
|
-
parity_trigger_paths: triggers.value ?? [],
|
|
3231
3196
|
suspicion_priors: priors.value ?? [],
|
|
3232
3197
|
...(agentsDir.value === undefined ? {} : { agents_dir: agentsDir.value }),
|
|
3233
3198
|
...(defaultBase.value === undefined
|
|
@@ -3251,7 +3216,6 @@ export function mergeConfig(
|
|
|
3251
3216
|
...(maxFiles.value === undefined
|
|
3252
3217
|
? {}
|
|
3253
3218
|
: { max_changed_files: maxFiles.value }),
|
|
3254
|
-
...(scout.value === undefined ? {} : { scout: scout.value }),
|
|
3255
3219
|
...(materialityGate.value === undefined
|
|
3256
3220
|
? {}
|
|
3257
3221
|
: { materiality_gate: materialityGate.value }),
|
|
@@ -3289,7 +3253,6 @@ export function mergeConfig(
|
|
|
3289
3253
|
const sources: ConfigSources = {
|
|
3290
3254
|
agents_dir: agentsDir.source,
|
|
3291
3255
|
default_base: defaultBase.source,
|
|
3292
|
-
parity_trigger_paths: triggers.source,
|
|
3293
3256
|
suspicion_priors: priors.source,
|
|
3294
3257
|
summary: { enabled: summaryEnabled.source },
|
|
3295
3258
|
models: models.source,
|
|
@@ -3299,7 +3262,6 @@ export function mergeConfig(
|
|
|
3299
3262
|
max_concurrent_steps: maxConcurrentSteps.source,
|
|
3300
3263
|
max_changed_lines: maxLines.source,
|
|
3301
3264
|
max_changed_files: maxFiles.source,
|
|
3302
|
-
scout: scout.source,
|
|
3303
3265
|
materiality_gate: materialityGate.source,
|
|
3304
3266
|
post: post.source,
|
|
3305
3267
|
post_min_severity: postMinSeverity.source,
|
|
@@ -3368,8 +3330,8 @@ export interface InitTemplateOmissions {
|
|
|
3368
3330
|
//
|
|
3369
3331
|
// `default_base` is NOT here and must never be: it is a `repo` key (D4),
|
|
3370
3332
|
// `parseGlobalConfig` rejects it by name, so no global file can supply it and
|
|
3371
|
-
// omitting it would scaffold a repo with no base ref at all. The
|
|
3372
|
-
//
|
|
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
|
|
3373
3335
|
// O-9's wording names only the person keys — the template hardcodes `true`,
|
|
3374
3336
|
// which is exactly the value `capped` forbids the team file from raising over
|
|
3375
3337
|
// a global `false` (judgment ledger JD-17), so seeding it against a global
|
|
@@ -3417,7 +3379,6 @@ export function initConfigTemplate(input: InitTemplateInput): string {
|
|
|
3417
3379
|
// and configures nothing, which is a line whose only effect is to make
|
|
3418
3380
|
// the next reader wonder what it does.
|
|
3419
3381
|
...(Object.keys(summary).length === 0 ? {} : { summary }),
|
|
3420
|
-
parity_trigger_paths: [],
|
|
3421
3382
|
suspicion_priors: [],
|
|
3422
3383
|
},
|
|
3423
3384
|
null,
|