mandrel 2.56.0 → 2.58.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/agents/plan-critic.md +13 -18
- package/.agents/agents/story-worker.md +25 -33
- package/.agents/docs/agentrc-reference.json +0 -30
- package/.agents/docs/configuration.md +8 -28
- package/.agents/docs/execution-reference.md +5 -5
- package/.agents/docs/quality-gates.md +8 -7
- package/.agents/instructions.md +9 -10
- package/.agents/schemas/agentrc.schema.json +9 -185
- package/.agents/schemas/story-deliver-terminal.schema.json +1 -1
- package/.agents/scripts/acceptance-eval.js +107 -17
- package/.agents/scripts/ceremony-derive.js +191 -0
- package/.agents/scripts/check-context-budget.js +28 -33
- package/.agents/scripts/check-cyclomatic.js +4 -3
- package/.agents/scripts/deliver-light.js +31 -94
- package/.agents/scripts/evidence-gate.js +17 -1
- package/.agents/scripts/lib/audit-suite/checklist-threading.js +15 -2
- package/.agents/scripts/lib/baselines/coverage-updater-cli.js +110 -0
- package/.agents/scripts/lib/baselines/crap-preview-scan.js +25 -0
- package/.agents/scripts/lib/baselines/crap-updater-cli.js +223 -0
- package/.agents/scripts/lib/bdd-scenario-budget.js +21 -3
- package/.agents/scripts/lib/bootstrap/quality-bootstrap.js +0 -1
- package/.agents/scripts/lib/close-validation/gates.js +52 -1
- package/.agents/scripts/lib/config/acceptance-eval.js +25 -57
- package/.agents/scripts/lib/config/delivery-routing.js +7 -33
- package/.agents/scripts/lib/config/explain.js +0 -19
- package/.agents/scripts/lib/config/limits.js +18 -78
- package/.agents/scripts/lib/config/quality.js +6 -3
- package/.agents/scripts/lib/config/runners.js +3 -2
- package/.agents/scripts/lib/config-settings-schema-delivery.js +15 -68
- package/.agents/scripts/lib/config-settings-schema-quality.js +0 -14
- package/.agents/scripts/lib/config-settings-schema.js +16 -143
- package/.agents/scripts/lib/crap-engine.js +35 -4
- package/.agents/scripts/lib/crap-utils.js +17 -1
- package/.agents/scripts/lib/cyclomatic-ceiling.js +19 -7
- package/.agents/scripts/lib/generated/agentrc-validator.js +1 -1
- package/.agents/scripts/lib/observability/runtime-friction.js +1 -1
- package/.agents/scripts/lib/observability/source-classifier.js +1 -0
- package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +5 -4
- package/.agents/scripts/lib/orchestration/ceremony-routing.js +19 -73
- package/.agents/scripts/lib/orchestration/code-review.js +7 -3
- package/.agents/scripts/lib/orchestration/complexity-gate.js +46 -212
- package/.agents/scripts/lib/orchestration/file-assumptions.js +32 -17
- package/.agents/scripts/lib/orchestration/light-escalation.js +3 -3
- package/.agents/scripts/lib/orchestration/light-suitability.js +66 -233
- package/.agents/scripts/lib/orchestration/pinned-identifier-lint.js +137 -0
- package/.agents/scripts/lib/orchestration/plan-context.js +189 -387
- package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +42 -153
- package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +14 -70
- package/.agents/scripts/lib/orchestration/plan-persist/acceptance-handle-repair.js +107 -0
- package/.agents/scripts/lib/orchestration/plan-persist/changes-repair.js +305 -0
- package/.agents/scripts/lib/orchestration/plan-persist/persist-helpers.js +138 -170
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +128 -297
- package/.agents/scripts/lib/orchestration/plan-persist/soft-findings.js +55 -0
- package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +16 -65
- package/.agents/scripts/lib/orchestration/plan-persist/wave-serialisation.js +22 -35
- package/.agents/scripts/lib/orchestration/plan-text-hygiene.js +36 -135
- package/.agents/scripts/lib/orchestration/planning/memory-pool-advisory.js +61 -223
- package/.agents/scripts/lib/orchestration/review-base-ref.js +138 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +5 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +37 -5
- package/.agents/scripts/lib/orchestration/single-story-close/phases/pre-gate-steps.js +46 -16
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +6 -1
- package/.agents/scripts/lib/orchestration/story-close/context-budget-writeback.js +213 -0
- package/.agents/scripts/lib/orchestration/task-body-validator.js +10 -63
- package/.agents/scripts/lib/orchestration/ticket-validator-conflicts.js +33 -539
- package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +21 -414
- package/.agents/scripts/lib/orchestration/ticket-validator.js +54 -118
- package/.agents/scripts/lib/orchestration/verify-credit.js +69 -24
- package/.agents/scripts/lib/story-body/body-format-lints.js +15 -85
- package/.agents/scripts/lib/story-body/story-body.js +54 -240
- package/.agents/scripts/lib/templates/decomposer-prompts.js +133 -121
- package/.agents/scripts/lib/test-isolate/cli-options.js +93 -0
- package/.agents/scripts/lib/test-isolate/progress-log.js +45 -0
- package/.agents/scripts/lib/test-isolate/render-report.js +97 -0
- package/.agents/scripts/lib/test-isolate/run-isolate.js +87 -0
- package/.agents/scripts/lib/test-run-credit.js +277 -0
- package/.agents/scripts/lib/wave-runner/footprint.js +48 -358
- package/.agents/scripts/lib/wave-runner/ready-set.js +6 -5
- package/.agents/scripts/lib/workers/crap-worker.js +32 -41
- package/.agents/scripts/plan-context.js +7 -9
- package/.agents/scripts/plan-critics.js +28 -54
- package/.agents/scripts/plan-persist.js +25 -68
- package/.agents/scripts/quality-preview.js +51 -0
- package/.agents/scripts/run-tests.js +12 -0
- package/.agents/scripts/stories-wave-tick.js +23 -45
- package/.agents/scripts/test-isolate.js +13 -180
- package/.agents/scripts/update-coverage-baseline.js +25 -70
- package/.agents/scripts/update-crap-baseline.js +19 -123
- package/.agents/skills/core/scope-triage/SKILL.md +3 -3
- package/.agents/workflows/audit-clean-code.md +4 -3
- package/.agents/workflows/helpers/acceptance-self-eval.md +41 -41
- package/.agents/workflows/helpers/code-quality-guardrails.md +4 -4
- package/.agents/workflows/helpers/code-review.md +2 -3
- package/.agents/workflows/helpers/deliver-digest.md +46 -55
- package/.agents/workflows/helpers/deliver-light.md +40 -105
- package/.agents/workflows/helpers/deliver-reference.md +1 -1
- package/.agents/workflows/helpers/deliver-story-reference.md +54 -55
- package/.agents/workflows/helpers/deliver-story.md +10 -13
- package/.agents/workflows/helpers/plan-reference.md +163 -221
- package/.agents/workflows/mandrel-plan.md +31 -40
- package/.agents/workflows/memory-consolidate.md +9 -13
- package/docs/CHANGELOG.md +36 -0
- package/lib/cli/registry.js +98 -2
- package/lib/migrations/index.js +4 -0
- package/lib/migrations/steps/2.57.0-retire-delivery-limit-knobs.js +45 -0
- package/lib/migrations/steps/2.57.0-retire-planning-limit-knobs.js +59 -0
- package/package.json +1 -1
- package/.agents/scripts/lib/framework-version.js +0 -39
- package/.agents/scripts/lib/orchestration/consolidation-precondition.js +0 -223
- package/.agents/scripts/lib/orchestration/plan-persist/fan-out-gate.js +0 -97
- package/.agents/scripts/lib/orchestration/planning/decomposer-context.js +0 -26
- package/.agents/scripts/lib/orchestration/spec-budget.js +0 -89
- package/.agents/scripts/lib/orchestration/spec-spill.js +0 -74
- package/.agents/scripts/lib/orchestration/verify-tier-repair.js +0 -107
|
@@ -348,6 +348,12 @@ function projectScanRow(relPath, mr) {
|
|
|
348
348
|
* skipped from the returned rows so the baseline never contains
|
|
349
349
|
* partially-scored entries. Both counters surface for reporting.
|
|
350
350
|
*
|
|
351
|
+
* A file neither path could score at all — unreadable, untranspilable, or one
|
|
352
|
+
* the kernel could not parse — is dropped and counted in `unscorableFiles`
|
|
353
|
+
* (Story #5311). Unscorable is not scored-as-nothing: without this counter a
|
|
354
|
+
* dropped file is indistinguishable from a file with no methods, which is what
|
|
355
|
+
* let a whole parse-failure class leave the baseline silently.
|
|
356
|
+
*
|
|
351
357
|
* When `scopeFiles` is provided (the `--changed-since` code path) files
|
|
352
358
|
* discovered via directory walking are filtered against that set before any
|
|
353
359
|
* I/O or scoring happens — so pre-push / PR-CI runs never pay the
|
|
@@ -385,6 +391,7 @@ function projectScanRow(relPath, mr) {
|
|
|
385
391
|
* scannedFiles: number,
|
|
386
392
|
* skippedFilesNoCoverage: number,
|
|
387
393
|
* skippedMethodsNoCoverage: number,
|
|
394
|
+
* unscorableFiles: number,
|
|
388
395
|
* }}
|
|
389
396
|
*/
|
|
390
397
|
export async function scanAndScore({
|
|
@@ -442,9 +449,16 @@ export async function scanAndScore({
|
|
|
442
449
|
const rows = [];
|
|
443
450
|
let skippedFilesNoCoverage = 0;
|
|
444
451
|
let skippedMethodsNoCoverage = 0;
|
|
452
|
+
let unscorableFiles = 0;
|
|
445
453
|
const resolution = newResolutionAccumulator();
|
|
446
454
|
for (const { item, result } of perFile) {
|
|
447
|
-
if (!result)
|
|
455
|
+
if (!result) {
|
|
456
|
+
// Unrecoverable per-file failure (a pool-level error the worker never
|
|
457
|
+
// answered). Dropped like any other unscorable file, and counted — the
|
|
458
|
+
// point of the counter is that no drop is silent.
|
|
459
|
+
unscorableFiles += 1;
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
448
462
|
if (result.skippedFileNoCoverage) {
|
|
449
463
|
skippedFilesNoCoverage += 1;
|
|
450
464
|
continue;
|
|
@@ -453,6 +467,7 @@ export async function scanAndScore({
|
|
|
453
467
|
// read/transpile/parse failure: drop and move on, but if the worker
|
|
454
468
|
// attached an error message (calculateCrapForSource throw) surface it
|
|
455
469
|
// so the run isn't silent on the ops side.
|
|
470
|
+
unscorableFiles += 1;
|
|
456
471
|
if (result.error) {
|
|
457
472
|
Logger.warn(
|
|
458
473
|
`[crap-utils] failed to score ${item.relPath}: ${result.error}`,
|
|
@@ -479,6 +494,7 @@ export async function scanAndScore({
|
|
|
479
494
|
scannedFiles,
|
|
480
495
|
skippedFilesNoCoverage,
|
|
481
496
|
skippedMethodsNoCoverage,
|
|
497
|
+
unscorableFiles,
|
|
482
498
|
resolution: summarizeResolution(resolution),
|
|
483
499
|
};
|
|
484
500
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* cyclomatic-ceiling.js — the enforcing core behind
|
|
3
|
-
*
|
|
2
|
+
* cyclomatic-ceiling.js — the enforcing core behind the cyclomatic ceiling
|
|
3
|
+
* ratchet (Story #4923; fixed ceiling since Story #5313).
|
|
4
4
|
*
|
|
5
5
|
* The two `codingGuardrails` cyclomatic knobs shipped schema-validated,
|
|
6
6
|
* bootstrap-defaulted and resolver-resolved, and were then read by nothing:
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* nothing enforces is worse than no ceiling, because the workflow docs promise
|
|
10
10
|
* the merge will be refused.
|
|
11
11
|
*
|
|
12
|
+
* Story #5313 retired the `cyclomaticMustFix` config key: the ratchet's
|
|
13
|
+
* ceiling is the fixed {@link CYCLOMATIC_CEILING} (12), so a consumer cannot
|
|
14
|
+
* bound this gate by tuning a number, and `cyclomaticFlag` is the one
|
|
15
|
+
* advisory knob — `quality-preview.js` reports over-flag methods and exits 0
|
|
16
|
+
* on them.
|
|
17
|
+
*
|
|
12
18
|
* This module is that enforcement, shaped as a **ratchet** rather than a
|
|
13
19
|
* cliff. The repository already carries dozens of functions above the
|
|
14
20
|
* must-fix ceiling; failing every one of them at once would have made the
|
|
@@ -37,6 +43,13 @@ import { scanDirectory } from './maintainability-utils.js';
|
|
|
37
43
|
/** Default location of the committed breach baseline. */
|
|
38
44
|
export const DEFAULT_CYCLOMATIC_BASELINE = 'baselines/cyclomatic.json';
|
|
39
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The per-function cyclomatic ceiling the ratchet enforces. Fixed — not a
|
|
48
|
+
* config key — since Story #5313.
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
export const CYCLOMATIC_CEILING = 12;
|
|
52
|
+
|
|
40
53
|
/** Baseline `$schema` marker, matching the sibling ratchet baselines. */
|
|
41
54
|
const CYCLOMATIC_BASELINE_SCHEMA =
|
|
42
55
|
'https://mandrel.dev/baselines/cyclomatic.schema.json';
|
|
@@ -44,10 +57,9 @@ const CYCLOMATIC_BASELINE_SCHEMA =
|
|
|
44
57
|
/**
|
|
45
58
|
* Resolve the enforcement policy from a resolved `delivery.quality` block.
|
|
46
59
|
*
|
|
47
|
-
* `mustFix`
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* maintainability gate (see the module note).
|
|
60
|
+
* `mustFix` is the fixed {@link CYCLOMATIC_CEILING}; `flag` comes from
|
|
61
|
+
* `resolveCodingGuardrails` (advisory only). `targetDirs` / `ignoreGlobs`
|
|
62
|
+
* are borrowed from the maintainability gate (see the module note).
|
|
51
63
|
*
|
|
52
64
|
* @param {object | null | undefined} quality resolved `delivery.quality`
|
|
53
65
|
* @returns {{ mustFix: number, flag: number, targetDirs: string[], ignoreGlobs: string[] }}
|
|
@@ -56,7 +68,7 @@ export function resolveCyclomaticPolicy(quality) {
|
|
|
56
68
|
const guardrails = quality?.codingGuardrails ?? {};
|
|
57
69
|
const mi = quality?.maintainability ?? {};
|
|
58
70
|
return {
|
|
59
|
-
mustFix:
|
|
71
|
+
mustFix: CYCLOMATIC_CEILING,
|
|
60
72
|
flag: Number(guardrails.cyclomaticFlag ?? 8),
|
|
61
73
|
targetDirs: Array.isArray(mi.targetDirs) ? mi.targetDirs : [],
|
|
62
74
|
ignoreGlobs: Array.isArray(mi.ignoreGlobs) ? mi.ignoreGlobs : [],
|