@rasensio/aidlc 1.7.0 → 1.8.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 (116) hide show
  1. package/dist/cli.js +5 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/cost.d.ts +2 -0
  4. package/dist/commands/cost.d.ts.map +1 -1
  5. package/dist/commands/cost.js +16 -1
  6. package/dist/commands/cost.js.map +1 -1
  7. package/dist/commands/doctor.d.ts +27 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +97 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/status.js +5 -9
  12. package/dist/commands/status.js.map +1 -1
  13. package/dist/commands/update.d.ts.map +1 -1
  14. package/dist/commands/update.js +11 -29
  15. package/dist/commands/update.js.map +1 -1
  16. package/dist/concurrency/claim-store.d.ts +10 -0
  17. package/dist/concurrency/claim-store.d.ts.map +1 -1
  18. package/dist/concurrency/claim-store.js +30 -0
  19. package/dist/concurrency/claim-store.js.map +1 -1
  20. package/dist/concurrency/gitattributes.d.ts +6 -0
  21. package/dist/concurrency/gitattributes.d.ts.map +1 -1
  22. package/dist/concurrency/gitattributes.js +13 -4
  23. package/dist/concurrency/gitattributes.js.map +1 -1
  24. package/dist/concurrency/registry.d.ts +4 -1
  25. package/dist/concurrency/registry.d.ts.map +1 -1
  26. package/dist/concurrency/registry.js +14 -6
  27. package/dist/concurrency/registry.js.map +1 -1
  28. package/dist/cost/providers/claude-code.d.ts +2 -0
  29. package/dist/cost/providers/claude-code.d.ts.map +1 -1
  30. package/dist/cost/providers/claude-code.js +34 -12
  31. package/dist/cost/providers/claude-code.js.map +1 -1
  32. package/dist/cost/providers/kiro.d.ts.map +1 -1
  33. package/dist/cost/providers/kiro.js +23 -10
  34. package/dist/cost/providers/kiro.js.map +1 -1
  35. package/dist/cost/providers/provider.d.ts +9 -4
  36. package/dist/cost/providers/provider.d.ts.map +1 -1
  37. package/dist/cost/providers/provider.js.map +1 -1
  38. package/dist/cost/recorder.d.ts +35 -3
  39. package/dist/cost/recorder.d.ts.map +1 -1
  40. package/dist/cost/recorder.js +157 -11
  41. package/dist/cost/recorder.js.map +1 -1
  42. package/dist/cost/sessions.d.ts +10 -2
  43. package/dist/cost/sessions.d.ts.map +1 -1
  44. package/dist/cost/sessions.js +26 -4
  45. package/dist/cost/sessions.js.map +1 -1
  46. package/dist/cost/sync.js +2 -2
  47. package/dist/cost/sync.js.map +1 -1
  48. package/dist/cost/types.d.ts +20 -0
  49. package/dist/cost/types.d.ts.map +1 -1
  50. package/dist/cost/types.js +2 -0
  51. package/dist/cost/types.js.map +1 -1
  52. package/dist/doctor/context.d.ts +7 -0
  53. package/dist/doctor/context.d.ts.map +1 -0
  54. package/dist/doctor/context.js +16 -0
  55. package/dist/doctor/context.js.map +1 -0
  56. package/dist/doctor/git.d.ts +17 -0
  57. package/dist/doctor/git.d.ts.map +1 -0
  58. package/dist/doctor/git.js +43 -0
  59. package/dist/doctor/git.js.map +1 -0
  60. package/dist/doctor/migrations/cost-gitignore.d.ts +11 -0
  61. package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -0
  62. package/dist/doctor/migrations/cost-gitignore.js +38 -0
  63. package/dist/doctor/migrations/cost-gitignore.js.map +1 -0
  64. package/dist/doctor/migrations/gitattributes.d.ts +8 -0
  65. package/dist/doctor/migrations/gitattributes.d.ts.map +1 -0
  66. package/dist/doctor/migrations/gitattributes.js +31 -0
  67. package/dist/doctor/migrations/gitattributes.js.map +1 -0
  68. package/dist/doctor/migrations/index.d.ts +10 -0
  69. package/dist/doctor/migrations/index.d.ts.map +1 -0
  70. package/dist/doctor/migrations/index.js +28 -0
  71. package/dist/doctor/migrations/index.js.map +1 -0
  72. package/dist/doctor/migrations/knowledge-gitignore.d.ts +12 -0
  73. package/dist/doctor/migrations/knowledge-gitignore.d.ts.map +1 -0
  74. package/dist/doctor/migrations/knowledge-gitignore.js +44 -0
  75. package/dist/doctor/migrations/knowledge-gitignore.js.map +1 -0
  76. package/dist/doctor/migrations/nested-gitignore.d.ts +14 -0
  77. package/dist/doctor/migrations/nested-gitignore.d.ts.map +1 -0
  78. package/dist/doctor/migrations/nested-gitignore.js +35 -0
  79. package/dist/doctor/migrations/nested-gitignore.js.map +1 -0
  80. package/dist/doctor/migrations/prune-capture-log.d.ts +11 -0
  81. package/dist/doctor/migrations/prune-capture-log.d.ts.map +1 -0
  82. package/dist/doctor/migrations/prune-capture-log.js +31 -0
  83. package/dist/doctor/migrations/prune-capture-log.js.map +1 -0
  84. package/dist/doctor/migrations/prune-cost-locks.d.ts +8 -0
  85. package/dist/doctor/migrations/prune-cost-locks.d.ts.map +1 -0
  86. package/dist/doctor/migrations/prune-cost-locks.js +28 -0
  87. package/dist/doctor/migrations/prune-cost-locks.js.map +1 -0
  88. package/dist/doctor/migrations/prune-registry.d.ts +11 -0
  89. package/dist/doctor/migrations/prune-registry.d.ts.map +1 -0
  90. package/dist/doctor/migrations/prune-registry.js +48 -0
  91. package/dist/doctor/migrations/prune-registry.js.map +1 -0
  92. package/dist/doctor/migrations/prune-session-stash.d.ts +8 -0
  93. package/dist/doctor/migrations/prune-session-stash.d.ts.map +1 -0
  94. package/dist/doctor/migrations/prune-session-stash.js +28 -0
  95. package/dist/doctor/migrations/prune-session-stash.js.map +1 -0
  96. package/dist/doctor/migrations/shipped-actions.d.ts +8 -0
  97. package/dist/doctor/migrations/shipped-actions.d.ts.map +1 -0
  98. package/dist/doctor/migrations/shipped-actions.js +32 -0
  99. package/dist/doctor/migrations/shipped-actions.js.map +1 -0
  100. package/dist/doctor/migrations/untrack-cost-ephemera.d.ts +14 -0
  101. package/dist/doctor/migrations/untrack-cost-ephemera.d.ts.map +1 -0
  102. package/dist/doctor/migrations/untrack-cost-ephemera.js +60 -0
  103. package/dist/doctor/migrations/untrack-cost-ephemera.js.map +1 -0
  104. package/dist/doctor/runner.d.ts +22 -0
  105. package/dist/doctor/runner.d.ts.map +1 -0
  106. package/dist/doctor/runner.js +99 -0
  107. package/dist/doctor/runner.js.map +1 -0
  108. package/dist/doctor/types.d.ts +66 -0
  109. package/dist/doctor/types.d.ts.map +1 -0
  110. package/dist/doctor/types.js +11 -0
  111. package/dist/doctor/types.js.map +1 -0
  112. package/dist/events/shipped-actions.d.ts +7 -0
  113. package/dist/events/shipped-actions.d.ts.map +1 -1
  114. package/dist/events/shipped-actions.js +14 -5
  115. package/dist/events/shipped-actions.js.map +1 -1
  116. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"untrack-cost-ephemera.js","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,6BAA6B;IAC7B,yBAAyB;IACzB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAc;IAC5C,EAAE,EAAE,uBAAuB;IAC3B,IAAI,EAAE,SAAS;IACf,KAAK,CAAC,GAAG;QACP,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAC9B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;QACpE,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,CAAC,sBAAsB,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3E,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACtC,OAAO;gBACL,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,iBAAiB,KAAK,CAAC,MAAM,kCAAkC;gBAC5E,QAAQ;gBACR,OAAO,EACL,mHAAmH;aACtH,CAAC;QACJ,CAAC;QACD,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,iBAAiB,KAAK,CAAC,MAAM,uDAAuD;YACjG,QAAQ;SACT,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAC9E,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,EAAE;YACjE,GAAG,EAAE,GAAG,CAAC,WAAW;YACpB,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;SACpC,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,aAAa,KAAK,CAAC,MAAM,uEAAuE;SAC1G,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Doctor runner: iterates every registered migration on every run (AC-1),
3
+ * applying safe-tier migrations automatically (AC-4) and gating
4
+ * confirm-tier migrations behind the print-exact-commands → confirm flow
5
+ * (AC-5..AC-9, AC-23; installMergeDriver pattern from commands/knowledge.ts).
6
+ *
7
+ * The runner owns the whole confirm decision table in one place —
8
+ * blocked → --yes → non-interactive skip → prompt — with an injectable
9
+ * ConfirmFn so tests never touch a TTY.
10
+ */
11
+ import type { DoctorContext, DoctorRunResult, Migration } from './types.js';
12
+ export type ConfirmFn = (req: {
13
+ id: string;
14
+ description: string;
15
+ commands: string[];
16
+ }) => Promise<boolean>;
17
+ export interface RunDoctorOpts {
18
+ dryRun: boolean;
19
+ confirm?: ConfirmFn;
20
+ }
21
+ export declare function runDoctor(ctx: DoctorContext, migrations: Migration[], opts: RunDoctorOpts): Promise<DoctorRunResult>;
22
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/doctor/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,SAAS,EAEV,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAYvB,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,SAAS,EAAE,EACvB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,eAAe,CAAC,CAY1B"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Doctor runner: iterates every registered migration on every run (AC-1),
3
+ * applying safe-tier migrations automatically (AC-4) and gating
4
+ * confirm-tier migrations behind the print-exact-commands → confirm flow
5
+ * (AC-5..AC-9, AC-23; installMergeDriver pattern from commands/knowledge.ts).
6
+ *
7
+ * The runner owns the whole confirm decision table in one place —
8
+ * blocked → --yes → non-interactive skip → prompt — with an injectable
9
+ * ConfirmFn so tests never touch a TTY.
10
+ */
11
+ import * as clack from '@clack/prompts';
12
+ const defaultConfirm = async ({ id, description, commands }) => {
13
+ process.stdout.write(`\n${id}: ${description}\n`);
14
+ process.stdout.write('This will run:\n');
15
+ for (const cmd of commands) {
16
+ process.stdout.write(` ${cmd}\n`);
17
+ }
18
+ const confirmed = await clack.confirm({ message: 'Run these commands now?' });
19
+ return confirmed === true;
20
+ };
21
+ export async function runDoctor(ctx, migrations, opts) {
22
+ const confirm = opts.confirm ?? defaultConfirm;
23
+ const outcomes = [];
24
+ for (const m of migrations) {
25
+ outcomes.push(await runOne(ctx, m, opts.dryRun, confirm));
26
+ }
27
+ return {
28
+ outcomes,
29
+ pendingConfirm: outcomes.filter((o) => o.status === 'pending'),
30
+ };
31
+ }
32
+ async function runOne(ctx, m, dryRun, confirm) {
33
+ let checked;
34
+ try {
35
+ checked = m.check(ctx);
36
+ }
37
+ catch (err) {
38
+ return outcome(m, 'error', `check failed: ${err.message}`);
39
+ }
40
+ if (!checked.applicable) {
41
+ return outcome(m, 'not-applicable', checked.reason);
42
+ }
43
+ if (!checked.pending) {
44
+ return outcome(m, 'clean', 'nothing to do');
45
+ }
46
+ if (dryRun) {
47
+ return {
48
+ ...outcome(m, 'would-apply', checked.description),
49
+ commands: checked.commands,
50
+ };
51
+ }
52
+ if (m.tier === 'safe') {
53
+ return applyOne(ctx, m);
54
+ }
55
+ // Confirm tier: blocked → --yes → non-interactive → prompt (AC-8, AC-6, AC-23, AC-5).
56
+ if (checked.blocked) {
57
+ return {
58
+ ...outcome(m, 'pending', checked.blocked),
59
+ commands: checked.commands,
60
+ pendingReason: 'blocked',
61
+ };
62
+ }
63
+ if (ctx.yes) {
64
+ return applyOne(ctx, m);
65
+ }
66
+ if (!ctx.interactive) {
67
+ return {
68
+ ...outcome(m, 'pending', checked.description),
69
+ commands: checked.commands,
70
+ pendingReason: 'non-interactive',
71
+ };
72
+ }
73
+ const confirmed = await confirm({
74
+ id: m.id,
75
+ description: checked.description,
76
+ commands: checked.commands ?? [],
77
+ });
78
+ if (!confirmed) {
79
+ return {
80
+ ...outcome(m, 'pending', `declined: ${checked.description}`),
81
+ commands: checked.commands,
82
+ pendingReason: 'declined',
83
+ };
84
+ }
85
+ return applyOne(ctx, m);
86
+ }
87
+ function applyOne(ctx, m) {
88
+ try {
89
+ const applied = m.apply(ctx);
90
+ return outcome(m, applied.changed ? 'applied' : 'clean', applied.summary);
91
+ }
92
+ catch (err) {
93
+ return outcome(m, 'error', `apply failed: ${err.message}`);
94
+ }
95
+ }
96
+ function outcome(m, status, detail) {
97
+ return { id: m.id, tier: m.tier, status, detail };
98
+ }
99
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/doctor/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAcxC,MAAM,cAAc,GAAc,KAAK,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,WAAW,IAAI,CAAC,CAAC;IAClD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;IAC9E,OAAO,SAAS,KAAK,IAAI,CAAC;AAC5B,CAAC,CAAC;AAOF,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAkB,EAClB,UAAuB,EACvB,IAAmB;IAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC;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AO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAkB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CACd,CAAY,EACZ,MAAkC,EAClC,MAAc;IAEd,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Doctor migration registry types (update-spring-clean AC-1..AC-3).
3
+ *
4
+ * A migration is a named check/apply pair. `check` is a pure state
5
+ * inspection — the ONLY source of pending-ness, shared verbatim by
6
+ * dry-run and real runs so they can never disagree (AC-2, AC-11).
7
+ * No migration-version stamp exists anywhere (AC-3): repos self-heal
8
+ * and converge regardless of the version they were initialized at.
9
+ */
10
+ export type MigrationTier = 'safe' | 'confirm';
11
+ export interface DoctorContext {
12
+ projectRoot: string;
13
+ /** Git common dir, or null outside a git repo (AC-12). */
14
+ gitCommonDir: string | null;
15
+ /** True when running from a linked worktree (AC-21). */
16
+ isLinkedWorktree: boolean;
17
+ /** Injected clock so TTL migrations are deterministic in tests. */
18
+ now: Date;
19
+ /** stdout is a TTY — confirm-tier migrations may prompt (AC-23). */
20
+ interactive: boolean;
21
+ /** --yes: apply confirm-tier migrations without prompting (AC-6). */
22
+ yes: boolean;
23
+ }
24
+ export type CheckResult = {
25
+ applicable: false;
26
+ reason: string;
27
+ } | {
28
+ applicable: true;
29
+ pending: false;
30
+ } | {
31
+ applicable: true;
32
+ pending: true;
33
+ /** One-line "would ..." used by dry-run listings and prompts (AC-11). */
34
+ description: string;
35
+ /** Confirm tier: the exact shell command(s) apply will run (AC-5). */
36
+ commands?: string[];
37
+ /** Set → apply must not run, even with --yes (AC-8 staged index). */
38
+ blocked?: string;
39
+ };
40
+ export interface ApplyResult {
41
+ changed: boolean;
42
+ /** One-line report, e.g. "removed 3 expired stash entries" (AC-4). */
43
+ summary: string;
44
+ }
45
+ export interface Migration {
46
+ /** Stable id, e.g. 'cost-gitignore' — never renamed (AC-1). */
47
+ id: string;
48
+ tier: MigrationTier;
49
+ check(ctx: DoctorContext): CheckResult;
50
+ apply(ctx: DoctorContext): ApplyResult;
51
+ }
52
+ export type PendingReason = 'declined' | 'non-interactive' | 'blocked';
53
+ export interface MigrationOutcome {
54
+ id: string;
55
+ tier: MigrationTier;
56
+ status: 'applied' | 'clean' | 'not-applicable' | 'would-apply' | 'pending' | 'error';
57
+ detail: string;
58
+ commands?: string[];
59
+ pendingReason?: PendingReason;
60
+ }
61
+ export interface DoctorRunResult {
62
+ outcomes: MigrationOutcome[];
63
+ /** Confirm-tier items left undone — drives the doctor exit code (AC-10). */
64
+ pendingConfirm: MigrationOutcome[];
65
+ }
66
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/doctor/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,wDAAwD;IACxD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,GAAG,EAAE,IAAI,CAAC;IACV,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,UAAU,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,UAAU,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,GACpC;IACE,UAAU,EAAE,IAAI,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC;IACd,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,CAAC;IACvC,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,gBAAgB,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;IACrF,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,4EAA4E;IAC5E,cAAc,EAAE,gBAAgB,EAAE,CAAC;CACpC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Doctor migration registry types (update-spring-clean AC-1..AC-3).
3
+ *
4
+ * A migration is a named check/apply pair. `check` is a pure state
5
+ * inspection — the ONLY source of pending-ness, shared verbatim by
6
+ * dry-run and real runs so they can never disagree (AC-2, AC-11).
7
+ * No migration-version stamp exists anywhere (AC-3): repos self-heal
8
+ * and converge regardless of the version they were initialized at.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/doctor/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -9,6 +9,13 @@
9
9
  import { type InferredAction } from '../commands/add-action.js';
