osborn 0.9.148 → 0.9.149
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/dist/claude-llm.js +31 -2
- package/package.json +1 -1
package/dist/claude-llm.js
CHANGED
|
@@ -332,9 +332,13 @@ export const NAMED_AGENTS = {
|
|
|
332
332
|
'Flag any change that could break existing callers, even if no test currently covers it.',
|
|
333
333
|
'',
|
|
334
334
|
'## How to work',
|
|
335
|
+
'0. **Get the diff first (MANDATORY):** Run `git diff HEAD~1 HEAD --name-only` to get the list of',
|
|
336
|
+
' changed files, then `git diff HEAD~1 HEAD` for the full diff. Build your entire test plan around',
|
|
337
|
+
' the SPECIFIC files and functions that changed — not a generic sweep.',
|
|
335
338
|
'1. Identify the correct test / build command from package.json, Makefile, or the task brief.',
|
|
336
339
|
'2. Run the FULL existing test suite first to establish the regression baseline.',
|
|
337
|
-
'3. Generate and run tests targeted at the SPECIFIC diff/change
|
|
340
|
+
'3. Generate and run tests targeted at the SPECIFIC diff/change — at both unit and integration levels.',
|
|
341
|
+
' Focus on: the changed functions/components, their callers, and any behavior the diff modifies.',
|
|
338
342
|
'4. Exercise edge cases: boundary values, empty inputs, error/exception paths, null/undefined.',
|
|
339
343
|
'5. Execution loop: write test → run it → read failure output → fix the test OR flag as a real bug in the code. Do NOT silently paper over a real defect.',
|
|
340
344
|
'6. If a command fails, read the relevant source files to locate the root cause.',
|
|
@@ -440,7 +444,19 @@ export const NAMED_AGENTS = {
|
|
|
440
444
|
'You must NEVER write code, config, or source files (.ts, .js, .json, .env, etc.) — the write gate',
|
|
441
445
|
'enforces this at the system level and will deny any such attempt.',
|
|
442
446
|
'',
|
|
447
|
+
'## Backward-compatibility mandate',
|
|
448
|
+
'For every change, explicitly verify:',
|
|
449
|
+
'- No existing exported function signature changed (parameter count/order/type, return type)',
|
|
450
|
+
'- No existing data-channel message schema changed (field names, types, required fields)',
|
|
451
|
+
'- No existing API endpoint behavior changed silently',
|
|
452
|
+
'- No existing UI prop interface changed in a breaking way',
|
|
453
|
+
'- Existing callers and consumers of the changed code still work',
|
|
454
|
+
'Tag any violation BLOCKER — silent compat breaks are the hardest bugs to catch after the fact.',
|
|
455
|
+
'',
|
|
443
456
|
'## How to work',
|
|
457
|
+
'0. **Get the diff first (MANDATORY):** Run `git diff HEAD~1 HEAD --stat` then `git diff HEAD~1 HEAD`.',
|
|
458
|
+
' Build your entire review around what ACTUALLY changed — not the writer\'s narrative alone.',
|
|
459
|
+
' If the task provides a diff, still verify it matches git history.',
|
|
444
460
|
'1. Run `git diff` (or read the files listed in the task) to see exactly what changed.',
|
|
445
461
|
'2. Read any file that needs context to evaluate the diff (interfaces, callers, tests).',
|
|
446
462
|
'3. Run the build or test suite if available to catch compile/runtime regressions.',
|
|
@@ -1181,13 +1197,26 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1181
1197
|
const idxPathReviewer = (this.#sessionId && this.#opts.workingDirectory)
|
|
1182
1198
|
? getIndexPath(this.#sessionId, this.#opts.workingDirectory)
|
|
1183
1199
|
: null;
|
|
1200
|
+
// Get the actual diff to give reviewer concrete evidence instead of just the narrative
|
|
1201
|
+
let gitDiff = '';
|
|
1202
|
+
try {
|
|
1203
|
+
const { execSync } = await import('child_process');
|
|
1204
|
+
const diffStat = execSync('git diff HEAD~1 HEAD --stat 2>/dev/null', { cwd: this.#opts.workingDirectory, timeout: 5000 }).toString().trim();
|
|
1205
|
+
const diff = execSync('git diff HEAD~1 HEAD 2>/dev/null', { cwd: this.#opts.workingDirectory, timeout: 5000 }).toString().trim();
|
|
1206
|
+
gitDiff = diffStat ? `\n\n<git_diff_stat>\n${diffStat}\n</git_diff_stat>\n\n<git_diff>\n${diff.slice(0, 6000)}\n</git_diff>` : '';
|
|
1207
|
+
}
|
|
1208
|
+
catch {
|
|
1209
|
+
// non-fatal: if git fails, proceed without diff
|
|
1210
|
+
}
|
|
1184
1211
|
const prompt = [
|
|
1185
1212
|
'Use the reviewer sub-agent to review this writer output for correctness/spec-adherence/obvious bugs.',
|
|
1213
|
+
'The git diff is provided below — use it as the authoritative source of what changed.',
|
|
1186
1214
|
'End your reply with exactly `VERDICT: ACCEPT` or `VERDICT: REJECT`.',
|
|
1187
1215
|
...(idxPathReviewer ? [`The session index is at ${idxPathReviewer} — you MUST read it before reviewing.`] : []),
|
|
1216
|
+
gitDiff,
|
|
1188
1217
|
'',
|
|
1189
1218
|
'<writer_output>',
|
|
1190
|
-
writerOutput.slice(0,
|
|
1219
|
+
writerOutput.slice(0, 6000),
|
|
1191
1220
|
'</writer_output>',
|
|
1192
1221
|
].join('\n');
|
|
1193
1222
|
// Do NOT pass agents here — the reviewer must be review-only and must not
|