@boyingliu01/xp-gate 0.38.82 → 0.38.83
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/lib/__tests__/crap.test.js +173 -0
- package/lib/crap-cli.js +51 -5
- package/lib/crap.js +47 -1
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/principles.js +11 -1
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
- package/principles/adapters/base.ts +30 -1
- package/principles/analyzer.ts +9 -0
- package/skills/delphi-review/AGENTS.md +1 -1
- package/skills/sprint-flow/AGENTS.md +1 -1
- package/skills/test-specification-alignment/AGENTS.md +1 -1
|
@@ -319,3 +319,176 @@ describe('#858 discoverCoverageFile', () => {
|
|
|
319
319
|
expect(discoverCoverageFile('/tmp/explicit.json')).toBe('/tmp/explicit.json');
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @test REQ-CRAP-858-B join a coverage summary that only names basenames
|
|
325
|
+
* @intent 0.38.79.0 taught readFileCoverage to parse Node's
|
|
326
|
+
* coverage-summary.json, and the user's real project still reported
|
|
327
|
+
* "measured 0 functions". The parse was fine; the JOIN was impossible.
|
|
328
|
+
*
|
|
329
|
+
* Node writes the key as the BASENAME only:
|
|
330
|
+
*
|
|
331
|
+
* coverage/coverage-summary.json keys : agents.mjs
|
|
332
|
+
* lizard --csv path : scripts\lib\agents.mjs
|
|
333
|
+
*
|
|
334
|
+
* No path-based match can ever hit that, and lizard's backslashes break
|
|
335
|
+
* even a name that did carry a directory. So the file was measured,
|
|
336
|
+
* the coverage was read, and every function still came out unmeasured.
|
|
337
|
+
*
|
|
338
|
+
* Two rules the fallback must obey, both learned from the issue:
|
|
339
|
+
* 1. exact normalised path first -- basename is only a fallback;
|
|
340
|
+
* 2. a basename that maps to MORE THAN ONE file is ambiguous, and an
|
|
341
|
+
* ambiguous match must be recorded as unmeasured, never guessed.
|
|
342
|
+
* Guessing would attribute A's coverage to B and silently produce a
|
|
343
|
+
* wrong CRAP ranking, which is worse than saying "not measured".
|
|
344
|
+
* @covers AC-858-07 basename keys join to nested paths
|
|
345
|
+
* @covers AC-858-08 backslash paths normalise on both sides
|
|
346
|
+
* @covers AC-858-09 an ambiguous basename is not guessed
|
|
347
|
+
* @covers AC-858-10 all-unmeasured output is NOT_CHECKED, never a green tick
|
|
348
|
+
*/
|
|
349
|
+
describe('#858 a basename-only summary still joins, and ambiguity is not guessed', () => {
|
|
350
|
+
const { readFileCoverage, joinCoverage } = require('../crap.js');
|
|
351
|
+
|
|
352
|
+
const lizard = (file, ccn = 8) => ({ file, name: 'f', ccn, line: 1 });
|
|
353
|
+
|
|
354
|
+
function summaryFile(obj) {
|
|
355
|
+
const p = path.join(os.tmpdir(), `cov858b-${Date.now()}-${Math.random().toString(36).slice(2)}.json`);
|
|
356
|
+
fs.writeFileSync(p, JSON.stringify(obj));
|
|
357
|
+
return p;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
it('AC-858-07: a basename key joins to a nested lizard path', () => {
|
|
361
|
+
// The exact shape the issue measured.
|
|
362
|
+
const file = summaryFile({
|
|
363
|
+
total: { lines: { total: 1, covered: 1, pct: 100 } },
|
|
364
|
+
'agents.mjs': { functions: { total: 4, covered: 1, pct: 25 } },
|
|
365
|
+
});
|
|
366
|
+
const joined = joinCoverage(
|
|
367
|
+
[lizard('scripts\\lib\\agents.mjs')],
|
|
368
|
+
readFileCoverage(file),
|
|
369
|
+
);
|
|
370
|
+
expect(joined[0].cov).toBeCloseTo(0.25, 5);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it('AC-858-08: absolute and relative spellings normalise to the same key', () => {
|
|
374
|
+
const file = summaryFile({
|
|
375
|
+
total: { lines: { total: 1, covered: 1, pct: 100 } },
|
|
376
|
+
'C:/repo/src/lib/x.mjs': { functions: { total: 2, covered: 2, pct: 100 } },
|
|
377
|
+
});
|
|
378
|
+
const joined = joinCoverage([lizard('C:\\repo\\src\\lib\\x.mjs')], readFileCoverage(file));
|
|
379
|
+
expect(joined[0].cov).toBeCloseTo(1, 5);
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
it('AC-858-09: an ambiguous basename is left unmeasured, not guessed', () => {
|
|
383
|
+
// Two distinct files called util.mjs, but the summary names only one.
|
|
384
|
+
// Attributing that coverage to the other would silently mis-rank it.
|
|
385
|
+
const file = summaryFile({
|
|
386
|
+
total: { lines: { total: 1, covered: 1, pct: 100 } },
|
|
387
|
+
'util.mjs': { functions: { total: 2, covered: 0, pct: 0 } },
|
|
388
|
+
});
|
|
389
|
+
const joined = joinCoverage(
|
|
390
|
+
[lizard('src/a/util.mjs'), lizard('src/b/util.mjs')],
|
|
391
|
+
readFileCoverage(file),
|
|
392
|
+
);
|
|
393
|
+
for (const row of joined) {
|
|
394
|
+
expect(row.cov, `${row.file} must stay unmeasured`).toBeNull();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it('AC-858-09b: an exact path match still wins over an ambiguous basename', () => {
|
|
399
|
+
// src/a/util.mjs is named in full, so it IS measured even though the bare
|
|
400
|
+
// basename is ambiguous. Precision beats the fallback.
|
|
401
|
+
const file = summaryFile({
|
|
402
|
+
total: { lines: { total: 1, covered: 1, pct: 100 } },
|
|
403
|
+
'src/a/util.mjs': { functions: { total: 2, covered: 1, pct: 50 } },
|
|
404
|
+
});
|
|
405
|
+
const joined = joinCoverage(
|
|
406
|
+
[lizard('src/a/util.mjs'), lizard('src/b/util.mjs')],
|
|
407
|
+
readFileCoverage(file),
|
|
408
|
+
);
|
|
409
|
+
expect(joined[0].cov).toBeCloseTo(0.5, 5);
|
|
410
|
+
expect(joined[1].cov).toBeNull();
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @test REQ-CRAP-858-C an all-unmeasured run is not a pass
|
|
416
|
+
* @intent The last item in the issue's acceptance table, and the one it called
|
|
417
|
+
* "the thing most worth fixing": when no function has coverage, the
|
|
418
|
+
* report printed
|
|
419
|
+
*
|
|
420
|
+
* measured 0 functions, 1 unmeasured
|
|
421
|
+
* ✅ Nothing at or above CRAP 6.
|
|
422
|
+
*
|
|
423
|
+
* A green tick over a ranking that never happened. The reader is told the
|
|
424
|
+
* code is fine when the truth is that nothing was measured -- the same
|
|
425
|
+
* "not checked rendered as passed" defect as #732, in the one place the
|
|
426
|
+
* issue says matters most.
|
|
427
|
+
* @covers AC-858-10 all-unmeasured renders NOT_CHECKED with a reason
|
|
428
|
+
*/
|
|
429
|
+
describe('#858 an all-unmeasured ranking is NOT_CHECKED, not a green tick', () => {
|
|
430
|
+
const { render } = require('../crap-cli.js');
|
|
431
|
+
|
|
432
|
+
const opts = { paths: ['src'], threshold: 6, top: 20 };
|
|
433
|
+
|
|
434
|
+
it('AC-858-10: measured 0 renders NOT_CHECKED and no success tick', () => {
|
|
435
|
+
const text = render({ measured: 0, unmeasured: 3, threshold: 6, hotspots: [] }, opts);
|
|
436
|
+
expect(text).toContain('NOT_CHECKED');
|
|
437
|
+
// The tick is the actual defect; asserting its absence is the point.
|
|
438
|
+
expect(text).not.toContain('✅');
|
|
439
|
+
expect(text).not.toContain('Nothing at or above');
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
it('AC-858-10b: a real measurement with no hotspots still says so plainly', () => {
|
|
443
|
+
// Anti-vacuity: measured work that found nothing must remain a clean result,
|
|
444
|
+
// otherwise the fix just replaces one wrong message with another.
|
|
445
|
+
const text = render({ measured: 2, unmeasured: 0, threshold: 6, hotspots: [] }, opts);
|
|
446
|
+
expect(text).toContain('Nothing at or above CRAP 6');
|
|
447
|
+
expect(text).not.toContain('NOT_CHECKED');
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @test REQ-CRAP-858-D the scan target is discovered, not assumed to be src
|
|
453
|
+
* @intent `--paths` defaulted to `src`. On a project whose code lives in
|
|
454
|
+
* `scripts/` -- the reporter's own repo, and every Node ESM package laid
|
|
455
|
+
* out that way -- that produced
|
|
456
|
+
*
|
|
457
|
+
* No functions found. Check that lizard is installed and --paths
|
|
458
|
+
* points at real code: lizard --csv -C 99999 src
|
|
459
|
+
*
|
|
460
|
+
* for a repository full of analysable code. The message made the user
|
|
461
|
+
* guess what to type next; the tool could have looked.
|
|
462
|
+
* @covers AC-858-11 conventional roots are discovered, and explicit --paths wins
|
|
463
|
+
*/
|
|
464
|
+
describe('#858 discoverSourcePaths', () => {
|
|
465
|
+
const fs = require('fs');
|
|
466
|
+
const os = require('os');
|
|
467
|
+
const path = require('path');
|
|
468
|
+
const { discoverSourcePaths } = require('../crap-cli.js');
|
|
469
|
+
|
|
470
|
+
let dir;
|
|
471
|
+
beforeEach(() => {
|
|
472
|
+
dir = fs.mkdtempSync(path.join(os.tmpdir(), 'crap858d-'));
|
|
473
|
+
});
|
|
474
|
+
afterEach(() => {
|
|
475
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
it('AC-858-11: finds scripts/ when there is no src/', () => {
|
|
479
|
+
fs.mkdirSync(path.join(dir, 'scripts'));
|
|
480
|
+
expect(discoverSourcePaths(dir)).toEqual(['scripts']);
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it('AC-858-11b: finds several conventional roots at once', () => {
|
|
484
|
+
fs.mkdirSync(path.join(dir, 'src'));
|
|
485
|
+
fs.mkdirSync(path.join(dir, 'lib'));
|
|
486
|
+
expect(discoverSourcePaths(dir)).toEqual(['src', 'lib']);
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
it('AC-858-11c: falls back to the working directory, never to an empty list', () => {
|
|
490
|
+
// An empty list would make lizard scan nothing while the report claimed there
|
|
491
|
+
// was no code -- indistinguishable from a project that legitimately has none.
|
|
492
|
+
expect(discoverSourcePaths(dir)).toEqual(['.']);
|
|
493
|
+
});
|
|
494
|
+
});
|
package/lib/crap-cli.js
CHANGED
|
@@ -65,14 +65,42 @@ function discoverCoverageFile(explicit, cwd) {
|
|
|
65
65
|
return path.join(coverageDir, candidates[0]);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Pick the source roots to scan when --paths was not given (#858).
|
|
70
|
+
*
|
|
71
|
+
* Hardcoding `src` made the command useless on any project whose code lives
|
|
72
|
+
* elsewhere -- the user's own repo keeps it in `scripts/`, and the report then
|
|
73
|
+
* said "No functions found ... --paths points at real code", leaving them to
|
|
74
|
+
* guess. The conventions below cover the layouts that actually occur:
|
|
75
|
+
*
|
|
76
|
+
* src, lib, scripts, app, packages, source (a directory)
|
|
77
|
+
* a single top-level entry file (bin/xp-gate.js style)
|
|
78
|
+
*
|
|
79
|
+
* Falls back to the working directory itself, which is what a caller who passed
|
|
80
|
+
* no flags most plausibly meant. Returning ['.'] rather than [] matters: an empty
|
|
81
|
+
* list makes lizard scan nothing and the report claim there is no code.
|
|
82
|
+
*/
|
|
83
|
+
function discoverSourcePaths(cwd) {
|
|
84
|
+
const root = cwd || process.cwd();
|
|
85
|
+
const candidates = ['src', 'lib', 'scripts', 'app', 'packages', 'source'];
|
|
86
|
+
const found = candidates.filter(name => {
|
|
87
|
+
try {
|
|
88
|
+
return fs.statSync(path.join(root, name)).isDirectory();
|
|
89
|
+
} catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return found.length ? found : ['.'];
|
|
94
|
+
}
|
|
95
|
+
|
|
68
96
|
function parseArgs(argv) {
|
|
69
97
|
const opts = {
|
|
70
98
|
top: 20,
|
|
71
99
|
threshold: 6,
|
|
72
100
|
json: false,
|
|
73
|
-
// #858: discovered after parsing
|
|
101
|
+
// #858: both discovered after parsing. `--coverage` and `--paths` still win.
|
|
74
102
|
coverage: null,
|
|
75
|
-
paths:
|
|
103
|
+
paths: null,
|
|
76
104
|
includeMirrors: false,
|
|
77
105
|
help: false,
|
|
78
106
|
};
|
|
@@ -156,6 +184,17 @@ function render(report, opts) {
|
|
|
156
184
|
|
|
157
185
|
if (!report.hotspots.length) {
|
|
158
186
|
lines.push('');
|
|
187
|
+
// #858: with nothing measured, "Nothing at or above CRAP 6" is a statement
|
|
188
|
+
// about a ranking that never happened, and the tick made it read as approval.
|
|
189
|
+
// Unmeasured functions are counted, not scored -- so an all-unmeasured run
|
|
190
|
+
// has no verdict to give, and must say that instead of implying a clean one.
|
|
191
|
+
if (!report.measured) {
|
|
192
|
+
lines.push('❌ NOT_CHECKED — no function had coverage, so nothing was ranked.');
|
|
193
|
+
lines.push(' This is not a clean result: every function above is unmeasured.');
|
|
194
|
+
lines.push(' A coverage summary was found, but no entry matched a scanned file.');
|
|
195
|
+
lines.push(' Check --paths and that the coverage file names the files you scanned.');
|
|
196
|
+
return lines.join('\n');
|
|
197
|
+
}
|
|
159
198
|
lines.push(`✅ Nothing at or above CRAP ${report.threshold}.`);
|
|
160
199
|
return lines.join('\n');
|
|
161
200
|
}
|
|
@@ -180,14 +219,19 @@ async function handleCrap(argv) {
|
|
|
180
219
|
return 0;
|
|
181
220
|
}
|
|
182
221
|
|
|
222
|
+
// Both discoveries must run BEFORE lizard is invoked: the scan target is an
|
|
223
|
+
// input to it. (Placed after, `--paths` discovery had no effect at all and the
|
|
224
|
+
// command still scanned the literal default.)
|
|
225
|
+
opts.coverage = discoverCoverageFile(opts.coverage);
|
|
226
|
+
|
|
227
|
+
if (!opts.paths || !opts.paths.length) opts.paths = discoverSourcePaths();
|
|
228
|
+
|
|
183
229
|
const csv = runLizard(opts.paths);
|
|
184
230
|
if (csv === null) {
|
|
185
231
|
console.error('✗ Could not run lizard. Install it with: pip install --user lizard');
|
|
186
232
|
return 1;
|
|
187
233
|
}
|
|
188
234
|
|
|
189
|
-
opts.coverage = discoverCoverageFile(opts.coverage);
|
|
190
|
-
|
|
191
235
|
if (!fs.existsSync(opts.coverage)) {
|
|
192
236
|
// #858: name the artifact that WOULD have been accepted. A user on Node's own
|
|
193
237
|
// runner is told "npx vitest run --coverage" and reasonably concludes CRAP
|
|
@@ -223,4 +267,6 @@ async function handleCrap(argv) {
|
|
|
223
267
|
return 0;
|
|
224
268
|
}
|
|
225
269
|
|
|
226
|
-
module.exports = {
|
|
270
|
+
module.exports = {
|
|
271
|
+
handleCrap, parseArgs, render, runLizard, discoverCoverageFile, discoverSourcePaths,
|
|
272
|
+
};
|
package/lib/crap.js
CHANGED
|
@@ -101,9 +101,55 @@ function relativiseArtifactPath(absPath, root) {
|
|
|
101
101
|
* @returns {Array<object>} each with `cov` and `crap` (either may be null)
|
|
102
102
|
*/
|
|
103
103
|
function joinCoverage(functions, coverage) {
|
|
104
|
+
const map = coverage instanceof Map ? coverage : new Map();
|
|
105
|
+
|
|
106
|
+
// #858: build the basename index once, and record how many DISTINCT keys share
|
|
107
|
+
// each basename. A count above one means the summary cannot disambiguate, and
|
|
108
|
+
// guessing there would attribute one file's coverage to another -- a wrong
|
|
109
|
+
// ranking, which is worse than an honest "unmeasured".
|
|
110
|
+
const byBasename = new Map();
|
|
111
|
+
const ambiguous = new Set();
|
|
112
|
+
|
|
113
|
+
// The map side: two distinct coverage keys sharing one basename are ambiguous.
|
|
114
|
+
for (const key of map.keys()) {
|
|
115
|
+
const base = path.basename(String(key).split('\\').join('/'));
|
|
116
|
+
const seen = byBasename.get(base);
|
|
117
|
+
if (seen !== undefined && seen !== key) {
|
|
118
|
+
ambiguous.add(base);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
byBasename.set(base, key);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// The function side matters just as much, and is the case the issue measured:
|
|
125
|
+
// the summary names `util.mjs` once, but the code has src/a/util.mjs AND
|
|
126
|
+
// src/b/util.mjs. Handing that one ratio to either is a coin flip, so the name
|
|
127
|
+
// is ambiguous even though the summary is internally consistent.
|
|
128
|
+
const namesOnFunctions = new Map();
|
|
129
|
+
for (const fn of functions) {
|
|
130
|
+
const base = path.basename(toRepoRelative(fn.file));
|
|
131
|
+
namesOnFunctions.set(base, (namesOnFunctions.get(base) ?? 0) + 1);
|
|
132
|
+
}
|
|
133
|
+
for (const [base, count] of namesOnFunctions) {
|
|
134
|
+
if (count > 1) ambiguous.add(base);
|
|
135
|
+
}
|
|
136
|
+
|
|
104
137
|
return functions.map((fn) => {
|
|
105
138
|
const key = toRepoRelative(fn.file);
|
|
106
|
-
|
|
139
|
+
|
|
140
|
+
// 1. exact normalised path
|
|
141
|
+
let cov = map.get(key);
|
|
142
|
+
|
|
143
|
+
// 2. basename fallback, only when the path did not match and the name is
|
|
144
|
+
// unambiguous. Node's own summary carries basenames only, so without this
|
|
145
|
+
// step a measured file is indistinguishable from an unmeasured one.
|
|
146
|
+
if (cov === undefined) {
|
|
147
|
+
const base = path.basename(key);
|
|
148
|
+
if (!ambiguous.has(base) && byBasename.has(base)) {
|
|
149
|
+
cov = map.get(byBasename.get(base));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
107
153
|
const known = cov === undefined ? null : cov;
|
|
108
154
|
return { ...fn, file: key, cov: known, crap: computeCrap(fn.ccn, known) };
|
|
109
155
|
});
|
package/lib/principles.js
CHANGED
|
@@ -217,9 +217,19 @@ function findPrinciplesEntry() {
|
|
|
217
217
|
// `.cs`/`.csx` were the gap: analyzer.ts registered CSharpAdapter, this walk
|
|
218
218
|
// never offered the files, so `xp-gate principles <csharp-dir>` reported
|
|
219
219
|
// "Files checked: 0" — indistinguishable from "no violations".
|
|
220
|
+
//
|
|
221
|
+
// #732: the walk must list EXACTLY the extensions `adapterMap` registers, or the
|
|
222
|
+
// two disagree and the disagreement is invisible — the engine advertises a
|
|
223
|
+
// language it can analyse while the walk never hands it a file. `.mts`/`.cts`
|
|
224
|
+
// were missing here for that reason; AC-758-02 pins the two lists together.
|
|
220
225
|
const SOURCE_EXTENSIONS = new Set([
|
|
221
|
-
'.ts', '.tsx', '.
|
|
226
|
+
'.ts', '.tsx', '.mts', '.cts',
|
|
227
|
+
'.js', '.jsx', '.mjs', '.cjs',
|
|
222
228
|
'.py', '.go', '.java', '.kt', '.kts',
|
|
229
|
+
// #731 shipped PhpAdapter and this walk kept dropping .php/.phtml, so the two
|
|
230
|
+
// lists disagreed in exactly the way #717 was about -- an adapter that existed
|
|
231
|
+
// and never received a file. AC-758-02 compares them, which is how it surfaced.
|
|
232
|
+
'.php', '.phtml',
|
|
223
233
|
'.cs', '.csx',
|
|
224
234
|
'.dart', '.swift', '.cpp', '.cc', '.cxx', '.c', '.h', '.hpp',
|
|
225
235
|
'.m', '.mm',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xp-gate",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.83",
|
|
4
4
|
"displayName": "XP-Gate",
|
|
5
5
|
"description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 12 pre-commit gates (Gate 0-11), 8 pre-push gates, Sprint Flow (6 phases), and Delphi multi-expert review (>=90% consensus).",
|
|
6
6
|
"author": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/plugins/dsh/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boyingliu01/dsh-plugin-xp-gate",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.83",
|
|
4
4
|
"description": "XP-Gate deterministic quality gates + AI workflow skills as a DeepSeek Harness (DSH) native plugin: gate-check / gate-principles / gate-arch tools + 12 SKILL.md skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xp-gate",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.83",
|
|
4
4
|
"displayName": "XP-Gate",
|
|
5
5
|
"description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 12 pre-commit gates (Gate 0-11), 8 pre-push gates, Sprint Flow (6 phases), and Delphi multi-expert review (>=90% consensus).",
|
|
6
6
|
"author": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
|
@@ -15,18 +15,47 @@ export abstract class BaseAdapter implements Adapter {
|
|
|
15
15
|
|
|
16
16
|
detectLanguage(): string {
|
|
17
17
|
const extension = extname(this.filePath).toLowerCase();
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
// The SECOND map that decides whether an adapter's file gets analysed. An
|
|
20
|
+
// adapter can exist and still be discarded: analyzer.ts drops anything whose
|
|
21
|
+
// detectLanguage() is 'unknown'. So a missing entry here is just as fatal as
|
|
22
|
+
// a missing adapterMap entry, and the two were out of step in the same way.
|
|
23
|
+
//
|
|
24
|
+
// #732: mjs/cjs/mts/cts added. Without them a .mjs file passed the shell
|
|
25
|
+
// filter, got an adapter, and was then thrown away at this line -- Gate 4
|
|
26
|
+
// reported a clean PASS over files it never read.
|
|
27
|
+
//
|
|
28
|
+
// .php/.phtml (#731) and .cs/.csx/.cpp/.c/.h/.hpp/.m/.mm (#717) were also
|
|
29
|
+
// missing here while their adapters existed, so the same silent discard
|
|
30
|
+
// applied to them. Covered by the capability test rather than by hand.
|
|
19
31
|
const languageMap: Record<string, string> = {
|
|
20
32
|
'.ts': 'typescript',
|
|
21
33
|
'.tsx': 'typescript',
|
|
34
|
+
'.mts': 'typescript',
|
|
35
|
+
'.cts': 'typescript',
|
|
22
36
|
'.js': 'javascript',
|
|
23
37
|
'.jsx': 'javascript',
|
|
38
|
+
'.mjs': 'javascript',
|
|
39
|
+
'.cjs': 'javascript',
|
|
24
40
|
'.py': 'python',
|
|
25
41
|
'.go': 'go',
|
|
26
42
|
'.java': 'java',
|
|
27
43
|
'.kt': 'kotlin',
|
|
44
|
+
'.kts': 'kotlin',
|
|
28
45
|
'.dart': 'dart',
|
|
29
46
|
'.swift': 'swift',
|
|
47
|
+
'.php': 'php',
|
|
48
|
+
'.phtml': 'php',
|
|
49
|
+
'.cs': 'csharp',
|
|
50
|
+
'.csx': 'csharp',
|
|
51
|
+
'.cpp': 'cpp',
|
|
52
|
+
'.cxx': 'cpp',
|
|
53
|
+
'.cc': 'cpp',
|
|
54
|
+
'.c': 'c',
|
|
55
|
+
'.hpp': 'cpp',
|
|
56
|
+
'.h': 'c',
|
|
57
|
+
'.m': 'objectivec',
|
|
58
|
+
'.mm': 'objectivec',
|
|
30
59
|
};
|
|
31
60
|
|
|
32
61
|
return languageMap[extension] || 'unknown';
|
package/principles/analyzer.ts
CHANGED
|
@@ -72,6 +72,15 @@ export function getAdapterForFile(filePath: string): Adapter | null {
|
|
|
72
72
|
'.tsx': TypeScriptAdapter,
|
|
73
73
|
'.js': TypeScriptAdapter,
|
|
74
74
|
'.jsx': TypeScriptAdapter,
|
|
75
|
+
// #732: the four module variants. This is the SECOND of the two inner maps
|
|
76
|
+
// that decide whether a file reaching Gate 4 is actually analysed -- the
|
|
77
|
+
// shell filter (githooks/lib/file-classifier.sh) only decides what reaches
|
|
78
|
+
// the gate. Fixing that one and not this one left Gate 4 reporting
|
|
79
|
+
// "✅ PASSED / Files checked: 0" over a project with 36 .mjs files.
|
|
80
|
+
'.mjs': TypeScriptAdapter,
|
|
81
|
+
'.cjs': TypeScriptAdapter,
|
|
82
|
+
'.mts': TypeScriptAdapter,
|
|
83
|
+
'.cts': TypeScriptAdapter,
|
|
75
84
|
'.py': PythonAdapter,
|
|
76
85
|
'.go': GoAdapter,
|
|
77
86
|
'.java': JavaAdapter,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.83.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|