@rasensio/aidlc 1.12.0 → 1.13.1

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 (96) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +3 -4
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/add-action.d.ts.map +1 -1
  5. package/dist/commands/add-action.js +2 -1
  6. package/dist/commands/add-action.js.map +1 -1
  7. package/dist/commands/add-skill.d.ts.map +1 -1
  8. package/dist/commands/add-skill.js +2 -1
  9. package/dist/commands/add-skill.js.map +1 -1
  10. package/dist/commands/claim.d.ts.map +1 -1
  11. package/dist/commands/claim.js +3 -2
  12. package/dist/commands/claim.js.map +1 -1
  13. package/dist/commands/continue.d.ts.map +1 -1
  14. package/dist/commands/continue.js +2 -1
  15. package/dist/commands/continue.js.map +1 -1
  16. package/dist/commands/cost.d.ts.map +1 -1
  17. package/dist/commands/cost.js +9 -1
  18. package/dist/commands/cost.js.map +1 -1
  19. package/dist/commands/discover.d.ts.map +1 -1
  20. package/dist/commands/discover.js +8 -0
  21. package/dist/commands/discover.js.map +1 -1
  22. package/dist/commands/docs.d.ts.map +1 -1
  23. package/dist/commands/docs.js +2 -1
  24. package/dist/commands/docs.js.map +1 -1
  25. package/dist/commands/doctor.d.ts.map +1 -1
  26. package/dist/commands/doctor.js +2 -1
  27. package/dist/commands/doctor.js.map +1 -1
  28. package/dist/commands/gate.d.ts.map +1 -1
  29. package/dist/commands/gate.js +2 -1
  30. package/dist/commands/gate.js.map +1 -1
  31. package/dist/commands/init.d.ts.map +1 -1
  32. package/dist/commands/init.js +23 -0
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/commands/knowledge.d.ts.map +1 -1
  35. package/dist/commands/knowledge.js +3 -2
  36. package/dist/commands/knowledge.js.map +1 -1
  37. package/dist/commands/metrics.d.ts.map +1 -1
  38. package/dist/commands/metrics.js +2 -1
  39. package/dist/commands/metrics.js.map +1 -1
  40. package/dist/commands/review.d.ts.map +1 -1
  41. package/dist/commands/review.js +2 -1
  42. package/dist/commands/review.js.map +1 -1
  43. package/dist/commands/start.d.ts.map +1 -1
  44. package/dist/commands/start.js +6 -1
  45. package/dist/commands/start.js.map +1 -1
  46. package/dist/commands/status.d.ts.map +1 -1
  47. package/dist/commands/status.js +2 -1
  48. package/dist/commands/status.js.map +1 -1
  49. package/dist/commands/transition.d.ts.map +1 -1
  50. package/dist/commands/transition.js +2 -1
  51. package/dist/commands/transition.js.map +1 -1
  52. package/dist/commands/update.d.ts.map +1 -1
  53. package/dist/commands/update.js +25 -38
  54. package/dist/commands/update.js.map +1 -1
  55. package/dist/compile/roadmap-skill.d.ts +76 -0
  56. package/dist/compile/roadmap-skill.d.ts.map +1 -0
  57. package/dist/compile/roadmap-skill.js +132 -0
  58. package/dist/compile/roadmap-skill.js.map +1 -0
  59. package/dist/core/index.d.ts +1 -0
  60. package/dist/core/index.d.ts.map +1 -1
  61. package/dist/core/index.js +1 -0
  62. package/dist/core/index.js.map +1 -1
  63. package/dist/core/project-root.d.ts +60 -0
  64. package/dist/core/project-root.d.ts.map +1 -0
  65. package/dist/core/project-root.js +98 -0
  66. package/dist/core/project-root.js.map +1 -0
  67. package/dist/core/version.d.ts +39 -0
  68. package/dist/core/version.d.ts.map +1 -0
  69. package/dist/core/version.js +69 -0
  70. package/dist/core/version.js.map +1 -0
  71. package/dist/doctor/migrations/index.d.ts.map +1 -1
  72. package/dist/doctor/migrations/index.js +7 -0
  73. package/dist/doctor/migrations/index.js.map +1 -1
  74. package/dist/doctor/migrations/roadmap-layout.d.ts +73 -0
  75. package/dist/doctor/migrations/roadmap-layout.d.ts.map +1 -0
  76. package/dist/doctor/migrations/roadmap-layout.js +281 -0
  77. package/dist/doctor/migrations/roadmap-layout.js.map +1 -0
  78. package/dist/doctor/migrations/stale-idea-skill.d.ts +28 -0
  79. package/dist/doctor/migrations/stale-idea-skill.d.ts.map +1 -0
  80. package/dist/doctor/migrations/stale-idea-skill.js +111 -0
  81. package/dist/doctor/migrations/stale-idea-skill.js.map +1 -0
  82. package/dist/events/event-bus.d.ts.map +1 -1
  83. package/dist/events/event-bus.js +39 -1
  84. package/dist/events/event-bus.js.map +1 -1
  85. package/dist/events/shipped-actions.d.ts.map +1 -1
  86. package/dist/events/shipped-actions.js +10 -0
  87. package/dist/events/shipped-actions.js.map +1 -1
  88. package/dist/metrics/report.d.ts +30 -2
  89. package/dist/metrics/report.d.ts.map +1 -1
  90. package/dist/metrics/report.js +18 -2
  91. package/dist/metrics/report.js.map +1 -1
  92. package/dist/roadmap/paths.d.ts +96 -0
  93. package/dist/roadmap/paths.d.ts.map +1 -0
  94. package/dist/roadmap/paths.js +194 -0
  95. package/dist/roadmap/paths.js.map +1 -0
  96. package/package.json +2 -2
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Project-root discovery — the one source of truth for "which `.aidlc/` tree is
3
+ * this?" (cwd-project-root/AC-1 … AC-7).
4
+ *
5
+ * Every command previously read `process.cwd()` and treated it as the project
6
+ * root. Run from a subdirectory that is silently wrong: `cost record` reported
7
+ * success while writing into a freshly-created `.aidlc/state/.aidlc/` tree no
8
+ * report reads, and `status`/`metrics` rendered zeroes as if measured. The
9
+ * failure had no error path because nothing was checking.
10
+ *
11
+ * This lives in `core/` for the reason `tty.ts` records: `commands/`, `doctor/`
12
+ * and `events/` all need it, and `menu/index.ts` imports the command registrars,
13
+ * so siting it anywhere those import from would close a cycle.
14
+ *
15
+ * ## Nearest wins, not primary
16
+ *
17
+ * `roadmap/paths.ts` resolves the **primary checkout** via `git rev-parse
18
+ * --git-common-dir`, deliberately: a backlog written inside a feature worktree is
19
+ * stranded on that branch until it merges. That is the correct rule for the
20
+ * roadmap and the wrong one here. Instance state and cost belong to the worktree
21
+ * that produced them, so this walks to the *nearest enclosing* `.aidlc/`
22
+ * (AC-5, AC-19). The two rules coexist on purpose; neither is a fallback for the
23
+ * other.
24
+ *
25
+ * ## Two commands must not use this
26
+ *
27
+ * `init` and `discover` keep reading `process.cwd()` (AC-16). `init` creates a
28
+ * project — searching upward would make `aidlc init` inside an existing project
29
+ * silently reconfigure the ancestor instead of initializing where the user is
30
+ * standing. `discover` scans a codebase for the same reason. `test/project-root-
31
+ * call-sites.test.ts` names both as expected exemptions, so a *new* unrouted
32
+ * `process.cwd()` fails the suite rather than being found later by a user.
33
+ *
34
+ * @module
35
+ */
36
+ /** The directory whose presence marks a project root. */
37
+ export declare const PROJECT_MARKER = ".aidlc";
38
+ /**
39
+ * The nearest ancestor of `from` (including `from`) containing a `.aidlc/`
40
+ * directory, or `from` itself when there is none.
41
+ *
42
+ * Falling back to `from` keeps behaviour outside a project byte-identical to
43
+ * today (AC-2) — that is what makes this a safe change to route ~20 call sites
44
+ * through at once. A caller that needs to distinguish "found" from "fell back"
45
+ * should use {@link findProjectRoot}.
46
+ *
47
+ * No subprocess and no `git` (AC-6): a project need not be a repository, and
48
+ * spawning `git` once per command to answer a question `statSync` answers would
49
+ * be slower and would fail differently outside a repo.
50
+ */
51
+ export declare function resolveProjectRoot(from?: string): string;
52
+ /**
53
+ * As {@link resolveProjectRoot}, but null when no ancestor holds the marker.
54
+ *
55
+ * Exists for the callers that must *report* rather than assume — a command can
56
+ * say "not in an AIDLC project" instead of inventing a root and then finding it
57
+ * empty, which is the shape of the original defect.
58
+ */
59
+ export declare function findProjectRoot(from?: string): string | null;
60
+ //# sourceMappingURL=project-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-root.d.ts","sourceRoot":"","sources":["../../src/core/project-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,yDAAyD;AACzD,eAAO,MAAM,cAAc,WAAW,CAAC;AAuBvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAsB,GAAG,MAAM,CAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAW3E"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Project-root discovery — the one source of truth for "which `.aidlc/` tree is
3
+ * this?" (cwd-project-root/AC-1 … AC-7).
4
+ *
5
+ * Every command previously read `process.cwd()` and treated it as the project
6
+ * root. Run from a subdirectory that is silently wrong: `cost record` reported
7
+ * success while writing into a freshly-created `.aidlc/state/.aidlc/` tree no
8
+ * report reads, and `status`/`metrics` rendered zeroes as if measured. The
9
+ * failure had no error path because nothing was checking.
10
+ *
11
+ * This lives in `core/` for the reason `tty.ts` records: `commands/`, `doctor/`
12
+ * and `events/` all need it, and `menu/index.ts` imports the command registrars,
13
+ * so siting it anywhere those import from would close a cycle.
14
+ *
15
+ * ## Nearest wins, not primary
16
+ *
17
+ * `roadmap/paths.ts` resolves the **primary checkout** via `git rev-parse
18
+ * --git-common-dir`, deliberately: a backlog written inside a feature worktree is
19
+ * stranded on that branch until it merges. That is the correct rule for the
20
+ * roadmap and the wrong one here. Instance state and cost belong to the worktree
21
+ * that produced them, so this walks to the *nearest enclosing* `.aidlc/`
22
+ * (AC-5, AC-19). The two rules coexist on purpose; neither is a fallback for the
23
+ * other.
24
+ *
25
+ * ## Two commands must not use this
26
+ *
27
+ * `init` and `discover` keep reading `process.cwd()` (AC-16). `init` creates a
28
+ * project — searching upward would make `aidlc init` inside an existing project
29
+ * silently reconfigure the ancestor instead of initializing where the user is
30
+ * standing. `discover` scans a codebase for the same reason. `test/project-root-
31
+ * call-sites.test.ts` names both as expected exemptions, so a *new* unrouted
32
+ * `process.cwd()` fails the suite rather than being found later by a user.
33
+ *
34
+ * @module
35
+ */
36
+ import { statSync } from 'node:fs';
37
+ import { dirname, join, resolve } from 'node:path';
38
+ /** The directory whose presence marks a project root. */
39
+ export const PROJECT_MARKER = '.aidlc';
40
+ /**
41
+ * True when `dir` contains a `.aidlc/` **directory**.
42
+ *
43
+ * The directory check is not incidental (AC-4): a *file* named `.aidlc` is not a
44
+ * project, and treating it as one would resolve a root whose every subsequent
45
+ * `join(root, '.aidlc', …)` fails on a path component that is not a directory —
46
+ * an error far from its cause. `statSync` rather than `existsSync` because
47
+ * `existsSync` cannot tell the two apart.
48
+ *
49
+ * Any error — unreadable ancestor, permission denied, path vanished mid-walk — is
50
+ * "no marker here" rather than a throw (AC-3). A directory we cannot inspect is
51
+ * not a project root we could have used.
52
+ */
53
+ function hasMarker(dir) {
54
+ try {
55
+ return statSync(join(dir, PROJECT_MARKER)).isDirectory();
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
61
+ /**
62
+ * The nearest ancestor of `from` (including `from`) containing a `.aidlc/`
63
+ * directory, or `from` itself when there is none.
64
+ *
65
+ * Falling back to `from` keeps behaviour outside a project byte-identical to
66
+ * today (AC-2) — that is what makes this a safe change to route ~20 call sites
67
+ * through at once. A caller that needs to distinguish "found" from "fell back"
68
+ * should use {@link findProjectRoot}.
69
+ *
70
+ * No subprocess and no `git` (AC-6): a project need not be a repository, and
71
+ * spawning `git` once per command to answer a question `statSync` answers would
72
+ * be slower and would fail differently outside a repo.
73
+ */
74
+ export function resolveProjectRoot(from = process.cwd()) {
75
+ return findProjectRoot(from) ?? resolve(from);
76
+ }
77
+ /**
78
+ * As {@link resolveProjectRoot}, but null when no ancestor holds the marker.
79
+ *
80
+ * Exists for the callers that must *report* rather than assume — a command can
81
+ * say "not in an AIDLC project" instead of inventing a root and then finding it
82
+ * empty, which is the shape of the original defect.
83
+ */
84
+ export function findProjectRoot(from = process.cwd()) {
85
+ let dir = resolve(from);
86
+ // `dirname('/')` is `/`, so compare against the previous value rather than
87
+ // testing for a specific root — this terminates identically on POSIX roots and
88
+ // Windows drive roots (AC-3).
89
+ for (;;) {
90
+ if (hasMarker(dir))
91
+ return dir;
92
+ const parent = dirname(dir);
93
+ if (parent === dir)
94
+ return null;
95
+ dir = parent;
96
+ }
97
+ }
98
+ //# sourceMappingURL=project-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-root.js","sourceRoot":"","sources":["../../src/core/project-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEvC;;;;;;;;;;;;GAYG;AACH,SAAS,SAAS,CAAC,GAAW;IAC5B,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IAC7D,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IAC1D,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,2EAA2E;IAC3E,+EAA+E;IAC/E,8BAA8B;IAC9B,SAAS,CAAC;QACR,IAAI,SAAS,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;QAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The package's own version and name — read once, from one place
3
+ * (roadmap-revamp/AC-18).
4
+ *
5
+ * Two call sites resolved `package.json` independently before this module
6
+ * existed, at *different* relative depths because each computed the path from
7
+ * its own compiled location: `cli.ts` builds to `dist/cli.js` so the package
8
+ * root is `..`, while `commands/update.ts` builds to `dist/commands/update.js`
9
+ * so it is `../..`. Both were correct and neither was copyable. A third reader
10
+ * at a third depth — roadmap-revamp added one — is a third chance to get it
11
+ * wrong, and the failure mode is silent: a bad path throws, the catch returns
12
+ * `0.0.0`, and the CLI reports a version it is not.
13
+ *
14
+ * Resolving here once removes the choice. This module compiles to
15
+ * `dist/core/version.js`, so the package root is `../..`.
16
+ *
17
+ * The values are module constants rather than functions because the manifest
18
+ * cannot change while the process runs, and a constant is what a template
19
+ * emitter can interpolate without threading a call through its signature.
20
+ *
21
+ * Deliberately NOT a literal: `scripts/check-docs-drift.mjs` fails the build on
22
+ * a hardcoded version in `cli.ts` because v1.1.0 shipped reporting `0.1.0`. The
23
+ * same check now covers the roadmap authoring skill's source template
24
+ * (roadmap-revamp/AC-17).
25
+ *
26
+ * @module
27
+ */
28
+ /**
29
+ * Absolute path to this package's root — the directory holding `package.json`.
30
+ *
31
+ * Exported because `commands/update.ts` needs the root itself, not only the
32
+ * two fields read from the manifest inside it.
33
+ */
34
+ export declare function cliPackageRoot(): string;
35
+ /** This package's version, e.g. `1.12.0`. */
36
+ export declare const VERSION: string;
37
+ /** This package's npm name, e.g. `@rasensio/aidlc`. */
38
+ export declare const PACKAGE_NAME: string;
39
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAUH;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAyBD,6CAA6C;AAC7C,eAAO,MAAM,OAAO,EAAE,MAAyB,CAAC;AAEhD,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,MAAsB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The package's own version and name — read once, from one place
3
+ * (roadmap-revamp/AC-18).
4
+ *
5
+ * Two call sites resolved `package.json` independently before this module
6
+ * existed, at *different* relative depths because each computed the path from
7
+ * its own compiled location: `cli.ts` builds to `dist/cli.js` so the package
8
+ * root is `..`, while `commands/update.ts` builds to `dist/commands/update.js`
9
+ * so it is `../..`. Both were correct and neither was copyable. A third reader
10
+ * at a third depth — roadmap-revamp added one — is a third chance to get it
11
+ * wrong, and the failure mode is silent: a bad path throws, the catch returns
12
+ * `0.0.0`, and the CLI reports a version it is not.
13
+ *
14
+ * Resolving here once removes the choice. This module compiles to
15
+ * `dist/core/version.js`, so the package root is `../..`.
16
+ *
17
+ * The values are module constants rather than functions because the manifest
18
+ * cannot change while the process runs, and a constant is what a template
19
+ * emitter can interpolate without threading a call through its signature.
20
+ *
21
+ * Deliberately NOT a literal: `scripts/check-docs-drift.mjs` fails the build on
22
+ * a hardcoded version in `cli.ts` because v1.1.0 shipped reporting `0.1.0`. The
23
+ * same check now covers the roadmap authoring skill's source template
24
+ * (roadmap-revamp/AC-17).
25
+ *
26
+ * @module
27
+ */
28
+ import { readFileSync } from 'node:fs';
29
+ import { dirname, join } from 'node:path';
30
+ import { fileURLToPath } from 'node:url';
31
+ /** Fallbacks match the ones the previous private readers used. */
32
+ const FALLBACK_VERSION = '0.0.0';
33
+ const FALLBACK_NAME = '@rasensio/aidlc';
34
+ /**
35
+ * Absolute path to this package's root — the directory holding `package.json`.
36
+ *
37
+ * Exported because `commands/update.ts` needs the root itself, not only the
38
+ * two fields read from the manifest inside it.
39
+ */
40
+ export function cliPackageRoot() {
41
+ return join(dirname(fileURLToPath(import.meta.url)), '..', '..');
42
+ }
43
+ /**
44
+ * Read the manifest once at module load.
45
+ *
46
+ * A throw here is not fatal: an unreadable manifest means a broken install, and
47
+ * every previous reader degraded to a placeholder rather than refusing to run.
48
+ * That behaviour is preserved so this refactor cannot change what a damaged
49
+ * install does.
50
+ */
51
+ function readManifest() {
52
+ try {
53
+ const raw = readFileSync(join(cliPackageRoot(), 'package.json'), 'utf8');
54
+ const parsed = JSON.parse(raw);
55
+ return {
56
+ version: typeof parsed.version === 'string' ? parsed.version : FALLBACK_VERSION,
57
+ name: typeof parsed.name === 'string' ? parsed.name : FALLBACK_NAME,
58
+ };
59
+ }
60
+ catch {
61
+ return { version: FALLBACK_VERSION, name: FALLBACK_NAME };
62
+ }
63
+ }
64
+ const manifest = readManifest();
65
+ /** This package's version, e.g. `1.12.0`. */
66
+ export const VERSION = manifest.version;
67
+ /** This package's npm name, e.g. `@rasensio/aidlc`. */
68
+ export const PACKAGE_NAME = manifest.name;
69
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA0C,CAAC;QACxE,OAAO;YACL,OAAO,EAAE,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB;YAC/E,IAAI,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa;SACpE,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;AAEhC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAW,QAAQ,CAAC,OAAO,CAAC;AAEhD,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAW,QAAQ,CAAC,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAe7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAiBjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiB7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAsBjC,CAAC"}
@@ -18,12 +18,19 @@ import { unknownAgentClaims } from './unknown-agent-claims.js';
18
18
  import { legacyCostHooks } from './legacy-cost-hooks.js';
19
19
  import { missingCostShim } from './missing-cost-shim.js';
20
20
  import { installGuidance } from './install-guidance.js';
21
+ import { staleIdeaSkill } from './stale-idea-skill.js';
22
+ import { roadmapLayout } from './roadmap-layout.js';
21
23
  export const MIGRATIONS = [
22
24
  costGitignore,
23
25
  knowledgeGitignore,
24
26
  gitattributes,
25
27
  shippedActions,
26
28
  installGuidance,
29
+ // Ordered before roadmap-layout: the orphaned skill still describes the old
30
+ // ideas directory, so clearing it first means a single run never leaves an
31
+ // instruction on disk that contradicts the layout the next migration creates.
32
+ staleIdeaSkill,
33
+ roadmapLayout,
27
34
  untrackCostEphemera,
28
35
  pruneSessionStash,
29
36
  pruneCostLocks,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,6EAA6E;IAC7E,6EAA6E;IAC7E,4EAA4E;IAC5E,eAAe;IACf,eAAe;CAChB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,eAAe;IACf,4EAA4E;IAC5E,2EAA2E;IAC3E,8EAA8E;IAC9E,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,6EAA6E;IAC7E,6EAA6E;IAC7E,4EAA4E;IAC5E,eAAe;IACf,eAAe;CAChB,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * roadmap-layout migration (roadmap-revamp/AC-23..AC-27, AC-38, confirm tier):
3
+ * move a legacy `.aidlc/ideas/` backlog into `.aidlc/roadmap/<status>/` and
4
+ * rewrite each item's frontmatter to the new schema.
5
+ *
6
+ * This is the first migration in this project that moves the *user's own*
7
+ * content rather than regenerating a framework artifact, which is why it is
8
+ * confirm tier and why every move goes through `git mv` when the file is
9
+ * tracked: a mistake stays one `git checkout` away from undone.
10
+ *
11
+ * `check` and `apply` both derive everything from `planRoadmapMoves` and nothing
12
+ * else computes pending-ness — the rule stated in `../types.ts`, so a dry run and
13
+ * a real run cannot disagree about what will happen.
14
+ *
15
+ * Old status maps to new directory: `raw` → `inbox`, `dropped` → `hold`,
16
+ * `promoted` → `done` or `in-progress` depending on whether the named instance
17
+ * actually finished. Raw items land in `inbox` rather than `backlog` because the
18
+ * old format has no field recording whether anything was ever triaged, and
19
+ * mapping to `backlog` would manufacture that signal (DD-8).
20
+ *
21
+ * Whether an instance finished is answered by `completionInfo` from the metrics
22
+ * module, not by a local "is the last phase complete?" test — that naive form is
23
+ * wrong for maintenance-terminal templates, which complete on maintenance entry.
24
+ */
25
+ import type { Migration } from '../types.js';
26
+ import type { DoctorContext } from '../types.js';
27
+ import { type RoadmapStatus } from '../../roadmap/paths.js';
28
+ /** One planned relocation, with everything `apply` needs to carry it out. */
29
+ export interface RoadmapMove {
30
+ /** Absolute source path. */
31
+ from: string;
32
+ /** Absolute target path. */
33
+ to: string;
34
+ /** Repo-relative source, for the printed command list. */
35
+ fromRel: string;
36
+ /** Repo-relative target, for the printed command list. */
37
+ toRel: string;
38
+ status: RoadmapStatus;
39
+ /** Rewritten file contents. */
40
+ contents: string;
41
+ /** Tracked by git, so the move can preserve history. */
42
+ tracked: boolean;
43
+ }
44
+ export interface RoadmapPlan {
45
+ moves: RoadmapMove[];
46
+ /** Repo-relative paths the planner could not classify; left in place. */
47
+ unclassified: string[];
48
+ }
49
+ /**
50
+ * Rewrite a legacy idea's frontmatter to the roadmap schema.
51
+ *
52
+ * Key order is fixed by AC-4, so the block is rebuilt rather than edited: the
53
+ * legacy shape shares only `promoted_to` and `depends_on` with the new one.
54
+ * The body below the frontmatter is copied through untouched apart from being
55
+ * read for its title.
56
+ *
57
+ * `author` is deliberately omitted rather than guessed. The legacy format never
58
+ * recorded one, and `created_by` from an unrelated instance is not the author of
59
+ * an idea.
60
+ */
61
+ export declare function rewriteFrontmatter(raw: string, filename: string, status: RoadmapStatus): {
62
+ contents: string;
63
+ id: string;
64
+ } | null;
65
+ /**
66
+ * Everything the migration would do, computed without writing.
67
+ *
68
+ * The single source of pending-ness. Sorted by source path so the plan never
69
+ * depends on directory read order.
70
+ */
71
+ export declare function planRoadmapMoves(ctx: DoctorContext): RoadmapPlan;
72
+ export declare const roadmapLayout: Migration;
73
+ //# sourceMappingURL=roadmap-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roadmap-layout.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/roadmap-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAEhC,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,yEAAyE;IACzE,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAsBD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,GACpB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA8CzC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,CAmEhE;AASD,eAAO,MAAM,aAAa,EAAE,SA8G3B,CAAC"}