mandrel 2.117.0 → 2.118.0
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/.agents/scripts/lib/baselines/coverage-updater-cli.js +2 -6
- package/.agents/scripts/lib/baselines/refresh-service.js +2 -6
- package/.agents/scripts/lib/baselines/seat-missing.js +2 -9
- package/.agents/scripts/lib/coverage-baseline.js +20 -9
- package/docs/CHANGELOG.md +7 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import path from 'node:path';
|
|
|
10
10
|
import { getBaselineEpsilon } from '../config/quality.js';
|
|
11
11
|
import {
|
|
12
12
|
buildScopePredicate,
|
|
13
|
+
coverageRowFromScores,
|
|
13
14
|
readCoverageFinal,
|
|
14
15
|
scoreCoverageFinal,
|
|
15
16
|
} from '../coverage-baseline.js';
|
|
@@ -108,12 +109,7 @@ function projectScoredRows(scores, files, opts, logger) {
|
|
|
108
109
|
: null;
|
|
109
110
|
const rows = Object.entries(scores)
|
|
110
111
|
.filter(([relPath]) => inScope === null || inScope.has(relPath))
|
|
111
|
-
.map(([relPath, s]) => (
|
|
112
|
-
path: relPath,
|
|
113
|
-
lines: s?.lines ?? 0,
|
|
114
|
-
branches: s?.branches ?? 0,
|
|
115
|
-
functions: s?.functions ?? 0,
|
|
116
|
-
}));
|
|
112
|
+
.map(([relPath, s]) => coverageRowFromScores(relPath, s));
|
|
117
113
|
logger.info(
|
|
118
114
|
`[Coverage] Scored ${Object.keys(scores).length} file(s)${inScope ? ` (${rows.length} in scope)` : ''}.`,
|
|
119
115
|
);
|
|
@@ -16,6 +16,7 @@ import { COVERAGE_GATE_DEFAULTS } from '../config/quality.js';
|
|
|
16
16
|
import { getQuality, resolveConfig } from '../config-resolver.js';
|
|
17
17
|
import {
|
|
18
18
|
buildScopePredicate,
|
|
19
|
+
coverageRowFromScores,
|
|
19
20
|
scoreCoverageFinal,
|
|
20
21
|
} from '../coverage-baseline.js';
|
|
21
22
|
import { MissingCoverageArtifactError } from '../coverage-capture.js';
|
|
@@ -181,12 +182,7 @@ function buildDefaultCoverageScorer({ cwd, config, quality } = {}) {
|
|
|
181
182
|
: null;
|
|
182
183
|
return Object.entries(scores)
|
|
183
184
|
.filter(([relPath]) => inScope === null || inScope.has(relPath))
|
|
184
|
-
.map(([relPath, score]) => (
|
|
185
|
-
path: relPath,
|
|
186
|
-
lines: score?.lines ?? 0,
|
|
187
|
-
branches: score?.branches ?? 0,
|
|
188
|
-
functions: score?.functions ?? 0,
|
|
189
|
-
}));
|
|
185
|
+
.map(([relPath, score]) => coverageRowFromScores(relPath, score));
|
|
190
186
|
};
|
|
191
187
|
}
|
|
192
188
|
|
|
@@ -12,6 +12,7 @@ import { execFileCaptureAsync } from '../child-exec.js';
|
|
|
12
12
|
import { getBaselines, getQuality, resolveConfig } from '../config-resolver.js';
|
|
13
13
|
import {
|
|
14
14
|
buildScopePredicate,
|
|
15
|
+
coverageRowFromScores,
|
|
15
16
|
scoreCoverageFinal,
|
|
16
17
|
} from '../coverage-baseline.js';
|
|
17
18
|
import { isCoverageFresh } from '../coverage-capture.js';
|
|
@@ -313,14 +314,6 @@ export function seatMaintainabilityBaseline(
|
|
|
313
314
|
});
|
|
314
315
|
}
|
|
315
316
|
|
|
316
|
-
/** One coverage baseline row from a file's scores. */
|
|
317
|
-
const coverageRow = (relPath, s) => ({
|
|
318
|
-
path: relPath,
|
|
319
|
-
lines: s?.lines ?? 0,
|
|
320
|
-
branches: s?.branches ?? 0,
|
|
321
|
-
functions: s?.functions ?? 0,
|
|
322
|
-
});
|
|
323
|
-
|
|
324
317
|
/** @param {string} coveragePath @param {string[]} inScope @param {string} cwd */
|
|
325
318
|
function staleRefusal(coveragePath, inScope, cwd) {
|
|
326
319
|
return new SeatRefusal(
|
|
@@ -339,7 +332,7 @@ function measuredRows(scores, inScope, logger) {
|
|
|
339
332
|
`[Coverage] not seated — the fresh artifact did not measure: ${unmeasured.join(', ')}`,
|
|
340
333
|
);
|
|
341
334
|
}
|
|
342
|
-
return measured.map((file) =>
|
|
335
|
+
return measured.map((file) => coverageRowFromScores(file, scores[file]));
|
|
343
336
|
}
|
|
344
337
|
|
|
345
338
|
/**
|
|
@@ -149,16 +149,27 @@ export function readBaseline(cwd, fsImpl = fs) {
|
|
|
149
149
|
*/
|
|
150
150
|
const NO_DENOMINATOR_PCT = 100;
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* One baseline row from a file's `scoreEntry` scores. Every writer builds
|
|
154
|
+
* its rows here, so a 0/0 axis persists as 100 on every path.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} file Repo-relative path.
|
|
157
|
+
* @param {{ lines?: number|null, branches?: number|null, functions?: number|null }|null|undefined} scores
|
|
158
|
+
* @returns {{ path: string, lines: number, branches: number, functions: number }}
|
|
159
|
+
*/
|
|
160
|
+
export function coverageRowFromScores(file, scores) {
|
|
161
|
+
return {
|
|
162
|
+
path: file,
|
|
163
|
+
lines: scores?.lines ?? NO_DENOMINATOR_PCT,
|
|
164
|
+
branches: scores?.branches ?? NO_DENOMINATOR_PCT,
|
|
165
|
+
functions: scores?.functions ?? NO_DENOMINATOR_PCT,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
152
169
|
function projectFlatToRows(baseline) {
|
|
153
|
-
return Object.entries(baseline ?? {}).map(([file, scores]) =>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
path: file,
|
|
157
|
-
lines: rest.lines ?? NO_DENOMINATOR_PCT,
|
|
158
|
-
branches: rest.branches ?? NO_DENOMINATOR_PCT,
|
|
159
|
-
functions: rest.functions ?? NO_DENOMINATOR_PCT,
|
|
160
|
-
};
|
|
161
|
-
});
|
|
170
|
+
return Object.entries(baseline ?? {}).map(([file, scores]) =>
|
|
171
|
+
coverageRowFromScores(file, scores),
|
|
172
|
+
);
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
function writeEnvelopeViaFsImpl(abs, envelope, fsImpl) {
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,13 @@ All notable changes to this project will be documented in this file.
|
|
|
15
15
|
-->
|
|
16
16
|
<!-- markdownlint-disable-file MD004 MD012 MD037 -->
|
|
17
17
|
|
|
18
|
+
## [2.118.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.117.0...mandrel-v2.118.0) (2026-11-11)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
* **baselines:** every coverage writer scores a 0/0 axis as 100 (refs [#6047](https://github.com/dsj1984/mandrel/issues/6047)) ([#6048](https://github.com/dsj1984/mandrel/issues/6048)) ([cd2d1fb](https://github.com/dsj1984/mandrel/commit/cd2d1fb6fb6ce854dca51c017b0ecc68d977c4f7))
|
|
24
|
+
|
|
18
25
|
## [2.117.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.116.0...mandrel-v2.117.0) (2026-11-11)
|
|
19
26
|
|
|
20
27
|
|
package/package.json
CHANGED