fix: close the gaps the review of the trial-5 fixes found
- park-attempt-files: parks in the git dir (outside the work tree, so Sub-step C.2 never registers a parked file again), reads a path with a space, names a new file under a header it cannot read, parks a symlink, never overwrites a parked file, and exits 1 while a file the attempt made is still in the tree; the upward diff is saved in one form whatever the git config. - brief-validator: BRIEF_SC_NOT_RUNNABLE only when a later backticked span is a command; a criterion that only names a flag or a path stays prose (Handover 1 says so now). - review ids: counted over the final list (runContract), as fill-finding-ids counts review.md; trimmed_count matches rows by id; engine-findings and fidelity-diff use computeFindingIds; the --workflow dedup keeps one source's different findings apart, the decision-23 put-back stays one copy per triplet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3238327483
commit
8677836060
16 changed files with 274 additions and 98 deletions
|
|
@ -10,7 +10,7 @@ import { readFileSync, existsSync } from 'node:fs';
|
|||
import { parseDocument } from '../util/frontmatter.mjs';
|
||||
import { issue, ok, fail } from '../util/result.mjs';
|
||||
import { BASE_ALLOWED_MODELS } from './profile-validator.mjs';
|
||||
import { parseSuccessCriteria, runnableCheck } from '../verification/criteria-runner.mjs';
|
||||
import { parseSuccessCriteria, runnableCheck, firstCommand } from '../verification/criteria-runner.mjs';
|
||||
import { isMain } from '../util/is-main.mjs';
|
||||
|
||||
export const BRIEF_REQUIRED_FRONTMATTER = ['type', 'brief_version', 'task', 'slug', 'research_topics', 'research_status'];
|
||||
|
|
@ -286,17 +286,22 @@ export function validateBriefContent(text, opts = {}) {
|
|||
'or write each sub-point as its own criterion with its own command.',
|
||||
));
|
||||
}
|
||||
// A backticked span that is not a command (`--stdin` named before the
|
||||
// command) is what the runner reads first and reports unrunnable; only
|
||||
// a criterion with no backticked span at all is prose (trial 5, finding 1).
|
||||
// A criterion whose first backticked span is not a command but whose
|
||||
// later span is one (`--stdin` named before `/bin/bash tests/contract.sh`):
|
||||
// the runner reads only the first span and reports it unrunnable. A
|
||||
// criterion that only names a flag or a path stays prose and unflagged
|
||||
// (HANDOVER-CONTRACTS Handover 1; voyage-lekerepo trial 5, finding 1).
|
||||
if (!c.command && c.reason === 'not-a-command' && !c.subpoints) {
|
||||
const span = (c.text.match(/`([^`]+)`/) ?? [])[1] ?? '';
|
||||
warnings.push(issue(
|
||||
'BRIEF_SC_NOT_RUNNABLE',
|
||||
`Success criterion ${c.label} opens with \`${span}\`, which is not a command, so the review's criteria runner will never run it (not-a-command)`,
|
||||
'The runner runs the first backticked span: put the command first and name anything else in plain words ' +
|
||||
'(voyage:writing-criteria), or it is reported NOT RUN at review.',
|
||||
));
|
||||
const spans = [...c.text.matchAll(/`([^`]+)`/g)].map((m) => m[1]);
|
||||
const later = spans.slice(1).find((span) => firstCommand(`\`${span}\``).command);
|
||||
if (later !== undefined) {
|
||||
warnings.push(issue(
|
||||
'BRIEF_SC_NOT_RUNNABLE',
|
||||
`Success criterion ${c.label}'s first backticked span is \`${spans[0]}\`, not a command, so the review's criteria runner never reaches \`${later}\` (not-a-command)`,
|
||||
'The runner runs the first backticked span: put the command first and name anything else in plain words ' +
|
||||
'(voyage:writing-criteria), or it is reported NOT RUN at review.',
|
||||
));
|
||||
}
|
||||
}
|
||||
if (!c.command) continue;
|
||||
const bare = c.command.replace(/^(?:[A-Za-z_][A-Za-z0-9_]*=\S*\s+)+/, '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue