refactor(cleanup): simplify pass on the R-a diff
engine-compare imports the coordinator's title limit and trim instead of a copy whose reason went with Arm B; the autonomy gate exports one parser and its test runs in-process with two CLI runs; one import scanner in lib-imports; the fenced-section walker shared from tests/helpers/md-section.mjs instead of six copies; plan-gate hash in-process; living-paths scans once; routing drops the orchestrator filter whose files are gone; small leftovers removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
029e83117c
commit
efe981f7bc
18 changed files with 161 additions and 358 deletions
|
|
@ -444,7 +444,7 @@ function effectiveSeverity(f) {
|
|||
return getRule(f.rule_key)?.severity ?? f.severity;
|
||||
}
|
||||
|
||||
function trimText(text, max) {
|
||||
export function trimText(text, max) {
|
||||
return text.slice(0, max - TRIM_MARKER.length) + TRIM_MARKER;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
// (lib/review/coordinator-contract.mjs runContract, `engine:out-of-scope`).
|
||||
|
||||
import { ENGINES } from './engine-findings.mjs';
|
||||
import { JUDGE_TITLE_MAX, trimText } from './coordinator-contract.mjs';
|
||||
|
||||
// The (file,line,rule_key) triplet a finding is deduped and matched on.
|
||||
const tripletOf = (f) => `${f.file}\u0000${f.line}\u0000${f.rule_key}`;
|
||||
|
|
@ -26,14 +27,10 @@ const normTitle = (f) => String(f.title).trim().toLowerCase();
|
|||
// The row a finding is matched to after the coordinator: its triplet plus its
|
||||
// `normTitle`. An untitled finding gets a key no titled row has.
|
||||
const rowOf = (f) => `${tripletOf(f)}\u0000${f.title === undefined ? '\u0001' : normTitle(f)}`;
|
||||
// The coordinator trims an over-long MINOR/SUGGESTION title as
|
||||
// lib/review/coordinator-contract.mjs judgeFilter does; its marker and limit
|
||||
// are inlined.
|
||||
const TRIM_MARKER = ' […trimmed]';
|
||||
const JUDGE_TITLE_MAX = 100;
|
||||
// A title as that trim writes it: over JUDGE_TITLE_MAX characters, cut to
|
||||
// leave room for the marker, then the marker; any other title unchanged.
|
||||
const trimmedTitle = (t) => (t.length > JUDGE_TITLE_MAX ? t.slice(0, JUDGE_TITLE_MAX - TRIM_MARKER.length) + TRIM_MARKER : t);
|
||||
// A title as lib/review/coordinator-contract.mjs judgeFilter trims an
|
||||
// over-long MINOR/SUGGESTION title: over JUDGE_TITLE_MAX characters it is
|
||||
// trimText's cut; any other title unchanged.
|
||||
const trimmedTitle = (t) => (t.length > JUDGE_TITLE_MAX ? trimText(t, JUDGE_TITLE_MAX) : t);
|
||||
|
||||
export { tripletOf, normTitle, rowOf, trimmedTitle };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue