mandrel 2.90.0 → 2.91.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/README.md +47 -7
- package/.agents/agents/story-worker.md +20 -0
- package/.agents/audit-checklists/lean.md +26 -0
- package/.agents/docs/agentrc-reference.json +5 -6
- package/.agents/docs/configuration.md +31 -30
- package/.agents/docs/workflows.md +7 -1
- package/.agents/instructions.md +3 -1
- package/.agents/runtime-deps.json +0 -2
- package/.agents/schemas/agentrc.schema.json +46 -45
- package/.agents/schemas/audit-rules.json +19 -0
- package/.agents/scripts/acceptance-eval.js +2 -6
- package/.agents/scripts/audit-exceptions.js +2 -4
- package/.agents/scripts/check-arch-cycles.js +1 -5
- package/.agents/scripts/check-context-budget.js +1 -5
- package/.agents/scripts/check-cyclomatic.js +1 -5
- package/.agents/scripts/check-dead-exports.js +23 -14
- package/.agents/scripts/check-doc-links.js +4 -4
- package/.agents/scripts/check-test-temp-hygiene.js +29 -33
- package/.agents/scripts/coverage-capture.js +14 -6
- package/.agents/scripts/diagnose-friction.js +8 -10
- package/.agents/scripts/generate-workflows-doc.js +5 -0
- package/.agents/scripts/lib/audit-exceptions/adapters/index.js +2 -0
- package/.agents/scripts/lib/audit-exceptions/adapters/inline-suppressions.js +36 -27
- package/.agents/scripts/lib/audit-exceptions/adapters/shortcut-markers.js +70 -0
- package/.agents/scripts/lib/audit-exceptions/adapters/source-scan.js +26 -0
- package/.agents/scripts/lib/audit-to-stories/audit-lenses.js +1 -0
- package/.agents/scripts/lib/baseline-schema-registry.js +3 -5
- package/.agents/scripts/lib/baselines/bundle-size-scorer.js +11 -28
- package/.agents/scripts/lib/baselines/components.js +5 -5
- package/.agents/scripts/lib/baselines/crap-preview-scan.js +4 -1
- package/.agents/scripts/lib/baselines/crap-updater-cli.js +6 -4
- package/.agents/scripts/lib/baselines/duplication-scanner.js +4 -10
- package/.agents/scripts/lib/baselines/kinds/crap.js +4 -2
- package/.agents/scripts/lib/baselines/kinds/duplication.js +4 -2
- package/.agents/scripts/lib/baselines/kinds/kind-factory.js +13 -6
- package/.agents/scripts/lib/baselines/refresh-service.js +10 -13
- package/.agents/scripts/lib/baselines/writer.js +4 -4
- package/.agents/scripts/lib/bdd-scenario-scanner.js +26 -31
- package/.agents/scripts/lib/bootstrap/gh-list.js +4 -5
- package/.agents/scripts/lib/bootstrap/gh-preflight.js +13 -8
- package/.agents/scripts/lib/child-exec.js +4 -4
- package/.agents/scripts/lib/claude/agents-projection.js +170 -0
- package/.agents/scripts/lib/claude/commands-projection.js +184 -0
- package/.agents/scripts/lib/close-validation/commands.js +28 -117
- package/.agents/scripts/lib/close-validation/gates.js +54 -48
- package/.agents/scripts/lib/close-validation/projections/crap.js +2 -1
- package/.agents/scripts/lib/close-validation/projections/maintainability.js +50 -15
- package/.agents/scripts/lib/config/agentrc-overlay.js +4 -7
- package/.agents/scripts/lib/config/commands.js +82 -7
- package/.agents/scripts/lib/config/explain.js +2 -1
- package/.agents/scripts/lib/config/gates/coverage.schema.js +39 -3
- package/.agents/scripts/lib/config/gates/crap-incremental-coverage.schema.js +1 -1
- package/.agents/scripts/lib/config/gates/crap.schema.js +5 -3
- package/.agents/scripts/lib/config/gates/duplication.schema.js +6 -11
- package/.agents/scripts/lib/config/gates/shared.js +2 -2
- package/.agents/scripts/lib/config/git-roots.js +120 -0
- package/.agents/scripts/lib/config/quality.js +46 -50
- package/.agents/scripts/lib/config/review-chain-default.js +4 -3
- package/.agents/scripts/lib/config/review-provider-clis.js +11 -0
- package/.agents/scripts/lib/config/temp-paths.js +3 -37
- package/.agents/scripts/lib/config-resolver.js +5 -9
- package/.agents/scripts/lib/config-settings-schema-delivery.js +2 -2
- package/.agents/scripts/lib/config-settings-schema-quality.js +3 -2
- package/.agents/scripts/lib/config-settings-schema.js +6 -7
- package/.agents/scripts/lib/coverage-baseline.js +2 -1
- package/.agents/scripts/lib/coverage-capture-affected.js +4 -3
- package/.agents/scripts/lib/coverage-capture-fullscope.js +3 -1
- package/.agents/scripts/lib/coverage-capture-passes.js +119 -34
- package/.agents/scripts/lib/coverage-capture-usage.js +1 -1
- package/.agents/scripts/lib/coverage-capture.js +31 -20
- package/.agents/scripts/lib/coverage-utils.js +34 -16
- package/.agents/scripts/lib/cpu-pool.js +2 -4
- package/.agents/scripts/lib/crap-engine.js +19 -1
- package/.agents/scripts/lib/crap-utils.js +2 -1
- package/.agents/scripts/lib/dead-exports-knip.js +29 -11
- package/.agents/scripts/lib/detect-package-manager.js +13 -0
- package/.agents/scripts/lib/feedback-loop/graduator-gh.js +4 -2
- package/.agents/scripts/lib/full-suite-lock.js +25 -9
- package/.agents/scripts/lib/gates/baseline-store.js +2 -10
- package/.agents/scripts/lib/generated/agentrc-validator.js +4 -1
- package/.agents/scripts/lib/gh-env.js +72 -0
- package/.agents/scripts/lib/gh-exec.js +26 -1
- package/.agents/scripts/lib/maintainability-utils.js +8 -8
- package/.agents/scripts/lib/npm-scripts.js +1 -1
- package/.agents/scripts/lib/observability/signal-validator.js +2 -6
- package/.agents/scripts/lib/observability/terse-result.js +2 -6
- package/.agents/scripts/lib/orchestration/board-access-latch.js +19 -8
- package/.agents/scripts/lib/orchestration/ci-rerun-guard.js +10 -13
- package/.agents/scripts/lib/orchestration/deliver-recover.js +2 -1
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/git-probes.js +3 -3
- package/.agents/scripts/lib/orchestration/lifecycle/emit-ledger-event.js +2 -6
- package/.agents/scripts/lib/orchestration/light-suitability.js +5 -7
- package/.agents/scripts/lib/orchestration/pr-watch.js +7 -7
- package/.agents/scripts/lib/orchestration/project-meta-cache.js +2 -11
- package/.agents/scripts/lib/orchestration/review-deposit.js +2 -9
- package/.agents/scripts/lib/orchestration/review-providers/callers-context.js +219 -0
- package/.agents/scripts/lib/orchestration/review-providers/code-review.js +53 -5
- package/.agents/scripts/lib/orchestration/review-providers/codex-cli.js +2 -2
- package/.agents/scripts/lib/orchestration/review-providers/llm-review.js +96 -0
- package/.agents/scripts/lib/orchestration/review-providers/mi-exemptions.js +2 -2
- package/.agents/scripts/lib/orchestration/review-providers/native.js +13 -19
- package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +3 -2
- package/.agents/scripts/lib/orchestration/review-providers/review-provider-factory.js +2 -0
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +11 -3
- package/.agents/scripts/lib/orchestration/story-close/baseline-upward-writeback.js +2 -3
- package/.agents/scripts/lib/orchestration/story-close/format-autofix.js +41 -15
- package/.agents/scripts/lib/orchestration/story-deliver-terminal-schema.js +2 -4
- package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +2 -13
- package/.agents/scripts/lib/orchestration/story-handoff.js +13 -5
- package/.agents/scripts/lib/orchestration/story-progress.js +3 -11
- package/.agents/scripts/lib/orchestration/ticketing/bulk.js +3 -5
- package/.agents/scripts/lib/orchestration/verify-credit.js +52 -28
- package/.agents/scripts/lib/single-story-sweep/protection-ctx.js +11 -11
- package/.agents/scripts/lib/single-story-sweep/protection.js +1 -9
- package/.agents/scripts/lib/single-story-sweep/sweep-lock.js +1 -5
- package/.agents/scripts/lib/source-extensions.js +30 -15
- package/.agents/scripts/lib/test-run-credit.js +1 -9
- package/.agents/scripts/lib/test-temp.js +22 -21
- package/.agents/scripts/lib/util/ajv.js +111 -0
- package/.agents/scripts/lib/util/atomic-write.js +30 -0
- package/.agents/scripts/lib/util/paths.js +51 -0
- package/.agents/scripts/lib/util/sleep.js +6 -0
- package/.agents/scripts/lib/util/slug.js +12 -0
- package/.agents/scripts/lib/validation-evidence.js +19 -40
- package/.agents/scripts/lib/worktree/lifecycle/force-drain.js +2 -1
- package/.agents/scripts/lib/worktree/lifecycle/pending-cleanup.js +10 -28
- package/.agents/scripts/lib/worktree/lifecycle/reap.js +2 -2
- package/.agents/scripts/lib/worktree/node-modules-strategy.js +21 -14
- package/.agents/scripts/lint-issue-body.js +2 -2
- package/.agents/scripts/plan-context.js +2 -7
- package/.agents/scripts/providers/github/auth.js +3 -3
- package/.agents/scripts/providers/github/errors.js +3 -1
- package/.agents/scripts/providers/github/gh-token-diagnostics.js +10 -7
- package/.agents/scripts/providers/github/issues.js +6 -2
- package/.agents/scripts/providers/github/mappers.js +1 -5
- package/.agents/scripts/providers/github/projects-v2-graphql.js +11 -3
- package/.agents/scripts/providers/github/search-budget.js +3 -1
- package/.agents/scripts/resolve-doc-tiers.js +7 -20
- package/.agents/scripts/sync-agentrc.js +5 -14
- package/.agents/scripts/sync-claude-agents.js +38 -150
- package/.agents/scripts/sync-claude-commands.js +35 -218
- package/.agents/scripts/update-coverage-baseline.js +1 -1
- package/.agents/scripts/update-crap-baseline.js +1 -1
- package/.agents/scripts/update-duplication-baseline.js +2 -16
- package/.agents/scripts/validate-skills.js +6 -10
- package/.agents/skills/core/code-review-and-quality/SKILL.md +3 -18
- package/.agents/skills/core/documentation-and-adrs/SKILL.md +4 -14
- package/.agents/workflows/audit-exceptions.md +9 -0
- package/.agents/workflows/audit-lean.md +129 -0
- package/.agents/workflows/helpers/audit-lens-core.md +7 -0
- package/.agents/workflows/helpers/code-quality-guardrails.md +21 -0
- package/.agents/workflows/helpers/code-review.md +15 -1
- package/.agents/workflows/helpers/deliver-digest.md +1 -1
- package/.agents/workflows/helpers/deliver-reference.md +2 -2
- package/.agents/workflows/mandrel-plan.md +2 -2
- package/docs/CHANGELOG.md +35 -0
- package/lib/cli/doctor-checks/codex.js +6 -5
- package/lib/cli/doctor-checks/llm-review.js +102 -0
- package/lib/cli/doctor-checks/project-access.js +20 -10
- package/lib/cli/doctor-checks/sync-parity.js +65 -140
- package/lib/cli/doctor-checks/test-credit-path.js +69 -28
- package/lib/cli/doctor-checks/toolchain.js +5 -3
- package/lib/cli/registry.js +5 -0
- package/lib/migrations/helpers/retire-agentrc-key.js +3 -3
- package/lib/migrations/index.js +6 -0
- package/lib/migrations/steps/2.91.0-move-shared-crap-capture-script.js +84 -0
- package/lib/migrations/steps/2.91.0-retire-duplication-formats.js +23 -0
- package/lib/migrations/steps/2.91.0-unset-null-lint-command.js +54 -0
- package/package.json +1 -3
|
@@ -15,6 +15,7 @@ import path from 'node:path';
|
|
|
15
15
|
|
|
16
16
|
import { getQuality } from './config/quality.js';
|
|
17
17
|
import { mainCheckoutRoot } from './config/temp-paths.js';
|
|
18
|
+
import { packageScriptArgv } from './detect-package-manager.js';
|
|
18
19
|
import { isFirstInLine, waitInLine } from './full-suite-queue.js';
|
|
19
20
|
import { acquireSweepLock } from './single-story-sweep/sweep-lock.js';
|
|
20
21
|
import {
|
|
@@ -51,9 +52,6 @@ const FALSEY = /^(0|false|off|no)$/i;
|
|
|
51
52
|
|
|
52
53
|
const LOCK_TAG = '[full-suite-lock]';
|
|
53
54
|
|
|
54
|
-
/** The argv coverage capture spawns — its workload identity. */
|
|
55
|
-
const COVERAGE_CAPTURE_ARGV = Object.freeze(['npm', 'run', 'test:coverage']);
|
|
56
|
-
|
|
57
55
|
const LOCK_DEFAULTS = Object.freeze({
|
|
58
56
|
enabled: true,
|
|
59
57
|
log: () => {},
|
|
@@ -299,9 +297,26 @@ export function fullSuiteLockPolicy(config, env = process.env, argv) {
|
|
|
299
297
|
};
|
|
300
298
|
}
|
|
301
299
|
|
|
300
|
+
/**
|
|
301
|
+
* The argv a capture spawns — its workload identity: `<pm> run <script>`,
|
|
302
|
+
* where `script` is the pass's own (an own CRAP source) or the coverage
|
|
303
|
+
* gate's `captureScript`.
|
|
304
|
+
*
|
|
305
|
+
* @param {object} [config]
|
|
306
|
+
* @param {{ cwd?: string, script?: string }} [captureOpts]
|
|
307
|
+
* @returns {string[]}
|
|
308
|
+
*/
|
|
309
|
+
function coverageCaptureArgv(config, { cwd, script } = {}) {
|
|
310
|
+
return packageScriptArgv(
|
|
311
|
+
cwd ?? process.cwd(),
|
|
312
|
+
script ?? getQuality(config).coverage.captureScript,
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
302
316
|
/**
|
|
303
317
|
* Serialize a capture runner's spawn. Wrapped at the one call site below
|
|
304
|
-
* every skip/freshness decision, so a credited capture never waits.
|
|
318
|
+
* every skip/freshness decision, so a credited capture never waits. The
|
|
319
|
+
* admission policy is resolved per spawn, from that spawn's argv.
|
|
305
320
|
*
|
|
306
321
|
* @param {Function} runCaptureFn
|
|
307
322
|
* @param {object} [config]
|
|
@@ -315,14 +330,15 @@ export function lockedCapture(
|
|
|
315
330
|
env = process.env,
|
|
316
331
|
lockOptions = {},
|
|
317
332
|
) {
|
|
318
|
-
const policy = {
|
|
319
|
-
...fullSuiteLockPolicy(config, env, COVERAGE_CAPTURE_ARGV),
|
|
320
|
-
...lockOptions,
|
|
321
|
-
};
|
|
322
333
|
return (captureOpts = {}) =>
|
|
323
334
|
withFullSuiteLockAsync(
|
|
324
335
|
{
|
|
325
|
-
...
|
|
336
|
+
...fullSuiteLockPolicy(
|
|
337
|
+
config,
|
|
338
|
+
env,
|
|
339
|
+
coverageCaptureArgv(config, captureOpts),
|
|
340
|
+
),
|
|
341
|
+
...lockOptions,
|
|
326
342
|
cwd: captureOpts.cwd,
|
|
327
343
|
log: captureOpts.log,
|
|
328
344
|
skipIfSatisfied: freshnessProbe(captureOpts),
|
|
@@ -10,6 +10,7 @@ import fs from 'node:fs';
|
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { readBaselineAtRef as defaultReadAtRef } from '../baseline-loader.js';
|
|
12
12
|
import { Logger } from '../Logger.js';
|
|
13
|
+
import { writeFileAtomic } from '../util/atomic-write.js';
|
|
13
14
|
|
|
14
15
|
export class BaselineNotFoundError extends Error {
|
|
15
16
|
constructor(message, details = {}) {
|
|
@@ -92,18 +93,9 @@ export function writeBaseline({
|
|
|
92
93
|
indent = 2,
|
|
93
94
|
} = {}) {
|
|
94
95
|
const abs = absPath(baselinePath, projectRoot);
|
|
95
|
-
const tmp = `${abs}.tmp`;
|
|
96
96
|
try {
|
|
97
|
-
|
|
98
|
-
fs.mkdirSync(path.dirname(abs), { recursive: true });
|
|
99
|
-
fs.writeFileSync(tmp, serialised, 'utf8');
|
|
100
|
-
fs.renameSync(tmp, abs);
|
|
97
|
+
writeFileAtomic(abs, `${JSON.stringify(data, null, indent)}\n`);
|
|
101
98
|
} catch (err) {
|
|
102
|
-
try {
|
|
103
|
-
fs.rmSync(tmp, { force: true });
|
|
104
|
-
} catch {
|
|
105
|
-
/* best-effort cleanup */
|
|
106
|
-
}
|
|
107
99
|
throw new BaselineWriteError(
|
|
108
100
|
`[baseline-store] failed to write baseline at ${baselinePath}: ${err?.message ?? err}`,
|
|
109
101
|
{ path: abs, cause: err },
|