mandrel 2.119.0 → 2.121.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 (47) hide show
  1. package/.agents/agents/acceptance-critic.md +4 -0
  2. package/.agents/agents/story-worker.md +1 -1
  3. package/.agents/docs/agentrc-reference.json +1 -0
  4. package/.agents/docs/configuration.md +18 -3
  5. package/.agents/schemas/acceptance-eval-verdict.schema.json +6 -1
  6. package/.agents/schemas/agentrc.schema.json +11 -2
  7. package/.agents/schemas/lifecycle/merge.unlanded.schema.json +2 -1
  8. package/.agents/schemas/story-deliver-terminal.schema.json +1 -0
  9. package/.agents/scripts/acceptance-eval.js +125 -13
  10. package/.agents/scripts/evidence-gate.js +15 -2
  11. package/.agents/scripts/lib/baselines/crap-preview-scan.js +1 -0
  12. package/.agents/scripts/lib/baselines/git-base.js +43 -0
  13. package/.agents/scripts/lib/baselines/kinds/_crap-new-method-gate.js +29 -5
  14. package/.agents/scripts/lib/baselines/kinds/crap.js +7 -1
  15. package/.agents/scripts/lib/baselines/kinds/kind-factory.js +81 -52
  16. package/.agents/scripts/lib/close-validation/projections/advisories.js +1 -0
  17. package/.agents/scripts/lib/close-validation/projections/crap.js +3 -0
  18. package/.agents/scripts/lib/config/gates/coverage.schema.js +1 -1
  19. package/.agents/scripts/lib/config/gates/crap.schema.js +7 -0
  20. package/.agents/scripts/lib/config/quality.js +13 -6
  21. package/.agents/scripts/lib/config-settings-schema.js +1 -1
  22. package/.agents/scripts/lib/generated/agentrc-validator.js +2 -2
  23. package/.agents/scripts/lib/observability/handoff-telemetry.js +1 -0
  24. package/.agents/scripts/lib/orchestrate/inventory.js +15 -0
  25. package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +65 -6
  26. package/.agents/scripts/lib/orchestration/check-baselines/phases/compare.js +34 -2
  27. package/.agents/scripts/lib/orchestration/check-baselines/phases/fail-detail.js +7 -2
  28. package/.agents/scripts/lib/orchestration/handoff-changed-tests.js +67 -0
  29. package/.agents/scripts/lib/orchestration/handoff-gates.js +2 -0
  30. package/.agents/scripts/lib/orchestration/handoff-suite-of-record.js +25 -10
  31. package/.agents/scripts/lib/orchestration/merge-block-class.js +1 -0
  32. package/.agents/scripts/lib/orchestration/merge-queue.js +155 -14
  33. package/.agents/scripts/lib/orchestration/preflight-lanes.js +2 -0
  34. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +131 -18
  35. package/.agents/scripts/lib/orchestration/story-handoff.js +24 -1
  36. package/.agents/scripts/lib/orchestration/ticket-validator.js +35 -0
  37. package/.agents/scripts/lib/orchestration/verify-credit.js +144 -0
  38. package/.agents/scripts/lib/validation-evidence.js +27 -0
  39. package/.agents/workflows/helpers/acceptance-self-eval.md +9 -1
  40. package/.agents/workflows/helpers/deliver-digest.md +7 -8
  41. package/.agents/workflows/helpers/deliver-reference.md +17 -0
  42. package/.agents/workflows/helpers/deliver-story-reference.md +1 -1
  43. package/.agents/workflows/helpers/plan-reference.md +3 -1
  44. package/docs/CHANGELOG.md +23 -0
  45. package/lib/cli/doctor-checks/suite-ownership.js +42 -0
  46. package/lib/cli/registry.js +6 -10
  47. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ // lib/cli/doctor-checks/suite-ownership.js — Doctor check: suite-ownership.
2
+
3
+ import fs from 'node:fs';
4
+ import { readEffectiveAgentrc } from './effective-agentrc.js';
5
+
6
+ const KEY = 'delivery.quality.gates.coverage';
7
+
8
+ const isSet = (value) => typeof value === 'string' && value.trim().length > 0;
9
+
10
+ /**
11
+ * Advisory: who runs the suite before a PR. Reports a suite owned by both the
12
+ * handoff and CI (`ciRatchetCheck` set, posture local), and a `ci` posture
13
+ * with no `project.commands.testChanged` guard. Never fails.
14
+ *
15
+ * @param {{ projectRoot?: string, cwd?: () => string, fsImpl?: { readFileSync: Function, existsSync: Function } }} [opts]
16
+ * @returns {Promise<{ ok: true, detail: string }>}
17
+ */
18
+ export async function runSuiteOwnership({
19
+ projectRoot,
20
+ cwd,
21
+ fsImpl = fs,
22
+ } = {}) {
23
+ const root = projectRoot ?? (cwd ?? (() => process.cwd()))();
24
+ const agentrc = readEffectiveAgentrc(root, fsImpl);
25
+ const gate = agentrc?.delivery?.quality?.gates?.coverage ?? {};
26
+ const guard = agentrc?.project?.commands?.testChanged;
27
+ if (gate.suiteOfRecord === 'ci') {
28
+ return {
29
+ ok: true,
30
+ detail: isSet(guard)
31
+ ? `CI owns the suite; the handoff runs \`${guard.trim()}\` (project.commands.testChanged) as a changed-tests guard`
32
+ : 'CI owns the suite and no test runs before the PR — set project.commands.testChanged to run a changed-tests guard at the handoff',
33
+ };
34
+ }
35
+ if (isSet(gate.ciRatchetCheck)) {
36
+ return {
37
+ ok: true,
38
+ detail: `the suite is owned by both the handoff and CI ("${gate.ciRatchetCheck}") — set ${KEY}.suiteOfRecord: "ci" to make CI its owner, plus project.commands.testChanged for a changed-tests guard`,
39
+ };
40
+ }
41
+ return { ok: true, detail: 'the handoff owns the suite' };
42
+ }
@@ -27,6 +27,7 @@ import {
27
27
  runRuntimeDeps,
28
28
  } from './doctor-checks/runtime-deps.js';
29
29
  import { spawn } from './doctor-checks/spawn.js';
30
+ import { runSuiteOwnership } from './doctor-checks/suite-ownership.js';
30
31
  import {
31
32
  runAgentsInSync,
32
33
  runCommandsInSync,
@@ -53,6 +54,8 @@ export {
53
54
  };
54
55
 
55
56
  /** `advisory: true` marks a check whose `run()` never fails. */
57
+ const advisory = (name, run) => ({ name, advisory: true, run });
58
+
56
59
  export const registry = [
57
60
  {
58
61
  name: 'node-version',
@@ -129,20 +132,13 @@ export const registry = [
129
132
  name: 'pin-current',
130
133
  run: (opts) => runPinCurrent(opts),
131
134
  },
132
- {
133
- name: 'version-current',
134
- advisory: true,
135
- run: (opts) => runVersionCurrent(opts),
136
- },
137
- {
138
- name: 'test-credit-path',
139
- advisory: true,
140
- run: (opts) => runTestCreditPath(opts),
141
- },
135
+ advisory('version-current', (opts) => runVersionCurrent(opts)),
136
+ advisory('test-credit-path', (opts) => runTestCreditPath(opts)),
142
137
  {
143
138
  name: 'coverage-ratchet',
144
139
  run: (opts) => runCoverageRatchet(opts),
145
140
  },
141
+ advisory('suite-ownership', (opts) => runSuiteOwnership(opts)),
146
142
  ];
147
143
 
148
144
  export default registry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandrel",
3
- "version": "2.119.0",
3
+ "version": "2.121.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/",