amsd-pipeline-shared 0.5.20 → 0.5.21
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.
|
@@ -97,10 +97,32 @@ function verifyRepair({ repo, base, branch, profile, layer, abortKind, install }
|
|
|
97
97
|
wtTip = worktree(repo, branch, profile.test.fixtures);
|
|
98
98
|
const green = runTests(wtTip, tests, profile, install);
|
|
99
99
|
if (green.status !== 0 || !profile.test.greenPatterns.every((r) => r.test(green.out))) return bad('the test fails with the fix: not GREEN', { files, red: red.out, green: green.out });
|
|
100
|
-
|
|
100
|
+
// NOTHING THAT USES THE CHANGED FILE IS BROKEN (LIVE-AMSD-2974-11, 2026-10-22: a RED/GREEN fix broke the test that reads the record
|
|
101
|
+
// listing every changed file, and the doctor never ran it): each existing user is run on the fix; one that passed on the base fails it
|
|
102
|
+
const regression = usersOf(repo, branch, src, tests, profile);
|
|
103
|
+
const broken = regression.filter((t) => runTests(wtTip, [t], profile, install).status !== 0 && runTests(wtBase, [t], profile, install).status === 0);
|
|
104
|
+
if (broken.length) return bad(`the fix breaks ${broken.join(', ')}, which passed on the base: an existing user of the changed file`, { files, red: red.out, green: green.out, regression });
|
|
105
|
+
return { ok: true, why: 'RED on the base, GREEN with the fix, and every existing user of the changed file still passes', files, tests, regression, red: red.out, green: green.out };
|
|
101
106
|
} finally { if (wtBase) drop(repo, wtBase); if (wtTip) drop(repo, wtTip); }
|
|
102
107
|
}
|
|
103
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The component's existing tests that use a changed file: a test that names it, or names a file of the component that names it (a record
|
|
111
|
+
* listing it, a script calling it). The repair's own tests and the profile's forbidden (monolithic) tests are not among them.
|
|
112
|
+
*/
|
|
113
|
+
function usersOf(repo, rev, src, own, profile) {
|
|
114
|
+
const { repairDirs, testDirs, testFile, forbiddenTests } = profile.scope;
|
|
115
|
+
const named = (names, dirs) => {
|
|
116
|
+
if (!names.length) return [];
|
|
117
|
+
const r = git(repo, 'grep', '-l', '-F', ...names.flatMap((n) => ['-e', n]), rev, '--', ...dirs);
|
|
118
|
+
return r.status === 0 ? r.stdout.split('\n').filter(Boolean).map((l) => l.slice(rev.length + 1)) : [];
|
|
119
|
+
};
|
|
120
|
+
const base = (fs_) => [...new Set(fs_.map((f) => path.posix.basename(f)))];
|
|
121
|
+
const referrers = named(base(src), repairDirs).filter((f) => !src.includes(f));
|
|
122
|
+
return named(base([...src, ...referrers]), testDirs)
|
|
123
|
+
.filter((f) => testFile.test(f) && !own.includes(f) && !forbiddenTests.some((r) => r.test(f))).sort();
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
// ── the reinstall: the component's own installer, then every packaged file compared byte for byte ─────────────────────
|
|
105
127
|
const show = (repo, rev, rel) => spawnSync('git', ['-C', repo, 'show', `${rev}:${rel}`], { encoding: 'buffer', maxBuffer: 64 * 1024 * 1024 });
|
|
106
128
|
|
|
@@ -21,12 +21,19 @@ const fs = require('fs');
|
|
|
21
21
|
* A STORY THAT SPANS CODELINES IS SPECIFIED PER CODELINE. In a lane's PRD (story.codeline = the lane)
|
|
22
22
|
* the spec mark from another lane is not this lane's spec: AMSD-2974's three site lanes skipped their
|
|
23
23
|
* spec pass on a resume because cxshared's spec had stamped the story (2026-10-01). The lane's own
|
|
24
|
-
* fix-site entry is the mark that this codeline was investigated.
|
|
24
|
+
* fix-site entry is the mark that this codeline was investigated — but only when specification.codeline
|
|
25
|
+
* is itself unknown. Once it names a lane, that name is definite: AMSD-2974 run 11 attempt 5 had it
|
|
26
|
+
* naming cxshared on every consumer lane's own PRD copy, and the fixSiteAnalysisPerCodeline fallback
|
|
27
|
+
* (populated once, for every codeline together, by the cross-codeline detective pass) wrongly read each
|
|
28
|
+
* consumer's own entry there as proof its OWN coordinator review had run, when it never had.
|
|
25
29
|
*/
|
|
26
30
|
function lacksOwnLane(s) {
|
|
27
31
|
if (!Array.isArray(s.codelines) || s.codelines.length < 2 || !s.codeline) return false;
|
|
32
|
+
const specCodeline = s.specification && s.specification.runId ? s.specification.codeline : undefined;
|
|
28
33
|
// This lane's own spec pass stamped its codeline on the spec (spec-mode-runner.js stampSpecification).
|
|
29
|
-
if (
|
|
34
|
+
if (specCodeline === s.codeline) return false;
|
|
35
|
+
// A KNOWN different lane is a definite mismatch — never excused by the legacy fallback below.
|
|
36
|
+
if (specCodeline) return true;
|
|
30
37
|
const own = s.fixSiteAnalysisPerCodeline;
|
|
31
38
|
return !(own && Object.prototype.hasOwnProperty.call(own, s.codeline));
|
|
32
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amsd-pipeline-shared",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.21",
|
|
4
4
|
"description": "The AMSD pipeline's shared components, one source for the bash pipeline and its Claude workflows: the model-call gateway (llm-handler.sh — retry, ladder, self-heal, cost) and the libraries it runs.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|