10
10
  /** Actions shipped with the framework. */
11
11
  export declare const SHIPPED_ACTIONS: InferredAction[];
12
+ /**
13
+ * Shipped-action ids not yet present in actions.yaml. Read-only half of
14
+ * installShippedActions, shared with `aidlc doctor` (update-spring-clean
15
+ * AC-13). Malformed actions.yaml → [] — report clean rather than risk a
16
+ * clobbering append.
17
+ */
18
+ export declare function pendingShippedActions(actionsPath: string): string[];
12
19
  /**
13
20
  * Install shipped actions into actions.yaml, skipping any id that already
14
21
  * exists. Returns the ids actually installed.
@@ -1 +1 @@
1
- {"version":3,"file":"shipped-actions.d.ts","sourceRoot":"","sources":["../../src/events/shipped-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG9E,0CAA0C;AAC1C,eAAO,MAAM,eAAe,EAAE,cAAc,EAS3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBnE"}
1
+ {"version":3,"file":"shipped-actions.d.ts","sourceRoot":"","sources":["../../src/events/shipped-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG9E,0CAA0C;AAC1C,eAAO,MAAM,eAAe,EAAE,cAAc,EAS3C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAWnE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CASnE"}
@@ -20,10 +20,12 @@ export const SHIPPED_ACTIONS = [
20
20
  },
21
21
  ];
22
22
  /**
23
- * Install shipped actions into actions.yaml, skipping any id that already
24
- * exists. Returns the ids actually installed.
23
+ * Shipped-action ids not yet present in actions.yaml. Read-only half of
24
+ * installShippedActions, shared with `aidlc doctor` (update-spring-clean
25
+ * AC-13). Malformed actions.yaml → [] — report clean rather than risk a
26
+ * clobbering append.
25
27
  */
