karajan-code 1.24.0 → 1.24.1
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
CHANGED
|
@@ -8,7 +8,8 @@ const DEFAULT_RULES = {
|
|
|
8
8
|
max_stale_iterations: 3,
|
|
9
9
|
no_new_dependencies_without_task: true,
|
|
10
10
|
scope_guard: true,
|
|
11
|
-
reviewer_overreach: true
|
|
11
|
+
reviewer_overreach: true,
|
|
12
|
+
reviewer_style_block: true
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export function evaluateRules(context, rulesConfig = {}) {
|
|
@@ -71,6 +72,25 @@ export function evaluateRules(context, rulesConfig = {}) {
|
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
|
|
75
|
+
// Rule 6: Reviewer style-only block — all blocking issues are style/naming/formatting, not security/correctness
|
|
76
|
+
if (rules.reviewer_style_block && context.blockingIssues?.length > 0) {
|
|
77
|
+
const styleKeywords = /\b(naming|name|rename|style|format|formatting|indent|spacing|camelCase|snake_case|convention|cosmetic|readability|comment|jsdoc|documentation|whitespace|semicolon|quotes|trailing)\b/i;
|
|
78
|
+
const styleSeverities = new Set(["low", "minor"]);
|
|
79
|
+
const allStyle = context.blockingIssues.every(issue => {
|
|
80
|
+
const desc = issue.description || "";
|
|
81
|
+
const sev = (issue.severity || "").toLowerCase();
|
|
82
|
+
return styleSeverities.has(sev) || styleKeywords.test(desc);
|
|
83
|
+
});
|
|
84
|
+
if (allStyle) {
|
|
85
|
+
alerts.push({
|
|
86
|
+
rule: "reviewer_style_block",
|
|
87
|
+
severity: "critical",
|
|
88
|
+
message: `Reviewer blocked on ${context.blockingIssues.length} style-only issue(s). Style preferences should not block approval — escalating to Solomon mediation.`,
|
|
89
|
+
detail: { issueCount: context.blockingIssues.length, issues: context.blockingIssues.map(i => i.description) }
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
74
94
|
return {
|
|
75
95
|
alerts,
|
|
76
96
|
hasCritical: alerts.some(a => a.severity === "critical"),
|
|
@@ -81,7 +101,7 @@ export function evaluateRules(context, rulesConfig = {}) {
|
|
|
81
101
|
/**
|
|
82
102
|
* Build context for rules evaluation from git diff and session state.
|
|
83
103
|
*/
|
|
84
|
-
export async function buildRulesContext({ session, task, iteration }) {
|
|
104
|
+
export async function buildRulesContext({ session, task, iteration, blockingIssues }) {
|
|
85
105
|
const context = {
|
|
86
106
|
task,
|
|
87
107
|
iteration,
|
|
@@ -90,7 +110,8 @@ export async function buildRulesContext({ session, task, iteration }) {
|
|
|
90
110
|
newDependencies: [],
|
|
91
111
|
outOfScopeFiles: [],
|
|
92
112
|
reviewerDemotedCount: 0,
|
|
93
|
-
reviewerAutoApproved: false
|
|
113
|
+
reviewerAutoApproved: false,
|
|
114
|
+
blockingIssues: blockingIssues || []
|
|
94
115
|
};
|
|
95
116
|
|
|
96
117
|
// Count reviewer scope-filter demotions from session checkpoints
|
package/src/orchestrator.js
CHANGED
|
@@ -534,12 +534,12 @@ async function handleBecariaEarlyPrOrPush({ becariaEnabled, config, session, emi
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
-
async function handleSolomonCheck({ config, session, emitter, eventBase, logger, task, i, askQuestion, becariaEnabled }) {
|
|
537
|
+
async function handleSolomonCheck({ config, session, emitter, eventBase, logger, task, i, askQuestion, becariaEnabled, blockingIssues }) {
|
|
538
538
|
if (config.pipeline?.solomon?.enabled === false) return { action: "continue" };
|
|
539
539
|
|
|
540
540
|
try {
|
|
541
541
|
const { evaluateRules, buildRulesContext } = await import("./orchestrator/solomon-rules.js");
|
|
542
|
-
const rulesContext = await buildRulesContext({ session, task, iteration: i });
|
|
542
|
+
const rulesContext = await buildRulesContext({ session, task, iteration: i, blockingIssues });
|
|
543
543
|
const rulesResult = evaluateRules(rulesContext, config.solomon?.rules);
|
|
544
544
|
|
|
545
545
|
if (rulesResult.alerts.length > 0) {
|
|
@@ -1100,7 +1100,7 @@ async function runSingleIteration(ctx) {
|
|
|
1100
1100
|
}));
|
|
1101
1101
|
session.standby_retry_count = 0;
|
|
1102
1102
|
|
|
1103
|
-
const solomonResult = await handleSolomonCheck({ config, session, emitter, eventBase, logger, task, i, askQuestion, becariaEnabled });
|
|
1103
|
+
const solomonResult = await handleSolomonCheck({ config, session, emitter, eventBase, logger, task, i, askQuestion, becariaEnabled, blockingIssues: review?.blocking_issues });
|
|
1104
1104
|
if (solomonResult.action === "pause") return { action: "return", result: solomonResult.result };
|
|
1105
1105
|
|
|
1106
1106
|
await handleBecariaReviewDispatch({ becariaEnabled, config, session, review, i, logger });
|