mandrel 2.65.0 → 2.66.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.
Files changed (56) hide show
  1. package/.agents/agents/acceptance-critic.md +5 -5
  2. package/.agents/agents/auditor.md +17 -18
  3. package/.agents/agents/plan-critic.md +5 -5
  4. package/.agents/agents/story-worker.md +5 -5
  5. package/.agents/docs/execution-reference.md +27 -5
  6. package/.agents/instructions.md +10 -12
  7. package/.agents/rules/ci-remediation.md +3 -3
  8. package/.agents/rules/gherkin-standards.md +3 -2
  9. package/.agents/rules/git-conventions-reference.md +12 -3
  10. package/.agents/rules/git-conventions.md +9 -7
  11. package/.agents/rules/testing-standards.md +8 -7
  12. package/.agents/runtime-deps.json +1 -1
  13. package/.agents/scripts/bootstrap.js +94 -89
  14. package/.agents/scripts/lib/baselines/duplication-scanner.js +17 -7
  15. package/.agents/scripts/lib/bootstrap/project-bootstrap.js +78 -78
  16. package/.agents/scripts/lib/cli/standard-args.js +60 -76
  17. package/.agents/scripts/lib/cli-args.js +26 -0
  18. package/.agents/scripts/lib/config/gates/shared.js +3 -3
  19. package/.agents/scripts/lib/feedback-loop/graduate-steps.js +205 -0
  20. package/.agents/scripts/lib/feedback-loop/graduator-core.js +47 -782
  21. package/.agents/scripts/lib/feedback-loop/graduator-gh.js +449 -0
  22. package/.agents/scripts/lib/observability/close-telemetry.js +330 -0
  23. package/.agents/scripts/lib/observability/runtime-friction.js +2 -0
  24. package/.agents/scripts/lib/observability/signal-validator.js +17 -5
  25. package/.agents/scripts/lib/orchestration/code-review.js +22 -0
  26. package/.agents/scripts/lib/orchestration/plan-metrics.js +76 -63
  27. package/.agents/scripts/lib/orchestration/review-providers/review-provider-factory.js +23 -0
  28. package/.agents/scripts/lib/orchestration/run-epilogue.js +6 -0
  29. package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +2 -0
  30. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +349 -263
  31. package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +21 -7
  32. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-override.js +4 -0
  33. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +327 -314
  34. package/.agents/scripts/lib/orchestration/ticket-validator.js +19 -36
  35. package/.agents/scripts/lib/signals/detectors/common.js +63 -51
  36. package/.agents/scripts/lib/transpile.js +28 -3
  37. package/.agents/scripts/single-story-close.js +10 -2
  38. package/.agents/scripts/single-story-confirm-merge.js +267 -238
  39. package/.agents/skills/core/idea-refinement/SKILL.md +6 -6
  40. package/.agents/skills/stack/qa/qa-harness/SKILL.md +1 -2
  41. package/.agents/workflows/audit-architecture.md +5 -4
  42. package/.agents/workflows/audit-documentation.md +5 -5
  43. package/.agents/workflows/audit-performance.md +10 -10
  44. package/.agents/workflows/helpers/acceptance-self-eval.md +8 -8
  45. package/.agents/workflows/helpers/audit-lens-core.md +30 -57
  46. package/.agents/workflows/helpers/deliver-digest.md +2 -2
  47. package/.agents/workflows/helpers/deliver-reference.md +3 -1
  48. package/.agents/workflows/helpers/deliver-story.md +6 -1
  49. package/.agents/workflows/helpers/parallel-tooling.md +16 -18
  50. package/.agents/workflows/mandrel-deliver.md +1 -1
  51. package/.agents/workflows/mandrel-plan.md +6 -5
  52. package/docs/CHANGELOG.md +26 -0
  53. package/lib/cli/guarded-sync.js +87 -0
  54. package/lib/cli/sync-agents.js +9 -92
  55. package/lib/cli/sync-commands.js +9 -101
  56. package/package.json +2 -2
@@ -1,106 +1,14 @@
1
1
  // lib/cli/sync-commands.js
2
- /**
3
- * `mandrel sync-commands`: delegate to `.agents/scripts/sync-claude-commands.js`
4
- * in a child process (it has top-level await and no exported main), forwarding
5
- * output and exit code.
6
- *
7
- * Refuses first when `.agents/` does not match the running CLI — otherwise
8
- * commands are projected from a stale tree, and since `.claude/*` is
9
- * gitignored nothing surfaces until an agent hits a missing module. With the
10
- * `.agents/.mandrel-version` marker, compare it to the CLI's own version;
11
- * without it, fall back to the `agents-drift` content check.
12
- *
13
- * `PROJECT_ROOT` (the package root) answers only "what version is this CLI";
14
- * the marker is read from `cwd()`. Reading both from `PROJECT_ROOT` would
15
- * compare the package with itself and never fire.
16
- */
2
+ /** `mandrel sync-commands`: project `.agents/workflows/` into `.claude/commands/`. */
17
3
 
