mandrel 2.35.0 → 2.37.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/docs/agentrc-reference.json +3 -1
- package/.agents/docs/configuration.md +27 -0
- package/.agents/rules/testing-standards.md +56 -0
- package/.agents/schemas/agentrc.schema.json +11 -0
- package/.agents/schemas/lifecycle/merge.unlanded.schema.json +2 -1
- package/.agents/schemas/story-deliver-terminal.schema.json +1 -0
- package/.agents/scripts/boot-sweep.js +7 -1
- package/.agents/scripts/check-context-budget.js +195 -103
- package/.agents/scripts/check-cyclomatic.js +112 -42
- package/.agents/scripts/check-doc-links.js +23 -2
- package/.agents/scripts/check-generated-validator.js +202 -0
- package/.agents/scripts/check-lifecycle-lint.js +2 -68
- package/.agents/scripts/check-schema-references.js +2 -28
- package/.agents/scripts/drain-pending-cleanup.js +18 -1
- package/.agents/scripts/git-cleanup.js +2 -0
- package/.agents/scripts/lib/baselines/components.js +32 -2
- package/.agents/scripts/lib/baselines/env-overrides.js +1 -1
- package/.agents/scripts/lib/bootstrap/branch-protection.js +1 -1
- package/.agents/scripts/lib/bootstrap/install-ledger.js +1 -1
- package/.agents/scripts/lib/bootstrap/prompt.js +1 -1
- package/.agents/scripts/lib/bootstrap/quality-bootstrap.js +2 -2
- package/.agents/scripts/lib/checks/loop-health.js +1 -1
- package/.agents/scripts/lib/cli-args.js +0 -2
- package/.agents/scripts/lib/close-validation/gates.js +1 -1
- package/.agents/scripts/lib/close-validation/process.js +1 -1
- package/.agents/scripts/lib/config/ci.js +18 -0
- package/.agents/scripts/lib/config/sync-agentrc.js +1 -1
- package/.agents/scripts/lib/config-settings-schema-delivery.js +13 -0
- package/.agents/scripts/lib/config-settings-schema.js +46 -6
- package/.agents/scripts/lib/coverage-baseline.js +2 -2
- package/.agents/scripts/lib/cpu-pool.js +90 -10
- package/.agents/scripts/lib/crap-utils.js +6 -2
- package/.agents/scripts/lib/cyclomatic-ceiling.js +28 -6
- package/.agents/scripts/lib/cyclomatic-scope.js +144 -0
- package/.agents/scripts/lib/dependency-version.js +86 -0
- package/.agents/scripts/lib/duplicate-search.js +1 -1
- package/.agents/scripts/lib/errors/index.js +1 -1
- package/.agents/scripts/lib/feedback-loop/graduator-core.js +2 -2
- package/.agents/scripts/lib/feedback-loop/prior-feedback-fetcher.js +1 -1
- package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +1 -1
- package/.agents/scripts/lib/generated/agentrc-validator.js +16 -0
- package/.agents/scripts/lib/install-cmd-parser.js +1 -1
- package/.agents/scripts/lib/knip-entry-sync.js +1 -57
- package/.agents/scripts/lib/maintainability-utils.js +108 -10
- package/.agents/scripts/lib/observability/source-classifier.js +1 -1
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/branches.js +22 -7
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/git-probes.js +22 -14
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/merged-tip.js +132 -0
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/render.js +56 -11
- package/.agents/scripts/lib/orchestration/merge-block-class.js +10 -1
- package/.agents/scripts/lib/orchestration/merge-poll.js +164 -0
- package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +70 -9
- package/.agents/scripts/lib/orchestration/pr-watch.js +1 -30
- package/.agents/scripts/lib/orchestration/reassert-status-column.js +2 -2
- package/.agents/scripts/lib/orchestration/review-providers/codex.js +3 -3
- package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +1 -1
- package/.agents/scripts/lib/orchestration/review-providers/native.js +9 -2
- package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +2 -2
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +3 -3
- package/.agents/scripts/lib/orchestration/single-story-close/phases/auto-merge.js +145 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +96 -5
- package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +52 -1
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +9 -1
- package/.agents/scripts/lib/orchestration/story-close/format-autofix.js +2 -5
- package/.agents/scripts/lib/orchestration/story-follow-ups.js +1 -1
- package/.agents/scripts/lib/orchestration/ticket-lease.js +34 -9
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +3 -1
- package/.agents/scripts/lib/preflight-runner.js +3 -3
- package/.agents/scripts/lib/qa/qa-session.js +1 -1
- package/.agents/scripts/lib/runtime-deps/manifest.js +1 -7
- package/.agents/scripts/lib/runtime-deps/scan-imports.js +3 -58
- package/.agents/scripts/lib/single-story-sweep/sweep-lock.js +284 -25
- package/.agents/scripts/lib/skills/walk-skill-files.js +1 -1
- package/.agents/scripts/lib/source-text/strip-js-comments.js +115 -0
- package/.agents/scripts/lib/test-isolate/runner.js +3 -3
- package/.agents/scripts/lib/test-runner-contract.js +14 -6
- package/.agents/scripts/lib/test-tiers.js +135 -18
- package/.agents/scripts/lib/transpile.js +16 -3
- package/.agents/scripts/lib/worktree/lifecycle/pending-cleanup.js +169 -31
- package/.agents/scripts/lib/worktree/node-modules-strategy.js +2 -5
- package/.agents/scripts/notify.js +4 -10
- package/.agents/scripts/pr-watch-with-update.js +305 -137
- package/.agents/scripts/providers/github/tickets.js +109 -16
- package/.agents/scripts/quality-preview.js +162 -70
- package/.agents/scripts/run-test-profile.js +8 -5
- package/.agents/scripts/run-tests.js +79 -14
- package/.agents/scripts/single-story-close.js +0 -2
- package/.agents/scripts/single-story-init.js +5 -1
- package/.agents/workflows/audit-documentation.md +5 -6
- package/docs/CHANGELOG.md +50 -0
- package/lib/cli/migrate.js +100 -94
- package/lib/migrations/helpers/retire-agentrc-key.js +200 -0
- package/lib/migrations/index.js +32 -33
- package/lib/migrations/steps/2.1.0-retire-mi-drop-knobs.js +21 -80
- package/lib/migrations/steps/2.1.0-retire-verify-concurrency-cap.js +15 -87
- package/lib/migrations/steps/2.11.0-retire-max-seed-words.js +13 -71
- package/lib/migrations/steps/2.20.0-retire-codebase-snapshot.js +13 -101
- package/lib/migrations/steps/2.32.0-retire-lint-baseline-command.js +13 -100
- package/package.json +9 -5
- package/.agents/scripts/generate-lifecycle-docs.js +0 -237
- package/.agents/scripts/lib/audit-suite/frontmatter-lint.js +0 -32
- package/.agents/scripts/lib/baselines/maintainability-baseline-save.js +0 -37
- package/.agents/scripts/lib/cli/parse-numeric.js +0 -60
- package/.agents/scripts/lib/close-validation/telemetry.js +0 -79
- package/.agents/scripts/lib/orchestration/label-transitions.js +0 -44
- package/.agents/scripts/lib/orchestration/parked-follow-ons.js +0 -147
- package/.agents/scripts/lib/orchestration/phase-runner.js +0 -88
- package/.agents/scripts/lib/orchestration/recut.js +0 -56
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* phase-runner.js — Lightweight wrappers for "named phase" error handling.
|
|
3
|
-
*
|
|
4
|
-
* Many orchestration entry points (`single-story-init.js`,
|
|
5
|
-
* `single-story-close.js`, and other phase modules) repeat the same
|
|
6
|
-
* `try { ... } catch (err) {
|
|
7
|
-
* logger.error('[phase=foo] ' + err.message); ... }` block. These two
|
|
8
|
-
* helpers consolidate that pattern.
|
|
9
|
-
*
|
|
10
|
-
* - `runPhase(name, fn, opts)`: Run `fn()`. On error, log with a
|
|
11
|
-
* `[phase=<name>]` prefix. If `fatal: true`, rethrow; otherwise
|
|
12
|
-
* return `opts.fallback` (default `undefined`) so the caller can
|
|
13
|
-
* continue.
|
|
14
|
-
*
|
|
15
|
-
* - `runSafely(fn, opts)`: Run `fn()` and swallow any error after
|
|
16
|
-
* logging it. Convenience for unnamed best-effort cleanup steps.
|
|
17
|
-
*
|
|
18
|
-
* Both helpers handle sync and async `fn`s — the return value is always
|
|
19
|
-
* a Promise that resolves to the function's value (or `fallback`).
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { NOOP_LOGGER } from '../Logger.js';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @typedef {object} PhaseLogger
|
|
26
|
-
* @property {(msg: string) => void} [error]
|
|
27
|
-
* @property {(msg: string) => void} [warn]
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
function pickLogger(logger) {
|
|
31
|
-
if (!logger) return NOOP_LOGGER;
|
|
32
|
-
return {
|
|
33
|
-
error:
|
|
34
|
-
typeof logger.error === 'function'
|
|
35
|
-
? logger.error.bind(logger)
|
|
36
|
-
: NOOP_LOGGER.error,
|
|
37
|
-
warn:
|
|
38
|
-
typeof logger.warn === 'function'
|
|
39
|
-
? logger.warn.bind(logger)
|
|
40
|
-
: NOOP_LOGGER.warn,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Run `fn` under a named phase. On error:
|
|
46
|
-
* - logs `[phase=<name>] <message>` via `logger.error`
|
|
47
|
-
* - if `fatal` is true, rethrows the original error
|
|
48
|
-
* - otherwise returns `fallback`
|
|
49
|
-
*
|
|
50
|
-
* @template T
|
|
51
|
-
* @param {string} name - Phase name (used in the log prefix).
|
|
52
|
-
* @param {() => (T | Promise<T>)} fn
|
|
53
|
-
* @param {{ logger?: PhaseLogger, fallback?: T, fatal?: boolean }} [opts]
|
|
54
|
-
* @returns {Promise<T | undefined>}
|
|
55
|
-
*/
|
|
56
|
-
export async function runPhase(name, fn, opts = {}) {
|
|
57
|
-
const logger = pickLogger(opts.logger);
|
|
58
|
-
const fatal = opts.fatal === true;
|
|
59
|
-
try {
|
|
60
|
-
return await fn();
|
|
61
|
-
} catch (err) {
|
|
62
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
63
|
-
logger.error(`[phase=${name}] ${message}`);
|
|
64
|
-
if (fatal) throw err;
|
|
65
|
-
return opts.fallback;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Run `fn` and swallow errors after logging. Equivalent to
|
|
71
|
-
* `runPhase('safe', fn, { logger, fatal: false })` but without requiring
|
|
72
|
-
* the caller to invent a phase name.
|
|
73
|
-
*
|
|
74
|
-
* @template T
|
|
75
|
-
* @param {() => (T | Promise<T>)} fn
|
|
76
|
-
* @param {{ logger?: PhaseLogger }} [opts]
|
|
77
|
-
* @returns {Promise<T | undefined>}
|
|
78
|
-
*/
|
|
79
|
-
export async function runSafely(fn, opts = {}) {
|
|
80
|
-
const logger = pickLogger(opts.logger);
|
|
81
|
-
try {
|
|
82
|
-
return await fn();
|
|
83
|
-
} catch (err) {
|
|
84
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
85
|
-
logger.warn(`[phase=safe] ${message}`);
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recut markers track when a Story is carved off mid-sprint from another
|
|
3
|
-
* Story that is already in the dispatch manifest. The marker is an HTML
|
|
4
|
-
* comment embedded in the new Story's body:
|
|
5
|
-
*
|
|
6
|
-
* <!-- recut-of: #641 -->
|
|
7
|
-
*
|
|
8
|
-
* Downstream consumers (the wave-completeness gate, the sprint retro)
|
|
9
|
-
* read the marker to attribute the new Story back to its ancestor so
|
|
10
|
-
* counts line up with the frozen manifest.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const MARKER_RE = /<!--\s*recut-of:\s*#?(\d+)\s*-->/i;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Parse a recut marker out of a Story body.
|
|
17
|
-
*
|
|
18
|
-
* @param {string | null | undefined} body
|
|
19
|
-
* @returns {{ parentStoryId: number, raw: string } | null}
|
|
20
|
-
*/
|
|
21
|
-
export function parseRecutMarker(body) {
|
|
22
|
-
if (typeof body !== 'string') return null;
|
|
23
|
-
const match = body.match(MARKER_RE);
|
|
24
|
-
if (!match) return null;
|
|
25
|
-
return { parentStoryId: Number.parseInt(match[1], 10), raw: match[0] };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Format a recut marker for a given parent Story ID.
|
|
30
|
-
*
|
|
31
|
-
* @param {number} parentStoryId
|
|
32
|
-
* @returns {string}
|
|
33
|
-
*/
|
|
34
|
-
export function formatRecutMarker(parentStoryId) {
|
|
35
|
-
return `<!-- recut-of: #${parentStoryId} -->`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Return a body with the recut marker present. Replaces any existing
|
|
40
|
-
* marker so the parent reference is always up to date; appends a fresh
|
|
41
|
-
* marker when none is present.
|
|
42
|
-
*
|
|
43
|
-
* @param {string | null | undefined} body
|
|
44
|
-
* @param {number} parentStoryId
|
|
45
|
-
* @returns {string}
|
|
46
|
-
*/
|
|
47
|
-
export function injectRecutMarker(body, parentStoryId) {
|
|
48
|
-
const marker = formatRecutMarker(parentStoryId);
|
|
49
|
-
const existing = parseRecutMarker(body);
|
|
50
|
-
if (existing) {
|
|
51
|
-
if (existing.parentStoryId === parentStoryId) return body ?? '';
|
|
52
|
-
return (body ?? '').replace(MARKER_RE, marker);
|
|
53
|
-
}
|
|
54
|
-
const trimmed = (body ?? '').replace(/\s+$/, '');
|
|
55
|
-
return trimmed.length > 0 ? `${trimmed}\n\n${marker}\n` : `${marker}\n`;
|
|
56
|
-
}
|