karajan-code 4.51.1 → 4.53.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/package.json +2 -1
- package/scripts/contract-claude.mjs +24 -0
- package/scripts/esbuild-sea.config.mjs +7 -0
- package/scripts/record-agent-fixtures.mjs +98 -0
- package/src/agents/claude-agent.js +8 -0
- package/src/agents/model-registry.js +5 -0
- package/src/agents/opencode-agent.js +16 -1
- package/src/audit/issue-filter.js +19 -1
- package/src/checks/audit-cycle.js +41 -0
- package/src/checks/claude-contract-check.js +27 -0
- package/src/checks/method.js +3 -2
- package/src/checks/release-check.js +23 -1
- package/src/checks/sonar.js +30 -12
- package/src/checks/supply-chain-check.js +47 -0
- package/src/cli/register-meta.js +14 -1
- package/src/cli/register-pipeline.js +9 -0
- package/src/cli/register-plan.js +10 -0
- package/src/commands/check.js +11 -1
- package/src/commands/config.js +2 -0
- package/src/commands/harden.js +3 -0
- package/src/commands/hu.js +24 -3
- package/src/commands/identity.js +4 -1
- package/src/commands/init.js +34 -1
- package/src/commands/plan/generate.js +5 -0
- package/src/commands/plan/license.js +35 -0
- package/src/commands/plan/ready.js +1 -1
- package/src/commands/plan/validate.js +1 -1
- package/src/commands/report.js +14 -0
- package/src/commands/review-gate.js +26 -2
- package/src/commands/worktree.js +35 -2
- package/src/config/defaults.js +10 -1
- package/src/config/overrides.js +8 -0
- package/src/config/schema.js +7 -0
- package/src/environment/playbook.js +2 -0
- package/src/harden/act-sign.js +2 -2
- package/src/harden/branch-protection.js +97 -0
- package/src/harden/phone-invite.js +15 -8
- package/src/harden/phone-texts.js +17 -0
- package/src/harden/security-level.js +18 -2
- package/src/harden/sentinel-hooks.js +2 -1
- package/src/hu/complexity-tier.js +32 -0
- package/src/hu/lane-prune.js +98 -0
- package/src/hu/model-router.js +7 -16
- package/src/hu/routing-metrics.js +16 -0
- package/src/hu/store.js +2 -0
- package/src/mcp/handlers/direct-handlers.js +2 -2
- package/src/orchestrator/drivers/pre-loop-phases/inject-loaded-plan.js +2 -0
- package/src/orchestrator/hu-sub-pipeline.js +19 -0
- package/src/orchestrator/stages/hu-reviewer-stage.js +10 -2
- package/src/orchestrator/stages/reviewer-stage.js +8 -1
- package/src/orchestrator/stages/sonar-stage.js +19 -1
- package/src/plan/plan-schema.js +4 -1
- package/src/plan/rework-license.js +38 -0
- package/src/prompts/hu-reviewer.js +5 -2
- package/src/prompts/planner.js +9 -1
- package/src/report/model-tally.js +39 -0
- package/src/review/branch-overlap.js +40 -0
- package/src/review/correction-rounds.js +40 -0
- package/src/review/dep-cooldown.js +87 -0
- package/src/review/one-shot-review.js +5 -2
- package/src/review/parser.js +21 -0
- package/src/review/publish-pr.js +54 -0
- package/src/review/solomon-arbitration.js +2 -2
- package/src/review/verdict-store.js +19 -7
- package/src/roles/sonar-role.js +4 -2
- package/src/sonar/api.js +7 -0
- package/src/utils/injection-guard.js +59 -43
- package/src/utils/injection-patterns.json +36 -0
- package/src/utils/model-selector.js +47 -3
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
// KJC-TSK-0699: the ONE table of default models per provider and level (the HU
|
|
2
|
+
// router reads it too). Ids verified 2026-10-16: claude takes its CLI aliases,
|
|
3
|
+
// which follow the current version; codex takes the models its CLI lists
|
|
4
|
+
// (models_cache.json: luna fast, terra balanced, sol the most capable). null
|
|
5
|
+
// leaves the CLI's own default where no id could be verified: aider and
|
|
6
|
+
// opencode run on each user's providers, gemini and qwen no longer serve
|
|
7
|
+
// individuals, copilot publishes no list.
|
|
8
|
+
const NO_MODEL = { trivial: null, simple: null, medium: null, complex: null };
|
|
1
9
|
const DEFAULT_MODEL_TIERS = {
|
|
2
10
|
claude: { trivial: "haiku", simple: "haiku", medium: "sonnet", complex: "opus" },
|
|
3
|
-
codex: { trivial: "
|
|
4
|
-
gemini:
|
|
5
|
-
|
|
11
|
+
codex: { trivial: "gpt-5.6-luna", simple: "gpt-5.6-luna", medium: "gpt-5.6-terra", complex: "gpt-5.6-sol" },
|
|
12
|
+
gemini: NO_MODEL,
|
|
13
|
+
qwen: NO_MODEL,
|
|
14
|
+
copilot: NO_MODEL,
|
|
15
|
+
opencode: NO_MODEL,
|
|
16
|
+
aider: NO_MODEL
|
|
6
17
|
};
|
|
7
18
|
|
|
8
19
|
const DEFAULT_ROLE_OVERRIDES = {
|
|
@@ -12,6 +23,39 @@ const DEFAULT_ROLE_OVERRIDES = {
|
|
|
12
23
|
|
|
13
24
|
const VALID_LEVELS = new Set(["trivial", "simple", "medium", "complex"]);
|
|
14
25
|
|
|
26
|
+
/**
|
|
27
|
+
* KJC-TSK-0699 (MR-B): named profiles over the levels, so the user talks of
|
|
28
|
+
* profiles, not model ids. Resolution: flag > roles.<role>.model > profile >
|
|
29
|
+
* the CLI's own default. The reviewer keeps its floor (never below medium).
|
|
30
|
+
*/
|
|
31
|
+
export const MODEL_PROFILES = { frugal: "trivial", standard: "medium", deep: "complex" };
|
|
32
|
+
const CODER_PROVIDER_ROLES = new Set(["planner", "refactorer", "solomon", "researcher", "tester", "security", "impeccable", "triage", "discover", "architect", "audit"]);
|
|
33
|
+
|
|
34
|
+
/** Fills the model of every role that has none yet; returns what it set. */
|
|
35
|
+
export function applyModelProfile(config, profile) {
|
|
36
|
+
const level = MODEL_PROFILES[profile];
|
|
37
|
+
if (!level) throw new Error(`model profile "${profile}" does not exist: use one of ${Object.keys(MODEL_PROFILES).join(", ")}`);
|
|
38
|
+
const coderProvider = config.roles?.coder?.provider || config.coder || null;
|
|
39
|
+
const set = {};
|
|
40
|
+
for (const [role, entry] of Object.entries(config.roles ?? {})) {
|
|
41
|
+
if (entry?.model) continue;
|
|
42
|
+
const provider = entry?.provider || (role === "reviewer" ? config.reviewer : null) || (CODER_PROVIDER_ROLES.has(role) || role === "coder" ? coderProvider : null);
|
|
43
|
+
const model = resolveModelForRole({ role, provider, level });
|
|
44
|
+
// A new object: the entry may be shared with the shipped defaults.
|
|
45
|
+
if (!model) continue;
|
|
46
|
+
set[role] = model;
|
|
47
|
+
config.roles[role] = { ...entry, model };
|
|
48
|
+
}
|
|
49
|
+
return set;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The line kj config prints about the effective profile. */
|
|
53
|
+
export function formatModelProfile(config) {
|
|
54
|
+
const profile = config?.model_profile;
|
|
55
|
+
if (!profile) return "Model profile: none (each CLI uses its own default model)";
|
|
56
|
+
return `Model profile: ${profile} (${MODEL_PROFILES[profile]} models; reviewer never below standard)`;
|
|
57
|
+
}
|
|
58
|
+
|
|
15
59
|
export function getDefaultModelTiers() {
|
|
16
60
|
return structuredClone(DEFAULT_MODEL_TIERS);
|
|
17
61
|
}
|