26
- export function installShippedActions(actionsPath) {
28
+ export function pendingShippedActions(actionsPath) {
27
29
  let existingIds = new Set();
28
30
  if (existsSync(actionsPath)) {
29
31
  try {
@@ -31,13 +33,20 @@ export function installShippedActions(actionsPath) {
31
33
  existingIds = new Set((config?.actions ?? []).map((a) => a.id));
32
34
  }
33
35
  catch {
34
- // Malformed actions.yaml: do not risk clobbering it with an append.
35
36
  return [];
36
37
  }
37
38
  }
39
+ return SHIPPED_ACTIONS.filter((a) => !existingIds.has(a.id)).map((a) => a.id);
40
+ }
41
+ /**
42
+ * Install shipped actions into actions.yaml, skipping any id that already
43
+ * exists. Returns the ids actually installed.
44
+ */
45
+ export function installShippedActions(actionsPath) {
46
+ const pending = new Set(pendingShippedActions(actionsPath));
38
47
  const installed = [];
39
48
  for (const action of SHIPPED_ACTIONS) {
40
- if (existingIds.has(action.id))
49
+ if (!pending.has(action.id))
41
50
  continue;
42
51
  appendAction(actionsPath, action);
43
52
  installed.push(action.id);
@@ -1 +1 @@
1
- {"version":3,"file":"shipped-actions.js","sourceRoot":"","sources":["../../src/events/shipped-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;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AAI,eAAe,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAAE,SAAS;QACtC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAClC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "AI Development Lifecycle Framework — structured lifecycle guidance for AI coding agents across platforms",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -24,7 +24,7 @@
24
24
  "commander": "15.0.0",
25
25
  "picomatch": "4.0.5",
26
26
  "yaml": "2.9.0",
27
- "@rasensio/aidlc-content": "1.7.0"
27
+ "@rasensio/aidlc-content": "1.8.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "22.15.32",