@astryxdesign/cli 0.6.3-canary.db4e378 → 0.6.3-canary.db7b338

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 (276) hide show
  1. package/README.md +22 -1
  2. package/api/blog/blog.doc.mjs +1 -0
  3. package/api/build/build.doc.mjs +1 -0
  4. package/api/component/component.doc.mjs +1 -0
  5. package/api/discover/discover.doc.mjs +1 -0
  6. package/api/docs/_adapter.d.mts +3 -8
  7. package/api/docs/_adapter.mjs +13 -105
  8. package/api/docs/detail/section/section.mjs +9 -15
  9. package/api/docs/detail/section/section.test.mjs +15 -6
  10. package/api/docs/docs.doc.mjs +1 -0
  11. package/api/docs/list/list.mjs +3 -7
  12. package/api/doctor/doctor.d.mts +25 -3
  13. package/api/doctor/doctor.doc.mjs +1 -0
  14. package/api/doctor/doctor.mjs +186 -14
  15. package/api/doctor/doctor.test.mjs +332 -7
  16. package/api/gap-report/gap-report.doc.mjs +1 -0
  17. package/api/hook/_adapter.mjs +19 -5
  18. package/api/hook/hook.doc.mjs +1 -0
  19. package/api/hook/list/list.d.mts +1 -1
  20. package/api/hook/list/list.mjs +69 -17
  21. package/api/init/init.doc.mjs +1 -0
  22. package/api/integration/add-contribution.mjs +7 -7
  23. package/api/integration/add-contribution.test.mjs +37 -3
  24. package/api/integration/add-theme.mjs +34 -64
  25. package/api/integration/add-theme.test.mjs +105 -21
  26. package/api/integration/authoring-checks.test.mjs +8 -4
  27. package/api/integration/integration-block-exports.test.mjs +10 -6
  28. package/api/integration/integrationAdd.doc.mjs +1 -0
  29. package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
  30. package/api/integration/integrationAddCodemod.doc.mjs +1 -0
  31. package/api/integration/integrationAddComponent.doc.mjs +1 -0
  32. package/api/integration/integrationAddDoc.doc.mjs +1 -0
  33. package/api/integration/integrationAddTemplate.doc.mjs +1 -0
  34. package/api/integration/integrationAddTheme.doc.mjs +6 -5
  35. package/api/integration/integrationComponentConflicts.doc.mjs +1 -0
  36. package/api/integration/integrationDocConflicts.doc.mjs +1 -0
  37. package/api/integration/integrationPackCheck.doc.mjs +1 -0
  38. package/api/integration/integrationTemplateConflicts.doc.mjs +1 -0
  39. package/api/integration/pack-check.test.mjs +17 -47
  40. package/api/integration/summarizeIssues.doc.mjs +1 -0
  41. package/api/integration/validate-integration-fixes.test.mjs +1389 -0
  42. package/api/integration/validate-integration.mjs +50 -102
  43. package/api/integration/validate-integration.test.mjs +85 -23
  44. package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
  45. package/api/integration/validateIntegration.doc.mjs +1 -0
  46. package/api/json/assertResponse.doc.mjs +1 -0
  47. package/api/json/isError.doc.mjs +1 -0
  48. package/api/json/parseResponse.doc.mjs +1 -0
  49. package/api/layout/layoutCheck.doc.mjs +1 -0
  50. package/api/layout/layoutExpand.doc.mjs +1 -0
  51. package/api/layout/layoutGrammar.doc.mjs +1 -0
  52. package/api/search/search.doc.mjs +1 -0
  53. package/api/search/search.mjs +16 -6
  54. package/api/swizzle/swizzle.doc.mjs +1 -0
  55. package/api/template/template-suffix.test.mjs +41 -21
  56. package/api/template/template.doc.mjs +1 -0
  57. package/api/theme/_adapter.d.mts +2 -3
  58. package/api/theme/_adapter.mjs +4 -5
  59. package/api/theme/add/add.binary.test.mjs +10 -17
  60. package/api/theme/add/add.test.mjs +14 -1
  61. package/api/theme/generateTonalPalette.doc.mjs +1 -0
  62. package/api/theme/integration-themes.test.mjs +39 -28
  63. package/api/theme/list/list.test.mjs +19 -20
  64. package/api/theme/listThemes.doc.mjs +6 -5
  65. package/api/theme/themeAdd.doc.mjs +4 -3
  66. package/api/theme/themeBuild.doc.mjs +1 -0
  67. package/api/theme/themeList.doc.mjs +6 -3
  68. package/api/theme/themeListAvailable.doc.mjs +5 -3
  69. package/api/theme/themePaletteGenerate.doc.mjs +1 -0
  70. package/api/theme/themeTargets.doc.mjs +1 -0
  71. package/api/theme/themeTemplate.doc.mjs +1 -0
  72. package/api/upgrade/_adapter.d.mts +32 -5
  73. package/api/upgrade/_adapter.mjs +97 -69
  74. package/api/upgrade/provider-agreement.test.mjs +152 -0
  75. package/api/upgrade/run/run.mjs +356 -59
  76. package/api/upgrade/upgrade.doc.mjs +6 -1
  77. package/api/upgrade/upgrade.type.d.mts +34 -0
  78. package/api/upgrade/upgrade.type.mjs +15 -0
  79. package/assets/codemods/__tests__/runner.test.mjs +330 -8
  80. package/assets/codemods/integration-discovery.mjs +8 -2
  81. package/assets/codemods/integration-discovery.test.mjs +15 -0
  82. package/assets/codemods/integration-runner.mjs +56 -4
  83. package/assets/codemods/integration-runner.protection.test.mjs +153 -0
  84. package/assets/codemods/run-codemod.mjs +177 -34
  85. package/assets/codemods/runner.mjs +350 -102
  86. package/assets/codemods/transforms/next/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
  87. package/assets/codemods/transforms/next/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
  88. package/assets/codemods/transforms/next/index.mjs +19 -1
  89. package/assets/codemods/transforms/next/migrate-native-picker-to-presentation.mjs +148 -0
  90. package/assets/codemods/transforms/next/migrate-theme-catalog-to-descriptors.mjs +141 -0
  91. package/assets/docs/cli-integrations.doc.mjs +30 -30
  92. package/assets/docs/cli.doc.mjs +15 -0
  93. package/assets/docs/theme.doc.mjs +1 -1
  94. package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +1 -1
  95. package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +14 -0
  96. package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -0
  97. package/assets/templates/blocks/components/TimeInput/TimeInputConstrained.tsx +1 -0
  98. package/assets/templates/themes/butter/butterTheme.doc.mjs +11 -0
  99. package/assets/templates/themes/chocolate/chocolateTheme.doc.mjs +11 -0
  100. package/assets/templates/themes/gothic/gothicTheme.doc.mjs +11 -0
  101. package/assets/templates/themes/matcha/matchaTheme.doc.mjs +11 -0
  102. package/assets/templates/themes/neutral/neutralTheme.doc.mjs +11 -0
  103. package/assets/templates/themes/stone/stoneTheme.doc.mjs +11 -0
  104. package/assets/templates/themes/y2k/y2kTheme.doc.mjs +11 -0
  105. package/authoring/codemod/codemod.doc.mjs +1 -1
  106. package/authoring/codemod/type.ts +12 -0
  107. package/authoring/config/config.doc.mjs +1 -1
  108. package/authoring/debug/debug.doc.d.mts +11 -0
  109. package/authoring/debug/debug.doc.mjs +182 -0
  110. package/authoring/doctypes/_schema.d.mts +71 -141
  111. package/authoring/doctypes/_schema.mjs +29 -2
  112. package/authoring/doctypes/base/graph-fields.doc.mjs +1 -1
  113. package/authoring/doctypes/command/command.doc.mjs +1 -1
  114. package/authoring/doctypes/command/type.ts +1 -1
  115. package/authoring/doctypes/component/type.ts +2 -2
  116. package/authoring/doctypes/doctypes-new.test.mjs +48 -6
  117. package/authoring/doctypes/enum/enum.doc.mjs +1 -1
  118. package/authoring/doctypes/enum/type.ts +1 -1
  119. package/authoring/doctypes/function/function.doc.mjs +1 -1
  120. package/authoring/doctypes/function/type.ts +1 -1
  121. package/authoring/doctypes/hook/type.ts +2 -2
  122. package/authoring/doctypes/load-contract.test.mjs +3 -2
  123. package/authoring/doctypes/namespace/namespace.doc.mjs +2 -2
  124. package/authoring/doctypes/namespace/parse.test.mjs +23 -25
  125. package/authoring/doctypes/namespace/type.ts +5 -2
  126. package/authoring/doctypes/parse.d.mts +4 -2
  127. package/authoring/doctypes/parse.mjs +10 -5
  128. package/authoring/doctypes/reference/reference.doc.mjs +6 -4
  129. package/authoring/doctypes/reference/type.ts +9 -10
  130. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  131. package/authoring/doctypes/schema/type.ts +1 -2
  132. package/authoring/doctypes/template/template.doc.mjs +3 -3
  133. package/authoring/doctypes/theme/parse.d.mts +35 -0
  134. package/authoring/doctypes/theme/parse.mjs +76 -0
  135. package/authoring/doctypes/theme/theme.doc.d.mts +9 -0
  136. package/authoring/doctypes/theme/theme.doc.mjs +79 -0
  137. package/authoring/doctypes/theme/type.ts +42 -0
  138. package/authoring/doctypes/types.ts +2 -1
  139. package/authoring/gap-report/gap-report.doc.d.mts +12 -0
  140. package/authoring/gap-report/gap-report.doc.mjs +183 -0
  141. package/authoring/index.d.mts +1 -0
  142. package/authoring/index.d.ts +7 -4
  143. package/authoring/index.mjs +2 -1
  144. package/authoring/integration/integration.doc.mjs +2 -2
  145. package/authoring/integration/type.ts +3 -9
  146. package/clients/cli/__tests__/cliManifest.test.ts +27 -29
  147. package/clients/cli/commands/blog.doc.mjs +1 -1
  148. package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
  149. package/clients/cli/commands/build-theme.mjs +10 -44
  150. package/clients/cli/commands/build.doc.mjs +1 -1
  151. package/clients/cli/commands/component.doc.mjs +1 -1
  152. package/clients/cli/commands/discover.doc.mjs +1 -1
  153. package/clients/cli/commands/docs.doc.mjs +1 -1
  154. package/clients/cli/commands/docs.mjs +15 -58
  155. package/clients/cli/commands/docs.test.mjs +11 -14
  156. package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
  157. package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
  158. package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -1
  159. package/clients/cli/commands/doctor-integration-validate.doc.mjs +1 -1
  160. package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
  161. package/clients/cli/commands/doctor-integration.test.mjs +15 -7
  162. package/clients/cli/commands/doctor.doc.mjs +1 -1
  163. package/clients/cli/commands/gap-report.doc.mjs +1 -1
  164. package/clients/cli/commands/hook.doc.mjs +1 -1
  165. package/clients/cli/commands/init.doc.mjs +1 -1
  166. package/clients/cli/commands/integration-add.controls.test.mjs +1 -1
  167. package/clients/cli/commands/integration-add.doc.mjs +1 -1
  168. package/clients/cli/commands/integration-pack.doc.mjs +1 -1
  169. package/clients/cli/commands/integration-real-world.test.mjs +3 -9
  170. package/clients/cli/commands/integration.doc.mjs +1 -1
  171. package/clients/cli/commands/layout-check.doc.mjs +1 -1
  172. package/clients/cli/commands/layout-expand.doc.mjs +1 -1
  173. package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
  174. package/clients/cli/commands/layout.doc.mjs +1 -1
  175. package/clients/cli/commands/manifest.doc.mjs +1 -1
  176. package/clients/cli/commands/search.doc.mjs +1 -1
  177. package/clients/cli/commands/swizzle.doc.mjs +1 -1
  178. package/clients/cli/commands/template.doc.mjs +1 -1
  179. package/clients/cli/commands/text-json-parity.test.mjs +718 -0
  180. package/clients/cli/commands/theme-add.doc.mjs +2 -2
  181. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  182. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  183. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -3
  184. package/clients/cli/commands/theme-palette.doc.mjs +1 -1
  185. package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
  186. package/clients/cli/commands/theme-targets.doc.mjs +1 -1
  187. package/clients/cli/commands/theme-template.doc.mjs +1 -1
  188. package/clients/cli/commands/theme.doc.mjs +1 -1
  189. package/clients/cli/commands/upgrade.doc.mjs +3 -2
  190. package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -0
  191. package/clients/cli/commands/upgrade.mjs +29 -7
  192. package/clients/cli/formatters/index.mjs +2 -0
  193. package/clients/cli/formatters/index.test.mjs +6 -0
  194. package/clients/cli/lib/hook-format.mjs +14 -5
  195. package/foundation/config/project-themes.test.mjs +11 -19
  196. package/foundation/config/project.d.mts +8 -0
  197. package/foundation/config/project.mjs +50 -21
  198. package/foundation/config/project.test.mjs +3 -16
  199. package/foundation/discovery/authoring-self-docs.d.mts +6 -0
  200. package/foundation/discovery/authoring-self-docs.mjs +17 -7
  201. package/foundation/discovery/authoring-self-docs.test.mjs +3 -2
  202. package/foundation/discovery/authoring-surface.d.mts +74 -0
  203. package/foundation/discovery/authoring-surface.mjs +525 -0
  204. package/foundation/discovery/authoring-surface.test.mjs +392 -0
  205. package/foundation/discovery/cli-self-docs.d.mts +113 -0
  206. package/foundation/discovery/cli-self-docs.mjs +514 -0
  207. package/foundation/discovery/cli-self-docs.test.mjs +437 -0
  208. package/foundation/discovery/component-loader.d.mts +35 -38
  209. package/foundation/discovery/component-loader.mjs +53 -222
  210. package/foundation/discovery/docs-discovery.d.mts +3 -2
  211. package/foundation/discovery/docs-discovery.mjs +14 -17
  212. package/foundation/discovery/docs-discovery.test.mjs +15 -15
  213. package/foundation/discovery/docs-section-key.d.mts +19 -8
  214. package/foundation/discovery/docs-section-key.mjs +119 -32
  215. package/foundation/discovery/docs-section-key.test.mjs +41 -19
  216. package/foundation/discovery/template-adapter.d.mts +7 -0
  217. package/foundation/discovery/template-adapter.mjs +27 -40
  218. package/foundation/discovery/template-adapter.test.mjs +15 -0
  219. package/foundation/discovery/theme-discovery.d.mts +67 -7
  220. package/foundation/discovery/theme-discovery.mjs +916 -186
  221. package/foundation/discovery/theme-discovery.test.mjs +613 -219
  222. package/foundation/doc-compiler/bundle.d.mts +47 -0
  223. package/foundation/doc-compiler/bundle.mjs +218 -0
  224. package/foundation/doc-compiler/bundle.test.mjs +255 -0
  225. package/foundation/doc-compiler/compile.d.mts +200 -0
  226. package/foundation/doc-compiler/compile.mjs +259 -9
  227. package/foundation/doc-compiler/diagnostics.d.mts +126 -0
  228. package/foundation/doc-compiler/diagnostics.mjs +277 -0
  229. package/foundation/doc-compiler/doc-compiler.test.mjs +28 -1
  230. package/foundation/doc-compiler/doc-loads.test.mjs +1642 -0
  231. package/foundation/doc-compiler/import.d.mts +24 -0
  232. package/foundation/doc-compiler/import.mjs +59 -0
  233. package/foundation/doc-compiler/inputs.d.mts +102 -0
  234. package/foundation/doc-compiler/inputs.mjs +286 -0
  235. package/foundation/doc-compiler/inputs.test.mjs +299 -0
  236. package/foundation/doc-compiler/ir.d.mts +13 -0
  237. package/foundation/doc-compiler/ir.mjs +189 -12
  238. package/foundation/doc-compiler/lower-doc.test.mjs +492 -0
  239. package/foundation/doc-compiler/overlays.d.mts +37 -0
  240. package/foundation/doc-compiler/overlays.mjs +206 -0
  241. package/foundation/doc-compiler/parse-readable.d.mts +9 -0
  242. package/foundation/doc-compiler/parse-readable.mjs +29 -0
  243. package/foundation/doc-compiler/read.d.mts +126 -0
  244. package/foundation/doc-compiler/read.mjs +320 -0
  245. package/foundation/doc-compiler/read.test.mjs +313 -0
  246. package/foundation/doc-compiler/source.d.mts +33 -0
  247. package/foundation/doc-compiler/source.mjs +128 -0
  248. package/foundation/fs/file-protection.d.mts +33 -0
  249. package/foundation/fs/file-protection.mjs +825 -0
  250. package/foundation/fs/file-protection.test.mjs +250 -0
  251. package/foundation/integrations/autolink.d.mts +58 -1
  252. package/foundation/integrations/autolink.mjs +143 -57
  253. package/foundation/integrations/contribution-fixes.d.mts +145 -0
  254. package/foundation/integrations/contribution-fixes.mjs +1284 -0
  255. package/foundation/integrations/contribution-inventory.d.mts +1 -1
  256. package/foundation/integrations/contribution-inventory.mjs +17 -20
  257. package/foundation/integrations/contribution-inventory.test.mjs +67 -27
  258. package/foundation/integrations/integrations.d.mts +3 -0
  259. package/foundation/integrations/integrations.mjs +11 -97
  260. package/foundation/integrations/provider-ledger.test.mjs +275 -0
  261. package/foundation/integrations/provider-resolution.d.mts +152 -0
  262. package/foundation/integrations/provider-resolution.mjs +576 -0
  263. package/foundation/integrations/provider-resolution.test.mjs +369 -0
  264. package/foundation/integrations/theme-descriptor.d.mts +8 -0
  265. package/foundation/integrations/theme-descriptor.mjs +44 -0
  266. package/foundation/integrations/validate-contributions.mjs +104 -10
  267. package/foundation/response/error-codes.d.mts +3 -1
  268. package/foundation/response/error-codes.d.ts +2 -0
  269. package/foundation/response/error-codes.doc.mjs +12 -2
  270. package/foundation/response/error-codes.mjs +7 -1
  271. package/foundation/response/error-codes.test.mjs +55 -11
  272. package/foundation/response/response-types.doc.mjs +1 -1
  273. package/foundation/response/response.doc.mjs +1 -1
  274. package/foundation/text/string-utils.mjs +22 -10
  275. package/package.json +10 -9
  276. package/assets/templates/themes/manifest.json +0 -95
