crysk 0.5.0 → 0.6.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 +2 -1
- package/package.json +3 -2
- package/skills/crysk-ci-setup/assets/workflow.yml +3 -0
- package/src/asset-manifest.ts +11 -0
- package/src/assets.ts +1 -1
- package/src/ci/credential-refresh.ts +524 -0
- package/src/ci/crysk-secrets.ts +20 -6
- package/src/ci/force-comment.ts +14 -1
- package/src/ci/gates.ts +64 -21
- package/src/ci/outcome.ts +165 -15
- package/src/ci/platform-estimate.ts +111 -0
- package/src/ci/platform-trace.ts +30 -0
- package/src/ci/platform.ts +183 -5
- package/src/ci/reporter.ts +14 -4
- package/src/ci/setup.ts +96 -6
- package/src/ci/trace-bundle.ts +231 -27
- package/src/ci/trace-transcripts.ts +65 -0
- package/src/ci/trigger.ts +20 -4
- package/src/commands/ci-setup.ts +12 -3
- package/src/commands/doctor.ts +25 -23
- package/src/diversity/identity.ts +11 -1
- package/src/diversity/pipeline-integration.ts +19 -6
- package/src/doctor.ts +133 -4
- package/src/execution/contracts.ts +15 -3
- package/src/harness/materiality-judge.ts +153 -0
- package/src/harness/pipeline-plan.ts +133 -0
- package/src/harness/replay-rows.ts +172 -0
- package/src/harness/route-runner.ts +288 -0
- package/src/harness/single-step.ts +153 -0
- package/src/index.ts +1 -1
- package/src/model/catalog.ts +10 -7
- package/src/model/model-name.ts +14 -0
- package/src/model/profiles/claude.ts +34 -0
- package/src/model/profiles/openai.ts +44 -0
- package/src/model/profiles.ts +213 -0
- package/src/model/routing.ts +155 -50
- package/src/pr/ci-admission-gate.ts +2 -0
- package/src/pr/discovery.ts +18 -0
- package/src/pr/plan.ts +41 -2
- package/src/pr/review-pr.ts +43 -6
- package/src/pr/target.ts +67 -15
- package/src/production-runtime.ts +100 -13
- package/src/review/pipeline.ts +193 -58
- package/src/review/preflight.ts +91 -9
- package/src/review/prompt-set.ts +68 -0
- package/src/review/report.ts +4 -0
- package/src/review/review.ts +21 -11
- package/src/review/route-preflight.ts +117 -67
- package/src/review/run.ts +50 -4
- package/src/security/credential-broker.ts +21 -9
- package/src/security/oauth-providers.ts +101 -0
- package/src/transport-registry.ts +33 -0
- package/src/transports/opencode-sdk.ts +33 -1
- package/src/ui/config-edit.ts +9 -0
- package/src/ui/config.ts +1 -0
- package/src/ui/menu.ts +9 -2
- package/src/ui/plan.ts +8 -3
- package/src/updater.ts +21 -13
- package/src/wizard.ts +23 -0
package/src/review/preflight.ts
CHANGED
|
@@ -18,9 +18,22 @@ import {
|
|
|
18
18
|
type ModelsConfig,
|
|
19
19
|
parseModelsConfig,
|
|
20
20
|
} from "#model/model-name";
|
|
21
|
+
import {
|
|
22
|
+
FALLBACK_PROFILE,
|
|
23
|
+
type ModelProfile,
|
|
24
|
+
profileIdProblem,
|
|
25
|
+
profileJudgeModels,
|
|
26
|
+
profileModelAlias,
|
|
27
|
+
profileRoute,
|
|
28
|
+
resolveProfile,
|
|
29
|
+
} from "#model/profiles";
|
|
21
30
|
import { judgeModelChoice } from "#model/routing";
|
|
22
31
|
import { POST_MIN_SEVERITIES, type PostMinSeverity } from "#pr/post-floor";
|
|
23
|
-
import
|
|
32
|
+
import {
|
|
33
|
+
type ProfilePromptSets,
|
|
34
|
+
profilePromptSet,
|
|
35
|
+
type SuspicionPrior,
|
|
36
|
+
} from "#review/prompt-set";
|
|
24
37
|
import { type AgentSpec, isSafeSlug, type ReviewSpec } from "#review/spec";
|
|
25
38
|
import {
|
|
26
39
|
ADJUDICATED_TAGS,
|
|
@@ -60,10 +73,12 @@ export const DEFAULT_GC_INTERVAL_MIN = 360;
|
|
|
60
73
|
|
|
61
74
|
export const DEFAULT_HEAD_REF = "HEAD";
|
|
62
75
|
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// only the honest model label shown in a preflight plan.
|
|
66
|
-
export const DEFAULT_SUMMARY_MODEL =
|
|
76
|
+
// The `claude` profile's summary model as a CLI alias (model-profiles S2),
|
|
77
|
+
// which prompts/summarizer.md's frontmatter also names while it keeps the
|
|
78
|
+
// line. This value is only the honest model label shown in a preflight plan.
|
|
79
|
+
export const DEFAULT_SUMMARY_MODEL = profileModelAlias(
|
|
80
|
+
profileRoute(FALLBACK_PROFILE, "summary").model,
|
|
81
|
+
);
|
|
67
82
|
|
|
68
83
|
export interface CliOptions {
|
|
69
84
|
// Relative on purpose: parseArgs is pure, so "resolve against cwd" is the
|
|
@@ -1609,6 +1624,11 @@ export interface AgentsDirResolution {
|
|
|
1609
1624
|
kind: "dir" | "bundled";
|
|
1610
1625
|
// Logical filename -> readable path. Present iff `kind === "bundled"`.
|
|
1611
1626
|
files?: Record<string, string>;
|
|
1627
|
+
// The model profile's prompt set merged over the default one
|
|
1628
|
+
// (model-profiles S4), present only when that set overrides an agent file.
|
|
1629
|
+
// It names the merged set in provenance, as a directory basename names a
|
|
1630
|
+
// user set. Absent: the default set itself, exactly as before profiles.
|
|
1631
|
+
promptSet?: string;
|
|
1612
1632
|
}
|
|
1613
1633
|
|
|
1614
1634
|
// The label the shipped binary shows wherever a prompt-set path would go.
|
|
@@ -1686,6 +1706,11 @@ export function resolveAgentsDirSetting(input: {
|
|
|
1686
1706
|
// inside the default branch so an explicit flag, config or env never pays
|
|
1687
1707
|
// for asset detection.
|
|
1688
1708
|
assets?: EngineAssets | undefined;
|
|
1709
|
+
// The active model profile (model-profiles S4). Absent: `claude`, whose
|
|
1710
|
+
// default set is the bundled one. `promptSets` is injected by tests only:
|
|
1711
|
+
// no profile ships a set yet (asset-manifest.ts PROFILE_PROMPT_FILES).
|
|
1712
|
+
profile?: ModelProfile | undefined;
|
|
1713
|
+
promptSets?: ProfilePromptSets | undefined;
|
|
1689
1714
|
}): AgentsDirResolution {
|
|
1690
1715
|
if (input.flag) {
|
|
1691
1716
|
return {
|
|
@@ -1709,6 +1734,28 @@ export function resolveAgentsDirSetting(input: {
|
|
|
1709
1734
|
};
|
|
1710
1735
|
}
|
|
1711
1736
|
const assets = input.assets ?? resolveEngineAssets();
|
|
1737
|
+
// The active profile's prompt set, file by file over the default set (S4).
|
|
1738
|
+
// Only here, in the default branch: a person's `--agents`, `agents_dir` or
|
|
1739
|
+
// env set above outranks the profile and is never mixed with it. With no
|
|
1740
|
+
// agent override (`claude`, or a set that only changes root prompts) the
|
|
1741
|
+
// resolution below is today's, byte for byte.
|
|
1742
|
+
const overrides = profilePromptSet(
|
|
1743
|
+
input.profile ?? FALLBACK_PROFILE,
|
|
1744
|
+
Object.keys(assets.bundledAgentFiles),
|
|
1745
|
+
input.promptSets,
|
|
1746
|
+
).agents;
|
|
1747
|
+
const setName = (input.profile ?? FALLBACK_PROFILE).promptSet;
|
|
1748
|
+
if (Object.keys(overrides).length > 0 && setName !== undefined) {
|
|
1749
|
+
// A MAP, like the compiled binary's: the files now live in two places, so
|
|
1750
|
+
// there is no single directory to join a basename onto.
|
|
1751
|
+
return {
|
|
1752
|
+
dir: `${BUNDLED_AGENTS_DIR_LABEL}, prompt set ${setName}`,
|
|
1753
|
+
source: "default",
|
|
1754
|
+
kind: "bundled",
|
|
1755
|
+
files: { ...assets.bundledAgentFiles, ...overrides },
|
|
1756
|
+
promptSet: setName,
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1712
1759
|
// The compiled binary's default set is a MAP, never a directory: its
|
|
1713
1760
|
// `defaultAgentsDir` is `path.dirname(<embedded path>)`, i.e. "/$bunfs/root",
|
|
1714
1761
|
// which no `existsSync` accepts and no `Bun.Glob` can scan. Handing that
|
|
@@ -2021,6 +2068,12 @@ export function resolveAgentsDir(
|
|
|
2021
2068
|
// detectAssetMode() reads `import.meta.dir` and always reports "dev" under
|
|
2022
2069
|
// `bun test`.
|
|
2023
2070
|
assets?: EngineAssets,
|
|
2071
|
+
// The active model profile and, in tests only, its prompt sets
|
|
2072
|
+
// (model-profiles S4). Absent: `claude`, today's resolution.
|
|
2073
|
+
prompts: Pick<
|
|
2074
|
+
Parameters<typeof resolveAgentsDirSetting>[0],
|
|
2075
|
+
"profile" | "promptSets"
|
|
2076
|
+
> = {},
|
|
2024
2077
|
): AgentsDirResolution {
|
|
2025
2078
|
const seat = agentsDirSeat({
|
|
2026
2079
|
config: loaded.effective,
|
|
@@ -2034,6 +2087,7 @@ export function resolveAgentsDir(
|
|
|
2034
2087
|
env: readBrandEnv(process.env, "AGENTS_DIR")?.value,
|
|
2035
2088
|
cwd: process.cwd(),
|
|
2036
2089
|
...(assets === undefined ? {} : { assets }),
|
|
2090
|
+
...prompts,
|
|
2037
2091
|
});
|
|
2038
2092
|
// Only a DIRECTORY can be checked for existence, and this gate running
|
|
2039
2093
|
// unconditionally is the whole shipped defect: the compiled binary's bundled
|
|
@@ -2193,6 +2247,9 @@ export const CONFIG_DIRECTION: Record<keyof LocalConfig, ConfigDirection> = {
|
|
|
2193
2247
|
// model or another bill. Both are PERSON_ONLY_KEYS, refused in a repo file.
|
|
2194
2248
|
models: "person",
|
|
2195
2249
|
credentials: "person",
|
|
2250
|
+
// Which model profile the review runs (openai-profile S1): it picks every
|
|
2251
|
+
// step's model and so the bill, like `models`, so it is person-only too.
|
|
2252
|
+
profile: "person",
|
|
2196
2253
|
max_verification_steps: "capped",
|
|
2197
2254
|
max_concurrent_steps: "capped",
|
|
2198
2255
|
max_changed_lines: "capped",
|
|
@@ -2238,6 +2295,9 @@ export interface LocalConfig {
|
|
|
2238
2295
|
models?: ModelsConfig;
|
|
2239
2296
|
// Which Claude credential is used, in order (S5).
|
|
2240
2297
|
credentials?: CredentialsConfig;
|
|
2298
|
+
// The model profile id (openai-profile S1). Absent: the fallback profile.
|
|
2299
|
+
// `models` still outranks it role by role.
|
|
2300
|
+
profile?: string;
|
|
2241
2301
|
// Item 7: unattended bound on the verify queue. Absent means
|
|
2242
2302
|
// DEFAULT_MAX_VERIFICATION_STEPS. 0 is legal — every queued prior lands
|
|
2243
2303
|
// `unconfirmed` (the pause switch, same shape as watch daily_cap).
|
|
@@ -2315,8 +2375,8 @@ const KNOWN_CONFIG_KEYS = new Set<string>(Object.keys(CONFIG_DIRECTION));
|
|
|
2315
2375
|
|
|
2316
2376
|
// Keys a committed repo file may never set. Wider than "direction is person":
|
|
2317
2377
|
// `agents_dir` and `post_min_severity` are person-direction keys a repo file
|
|
2318
|
-
// may still name. These
|
|
2319
|
-
const PERSON_ONLY_KEYS = new Set<string>(["models", "credentials"]);
|
|
2378
|
+
// may still name. These three choose a model or a bill.
|
|
2379
|
+
const PERSON_ONLY_KEYS = new Set<string>(["models", "credentials", "profile"]);
|
|
2320
2380
|
|
|
2321
2381
|
const LOCAL_CONFIG_KEYS = new Set<string>(
|
|
2322
2382
|
Object.keys(CONFIG_DIRECTION).filter((key) => !PERSON_ONLY_KEYS.has(key)),
|
|
@@ -2493,6 +2553,7 @@ function parseConfigLayer(
|
|
|
2493
2553
|
throw new CliUsageError(`suspicion_priors[${i}].reason required`);
|
|
2494
2554
|
}
|
|
2495
2555
|
}
|
|
2556
|
+
const profile = parseProfile(config.profile, file);
|
|
2496
2557
|
const summaryParse = parseSummaryConfig(config.summary, file);
|
|
2497
2558
|
const summary = summaryParse?.summary;
|
|
2498
2559
|
let models = parseModels(config.models, file);
|
|
@@ -2517,11 +2578,14 @@ function parseConfigLayer(
|
|
|
2517
2578
|
}
|
|
2518
2579
|
// The judge's list is kept as written (the plan skips what it cannot
|
|
2519
2580
|
// use), but a model it will never run on is said out loud here, once.
|
|
2581
|
+
// Checked against this file's own profile: `profile` and `models` are both
|
|
2582
|
+
// person-only, so they are always read from the same file.
|
|
2520
2583
|
if (models?.judge !== undefined) {
|
|
2521
|
-
const
|
|
2584
|
+
const active = resolveProfile(profile);
|
|
2585
|
+
const { model, dropped } = judgeModelChoice(models, active);
|
|
2522
2586
|
if (dropped.length > 0) {
|
|
2523
2587
|
warnings?.push(
|
|
2524
|
-
`${file}: models.judge skips ${dropped.join(", ")}: the materiality judge runs only on
|
|
2588
|
+
`${file}: models.judge skips ${dropped.join(", ")}: the materiality judge runs only on ${profileJudgeModels(active).join(" or ")}${model === undefined ? ", so it stands down" : ""}.`,
|
|
2525
2589
|
);
|
|
2526
2590
|
}
|
|
2527
2591
|
}
|
|
@@ -2611,6 +2675,7 @@ function parseConfigLayer(
|
|
|
2611
2675
|
...(summary === undefined ? {} : { summary }),
|
|
2612
2676
|
...(models === undefined ? {} : { models }),
|
|
2613
2677
|
...(credentials === undefined ? {} : { credentials }),
|
|
2678
|
+
...(profile === undefined ? {} : { profile }),
|
|
2614
2679
|
...(maxVerificationSteps === undefined
|
|
2615
2680
|
? {}
|
|
2616
2681
|
: { max_verification_steps: maxVerificationSteps }),
|
|
@@ -2654,6 +2719,16 @@ function parseConfigLayer(
|
|
|
2654
2719
|
};
|
|
2655
2720
|
}
|
|
2656
2721
|
|
|
2722
|
+
// The `profile` id (openai-profile S1): one of the registered profiles.
|
|
2723
|
+
function parseProfile(value: unknown, file: string): string | undefined {
|
|
2724
|
+
if (value === undefined) return undefined;
|
|
2725
|
+
const problem = profileIdProblem(value);
|
|
2726
|
+
if (problem === undefined) return value as string;
|
|
2727
|
+
const got =
|
|
2728
|
+
typeof value === "string" ? ` (got "${redactConfigValue(value)}")` : "";
|
|
2729
|
+
throw new CliUsageError(`${file} ${problem}${got}`);
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2657
2732
|
// The `models` object (S1, S3). Its rules live in model/model-name.ts; this
|
|
2658
2733
|
// adds the file to every message, as every other key's error does.
|
|
2659
2734
|
function parseModels(value: unknown, file: string): ModelsConfig | undefined {
|
|
@@ -3072,6 +3147,11 @@ export function mergeConfig(
|
|
|
3072
3147
|
CONFIG_DIRECTION.credentials,
|
|
3073
3148
|
(layer) => layer.credentials,
|
|
3074
3149
|
);
|
|
3150
|
+
const profile = foldKey(
|
|
3151
|
+
layers,
|
|
3152
|
+
CONFIG_DIRECTION.profile,
|
|
3153
|
+
(layer) => layer.profile,
|
|
3154
|
+
);
|
|
3075
3155
|
const ciReviewPolicy = foldKey(
|
|
3076
3156
|
layers,
|
|
3077
3157
|
CONFIG_DIRECTION.ci_review_policy,
|
|
@@ -3137,6 +3217,7 @@ export function mergeConfig(
|
|
|
3137
3217
|
...(credentials.value === undefined
|
|
3138
3218
|
? {}
|
|
3139
3219
|
: { credentials: credentials.value }),
|
|
3220
|
+
...(profile.value === undefined ? {} : { profile: profile.value }),
|
|
3140
3221
|
...(maxSteps.value === undefined
|
|
3141
3222
|
? {}
|
|
3142
3223
|
: { max_verification_steps: maxSteps.value }),
|
|
@@ -3192,6 +3273,7 @@ export function mergeConfig(
|
|
|
3192
3273
|
summary: { enabled: summaryEnabled.source },
|
|
3193
3274
|
models: models.source,
|
|
3194
3275
|
credentials: credentials.source,
|
|
3276
|
+
profile: profile.source,
|
|
3195
3277
|
max_verification_steps: maxSteps.source,
|
|
3196
3278
|
max_concurrent_steps: maxConcurrentSteps.source,
|
|
3197
3279
|
max_changed_lines: maxLines.source,
|
package/src/review/prompt-set.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// spawn time moves into the driver (renderAgentBody).
|
|
7
7
|
|
|
8
8
|
import { EFFORT_LEVELS, type Effort, isEffort } from "#model/catalog";
|
|
9
|
+
import type { ModelProfile } from "#model/profiles";
|
|
10
|
+
import { PROFILE_PROMPT_FILES } from "../asset-manifest";
|
|
9
11
|
import { wrapBlock } from "./boundary";
|
|
10
12
|
|
|
11
13
|
// Fixed order — the lab's promptSetFingerprint hashes the concatenated files
|
|
@@ -19,6 +21,72 @@ export const AGENT_NAMES = [
|
|
|
19
21
|
"review-refuter",
|
|
20
22
|
] as const;
|
|
21
23
|
|
|
24
|
+
// The engine-owned prompts at `prompts/` root: not part of the fingerprinted
|
|
25
|
+
// agent set (a user `agents_dir` never holds them), but looked up through the
|
|
26
|
+
// active profile's prompt set like every other step's prompt
|
|
27
|
+
// (model-profiles S4).
|
|
28
|
+
export const ENGINE_PROMPT_FILES = [
|
|
29
|
+
"consolidate.md",
|
|
30
|
+
"scout.md",
|
|
31
|
+
"summarizer.md",
|
|
32
|
+
"materiality.md",
|
|
33
|
+
] as const;
|
|
34
|
+
export type EnginePromptFile = (typeof ENGINE_PROMPT_FILES)[number];
|
|
35
|
+
|
|
36
|
+
// Profile prompt sets by name: logical filename -> readable path, holding ONLY
|
|
37
|
+
// the files that differ from the default set (`prompts/profiles/<set>/`,
|
|
38
|
+
// embedded through asset-manifest.ts like every other prompt).
|
|
39
|
+
export type ProfilePromptSets = Readonly<
|
|
40
|
+
Record<string, Readonly<Record<string, string>>>
|
|
41
|
+
>;
|
|
42
|
+
|
|
43
|
+
export interface ProfilePromptOverrides {
|
|
44
|
+
// Agent files (`deep-review-*.md`, `review-refuter.md`) the set overrides.
|
|
45
|
+
agents: Record<string, string>;
|
|
46
|
+
// Engine-owned root prompts the set overrides.
|
|
47
|
+
engine: Partial<Record<EnginePromptFile, string>>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// The ONE lookup of a profile's prompt set, split into the two places a
|
|
51
|
+
// prompt is read from: the agents (merged over the default set by
|
|
52
|
+
// resolveAgentsDirSetting) and the engine-owned root prompts
|
|
53
|
+
// (enginePromptPath). Any file the set does not hold falls back to the default
|
|
54
|
+
// set's. A profile with no `promptSet` (`claude`) overrides nothing.
|
|
55
|
+
//
|
|
56
|
+
// A set name this build lacks, or a file that overrides nothing in the default
|
|
57
|
+
// set, throws: either is a build defect, and a silent fallback would run the
|
|
58
|
+
// default prompt while the profile reads as tuned.
|
|
59
|
+
export function profilePromptSet(
|
|
60
|
+
profile: Pick<ModelProfile, "id" | "promptSet">,
|
|
61
|
+
defaultAgentFiles: readonly string[],
|
|
62
|
+
sets: ProfilePromptSets = PROFILE_PROMPT_FILES,
|
|
63
|
+
): ProfilePromptOverrides {
|
|
64
|
+
const overrides: ProfilePromptOverrides = { agents: {}, engine: {} };
|
|
65
|
+
if (profile.promptSet === undefined) return overrides;
|
|
66
|
+
const set = sets[profile.promptSet];
|
|
67
|
+
if (set === undefined) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`model profile "${profile.id}" names prompt set "${profile.promptSet}", which this build does not have`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
for (const [file, filePath] of Object.entries(set)) {
|
|
73
|
+
if (defaultAgentFiles.includes(file)) {
|
|
74
|
+
overrides.agents[file] = filePath;
|
|
75
|
+
} else if (isEnginePromptFile(file)) {
|
|
76
|
+
overrides.engine[file] = filePath;
|
|
77
|
+
} else {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`prompt set "${profile.promptSet}" holds "${file}", which overrides no file of the default set`,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return overrides;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function isEnginePromptFile(file: string): file is EnginePromptFile {
|
|
87
|
+
return (ENGINE_PROMPT_FILES as readonly string[]).includes(file);
|
|
88
|
+
}
|
|
89
|
+
|
|
22
90
|
export interface ParsedAgent {
|
|
23
91
|
name: string;
|
|
24
92
|
description: string;
|
package/src/review/report.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// come out byte-identical (the lab already replays old findings.json files;
|
|
8
8
|
// a renderer that reached for `new Date()` would make that a lie).
|
|
9
9
|
|
|
10
|
+
import type { PlatformEstimateBasis } from "#ci/platform-estimate";
|
|
10
11
|
import { listPaths } from "#git/refs";
|
|
11
12
|
import type { ResolvedRoutePlan, ResolvedStepRoute } from "#model/routing";
|
|
12
13
|
import type { PostMinSeverity } from "#pr/post-floor";
|
|
@@ -56,6 +57,9 @@ export interface CostEstimate {
|
|
|
56
57
|
// Plain-language statement of how coarse this is, meant to be printed next
|
|
57
58
|
// to the numbers so nobody reads the band as a quote.
|
|
58
59
|
basis: string;
|
|
60
|
+
// Set when the range is the Crysk platform's estimate, not this band: what
|
|
61
|
+
// the platform priced it from (src/ci/platform-estimate.ts).
|
|
62
|
+
platform?: PlatformEstimateBasis;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
// Per-hunter marginal cost, fitted to the measured runs (see BAND below).
|
package/src/review/review.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from "#review/preflight";
|
|
40
40
|
import { estimateCost } from "#review/report";
|
|
41
41
|
import {
|
|
42
|
+
isBundledAgentsDir,
|
|
42
43
|
pipelineConsolidateInput,
|
|
43
44
|
pipelineMaterialityInput,
|
|
44
45
|
pipelineScoutInput,
|
|
@@ -56,6 +57,7 @@ import {
|
|
|
56
57
|
resolvePipelineRoute,
|
|
57
58
|
resolvePromptSet,
|
|
58
59
|
resolveReviewInstructions,
|
|
60
|
+
routingConfigured,
|
|
59
61
|
selectActiveHunters,
|
|
60
62
|
shadowedGotchasNotice,
|
|
61
63
|
validateGotchas,
|
|
@@ -100,12 +102,14 @@ export async function review(options: CliOptions): Promise<number> {
|
|
|
100
102
|
// Two layers since C5, folded by loadEffectiveConfig into the one
|
|
101
103
|
// LocalConfig everything below already expected. The --config missing-file
|
|
102
104
|
// error and the boundary rules live there.
|
|
103
|
-
const { loaded, config, summary, scout, post } = await loadRunConfig(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
const { loaded, config, summary, scout, post, profile } = await loadRunConfig(
|
|
106
|
+
{
|
|
107
|
+
root: repoRoot,
|
|
108
|
+
home: os.homedir(),
|
|
109
|
+
configFlag: options.config,
|
|
110
|
+
options,
|
|
111
|
+
},
|
|
112
|
+
);
|
|
109
113
|
options = { ...options, scout, post };
|
|
110
114
|
// S5: the Claude credential this run uses, chosen once, here, from
|
|
111
115
|
// `credentials.claude` and what is set. Every runner, binding and child below
|
|
@@ -158,6 +162,7 @@ export async function review(options: CliOptions): Promise<number> {
|
|
|
158
162
|
const { agents, spec, agentFiles, promptSet } = await resolvePromptSet(
|
|
159
163
|
options,
|
|
160
164
|
loaded,
|
|
165
|
+
{ profile },
|
|
161
166
|
);
|
|
162
167
|
const { dir: agentsDir, source: agentsDirSource } = agents;
|
|
163
168
|
|
|
@@ -250,12 +255,14 @@ export async function review(options: CliOptions): Promise<number> {
|
|
|
250
255
|
true,
|
|
251
256
|
);
|
|
252
257
|
const productionRoute = await resolvePipelineRoute({
|
|
253
|
-
modelsConfigured: config
|
|
258
|
+
modelsConfigured: routingConfigured(config),
|
|
254
259
|
workspaceRoot: repoRoot,
|
|
255
260
|
spec,
|
|
256
261
|
options,
|
|
257
262
|
agentFiles,
|
|
263
|
+
bundledAgents: isBundledAgentsDir(agents),
|
|
258
264
|
models: config.models,
|
|
265
|
+
profile,
|
|
259
266
|
summary,
|
|
260
267
|
materialityEnabled: resolveMaterialityGate(config),
|
|
261
268
|
claudeRun: options.dryRun ? undefined : claudeRun,
|
|
@@ -425,6 +432,8 @@ export async function review(options: CliOptions): Promise<number> {
|
|
|
425
432
|
gotchasPath,
|
|
426
433
|
agentsDir,
|
|
427
434
|
...(agents.files ? { agentFiles: agents.files } : {}),
|
|
435
|
+
// The same answer the plan was built with (resolvePipelineRoute).
|
|
436
|
+
...(isBundledAgentsDir(agents) ? { bundledAgents: true } : {}),
|
|
428
437
|
runDir,
|
|
429
438
|
outPath: path.join(runDir, "findings.json"),
|
|
430
439
|
mcpConfigPath,
|
|
@@ -432,10 +441,11 @@ export async function review(options: CliOptions): Promise<number> {
|
|
|
432
441
|
...(options.model ? { model: options.model } : {}),
|
|
433
442
|
parityTriggerPaths: config.parity_trigger_paths,
|
|
434
443
|
suspicionPriors: config.suspicion_priors,
|
|
435
|
-
|
|
436
|
-
...
|
|
437
|
-
...
|
|
438
|
-
...
|
|
444
|
+
modelProfile: profile,
|
|
445
|
+
...pipelineSummarizerInput(summary, { profile }),
|
|
446
|
+
...pipelineScoutInput(options, { profile }),
|
|
447
|
+
...pipelineConsolidateInput({ profile }),
|
|
448
|
+
...pipelineMaterialityInput(config, { profile }),
|
|
439
449
|
...(prTitle === undefined ? {} : { prTitle }),
|
|
440
450
|
...(resolveSharedPrefix(options) ? { sharedPrefix: true } : {}),
|
|
441
451
|
...pipelineConfigInput(loaded),
|