@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,38 @@
1
+ /**
2
+ * cost-gitignore migration (AC-15): ensure cost ephemera are git-ignored
3
+ * via a nested selective .aidlc/cost/.gitignore.
4
+ *
5
+ * Selective, NOT '*': .aidlc/cost/unattributed.ndjson is durable ledger
6
+ * data that must remain trackable.
7
+ */
8
+ import { join } from 'node:path';
9
+ import { ensureIgnoreLines, missingIgnoreLines } from './nested-gitignore.js';
10
+ export const COST_IGNORE_LINES = ['active-sessions/', 'capture.log', 'locks/', '.gitignore'];
11
+ function ignorePath(projectRoot) {
12
+ return join(projectRoot, '.aidlc', 'cost', '.gitignore');
13
+ }
14
+ export const costGitignore = {
15
+ id: 'cost-gitignore',
16
+ tier: 'safe',
17
+ check(ctx) {
18
+ if (ctx.gitCommonDir === null) {
19
+ return { applicable: false, reason: 'requires a git repository' };
20
+ }
21
+ const missing = missingIgnoreLines(ignorePath(ctx.projectRoot), COST_IGNORE_LINES);
22
+ if (missing.length === 0)
23
+ return { applicable: true, pending: false };
24
+ return {
25
+ applicable: true,
26
+ pending: true,
27
+ description: `would add ${missing.length} line(s) to .aidlc/cost/.gitignore (${missing.join(', ')})`,
28
+ };
29
+ },
30
+ apply(ctx) {
31
+ const added = ensureIgnoreLines(ignorePath(ctx.projectRoot), COST_IGNORE_LINES);
32
+ return {
33
+ changed: added.length > 0,
34
+ summary: `added ${added.length} line(s) to .aidlc/cost/.gitignore`,
35
+ };
36
+ },
37
+ };
38
+ //# sourceMappingURL=cost-gitignore.js.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QAChF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;YACzB,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,oCAAoC;SACnE,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * gitattributes migration (AC-13): the merge=union installer, absorbed
3
+ * from update.ts's post-bump seam into the registry — giving it dry-run
4
+ * visibility for the first time (AC-14).
5
+ */
6
+ import type { Migration } from '../types.js';
7
+ export declare const gitattributes: Migration;
8
+ //# sourceMappingURL=gitattributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitattributes.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/gitattributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,aAAa,EAAE,SAsB3B,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * gitattributes migration (AC-13): the merge=union installer, absorbed
3
+ * from update.ts's post-bump seam into the registry — giving it dry-run
4
+ * visibility for the first time (AC-14).
5
+ */
6
+ import { installGitattributes, missingGitattributesLines, } from '../../concurrency/gitattributes.js';
7
+ export const gitattributes = {
8
+ id: 'gitattributes',
9
+ tier: 'safe',
10
+ check(ctx) {
11
+ if (ctx.gitCommonDir === null) {
12
+ return { applicable: false, reason: 'requires a git repository' };
13
+ }
14
+ const missing = missingGitattributesLines(ctx.projectRoot);
15
+ if (missing.length === 0)
16
+ return { applicable: true, pending: false };
17
+ return {
18
+ applicable: true,
19
+ pending: true,
20
+ description: `would add ${missing.length} merge=union entr${missing.length === 1 ? 'y' : 'ies'} to .gitattributes`,
21
+ };
22
+ },
23
+ apply(ctx) {
24
+ const added = installGitattributes(ctx.projectRoot);
25
+ return {
26
+ changed: added.length > 0,
27
+ summary: `added ${added.length} merge=union entr${added.length === 1 ? 'y' : 'ies'} to .gitattributes`,
28
+ };
29
+ },
30
+ };
31
+ //# sourceMappingURL=gitattributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitattributes.js","sourceRoot":"","sources":["../../../src/doctor/migrations/gitattributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAG5C,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,MAAM;IACZ,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,OAAO,GAAG,yBAAyB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,aAAa,OAAO,CAAC,MAAM,oBAAoB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,oBAAoB;SACnH,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;YACzB,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,oBAAoB,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,oBAAoB;SACvG,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Doctor migration registry (AC-1). Every entry is evaluated on every run.
3
+ *
4
+ * Order is deliberate: ignore-file migrations run before the untrack
5
+ * migration so freshly-untracked files immediately fall under ignore
6
+ * rules and never reappear as untracked noise.
7
+ */
8
+ import type { Migration } from '../types.js';
9
+ export declare const MIGRATIONS: Migration[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;AAW7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAUjC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Doctor migration registry (AC-1). Every entry is evaluated on every run.
3
+ *
4
+ * Order is deliberate: ignore-file migrations run before the untrack
5
+ * migration so freshly-untracked files immediately fall under ignore
6
+ * rules and never reappear as untracked noise.
7
+ */
8
+ import { costGitignore } from './cost-gitignore.js';
9
+ import { knowledgeGitignore } from './knowledge-gitignore.js';
10
+ import { gitattributes } from './gitattributes.js';
11
+ import { shippedActions } from './shipped-actions.js';
12
+ import { untrackCostEphemera } from './untrack-cost-ephemera.js';
13
+ import { pruneSessionStash } from './prune-session-stash.js';
14
+ import { pruneCostLocks } from './prune-cost-locks.js';
15
+ import { pruneCaptureLogMigration } from './prune-capture-log.js';
16
+ import { pruneRegistry } from './prune-registry.js';
17
+ export const MIGRATIONS = [
18
+ costGitignore,
19
+ knowledgeGitignore,
20
+ gitattributes,
21
+ shippedActions,
22
+ untrackCostEphemera,
23
+ pruneSessionStash,
24
+ pruneCostLocks,
25
+ pruneCaptureLogMigration,
26
+ pruneRegistry,
27
+ ];
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,aAAa;CACd,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * knowledge-gitignore migration (AC-16): ensure the derived sqlite index
3
+ * (.aidlc/knowledge/index.db, disposable cache per knowledge/index/
4
+ * sqlite-index.ts) is git-ignored via a nested .gitignore.
5
+ *
6
+ * Pending only when .aidlc/knowledge/ already exists — never creates the
7
+ * feature directory for repos not using the knowledge graph.
8
+ */
9
+ import type { Migration } from '../types.js';
10
+ export declare const KNOWLEDGE_IGNORE_LINES: string[];
11
+ export declare const knowledgeGitignore: Migration;
12
+ //# sourceMappingURL=knowledge-gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/knowledge-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,sBAAsB,UAA6B,CAAC;AAMjE,eAAO,MAAM,kBAAkB,EAAE,SA6BhC,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * knowledge-gitignore migration (AC-16): ensure the derived sqlite index
3
+ * (.aidlc/knowledge/index.db, disposable cache per knowledge/index/
4
+ * sqlite-index.ts) is git-ignored via a nested .gitignore.
5
+ *
6
+ * Pending only when .aidlc/knowledge/ already exists — never creates the
7
+ * feature directory for repos not using the knowledge graph.
8
+ */
9
+ import { existsSync } from 'node:fs';
10
+ import { join } from 'node:path';
11
+ import { ensureIgnoreLines, missingIgnoreLines } from './nested-gitignore.js';
12
+ export const KNOWLEDGE_IGNORE_LINES = ['index.db', '.gitignore'];
13
+ function knowledgeDir(projectRoot) {
14
+ return join(projectRoot, '.aidlc', 'knowledge');
15
+ }
16
+ export const knowledgeGitignore = {
17
+ id: 'knowledge-gitignore',
18
+ tier: 'safe',
19
+ check(ctx) {
20
+ if (ctx.gitCommonDir === null) {
21
+ return { applicable: false, reason: 'requires a git repository' };
22
+ }
23
+ if (!existsSync(knowledgeDir(ctx.projectRoot))) {
24
+ return { applicable: true, pending: false };
25
+ }
26
+ const ignore = join(knowledgeDir(ctx.projectRoot), '.gitignore');
27
+ const missing = missingIgnoreLines(ignore, KNOWLEDGE_IGNORE_LINES);
28
+ if (missing.length === 0)
29
+ return { applicable: true, pending: false };
30
+ return {
31
+ applicable: true,
32
+ pending: true,
33
+ description: `would add ${missing.length} line(s) to .aidlc/knowledge/.gitignore (${missing.join(', ')})`,
34
+ };
35
+ },
36
+ apply(ctx) {
37
+ const added = ensureIgnoreLines(join(knowledgeDir(ctx.projectRoot), '.gitignore'), KNOWLEDGE_IGNORE_LINES);
38
+ return {
39
+ changed: added.length > 0,
40
+ summary: `added ${added.length} line(s) to .aidlc/knowledge/.gitignore`,
41
+ };
42
+ },
43
+ };
44
+ //# sourceMappingURL=knowledge-gitignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/knowledge-gitignore.ts"],"names":[],"mapp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C1G,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,KAAK,GAAG,iBAAiB,CAC7B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,EACjD,sBAAsB,CACvB,CAAC;QACF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;YACzB,OAAO,EAAE,SAAS,KAAK,CAAC,MAAM,yCAAyC;SACxE,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared helper for nested selective .gitignore migrations (AC-15, AC-16).
3
+ *
4
+ * Ignore rules live in a .gitignore INSIDE the governed directory (the
5
+ * traceability/cache.ts self-ignoring pattern) — the project root
6
+ * .gitignore is never modified. Lines are SELECTIVE, not '*': directories
7
+ * like .aidlc/cost/ mix ephemera with files that must remain trackable
8
+ * (unattributed.ndjson). Do not simplify to '*'.
9
+ */
10
+ /** Lines from `ignorePath` missing the required entries (empty = healthy). */
11
+ export declare function missingIgnoreLines(ignorePath: string, required: string[]): string[];
12
+ /** Idempotently ensure `required` lines exist in `ignorePath`. Returns lines added. */
13
+ export declare function ensureIgnoreLines(ignorePath: string, required: string[]): string[];
14
+ //# sourceMappingURL=nested-gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nested-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CASnF;AAED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWlF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared helper for nested selective .gitignore migrations (AC-15, AC-16).
3
+ *
4
+ * Ignore rules live in a .gitignore INSIDE the governed directory (the
5
+ * traceability/cache.ts self-ignoring pattern) — the project root
6
+ * .gitignore is never modified. Lines are SELECTIVE, not '*': directories
7
+ * like .aidlc/cost/ mix ephemera with files that must remain trackable
8
+ * (unattributed.ndjson). Do not simplify to '*'.
9
+ */
10
+ import { existsSync, mkdirSync, readFileSync, appendFileSync, writeFileSync } from 'node:fs';
11
+ import { dirname } from 'node:path';
12
+ /** Lines from `ignorePath` missing the required entries (empty = healthy). */
13
+ export function missingIgnoreLines(ignorePath, required) {
14
+ const existing = existsSync(ignorePath)
15
+ ? new Set(readFileSync(ignorePath, 'utf8')
16
+ .split('\n')
17
+ .map((l) => l.trim()))
18
+ : new Set();
19
+ return required.filter((l) => !existing.has(l));
20
+ }
21
+ /** Idempotently ensure `required` lines exist in `ignorePath`. Returns lines added. */
22
+ export function ensureIgnoreLines(ignorePath, required) {
23
+ const missing = missingIgnoreLines(ignorePath, required);
24
+ if (missing.length === 0)
25
+ return [];
26
+ if (!existsSync(ignorePath)) {
27
+ mkdirSync(dirname(ignorePath), { recursive: true });
28
+ writeFileSync(ignorePath, missing.join('\n') + '\n', 'utf8');
29
+ return missing;
30
+ }
31
+ const prefix = readFileSync(ignorePath, 'utf8').endsWith('\n') ? '' : '\n';
32
+ appendFileSync(ignorePath, prefix + missing.join('\n') + '\n', 'utf8');
33
+ return missing;
34
+ }
35
+ //# sourceMappingURL=nested-gitignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nested-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,UAAU,kBAAkB,CAAC,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@@
1
+ /**
2
+ * prune-capture-log migration (cost-capture-noise AC-13): drop capture.log
3
+ * lines past the retention window. The window is owned by cost/recorder.ts,
4
+ * which also decides which errors are still worth surfacing — pruning here
5
+ * just keeps the file from carrying diagnostics nobody will ever read.
6
+ *
7
+ * Works without git; capture.log is machine-local and gitignored.
8
+ */
9
+ import type { Migration } from '../types.js';
10
+ export declare const pruneCaptureLogMigration: Migration;
11
+ //# sourceMappingURL=prune-capture-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-capture-log.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-capture-log.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,wBAAwB,EAAE,SAmBtC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * prune-capture-log migration (cost-capture-noise AC-13): drop capture.log
3
+ * lines past the retention window. The window is owned by cost/recorder.ts,
4
+ * which also decides which errors are still worth surfacing — pruning here
5
+ * just keeps the file from carrying diagnostics nobody will ever read.
6
+ *
7
+ * Works without git; capture.log is machine-local and gitignored.
8
+ */
9
+ import { expiredCaptureLogLines, pruneCaptureLog } from '../../cost/recorder.js';
10
+ export const pruneCaptureLogMigration = {
11
+ id: 'prune-capture-log',
12
+ tier: 'safe',
13
+ check(ctx) {
14
+ const expired = expiredCaptureLogLines(ctx.projectRoot, ctx.now);
15
+ if (expired === 0)
16
+ return { applicable: true, pending: false };
17
+ return {
18
+ applicable: true,
19
+ pending: true,
20
+ description: `would drop ${expired} expired capture.log line(s)`,
21
+ };
22
+ },
23
+ apply(ctx) {
24
+ const removed = pruneCaptureLog(ctx.projectRoot, ctx.now);
25
+ return {
26
+ changed: removed > 0,
27
+ summary: `dropped ${removed} expired capture.log line(s)`,
28
+ };
29
+ },
30
+ };
31
+ //# sourceMappingURL=prune-capture-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-capture-log.js","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-capture-log.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGjF,MAAM,CAAC,MAAM,wBAAwB,GAAc;IACjD,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,MAAM;IACZ,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC/D,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,cAAc,OAAO,8BAA8B;SACjE,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE,OAAO,GAAG,CAAC;YACpB,OAAO,EAAE,WAAW,OAAO,8BAA8B;SAC1D,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * prune-cost-locks migration (AC-19): remove stale per-session cost lock
3
+ * files. Staleness threshold stays owned by cost/recorder.ts. Works
4
+ * without git (AC-12).
5
+ */
6
+ import type { Migration } from '../types.js';
7
+ export declare const pruneCostLocks: Migration;
8
+ //# sourceMappingURL=prune-cost-locks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-cost-locks.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-cost-locks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,SAmB5B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * prune-cost-locks migration (AC-19): remove stale per-session cost lock
3
+ * files. Staleness threshold stays owned by cost/recorder.ts. Works
4
+ * without git (AC-12).
5
+ */
6
+ import { staleLockFiles, removeStaleLocks } from '../../cost/recorder.js';
7
+ export const pruneCostLocks = {
8
+ id: 'prune-cost-locks',
9
+ tier: 'safe',
10
+ check(ctx) {
11
+ const stale = staleLockFiles(ctx.projectRoot, ctx.now);
12
+ if (stale.length === 0)
13
+ return { applicable: true, pending: false };
14
+ return {
15
+ applicable: true,
16
+ pending: true,
17
+ description: `would remove ${stale.length} stale cost lock file(s)`,
18
+ };
19
+ },
20
+ apply(ctx) {
21
+ const removed = removeStaleLocks(ctx.projectRoot, ctx.now);
22
+ return {
23
+ changed: removed.length > 0,
24
+ summary: `removed ${removed.length} stale cost lock file(s)`,
25
+ };
26
+ },
27
+ };
28
+ //# sourceMappingURL=prune-cost-locks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-cost-locks.js","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-cost-locks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,CAAC,GAAG;QACP,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACpE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,gBAAgB,KAAK,CAAC,MAAM,0BAA0B;SACpE,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3D,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;YAC3B,OAAO,EAAE,WAAW,OAAO,CAAC,MAAM,0BAA0B;SAC7D,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * prune-registry migration (AC-20, AC-21): remove stale instance-registry
3
+ * entries and release orphaned claims — the same logic behind
4
+ * `aidlc status --prune`, whose surface is unchanged.
5
+ *
6
+ * Coordination files live in the git common dir, so running from a linked
7
+ * worktree cleans shared state exactly once and never touches any index.
8
+ */
9
+ import type { Migration } from '../types.js';
10
+ export declare const pruneRegistry: Migration;
11
+ //# sourceMappingURL=prune-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-registry.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,aAAa,EAAE,SAiC3B,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * prune-registry migration (AC-20, AC-21): remove stale instance-registry
3
+ * entries and release orphaned claims — the same logic behind
4
+ * `aidlc status --prune`, whose surface is unchanged.
5
+ *
6
+ * Coordination files live in the git common dir, so running from a linked
7
+ * worktree cleans shared state exactly once and never touches any index.
8
+ */
9
+ import { openRegistry } from '../../concurrency/registry.js';
10
+ import { openClaimStore, orphanedClaims, releaseOrphanedClaims, } from '../../concurrency/claim-store.js';
11
+ import { loadClaimTimeoutMinutes } from '../../cost/config.js';
12
+ export const pruneRegistry = {
13
+ id: 'prune-registry',
14
+ tier: 'safe',
15
+ check(ctx) {
16
+ if (ctx.gitCommonDir === null) {
17
+ return { applicable: false, reason: 'requires a git repository' };
18
+ }
19
+ const registry = openRegistry(ctx.projectRoot);
20
+ const stale = registry ? registry.stale() : [];
21
+ const store = openClaimStore(ctx.projectRoot, loadClaimTimeoutMinutes(ctx.projectRoot));
22
+ const orphans = orphanedClaims(store);
23
+ if (stale.length === 0 && orphans.length === 0) {
24
+ return { applicable: true, pending: false };
25
+ }
26
+ const parts = [];
27
+ if (stale.length > 0)
28
+ parts.push(`${stale.length} stale registry entr${stale.length === 1 ? 'y' : 'ies'}`);
29
+ if (orphans.length > 0)
30
+ parts.push(`${orphans.length} orphaned claim(s)`);
31
+ return {
32
+ applicable: true,
33
+ pending: true,
34
+ description: `would prune ${parts.join(' and ')}`,
35
+ };
36
+ },
37
+ apply(ctx) {
38
+ const registry = openRegistry(ctx.projectRoot);
39
+ const removed = registry ? registry.prune() : [];
40
+ const store = openClaimStore(ctx.projectRoot, loadClaimTimeoutMinutes(ctx.projectRoot));
41
+ const released = releaseOrphanedClaims(store);
42
+ return {
43
+ changed: removed.length > 0 || released.length > 0,
44
+ summary: `pruned ${removed.length} registry entr${removed.length === 1 ? 'y' : 'ies'}, released ${released.length} orphaned claim(s)`,
45
+ };
46
+ },
47
+ };
48
+ //# sourceMappingURL=prune-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-registry.js","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,MAAM;IACZ,KAAK,CAAC,GAAG;QACP,IAAI,GAAG,CAAC,YAAY,KAA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AO,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACxF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,EAAE,UAAU,OAAO,CAAC,MAAM,iBAAiB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,cAAc,QAAQ,CAAC,MAAM,oBAAoB;SACtI,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * prune-session-stash migration (AC-18): delete expired active-session
3
+ * stash entries. TTL logic stays owned by cost/sessions.ts — this
4
+ * migration only invokes it. Works without git (AC-12).
5
+ */
6
+ import type { Migration } from '../types.js';
7
+ export declare const pruneSessionStash: Migration;
8
+ //# sourceMappingURL=prune-session-stash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-session-stash.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-session-stash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,iBAAiB,EAAE,SAmB/B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * prune-session-stash migration (AC-18): delete expired active-session
3
+ * stash entries. TTL logic stays owned by cost/sessions.ts — this
4
+ * migration only invokes it. Works without git (AC-12).
5
+ */
6
+ import { expiredStashEntries, pruneStash } from '../../cost/sessions.js';
7
+ export const pruneSessionStash = {
8
+ id: 'prune-session-stash',
9
+ tier: 'safe',
10
+ check(ctx) {
11
+ const expired = expiredStashEntries(ctx.projectRoot, ctx.now);
12
+ if (expired.length === 0)
13
+ return { applicable: true, pending: false };
14
+ return {
15
+ applicable: true,
16
+ pending: true,
17
+ description: `would remove ${expired.length} expired active-session stash entr${expired.length === 1 ? 'y' : 'ies'}`,
18
+ };
19
+ },
20
+ apply(ctx) {
21
+ const removed = pruneStash(ctx.projectRoot, ctx.now);
22
+ return {
23
+ changed: removed.length > 0,
24
+ summary: `removed ${removed.length} expired active-session stash entr${removed.length === 1 ? 'y' : 'ies'}`,
25
+ };
26
+ },
27
+ };
28
+ //# sourceMappingURL=prune-session-stash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-session-stash.js","sourceRoot":"","sources":["../../../src/doctor/migrations/prune-session-stash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzE,MAAM,CAAC,MAAM,iBAAiB,GAAc;IAC1C,EAAE,EAAE,qBAAqB;IACzB,IAAI,EAAE,MAAM;IACZ,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,gBAAgB,OAAO,CAAC,MAAM,qCAAqC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;SACrH,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACrD,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;YAC3B,OAAO,EAAE,WAAW,OAAO,CAAC,MAAM,qCAAqC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;SAC5G,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * shipped-actions migration (AC-13): the match-by-id shipped lifecycle
3
+ * action installer, absorbed from update.ts's post-bump seam. Malformed
4
+ * actions.yaml reports clean (never clobbers), exactly as before.
5
+ */
6
+ import type { Migration } from '../types.js';
7
+ export declare const shippedActions: Migration;
8
+ //# sourceMappingURL=shipped-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipped-actions.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/shipped-actions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,eAAO,MAAM,cAAc,EAAE,SAmB5B,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * shipped-actions migration (AC-13): the match-by-id shipped lifecycle
3
+ * action installer, absorbed from update.ts's post-bump seam. Malformed
4
+ * actions.yaml reports clean (never clobbers), exactly as before.
5
+ */
6
+ import { join } from 'node:path';
7
+ import { installShippedActions, pendingShippedActions, } from '../../events/shipped-actions.js';
8
+ function actionsPath(projectRoot) {
9
+ return join(projectRoot, '.aidlc', 'actions.yaml');
10
+ }
11
+ export const shippedActions = {
12
+ id: 'shipped-actions',
13
+ tier: 'safe',
14
+ check(ctx) {
15
+ const pending = pendingShippedActions(actionsPath(ctx.projectRoot));
16
+ if (pending.length === 0)
17
+ return { applicable: true, pending: false };
18
+ return {
19
+ applicable: true,
20
+ pending: true,
21
+ description: `would install shipped action(s): ${pending.join(', ')}`,
22
+ };
23
+ },
24
+ apply(ctx) {
25
+ const installed = installShippedActions(actionsPath(ctx.projectRoot));
26
+ return {
27
+ changed: installed.length > 0,
28
+ summary: `installed shipped action(s): ${installed.join(', ') || 'none'}`,
29
+ };
30
+ },
31
+ };
32
+ //# sourceMappingURL=shipped-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipped-actions.js","sourceRoot":"","sources":["../../../src/doctor/migrations/shipped-actions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAGzC,SAAS,WAAW,CAAC,WAAmB;IACtC,OAAO,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,EAAE,EAAE,iBAAiB;IACrB,IAAI,EAAE,MAAM;IACZ,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACpE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,oCAAoC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACtE,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,qBAAqB,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACtE,OAAO;YACL,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;YAC7B,OAAO,EAAE,gCAAgC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE;SAC1E,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * untrack-cost-ephemera migration (AC-17, confirm tier): cost ephemera
3
+ * committed before any ignore rule existed get untracked with
4
+ * `git rm --cached` — files stay on disk; the staged deletion is the
5
+ * user's to commit.
6
+ *
7
+ * The printed command is exactly what apply() executes (NFR). Pathspecs
8
+ * include the mistaken `.aidlc/costs/` plural path seen in the wild.
9
+ * unattributed.ndjson is durable ledger data — never listed here.
10
+ */
11
+ import type { Migration } from '../types.js';
12
+ export declare const EPHEMERA_PATHSPECS: string[];
13
+ export declare const untrackCostEphemera: Migration;
14
+ //# sourceMappingURL=untrack-cost-ephemera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"untrack-cost-ephemera.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,kBAAkB,UAK9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAuCjC,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * untrack-cost-ephemera migration (AC-17, confirm tier): cost ephemera
3
+ * committed before any ignore rule existed get untracked with
4
+ * `git rm --cached` — files stay on disk; the staged deletion is the
5
+ * user's to commit.
6
+ *
7
+ * The printed command is exactly what apply() executes (NFR). Pathspecs
8
+ * include the mistaken `.aidlc/costs/` plural path seen in the wild.
9
+ * unattributed.ndjson is durable ledger data — never listed here.
10
+ */
11
+ import { execFileSync } from 'node:child_process';
12
+ import { trackedFiles, hasStagedChanges, shellQuote } from '../git.js';
13
+ export const EPHEMERA_PATHSPECS = [
14
+ '.aidlc/cost/active-sessions',
15
+ '.aidlc/cost/capture.log',
16
+ '.aidlc/cost/locks',
17
+ '.aidlc/costs',
18
+ ];
19
+ export const untrackCostEphemera = {
20
+ id: 'untrack-cost-ephemera',
21
+ tier: 'confirm',
22
+ check(ctx) {
23
+ if (ctx.gitCommonDir === null) {
24
+ return { applicable: false, reason: 'requires a git repository' };
25
+ }
26
+ const files = trackedFiles(ctx.projectRoot, EPHEMERA_PATHSPECS);
27
+ if (files.length === 0)
28
+ return { applicable: true, pending: false };
29
+ const commands = [`git rm --cached -- ${files.map(shellQuote).join(' ')}`];
30
+ if (hasStagedChanges(ctx.projectRoot)) {
31
+ return {
32
+ applicable: true,
33
+ pending: true,
34
+ description: `would untrack ${files.length} committed cost ephemera file(s)`,
35
+ commands,
36
+ blocked: 'git index has staged changes — commit or unstage them first, then run the command yourself or re-run aidlc doctor',
37
+ };
38
+ }
39
+ return {
40
+ applicable: true,
41
+ pending: true,
42
+ description: `would untrack ${files.length} committed cost ephemera file(s) (files stay on disk)`,
43
+ commands,
44
+ };
45
+ },
46
+ apply(ctx) {
47
+ const files = trackedFiles(ctx.projectRoot, EPHEMERA_PATHSPECS);
48
+ if (files.length === 0)
49
+ return { changed: false, summary: 'nothing tracked' };
50
+ execFileSync('git', ['rm', '--cached', '--quiet', '--', ...files], {
51
+ cwd: ctx.projectRoot,
52
+ stdio: ['ignore', 'ignore', 'pipe'],
53
+ });
54
+ return {
55
+ changed: true,
56
+ summary: `untracked ${files.length} file(s) — staged as deletions, files kept on disk; commit when ready`,
57
+ };
58
+ },
59
+ };
60
+ //# sourceMappingURL=untrack-cost-ephemera.js.map