@@ -17,6 +17,7 @@
17
17
  * integration; execution errors abort before the agent-doc write.
18
18
  */
19
19
 
20
+ import * as fs from 'node:fs';
20
21
  import * as path from 'node:path';
21
22
  import {
22
23
  detectInstalledTargetVersion,
@@ -47,7 +48,58 @@ import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
47
48
  import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
48
49
  import {AstryxError} from '../../error.mjs';
49
50
  import {logger} from '../../logger.mjs';
50
- import {assertWithin, PathSafetyError} from '../../../foundation/fs/path-safety.mjs';
51
+ import {
52
+ assertWithin,
53
+ PathSafetyError,
54
+ } from '../../../foundation/fs/path-safety.mjs';
55
+ import {createFileProtectionResolver} from '../../../foundation/fs/file-protection.mjs';
56
+
57
+ /**
58
+ * Collapse per-codemod protection hits into one stable row per file.
59
+ * @param {Array<{file: string, codemod: string, reason: string, declaration: string, generated: boolean, command?: string}>} rows
60
+ */
61
+ function summarizeProtectedFiles(rows) {
62
+ const byFile = new Map();
63
+ for (const row of rows) {
64
+ const current = byFile.get(row.file) ?? {
65
+ file: row.file,
66
+ codemods: new Set(),
67
+ reasons: new Set(),
68
+ declarations: new Set(),
69
+ commands: new Set(),
70
+ };
71
+ current.codemods.add(row.codemod);
72
+ current.reasons.add(row.reason);
73
+ current.declarations.add(row.declaration);
74
+ if (row.command) current.commands.add(row.command);
75
+ byFile.set(row.file, current);
76
+ }
77
+ return [...byFile.values()]
78
+ .map(item => ({
79
+ file: item.file,
80
+ codemods: [...item.codemods].sort(),
81
+ reasons: [...item.reasons].sort(),
82
+ declarations: [...item.declarations].sort(),
83
+ commands: [...item.commands].sort(),
84
+ }))
85
+ .sort((a, b) => a.file.localeCompare(b.file));
86
+ }
87
+
88
+ /** @param {string} cwd */
89
+ function loadFileProtection(cwd) {
90
+ try {
91
+ return createFileProtectionResolver(cwd);
92
+ } catch (err) {
93
+ const message = err instanceof Error ? err.message : String(err);
94
+ logger.error(message);
95
+ logger.log('Upgrade failed\n');
96
+ throw new AstryxError(
97
+ message,
98
+ undefined,
99
+ ERROR_CODES.ERR_CODEMOD_PROTECTION_SOURCE,
100
+ );
101
+ }
102
+ }
51
103
 
52
104
  /**
53
105
  * Run the upgrade pipeline for a validated, non-list invocation. Returns the
@@ -75,7 +127,11 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
75
127
  if (err instanceof PathSafetyError) {
76
128
  logger.error(err.message);
77
129
  logger.log('Aborted\n');
78
- throw new AstryxError(err.message, undefined, ERROR_CODES.ERR_PATH_TRAVERSAL);
130
+ throw new AstryxError(
131
+ err.message,
132
+ undefined,
133
+ ERROR_CODES.ERR_PATH_TRAVERSAL,
134
+ );
79
135
  }
80
136
  throw err;
81
137
  }
@@ -133,7 +189,10 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
133
189
  });
134
190
  }
135
191
 
136
- const versionManifests = await getCoreVersionManifests(currentVersion, targetVersion);
192
+ const versionManifests = await getCoreVersionManifests(
193
+ currentVersion,
194
+ targetVersion,
195
+ );
137
196
 
138
197
  const coreConfigCodemodNames = [];
139
198
  for (const {transforms} of versionManifests) {
@@ -157,6 +216,11 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
157
216
  }
158
217
  }
159
218
 
219
+ // Read and parse all working-tree protection declarations before any
220
+ // dependency installation or codemod write. Core and integration runners
221
+ // share this exact snapshot.
222
+ let protection = loadFileProtection(cwd);
223
+
160
224
  const ready = await ensureCodemodDeps({installDeps: options.installDeps});
161
225
  if (!ready) {
162
226
  const msg = 'jscodeshift is required but could not be installed.';
@@ -171,34 +235,82 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
171
235
  path: path_,
172
236
  codemod: options.codemod,
173
237
  skipCodemods,
238
+ root: cwd,
239
+ protection,
174
240
  });
175
- const coreResult = codemodResult && 'totalFilesChanged' in codemodResult ? codemodResult : null;
241
+ const coreResult =
242
+ codemodResult && 'totalFilesChanged' in codemodResult
243
+ ? codemodResult
244
+ : null;
176
245
 
177
246
  /** @type {Array<import('../../../foundation/integrations/integrations.mjs').LoadedIntegration>} */
178
247
  let integrations;
179
248
  /** @type {import('../../../authoring/config/type').PostCodemodHook[]} */
180
249
  let postCodemodHooks;
181
250
  try {
182
- const projectContext = await loadProjectContext(cwd, options.integration ?? []);
251
+ const projectContext = await loadProjectContext(
252
+ cwd,
253
+ options.integration ?? [],
254
+ );
183
255
  postCodemodHooks = projectContext.postCodemodHooks;
184
256
  integrations = projectContext.integrations;
185
257
  } catch (err) {
186
258
  const configErr = /** @type {Error} */ (err);
259
+ const allProtected = coreResult?.protectedFiles ?? [];
260
+ if (allProtected.length > 0) {
261
+ const protectedFiles = summarizeProtectedFiles(allProtected);
262
+ logger.error(
263
+ `${ERROR_CODES.ERR_CODEMOD_PROTECTED}: protected codemod changes remain while loading the Astryx config.`,
264
+ );
265
+ for (const item of protectedFiles) {
266
+ logger.error(` ${item.file} — ${item.declarations.join('; ')}`);
267
+ }
268
+ logger.log('Upgrade incomplete: protected changes remain\n');
269
+ return {
270
+ type: 'upgrade.run',
271
+ data: {
272
+ from: currentVersion,
273
+ to: targetVersion,
274
+ codemods: totalTransforms,
275
+ integrations: [],
276
+ agentDocsRefreshed: false,
277
+ agentDocs: {
278
+ status: 'current',
279
+ installedVersion: targetVersion,
280
+ fromVersions: [],
281
+ files: [],
282
+ refreshed: false,
283
+ action: 'none',
284
+ },
285
+ filesChanged: coreResult?.totalFilesChanged ?? 0,
286
+ transformsApplied: coreResult?.totalTransformsApplied ?? 0,
287
+ modifiedFiles: uniqueFiles(coreResult?.changedFiles).map(file =>
288
+ path.relative(cwd, file).split(path.sep).join('/'),
289
+ ),
290
+ protectedFiles,
291
+ declinedCandidates: [],
292
+ complete: false,
293
+ errorCode: 'ERR_CODEMOD_PROTECTED',
294
+ errors: coreResult?.errors ?? [],
295
+ },
296
+ };
297
+ }
187
298
  // Graceful dry-run catch: a config that fails strict validation is expected
188
299
  // & fixable ONLY when dry-run AND a pending core config codemod previewed a
189
300
  // change (the codemod that would repair it).
190
- const codemodWouldFixConfig = hasCoreConfigCodemod && (coreResult?.totalFilesChanged ?? 0) > 0;
301
+ const codemodWouldFixConfig =
302
+ hasCoreConfigCodemod && (coreResult?.totalFilesChanged ?? 0) > 0;
191
303
  if (!apply && codemodWouldFixConfig) {
192
304
  // Lightweight inspection — no config/Project load (config is still broken
193
305
  // in dry-run; the codemod previewed a fix but did not write it).
194
306
  const inspection = inspectAgentDocs(cwd, targetVersion);
195
- return statusConfigFixable(
196
- {
197
- from: currentVersion,
198
- to: targetVersion,
199
- configError: configErr.message,
200
- configCodemods: coreConfigCodemodNames,
201
- agentDocs: /** @type {import('../upgrade.type.mjs').AgentDocsSummary} */ ({
307
+ return statusConfigFixable({
308
+ from: currentVersion,
309
+ to: targetVersion,
310
+ configError: configErr.message,
311
+ configCodemods: coreConfigCodemodNames,
312
+ agentDocs:
313
+ /** @type {import('../upgrade.type.mjs').AgentDocsSummary} */ ({
202
314
  status: inspection.status,
203
315
  installedVersion: targetVersion,
204
316
  fromVersions: inspection.blockVersions,
@@ -206,17 +318,22 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
206
318
  refreshed: false,
207
319
  action: inspection.status === 'missing' ? 'nudge-init' : 'none',
208
320
  }),
209
- },
210
- );
321
+ });
211
322
  }
212
323
  // Genuine config error: abort.
213
324
  logger.error(configErr.message);
214
325
  logger.log('Aborted\n');
215
- throw new AstryxError(configErr.message, undefined, ERROR_CODES.ERR_INVALID_ARGUMENT);
326
+ throw new AstryxError(
327
+ configErr.message,
328
+ undefined,
329
+ ERROR_CODES.ERR_INVALID_ARGUMENT,
330
+ );
216
331
  }
217
332
 
218
333
  if (integrations.length > 0) {
219
- logger.log(`Integrations: ${integrations.map(i => i.name ?? i.__spec).join(', ')}`);
334
+ logger.log(
335
+ `Integrations: ${integrations.map(i => i.name ?? i.__spec).join(', ')}`,
336
+ );
220
337
  }
221
338
 
222
339
  // Non-blocking nudge for integration validation issues (suppressed for
@@ -228,7 +345,9 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
228
345
  currentVersion,
229
346
  targetVersion,
230
347
  );
231
- const hasIntegrationCodemods = integrationVersionGroups.some(g => g.codemods.length > 0);
348
+ const hasIntegrationCodemods = integrationVersionGroups.some(
349
+ g => g.codemods.length > 0,
350
+ );
232
351
 
233
352
  for (const {codemods} of integrationVersionGroups) {
234
353
  for (const c of codemods) {
@@ -266,14 +385,14 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
266
385
  }
267
386
 
268
387
  if (totalTransforms > 0) {
269
- logger.log(`${totalTransforms} codemod${totalTransforms === 1 ? '' : 's'} to run${apply ? '' : ' (dry run)'}`);
388
+ logger.log(
389
+ `${totalTransforms} codemod${totalTransforms === 1 ? '' : 's'} to run${apply ? '' : ' (dry run)'}`,
390
+ );
270
391
  } else {
271
392
  logger.log('No automatic codemods to run for this version range.');
272
393
  }
273
394
 
274
- /**
275
- * @type {{from: string, to: string, codemods: number, integrations: string[], agentDocsRefreshed: boolean, agentDocs: import('../upgrade.type.mjs').AgentDocsSummary, registryCompositions?: import('../upgrade.type.mjs').RegistryCompositionSummary, filesChanged?: number, transformsApplied?: number, errors?: Array<{file: string, codemod: string, error: string}>}}
276
- */
395
+ /** @type {import('../upgrade.type.mjs').UpgradeRunResponse['data']} */
277
396
  const receipt = {
278
397
  from: currentVersion,
279
398
  to: targetVersion,
@@ -281,79 +400,257 @@ export async function run(options = {}, {cwd = process.cwd()} = {}) {
281
400
  integrations: integrations.map(i => i.name ?? i.__spec),
282
401
  agentDocsRefreshed: false,
283
402
  agentDocs: /** @type {import('../upgrade.type.mjs').AgentDocsSummary} */ ({
284
- status: 'current', installedVersion: targetVersion,
285
- fromVersions: [], files: [], refreshed: false, action: 'none',
403
+ status: 'current',
404
+ installedVersion: targetVersion,
405
+ fromVersions: [],
406
+ files: [],
407
+ refreshed: false,
408
+ action: 'none',
286
409
  }),
287
410
  };
288
411
 
289
412
  let integrationResult = null;
290
413
  if (hasIntegrationCodemods) {
414
+ const coreStagedContents = coreResult?.stagedContents;
415
+ if (
416
+ (coreResult?.writtenFiles.length ?? 0) > 0 ||
417
+ (coreStagedContents?.size ?? 0) > 0
418
+ ) {
419
+ protection = createFileProtectionResolver(cwd, {
420
+ overrides: coreStagedContents,
421
+ });
422
+ }
291
423
  logger.log('Applying integration codemods...');
292
- integrationResult = await runIntegrationCodemodsStep(integrationVersionGroups, {
293
- apply,
294
- path: path_,
295
- codemod: options.codemod,
296
- skipCodemods,
297
- });
424
+ integrationResult = await runIntegrationCodemodsStep(
425
+ integrationVersionGroups,
426
+ {
427
+ apply,
428
+ path: path_,
429
+ codemod: options.codemod,
430
+ skipCodemods,
431
+ root: cwd,
432
+ protection,
433
+ contents: coreStagedContents,
434
+ },
435
+ );
298
436
  }
299
437
 
300
438
  const registryResult = await reconcileCompositions();
301
439
 
302
- const mergedFilesChanged = (coreResult?.totalFilesChanged ?? 0) + (integrationResult?.totalFilesChanged ?? 0);
303
- const mergedTransformsApplied = (coreResult?.totalTransformsApplied ?? 0) + (integrationResult?.totalTransformsApplied ?? 0);
304
- const mergedWrittenFiles = [
305
- ...(coreResult?.writtenFiles ?? []),
306
- ...(integrationResult?.writtenFiles ?? []),
440
+ const mergedFilesChanged =
441
+ (coreResult?.totalFilesChanged ?? 0) +
442
+ (integrationResult?.totalFilesChanged ?? 0);
443
+ const mergedTransformsApplied =
444
+ (coreResult?.totalTransformsApplied ?? 0) +
445
+ (integrationResult?.totalTransformsApplied ?? 0);
446
+ const mergedChangedFiles = [
447
+ ...(coreResult?.changedFiles ?? []),
448
+ ...(integrationResult?.changedFiles ?? []),
307
449
  ...(registryResult?.writtenFiles ?? []),
308
450
  ];
309
- const mergedErrors = [...(coreResult?.errors ?? []), ...(integrationResult?.errors ?? [])];
451
+ const mergedErrors = [
452
+ ...(coreResult?.errors ?? []),
453
+ ...(integrationResult?.errors ?? []),
454
+ ];
455
+ let finalErrors = mergedErrors;
456
+ /** @type {string|undefined} */
457
+ let hookFailure;
458
+ const initialProtected = [
459
+ ...(coreResult?.protectedFiles ?? []),
460
+ ...(integrationResult?.protectedFiles ?? []),
461
+ ];
310
462
  const registryFilesChanged = registryResult?.writtenFiles.length ?? 0;
463
+ const generatedChangeBlocked = initialProtected.some(item => item.generated);
464
+ const shouldRunHooks =
465
+ postCodemodHooks.length > 0 &&
466
+ (mergedFilesChanged > 0 ||
467
+ registryFilesChanged > 0 ||
468
+ generatedChangeBlocked);
469
+ /** @type {Map<string, Buffer>} */
470
+ const protectedBeforeHooks = new Map();
471
+ if (apply && shouldRunHooks) {
472
+ for (const item of initialProtected) {
473
+ const absolute = path.resolve(cwd, item.file);
474
+ const relative = path.relative(cwd, absolute);
475
+ if (
476
+ relative.startsWith(`..${path.sep}`) ||
477
+ relative === '..' ||
478
+ path.isAbsolute(relative)
479
+ )
480
+ continue;
481
+ try {
482
+ if (fs.lstatSync(absolute).isFile()) {
483
+ protectedBeforeHooks.set(absolute, fs.readFileSync(absolute));
484
+ }
485
+ } catch {
486
+ // A candidate can disappear between planning and regeneration.
487
+ }
488
+ }
489
+ }
490
+ /** @type {string[]} */
491
+ const hookModifiedFiles = [];
311
492
 
312
- if (postCodemodHooks.length > 0 && (mergedFilesChanged > 0 || registryFilesChanged > 0)) {
313
- const files = uniqueFiles(mergedWrittenFiles).map(file => path.relative(cwd, file));
493
+ if (shouldRunHooks) {
494
+ const files = uniqueFiles(mergedChangedFiles).map(file =>
495
+ path.relative(cwd, file),
496
+ );
314
497
  try {
315
- await runPostCodemodHooks(postCodemodHooks, {packageDir: cwd, files, apply: apply || false});
498
+ await runPostCodemodHooks(postCodemodHooks, {
499
+ packageDir: cwd,
500
+ files,
501
+ apply: apply || false,
502
+ });
316
503
  } catch (err) {
317
504
  const hookErr = /** @type {Error} */ (err);
318
505
  const msg = `Post-codemod hook failed: ${hookErr.message}`;
319
506
  logger.error(msg);
320
- logger.log('Upgrade failed\n');
321
- throw new AstryxError(msg, undefined, ERROR_CODES.ERR_CODEMOD_FAILED);
507
+ if (initialProtected.length === 0) {
508
+ logger.log('Upgrade failed\n');
509
+ throw new AstryxError(msg, undefined, ERROR_CODES.ERR_CODEMOD_FAILED);
510
+ }
511
+ hookFailure = msg;
512
+ finalErrors = [
513
+ ...mergedErrors,
514
+ {file: '.', codemod: 'post-codemod-hook', error: msg},
515
+ ];
516
+ logger.log('Regeneration failed; protected changes remain\n');
517
+ }
518
+ if (apply) {
519
+ for (const [file, before] of protectedBeforeHooks) {
520
+ try {
521
+ if (!before.equals(fs.readFileSync(file)))
522
+ hookModifiedFiles.push(file);
523
+ } catch {
524
+ hookModifiedFiles.push(file);
525
+ }
526
+ }
322
527
  }
323
528
  }
324
529
 
530
+ // A successful apply hook may have regenerated protected outputs. Rerun the
531
+ // selected codemods in preview mode against fresh bytes and fresh declarations
532
+ // to distinguish resolved outputs from changes that remain blocked.
533
+ let remainingProtected = initialProtected;
534
+ if (apply && shouldRunHooks && !hookFailure) {
535
+ const refreshedProtection = loadFileProtection(cwd);
536
+ const coreCheck = await runCoreCodemods(versionManifests, {
537
+ apply: false,
538
+ path: path_,
539
+ codemod: options.codemod,
540
+ skipCodemods,
541
+ root: cwd,
542
+ protection: refreshedProtection,
543
+ silent: true,
544
+ });
545
+ const checkedCore =
546
+ coreCheck && 'totalFilesChanged' in coreCheck ? coreCheck : null;
547
+ const recheckProtection =
548
+ (checkedCore?.stagedContents.size ?? 0) > 0
549
+ ? createFileProtectionResolver(cwd, {
550
+ overrides: checkedCore?.stagedContents,
551
+ })
552
+ : refreshedProtection;
553
+ const integrationCheck = hasIntegrationCodemods
554
+ ? await runIntegrationCodemodsStep(integrationVersionGroups, {
555
+ apply: false,
556
+ path: path_,
557
+ codemod: options.codemod,
558
+ skipCodemods,
559
+ root: cwd,
560
+ protection: recheckProtection,
561
+ contents: checkedCore?.stagedContents,
562
+ silent: true,
563
+ })
564
+ : null;
565
+ const recheckedProtected = [
566
+ ...(checkedCore?.protectedFiles ?? []),
567
+ ...(integrationCheck?.protectedFiles ?? []),
568
+ ];
569
+ const recheckedChangedFiles = [
570
+ ...(checkedCore?.changedFiles ?? []),
571
+ ...(integrationCheck?.changedFiles ?? []),
572
+ ].map(file => path.relative(cwd, file).split(path.sep).join('/'));
573
+ const initialByFile = new Map();
574
+ for (const item of initialProtected) {
575
+ const rows = initialByFile.get(item.file) ?? [];
576
+ rows.push(item);
577
+ initialByFile.set(item.file, rows);
578
+ }
579
+ // A hook that removes a protection marker without regenerating the bytes
580
+ // does not make the required change disappear. Retain the original
581
+ // declaration for that still-pending file.
582
+ for (const file of recheckedChangedFiles) {
583
+ recheckedProtected.push(...(initialByFile.get(file) ?? []));
584
+ }
585
+ remainingProtected = recheckedProtected;
586
+ finalErrors = [
587
+ ...mergedErrors,
588
+ ...(checkedCore?.errors ?? []),
589
+ ...(integrationCheck?.errors ?? []),
590
+ ];
591
+ }
592
+
593
+ const protectedFiles = summarizeProtectedFiles(remainingProtected);
325
594
  receipt.filesChanged = mergedFilesChanged;
326
595
  receipt.transformsApplied = mergedTransformsApplied;
327
- receipt.errors = mergedErrors;
596
+ receipt.modifiedFiles = uniqueFiles([
597
+ ...mergedChangedFiles,
598
+ ...hookModifiedFiles,
599
+ ]).map(file => path.relative(cwd, file).split(path.sep).join('/'));
600
+ receipt.protectedFiles = protectedFiles;
601
+ receipt.declinedCandidates = [];
602
+ receipt.complete = protectedFiles.length === 0;
603
+ if (!receipt.complete) {
604
+ receipt.errorCode = 'ERR_CODEMOD_PROTECTED';
605
+ }
606
+ receipt.errors = finalErrors;
328
607
  if (registryResult) receipt.registryCompositions = registryResult.summary;
329
608
 
330
- if (receipt.errors?.length > 0) {
609
+ if (protectedFiles.length > 0) {
610
+ logger.error(
611
+ `${ERROR_CODES.ERR_CODEMOD_PROTECTED}: ${protectedFiles.length} protected file${protectedFiles.length === 1 ? '' : 's'} still require${protectedFiles.length === 1 ? 's' : ''} a codemod change:`,
612
+ );
613
+ for (const item of protectedFiles) {
614
+ logger.error(` ${item.file} — ${item.declarations.join('; ')}`);
615
+ for (const command of item.commands) {
616
+ logger.log(` Regenerate with: ${command}`);
617
+ }
618
+ }
619
+ }
620
+
621
+ if (receipt.errors?.length > 0 && protectedFiles.length === 0) {
331
622
  const msg = `Upgrade completed with ${receipt.errors.length} codemod error${receipt.errors.length === 1 ? '' : 's'}.`;
332
623
  logger.log('Upgrade failed\n');
333
624
  throw new AstryxError(msg, undefined, ERROR_CODES.ERR_CODEMOD_FAILED);
334
625
  }
335
626
 
336
- // All codemods + hooks succeeded — render from final post-upgrade state.
337
- const agentDocsPlan = await prepareAgentDocsRefresh({
338
- cwd,
339
- installedVersion: targetVersion,
340
- apply,
341
- fresh: true,
342
- });
343
- const completedAgentDocs = apply
344
- ? applyAgentDocsRefresh(agentDocsPlan)
345
- : agentDocsPlan.summary;
346
- receipt.agentDocs = completedAgentDocs;
347
- receipt.agentDocsRefreshed = completedAgentDocs.refreshed;
627
+ // Only refresh managed docs after all required codemod changes are complete.
628
+ if (protectedFiles.length === 0) {
629
+ const agentDocsPlan = await prepareAgentDocsRefresh({
630
+ cwd,
631
+ installedVersion: targetVersion,
632
+ apply,
633
+ fresh: true,
634
+ });
635
+ const completedAgentDocs = apply
636
+ ? applyAgentDocsRefresh(agentDocsPlan)
637
+ : agentDocsPlan.summary;
638
+ receipt.agentDocs = completedAgentDocs;
639
+ receipt.agentDocsRefreshed = completedAgentDocs.refreshed;
640
+ }
348
641
 
349
642
  const registryOk = receipt.registryCompositions?.ok ?? true;
350
643
  logger.log(
351
- registryOk
352
- ? (apply ? 'Upgrade complete' : 'Dry run complete') + '\n'
353
- : 'Upgrade finished with unresolved registry items\n',
644
+ protectedFiles.length > 0
645
+ ? 'Upgrade incomplete: protected changes remain\n'
646
+ : registryOk
647
+ ? (apply ? 'Upgrade complete' : 'Dry run complete') + '\n'
648
+ : 'Upgrade finished with unresolved registry items\n',
354
649
  );
355
650
  return {
356
651
  type: 'upgrade.run',
357
- data: /** @type {import('../upgrade.type.mjs').UpgradeRunResponse['data']} */ (/** @type {unknown} */ (receipt)),
652
+ data: /** @type {import('../upgrade.type.mjs').UpgradeRunResponse['data']} */ (
653
+ /** @type {unknown} */ (receipt)
654
+ ),
358
655
  };
359
656
  }
@@ -11,6 +11,7 @@ export const doc = {
11
11
  type: 'function',
12
12
  kind: 'api',
13
13
  name: 'upgrade',
14
+ namespace: 'cli/api',
14
15
  displayName: 'upgrade()',
15
16
  summary: 'Run version migrations and reconcile copied compositions.',
16
17
  description:
@@ -120,7 +121,7 @@ export const doc = {
120
121
  {
121
122
  type: 'upgrade.run',
122
123
  description:
123
- 'The terminal run receipt: from/to versions, the codemod count, integrations processed, the agent-docs summary, an optional copied-composition registry summary, and (apply mode) filesChanged, transformsApplied, and any per-codemod errors.',
124
+ 'The terminal run receipt: from/to versions, codemod count, integrations processed, agent-docs and registry summaries, modifiedFiles, protectedFiles, declinedCandidates, and completion state. A protected required change returns complete: false with ERR_CODEMOD_PROTECTED; the CLI exits nonzero while preserving the structured receipt.',
124
125
  },
125
126
  ],
126
127
  throws: [
@@ -146,6 +147,10 @@ export const doc = {
146
147
  code: 'ERR_CODEMOD_FAILED',
147
148
  when: 'one or more codemods failed, or a post-codemod hook failed',
148
149
  },
150
+ {
151
+ code: 'ERR_CODEMOD_PROTECTION_SOURCE',
152
+ when: 'a working-tree protection declaration cannot be read or parsed before writes begin',
153
+ },
149
154
  ],
150
155
  examples: [
151
156
  {
@@ -131,6 +131,31 @@ export type UpgradeRegistryResponse = {
131
131
  type: "upgrade.registry";
132
132
  data: RegistryCompositionSummary;
133
133
  };
134
+ /**
135
+ * A required codemod change blocked by effective working-tree protection.
136
+ */
137
+ export type ProtectedCodemodFile = {
138
+ /**
139
+ * Project-relative path.
140
+ */
141
+ file: string;
142
+ /**
143
+ * Codemods that still require a change.
144
+ */
145
+ codemods: string[];
146
+ /**
147
+ * Protection categories (generated, vendored, ignored, and hard boundaries).
148
+ */
149
+ reasons: string[];
150
+ /**
151
+ * Effective declarations that protect the file.
152
+ */
153
+ declarations: string[];
154
+ /**
155
+ * Exact regeneration commands found in generated headers, when present.
156
+ */
157
+ commands: string[];
158
+ };
134
159
  /**
135
160
  * astryx --json upgrade [--apply]
136
161
  */
@@ -144,7 +169,16 @@ export type UpgradeRunResponse = {
144
169
  agentDocsRefreshed: boolean;
145
170
  agentDocs: AgentDocsSummary;
146
171
  registryCompositions?: RegistryCompositionSummary | undefined;
172
+ complete?: boolean | undefined;
173
+ errorCode?: "ERR_CODEMOD_PROTECTED" | undefined;
147
174
  filesChanged?: number | undefined;
175
+ modifiedFiles?: string[] | undefined;
176
+ protectedFiles?: ProtectedCodemodFile[] | undefined;
177
+ declinedCandidates?: {
178
+ file: string;
179
+ location?: string;
180
+ reason: string;
181
+ }[] | undefined;
148
182
  transformsApplied?: number | undefined;
149
183
  errors?: {
150
184
  file: string;
@@ -95,6 +95,16 @@
95
95
  * @property {RegistryCompositionSummary} data
96
96
  */
97
97
 
98
+ /**
99
+ * A required codemod change blocked by effective working-tree protection.
100
+ * @typedef {object} ProtectedCodemodFile
101
+ * @property {string} file Project-relative path.
102
+ * @property {string[]} codemods Codemods that still require a change.
103
+ * @property {string[]} reasons Protection categories (generated, vendored, ignored, and hard boundaries).
104
+ * @property {string[]} declarations Effective declarations that protect the file.
105
+ * @property {string[]} commands Exact regeneration commands found in generated headers, when present.
106
+ */
107
+
98
108
  /**
99
109
  * astryx --json upgrade [--apply]
100
110
  * @typedef {object} UpgradeRunResponse
@@ -107,7 +117,12 @@
107
117
  * @property {boolean} data.agentDocsRefreshed
108
118
  * @property {AgentDocsSummary} data.agentDocs
109
119
  * @property {RegistryCompositionSummary} [data.registryCompositions]
120
+ * @property {boolean} [data.complete] False when protected required changes remain.
121
+ * @property {'ERR_CODEMOD_PROTECTED'} [data.errorCode] Stable incomplete-result code when complete is false.
110
122
  * @property {number} [data.filesChanged] Total files changed across core + integration codemods (apply mode).
123
+ * @property {string[]} [data.modifiedFiles] Project-relative files changed or previewed.
124
+ * @property {ProtectedCodemodFile[]} [data.protectedFiles] Protected files that still require a codemod change after regeneration.
125
+ * @property {Array<{file: string, location?: string, reason: string}>} [data.declinedCandidates] Candidates left unchanged because proof was insufficient.
111
126
  * @property {number} [data.transformsApplied] Total transforms that reported a change.
112
127
  * @property {Array<{file: string, codemod: string, error: string}>} [data.errors] Per-codemod errors, when any codemod failed.
113
128
  */