18
- import { spawnSync } from 'node:child_process';
19
- import nodeFs from 'node:fs';
20
- import path from 'node:path';
21
- import { fileURLToPath } from 'node:url';
4
+ import { runGuardedSync } from './guarded-sync.js';
22
5
 
23
- import { runAgentsDrift } from './registry.js';
24
- import { readVersionMarker } from './sync.js';
6
+ const SPEC = {
7
+ command: 'sync-commands',
8
+ target: '.claude/commands/',
9
+ script: 'sync-claude-commands.js',
10
+ };
25
11
 
26
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
27
- // lib/cli/ → lib/ → project root
28
- const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
29
- const SYNC_SCRIPT = path.join(
30
- PROJECT_ROOT,
31
- '.agents',
32
- 'scripts',
33
- 'sync-claude-commands.js',
34
- );
35
-
36
- /**
37
- * @param {typeof nodeFs} fsImpl
38
- * @returns {string}
39
- */
40
- function resolveOwnPackageVersion(fsImpl) {
41
- const parsed = JSON.parse(
42
- fsImpl.readFileSync(path.join(PROJECT_ROOT, 'package.json'), 'utf8'),
43
- );
44
- return String(parsed.version);
45
- }
46
-
47
- /**
48
- * @param {string[]} _argv - Unused; reserved for future flags.
49
- * @param {{
50
- * runner?: typeof spawnSync,
51
- * cwd?: () => string,
52
- * fs?: typeof nodeFs,
53
- * ownVersion?: string,
54
- * checkAgentsDrift?: () => { ok: boolean, detail: string },
55
- * writeErr?: (s: string) => void,
56
- * exit?: (code: number) => void,
57
- * }} [opts]
58
- * @returns {void}
59
- */
60
- export default function run(
61
- _argv = [],
62
- {
63
- runner = spawnSync,
64
- cwd = () => process.cwd(),
65
- fs = nodeFs,
66
- ownVersion,
67
- checkAgentsDrift,
68
- writeErr = (s) => process.stderr.write(s),
69
- exit = (code) => process.exit(code),
70
- } = {},
71
- ) {
72
- const projectRoot = cwd();
73
- const resolvedOwnVersion = ownVersion ?? resolveOwnPackageVersion(fs);
74
- const marker = readVersionMarker(projectRoot, fs);
75
-
76
- if (marker) {
77
- if (marker !== resolvedOwnVersion) {
78
- writeErr(
79
- `mandrel sync-commands: the materialized .agents/ tree is v${marker} but the running CLI is v${resolvedOwnVersion} — refusing to project .claude/commands/ from a mismatched tree.\n` +
80
- ' → Run `mandrel sync` to re-materialize .agents/ to the current version, then re-run.\n',
81
- );
82
- exit(1);
83
- return;
84
- }
85
- } else {
86
- const drift = (checkAgentsDrift ?? (() => runAgentsDrift({ cwd })))();
87
- if (!drift.ok) {
88
- writeErr(
89
- `mandrel sync-commands: .agents/ appears to have drifted from the installed package payload (${drift.detail}) — refusing to project .claude/commands/ from a mismatched tree.\n` +
90
- ' → Run `mandrel sync` to restore the materialized .agents/ payload, then re-run.\n',
91
- );
92
- exit(1);
93
- return;
94
- }
95
- }
96
-
97
- const result = runner(process.execPath, [SYNC_SCRIPT], {
98
- stdio: 'inherit',
99
- env: process.env,
100
- });
101
-
102
- const exitCode = result.status ?? 1;
103
- if (exitCode !== 0) {
104
- exit(exitCode);
105
- }
12
+ export default function run(argv, opts) {
13
+ runGuardedSync(SPEC, argv, opts);
106
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandrel",
3
- "version": "2.65.0",
3
+ "version": "2.66.0",
4
4
  "description": "Claude Code-first opinionated workflow framework: instructions, skills, rules, and SDLC workflows that govern AI coding assistants.",
5
5
  "files": [
6
6
  ".agents/",
@@ -127,7 +127,7 @@
127
127
  },
128
128
  "peerDependencies": {
129
129
  "@cucumber/gherkin": ">=32.0.0",
130
- "typescript": ">=5.0.0"
130
+ "typescript": ">=5.0.0 <7"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@cucumber/gherkin": {