@tdk-landscape/tdk-cli-core 1.3.53 → 1.3.54

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 (388) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cli/dist/generator/extension-fetch.js +16 -9
  3. package/cli/package.json +1 -1
  4. package/package.json +16 -1
  5. package/.claude/skills/layer-autoresearch/SKILL.md +0 -48
  6. package/.claude/skills/tdk-troubleshoot/SKILL.md +0 -222
  7. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -40
  8. package/.github/ISSUE_TEMPLATE/config.yml +0 -11
  9. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
  10. package/.github/ISSUE_TEMPLATE/premium_license.yml +0 -43
  11. package/.github/dependabot.yml +0 -33
  12. package/.github/pull_request_template.md +0 -5
  13. package/.github/workflows/ci.yml +0 -200
  14. package/.github/workflows/release-binaries.yml +0 -139
  15. package/.github/zizmor.yml +0 -9
  16. package/.pre-commit-config.yaml +0 -57
  17. package/CODE_OF_CONDUCT.md +0 -9
  18. package/CONTRIBUTING.md +0 -42
  19. package/Makefile +0 -92
  20. package/SECURITY.md +0 -17
  21. package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +0 -45
  22. package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +0 -150
  23. package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +0 -73
  24. package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +0 -77
  25. package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +0 -202
  26. package/cli/AGENTS.md +0 -390
  27. package/cli/DESIGN.md +0 -735
  28. package/cli/README.md +0 -292
  29. package/cli/biome.json +0 -40
  30. package/cli/dependency-graph.svg +0 -1135
  31. package/cli/dist/cli.d.ts +0 -3
  32. package/cli/dist/cli.d.ts.map +0 -1
  33. package/cli/dist/cli.js.map +0 -1
  34. package/cli/dist/commands/completion.d.ts +0 -3
  35. package/cli/dist/commands/completion.d.ts.map +0 -1
  36. package/cli/dist/commands/completion.js.map +0 -1
  37. package/cli/dist/commands/config.d.ts +0 -3
  38. package/cli/dist/commands/config.d.ts.map +0 -1
  39. package/cli/dist/commands/config.js.map +0 -1
  40. package/cli/dist/commands/doctor.d.ts +0 -19
  41. package/cli/dist/commands/doctor.d.ts.map +0 -1
  42. package/cli/dist/commands/doctor.js.map +0 -1
  43. package/cli/dist/commands/down.d.ts +0 -3
  44. package/cli/dist/commands/down.d.ts.map +0 -1
  45. package/cli/dist/commands/down.js.map +0 -1
  46. package/cli/dist/commands/help.d.ts +0 -2
  47. package/cli/dist/commands/help.d.ts.map +0 -1
  48. package/cli/dist/commands/help.js.map +0 -1
  49. package/cli/dist/commands/networks.d.ts +0 -3
  50. package/cli/dist/commands/networks.d.ts.map +0 -1
  51. package/cli/dist/commands/networks.js.map +0 -1
  52. package/cli/dist/commands/project.d.ts +0 -9
  53. package/cli/dist/commands/project.d.ts.map +0 -1
  54. package/cli/dist/commands/project.js.map +0 -1
  55. package/cli/dist/commands/projects.d.ts +0 -3
  56. package/cli/dist/commands/projects.d.ts.map +0 -1
  57. package/cli/dist/commands/projects.js.map +0 -1
  58. package/cli/dist/commands/resource.d.ts +0 -69
  59. package/cli/dist/commands/resource.d.ts.map +0 -1
  60. package/cli/dist/commands/resource.js.map +0 -1
  61. package/cli/dist/commands/resources.d.ts +0 -3
  62. package/cli/dist/commands/resources.d.ts.map +0 -1
  63. package/cli/dist/commands/resources.js.map +0 -1
  64. package/cli/dist/commands/stack.d.ts +0 -3
  65. package/cli/dist/commands/stack.d.ts.map +0 -1
  66. package/cli/dist/commands/stack.js.map +0 -1
  67. package/cli/dist/commands/stacks.d.ts +0 -3
  68. package/cli/dist/commands/stacks.d.ts.map +0 -1
  69. package/cli/dist/commands/stacks.js.map +0 -1
  70. package/cli/dist/commands/status.d.ts +0 -3
  71. package/cli/dist/commands/status.d.ts.map +0 -1
  72. package/cli/dist/commands/status.js.map +0 -1
  73. package/cli/dist/commands/ui.d.ts +0 -3
  74. package/cli/dist/commands/ui.d.ts.map +0 -1
  75. package/cli/dist/commands/ui.js.map +0 -1
  76. package/cli/dist/commands/up.d.ts +0 -3
  77. package/cli/dist/commands/up.d.ts.map +0 -1
  78. package/cli/dist/commands/up.js.map +0 -1
  79. package/cli/dist/commands/upgrade.d.ts +0 -14
  80. package/cli/dist/commands/upgrade.d.ts.map +0 -1
  81. package/cli/dist/commands/upgrade.js.map +0 -1
  82. package/cli/dist/commands/version.d.ts +0 -3
  83. package/cli/dist/commands/version.d.ts.map +0 -1
  84. package/cli/dist/commands/version.js.map +0 -1
  85. package/cli/dist/components/Accessible.d.ts +0 -8
  86. package/cli/dist/components/Accessible.d.ts.map +0 -1
  87. package/cli/dist/components/Accessible.js.map +0 -1
  88. package/cli/dist/components/BaseTooltip.d.ts +0 -4
  89. package/cli/dist/components/BaseTooltip.d.ts.map +0 -1
  90. package/cli/dist/components/BaseTooltip.js.map +0 -1
  91. package/cli/dist/components/DetailPanel.d.ts +0 -4
  92. package/cli/dist/components/DetailPanel.d.ts.map +0 -1
  93. package/cli/dist/components/DetailPanel.js.map +0 -1
  94. package/cli/dist/components/FileTree.d.ts +0 -4
  95. package/cli/dist/components/FileTree.d.ts.map +0 -1
  96. package/cli/dist/components/FileTree.js.map +0 -1
  97. package/cli/dist/components/ResourceSelectInput.d.ts +0 -4
  98. package/cli/dist/components/ResourceSelectInput.d.ts.map +0 -1
  99. package/cli/dist/components/ResourceSelectInput.js.map +0 -1
  100. package/cli/dist/components/ResourceTable.d.ts +0 -4
  101. package/cli/dist/components/ResourceTable.d.ts.map +0 -1
  102. package/cli/dist/components/ResourceTable.js.map +0 -1
  103. package/cli/dist/components/TabBar.d.ts +0 -4
  104. package/cli/dist/components/TabBar.d.ts.map +0 -1
  105. package/cli/dist/components/TabBar.js.map +0 -1
  106. package/cli/dist/components/Tooltip.d.ts +0 -12
  107. package/cli/dist/components/Tooltip.d.ts.map +0 -1
  108. package/cli/dist/components/Tooltip.js.map +0 -1
  109. package/cli/dist/components/index.d.ts +0 -8
  110. package/cli/dist/components/index.d.ts.map +0 -1
  111. package/cli/dist/components/index.js.map +0 -1
  112. package/cli/dist/config/platform-standards.d.ts +0 -159
  113. package/cli/dist/config/platform-standards.d.ts.map +0 -1
  114. package/cli/dist/config/platform-standards.js.map +0 -1
  115. package/cli/dist/generator/extension-fetch.d.ts +0 -25
  116. package/cli/dist/generator/extension-fetch.d.ts.map +0 -1
  117. package/cli/dist/generator/extension-fetch.js.map +0 -1
  118. package/cli/dist/generator/template-engine.d.ts +0 -62
  119. package/cli/dist/generator/template-engine.d.ts.map +0 -1
  120. package/cli/dist/generator/template-engine.js.map +0 -1
  121. package/cli/dist/index.d.ts +0 -11
  122. package/cli/dist/index.d.ts.map +0 -1
  123. package/cli/dist/index.js.map +0 -1
  124. package/cli/dist/types/index.d.ts +0 -257
  125. package/cli/dist/types/index.d.ts.map +0 -1
  126. package/cli/dist/types/index.js.map +0 -1
  127. package/cli/dist/utils/cache.d.ts +0 -19
  128. package/cli/dist/utils/cache.d.ts.map +0 -1
  129. package/cli/dist/utils/cache.js.map +0 -1
  130. package/cli/dist/utils/command-helpers.d.ts +0 -17
  131. package/cli/dist/utils/command-helpers.d.ts.map +0 -1
  132. package/cli/dist/utils/command-helpers.js.map +0 -1
  133. package/cli/dist/utils/constants.d.ts +0 -53
  134. package/cli/dist/utils/constants.d.ts.map +0 -1
  135. package/cli/dist/utils/constants.js.map +0 -1
  136. package/cli/dist/utils/discovery-context.d.ts +0 -4
  137. package/cli/dist/utils/discovery-context.d.ts.map +0 -1
  138. package/cli/dist/utils/discovery-context.js.map +0 -1
  139. package/cli/dist/utils/docker.d.ts +0 -4
  140. package/cli/dist/utils/docker.d.ts.map +0 -1
  141. package/cli/dist/utils/docker.js.map +0 -1
  142. package/cli/dist/utils/doctor-runtime.d.ts +0 -81
  143. package/cli/dist/utils/doctor-runtime.d.ts.map +0 -1
  144. package/cli/dist/utils/doctor-runtime.js.map +0 -1
  145. package/cli/dist/utils/env-validator.d.ts +0 -15
  146. package/cli/dist/utils/env-validator.d.ts.map +0 -1
  147. package/cli/dist/utils/env-validator.js.map +0 -1
  148. package/cli/dist/utils/errors.d.ts +0 -31
  149. package/cli/dist/utils/errors.d.ts.map +0 -1
  150. package/cli/dist/utils/errors.js.map +0 -1
  151. package/cli/dist/utils/file-helpers.d.ts +0 -14
  152. package/cli/dist/utils/file-helpers.d.ts.map +0 -1
  153. package/cli/dist/utils/file-helpers.js.map +0 -1
  154. package/cli/dist/utils/formatting.d.ts +0 -30
  155. package/cli/dist/utils/formatting.d.ts.map +0 -1
  156. package/cli/dist/utils/formatting.js.map +0 -1
  157. package/cli/dist/utils/paths.d.ts +0 -3
  158. package/cli/dist/utils/paths.d.ts.map +0 -1
  159. package/cli/dist/utils/paths.js.map +0 -1
  160. package/cli/dist/utils/port-assignment.d.ts +0 -6
  161. package/cli/dist/utils/port-assignment.d.ts.map +0 -1
  162. package/cli/dist/utils/port-assignment.js.map +0 -1
  163. package/cli/dist/utils/project-features.d.ts +0 -23
  164. package/cli/dist/utils/project-features.d.ts.map +0 -1
  165. package/cli/dist/utils/project-features.js.map +0 -1
  166. package/cli/dist/utils/project-templates.d.ts +0 -7
  167. package/cli/dist/utils/project-templates.d.ts.map +0 -1
  168. package/cli/dist/utils/project-templates.js.map +0 -1
  169. package/cli/dist/utils/prompt.d.ts +0 -28
  170. package/cli/dist/utils/prompt.d.ts.map +0 -1
  171. package/cli/dist/utils/prompt.js.map +0 -1
  172. package/cli/dist/utils/resource-features.d.ts +0 -29
  173. package/cli/dist/utils/resource-features.d.ts.map +0 -1
  174. package/cli/dist/utils/resource-features.js.map +0 -1
  175. package/cli/dist/utils/service-urls.d.ts +0 -30
  176. package/cli/dist/utils/service-urls.d.ts.map +0 -1
  177. package/cli/dist/utils/service-urls.js.map +0 -1
  178. package/cli/dist/utils/services.d.ts +0 -18
  179. package/cli/dist/utils/services.d.ts.map +0 -1
  180. package/cli/dist/utils/services.js.map +0 -1
  181. package/cli/dist/utils/stack-features.d.ts +0 -22
  182. package/cli/dist/utils/stack-features.d.ts.map +0 -1
  183. package/cli/dist/utils/stack-features.js.map +0 -1
  184. package/cli/dist/utils/tar.d.ts +0 -7
  185. package/cli/dist/utils/tar.d.ts.map +0 -1
  186. package/cli/dist/utils/tar.js.map +0 -1
  187. package/cli/dist/utils/tilt.d.ts +0 -20
  188. package/cli/dist/utils/tilt.d.ts.map +0 -1
  189. package/cli/dist/utils/tilt.js.map +0 -1
  190. package/cli/dist/utils/validation.d.ts +0 -16
  191. package/cli/dist/utils/validation.d.ts.map +0 -1
  192. package/cli/dist/utils/validation.js.map +0 -1
  193. package/cli/knip.json +0 -6
  194. package/cli/pnpm-lock.yaml +0 -2305
  195. package/cli/pnpm-workspace.yaml +0 -2
  196. package/cli/src/cli.ts +0 -72
  197. package/cli/src/commands/__tests__/always-enabled-infra.test.ts +0 -109
  198. package/cli/src/commands/__tests__/config.test.ts +0 -146
  199. package/cli/src/commands/__tests__/doctor.test.ts +0 -730
  200. package/cli/src/commands/__tests__/error-handling.test.ts +0 -78
  201. package/cli/src/commands/__tests__/phases-model.test.ts +0 -161
  202. package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +0 -187
  203. package/cli/src/commands/__tests__/project.test.ts +0 -68
  204. package/cli/src/commands/__tests__/resource.test.ts +0 -226
  205. package/cli/src/commands/__tests__/saas-starter-integration.test.ts +0 -194
  206. package/cli/src/commands/__tests__/stack-features-e2e.test.ts +0 -135
  207. package/cli/src/commands/__tests__/upgrade.test.ts +0 -198
  208. package/cli/src/commands/completion.ts +0 -300
  209. package/cli/src/commands/config.ts +0 -299
  210. package/cli/src/commands/doctor.ts +0 -926
  211. package/cli/src/commands/down.ts +0 -37
  212. package/cli/src/commands/help.ts +0 -143
  213. package/cli/src/commands/networks-design.md +0 -80
  214. package/cli/src/commands/networks.ts +0 -332
  215. package/cli/src/commands/project.ts +0 -456
  216. package/cli/src/commands/projects.ts +0 -82
  217. package/cli/src/commands/resource.ts +0 -652
  218. package/cli/src/commands/resources.ts +0 -95
  219. package/cli/src/commands/stack.ts +0 -128
  220. package/cli/src/commands/stacks.ts +0 -52
  221. package/cli/src/commands/status.ts +0 -88
  222. package/cli/src/commands/ui.tsx +0 -843
  223. package/cli/src/commands/up.ts +0 -169
  224. package/cli/src/commands/upgrade.ts +0 -628
  225. package/cli/src/commands/version.ts +0 -9
  226. package/cli/src/components/Accessible.tsx +0 -21
  227. package/cli/src/components/BaseTooltip.tsx +0 -66
  228. package/cli/src/components/DetailPanel.tsx +0 -146
  229. package/cli/src/components/FileTree.tsx +0 -89
  230. package/cli/src/components/ResourceSelectInput.tsx +0 -30
  231. package/cli/src/components/ResourceTable.tsx +0 -78
  232. package/cli/src/components/TabBar.tsx +0 -53
  233. package/cli/src/components/Tooltip.tsx +0 -11
  234. package/cli/src/components/index.ts +0 -7
  235. package/cli/src/config/platform-standards.test.ts +0 -11
  236. package/cli/src/config/platform-standards.ts +0 -196
  237. package/cli/src/generator/__tests__/extension-fetch.test.ts +0 -242
  238. package/cli/src/generator/__tests__/template-engine.test.ts +0 -70
  239. package/cli/src/generator/extension-fetch.ts +0 -286
  240. package/cli/src/generator/template-engine.ts +0 -752
  241. package/cli/src/index.ts +0 -86
  242. package/cli/src/templates.d.ts +0 -4
  243. package/cli/src/types/index.ts +0 -353
  244. package/cli/src/utils/__tests__/cache.test.ts +0 -98
  245. package/cli/src/utils/__tests__/formatting.test.ts +0 -170
  246. package/cli/src/utils/__tests__/paths.test.ts +0 -180
  247. package/cli/src/utils/__tests__/port-assignment.test.ts +0 -121
  248. package/cli/src/utils/__tests__/service-urls.test.ts +0 -174
  249. package/cli/src/utils/__tests__/services.test.ts +0 -531
  250. package/cli/src/utils/__tests__/tilt.test.ts +0 -172
  251. package/cli/src/utils/__tests__/validation.test.ts +0 -148
  252. package/cli/src/utils/cache.ts +0 -76
  253. package/cli/src/utils/command-helpers.ts +0 -54
  254. package/cli/src/utils/constants.ts +0 -130
  255. package/cli/src/utils/discovery-context.ts +0 -49
  256. package/cli/src/utils/docker.ts +0 -20
  257. package/cli/src/utils/doctor-runtime.ts +0 -644
  258. package/cli/src/utils/env-validator.ts +0 -139
  259. package/cli/src/utils/errors.ts +0 -168
  260. package/cli/src/utils/file-helpers.ts +0 -62
  261. package/cli/src/utils/formatting.ts +0 -215
  262. package/cli/src/utils/paths.ts +0 -53
  263. package/cli/src/utils/port-assignment.ts +0 -106
  264. package/cli/src/utils/project-features.ts +0 -118
  265. package/cli/src/utils/project-templates.ts +0 -29
  266. package/cli/src/utils/prompt.ts +0 -128
  267. package/cli/src/utils/resource-features.ts +0 -215
  268. package/cli/src/utils/service-urls.ts +0 -124
  269. package/cli/src/utils/services.ts +0 -364
  270. package/cli/src/utils/stack-features.ts +0 -30
  271. package/cli/src/utils/tar.ts +0 -24
  272. package/cli/src/utils/tilt.ts +0 -133
  273. package/cli/src/utils/validation.ts +0 -67
  274. package/cli/tsconfig.json +0 -25
  275. package/cli/tsconfig.typecheck.json +0 -8
  276. package/docs/FEATURES.md +0 -281
  277. package/docs/demo.svg +0 -217
  278. package/engine/docs/AUTODISCOVERY_TEST.md +0 -182
  279. package/engine/docs/C4-ARCHITECTURE-operations.md +0 -396
  280. package/engine/docs/C4-ARCHITECTURE-overview.md +0 -284
  281. package/engine/docs/C4-ARCHITECTURE.md +0 -17
  282. package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +0 -349
  283. package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +0 -357
  284. package/engine/docs/README.md +0 -284
  285. package/install.sh +0 -19
  286. package/knip.json +0 -10
  287. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +0 -2
  288. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +0 -102
  289. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +0 -31
  290. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +0 -48
  291. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +0 -63
  292. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +0 -56
  293. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +0 -61
  294. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +0 -2
  295. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +0 -114
  296. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +0 -32
  297. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +0 -20
  298. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +0 -20
  299. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +0 -20
  300. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +0 -194
  301. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +0 -2
  302. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +0 -111
  303. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +0 -33
  304. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +0 -12
  305. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +0 -18
  306. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +0 -16
  307. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +0 -12
  308. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +0 -12
  309. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +0 -194
  310. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +0 -2
  311. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +0 -84
  312. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +0 -31
  313. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +0 -27
  314. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +0 -27
  315. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +0 -23
  316. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +0 -27
  317. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +0 -39
  318. package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +0 -2
  319. package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +0 -80
  320. package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +0 -40
  321. package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +0 -52
  322. package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +0 -51
  323. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +0 -2
  324. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +0 -43
  325. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +0 -29
  326. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +0 -67
  327. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +0 -27
  328. package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +0 -3
  329. package/openspec/changes/optimize-runtime-docker-layers/design.md +0 -81
  330. package/openspec/changes/optimize-runtime-docker-layers/proposal.md +0 -44
  331. package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +0 -79
  332. package/openspec/changes/optimize-runtime-docker-layers/tasks.md +0 -36
  333. package/openspec/changes/prioritized-cold-start/.openspec.yaml +0 -4
  334. package/openspec/changes/prioritized-cold-start/design.md +0 -137
  335. package/openspec/changes/prioritized-cold-start/proposal.md +0 -41
  336. package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +0 -98
  337. package/openspec/changes/prioritized-cold-start/tasks.md +0 -69
  338. package/openspec/config.yaml +0 -1
  339. package/openspec/specs/manifest-field-migration/spec.md +0 -24
  340. package/openspec/specs/resource-terminology-standard/spec.md +0 -24
  341. package/openspec/specs/self-contained-generated-projects/spec.md +0 -67
  342. package/openspec/specs/stack-terminology-standard/spec.md +0 -24
  343. package/platform/services/platform/proxy/service.yaml +0 -14
  344. package/scripts/audit-codebase.sh +0 -213
  345. package/scripts/autoresearch/layer-eval.sh +0 -65
  346. package/scripts/benchmark/README.md +0 -25
  347. package/scripts/benchmark/container-scale.ts +0 -503
  348. package/scripts/benchmark/pre-release-gate.sh +0 -9
  349. package/scripts/install-git-hooks.sh +0 -14
  350. package/scripts/measure-idle-footprint.sh +0 -58
  351. package/scripts/record-demo.sh +0 -43
  352. package/scripts/release-binaries.sh +0 -97
  353. package/scripts/setup-pre-commit.sh +0 -33
  354. package/scripts/stage-npm-engine.sh +0 -36
  355. package/tests/tilt-engine/__init__.py +0 -5
  356. package/tests/tilt-engine/conftest.py +0 -182
  357. package/tests/tilt-engine/fixtures/appointment-frontend-service.json +0 -11
  358. package/tests/tilt-engine/fixtures/identity-backend-service.json +0 -12
  359. package/tests/tilt-engine/fixtures/invalid-service.json +0 -4
  360. package/tests/tilt-engine/test_agents_md_generator.py +0 -341
  361. package/tests/tilt-engine/test_agents_md_integration.py +0 -378
  362. package/tests/tilt-engine/test_cache_operations.py +0 -181
  363. package/tests/tilt-engine/test_cache_persistence.py +0 -142
  364. package/tests/tilt-engine/test_code_executor.py +0 -152
  365. package/tests/tilt-engine/test_code_viewer.py +0 -127
  366. package/tests/tilt-engine/test_compose_port_anchors.py +0 -310
  367. package/tests/tilt-engine/test_config_inspector.py +0 -162
  368. package/tests/tilt-engine/test_daemon_focus_mode.py +0 -89
  369. package/tests/tilt-engine/test_daemon_polling.py +0 -122
  370. package/tests/tilt-engine/test_daemon_registration.py +0 -115
  371. package/tests/tilt-engine/test_daemon_validation.py +0 -107
  372. package/tests/tilt-engine/test_docker_generator_bugs.py +0 -493
  373. package/tests/tilt-engine/test_docker_prune.py +0 -119
  374. package/tests/tilt-engine/test_dockerignore_path_bug.py +0 -82
  375. package/tests/tilt-engine/test_file_browser.py +0 -193
  376. package/tests/tilt-engine/test_frontend_basepath_manifest.py +0 -27
  377. package/tests/tilt-engine/test_health_dependencies.py +0 -130
  378. package/tests/tilt-engine/test_health_endpoints.py +0 -118
  379. package/tests/tilt-engine/test_health_tilt_ui.py +0 -85
  380. package/tests/tilt-engine/test_runtime_container_footprint.py +0 -162
  381. package/tests/tilt-engine/test_sablier_defer_start.py +0 -237
  382. package/tests/tilt-engine/test_safety_aliases.py +0 -84
  383. package/tests/tilt-engine/test_snapshot_diff.py +0 -136
  384. package/tests/tilt-engine/test_snapshot_persistence.py +0 -163
  385. package/tests/tilt-engine/test_snapshot_scanning.py +0 -123
  386. package/tests/tilt-engine/test_standalone_project_boot.py +0 -61
  387. package/tests/tilt-engine/test_standalone_traefik.py +0 -160
  388. package/tests/tilt-engine/test_traefik_static_wake_route.py +0 -187
@@ -1,644 +0,0 @@
1
- import { execSync } from "node:child_process";
2
- import { existsSync, readFileSync } from "node:fs";
3
- import { join } from "node:path";
4
- import type { CheckResult } from "../types/index.js";
5
- import { formatCount } from "./formatting.js";
6
- import { findProjectRoot } from "./paths.js";
7
- import { getProjectName } from "./service-urls.js";
8
- import { discoverResources } from "./services.js";
9
-
10
- const EXEC_TIMEOUT_MS = 10_000;
11
- const REGISTRY_PROBE_TIMEOUT_MS = 3_000;
12
- const DEFAULT_VERDACCIO_URL = "http://localhost:4873";
13
-
14
- /** Host ports Traefik publishes for local ingress. Without these, app routes never come up. */
15
- export const INGRESS_PORTS = [80, 443] as const;
16
-
17
- export function toComposeProjectPrefix(projectName: string): string {
18
- return projectName.replace(/-/g, "_");
19
- }
20
-
21
- export interface PublishedPortHolder {
22
- name: string;
23
- ports: string;
24
- publishedPorts: number[];
25
- }
26
-
27
- /**
28
- * Parse `docker ps --format '{{.Names}}\t{{.Ports}}'` lines into containers that
29
- * publish specific host ports (e.g. 0.0.0.0:80->80/tcp).
30
- */
31
- export function parsePublishedPortHolders(
32
- dockerPsOutput: string,
33
- ports: readonly number[],
34
- ): PublishedPortHolder[] {
35
- const wanted = new Set(ports);
36
- const holders: PublishedPortHolder[] = [];
37
-
38
- for (const line of dockerPsOutput.split("\n")) {
39
- const trimmed = line.trim();
40
- if (!trimmed) continue;
41
- const tab = trimmed.indexOf("\t");
42
- const name = tab >= 0 ? trimmed.slice(0, tab) : trimmed;
43
- const portsField = tab >= 0 ? trimmed.slice(tab + 1) : "";
44
- const publishedPorts: number[] = [];
45
-
46
- for (const port of wanted) {
47
- // Matches 0.0.0.0:80->, :::80->, 127.0.0.1:80->
48
- const pattern = new RegExp(`(?:^|[\\s,])(?:\\d[\\d.]*:|\\[::\\]:|::)?${port}->`);
49
- if (pattern.test(portsField) || portsField.includes(`:${port}->`)) {
50
- publishedPorts.push(port);
51
- }
52
- }
53
-
54
- if (publishedPorts.length > 0) {
55
- holders.push({ name, ports: portsField, publishedPorts });
56
- }
57
- }
58
-
59
- return holders;
60
- }
61
-
62
- export function isOwnIngressContainer(containerName: string, projectPrefix: string): boolean {
63
- const name = containerName.toLowerCase();
64
- const prefix = projectPrefix.toLowerCase();
65
- // tdk_project_traefik, tdk_project-traefik-1, etc.
66
- return name === `${prefix}_traefik` || name.startsWith(`${prefix}_traefik`);
67
- }
68
-
69
- export function findForeignIngressHolders(
70
- holders: PublishedPortHolder[],
71
- projectPrefix: string,
72
- ): PublishedPortHolder[] {
73
- return holders.filter((holder) => !isOwnIngressContainer(holder.name, projectPrefix));
74
- }
75
-
76
- export interface TiltResourceFailure {
77
- name: string;
78
- updateStatus: string;
79
- runtimeStatus: string;
80
- error: string;
81
- }
82
-
83
- interface TiltUiResourceItem {
84
- metadata?: { name?: string };
85
- status?: {
86
- updateStatus?: string;
87
- runtimeStatus?: string;
88
- buildHistory?: Array<{ error?: string }>;
89
- };
90
- }
91
-
92
- /**
93
- * Resource names with `sablier: {enable: true, deferStart: true}` in their
94
- * manifest (openspec/changes/prioritized-cold-start): these are expected to
95
- * sit at `runtimeStatus: none` until their first request, not a sign of
96
- * anything stuck. Best-effort — returns an empty set if discovery fails
97
- * (e.g. not run from inside a project), so callers degrade to today's
98
- * behavior rather than erroring.
99
- */
100
- export function getDeferredResourceNames(): Set<string> {
101
- try {
102
- return new Set(
103
- discoverResources()
104
- .filter((svc) => svc.config?.sablier?.enable && svc.config?.sablier?.deferStart)
105
- .map((svc) => svc.name),
106
- );
107
- } catch {
108
- return new Set();
109
- }
110
- }
111
-
112
- /**
113
- * Extract failing UIResources from `tilt get uiresources -o json`.
114
- *
115
- * `deferredNames` (typically from getDeferredResourceNames()) separates a
116
- * `sablier.deferStart` resource's expected `none`/`pending` status into its
117
- * own count so it's never described as "blocked" or otherwise lumped in with
118
- * genuinely stuck resources.
119
- */
120
- export function parseTiltResourceFailures(
121
- jsonText: string,
122
- deferredNames: Set<string> = new Set(),
123
- ): {
124
- failures: TiltResourceFailure[];
125
- pendingCount: number;
126
- deferredCount: number;
127
- okCount: number;
128
- total: number;
129
- } {
130
- const parsed = JSON.parse(jsonText) as { items?: TiltUiResourceItem[] };
131
- const items = parsed.items ?? [];
132
- const failures: TiltResourceFailure[] = [];
133
- let pendingCount = 0;
134
- let deferredCount = 0;
135
- let okCount = 0;
136
-
137
- for (const item of items) {
138
- const name = item.metadata?.name ?? "unknown";
139
- const updateStatus = item.status?.updateStatus ?? "";
140
- const runtimeStatus = item.status?.runtimeStatus ?? "";
141
- const error = (item.status?.buildHistory?.[0]?.error ?? "").trim();
142
-
143
- if (updateStatus === "error" || runtimeStatus === "error") {
144
- failures.push({
145
- name,
146
- updateStatus,
147
- runtimeStatus,
148
- // Keep enough of the raw Tilt error for summarizers; display uses
149
- // summarizeTiltBuildError() which extracts the actionable root cause.
150
- error: error.replace(/\s+/g, " ").slice(0, 800),
151
- });
152
- continue;
153
- }
154
-
155
- if (updateStatus === "ok" && (runtimeStatus === "ok" || runtimeStatus === "not_applicable")) {
156
- okCount += 1;
157
- continue;
158
- }
159
-
160
- if (
161
- name !== "(Tiltfile)" &&
162
- (updateStatus === "pending" ||
163
- runtimeStatus === "pending" ||
164
- updateStatus === "none" ||
165
- runtimeStatus === "none")
166
- ) {
167
- if (deferredNames.has(name)) {
168
- deferredCount += 1;
169
- } else {
170
- pendingCount += 1;
171
- }
172
- }
173
- }
174
-
175
- return { failures, pendingCount, deferredCount, okCount, total: items.length };
176
- }
177
-
178
- /**
179
- * Turn noisy Tilt/Docker build errors into an actionable one-liner.
180
- * Prefer registry/network root causes over truncated ImageBuild exit lines.
181
- */
182
- export function summarizeTiltBuildError(error: string): string {
183
- const normalized = error.replace(/\s+/g, " ").trim();
184
-
185
- const bindMatch = normalized.match(/Bind for [^ ]+:(\d+) failed: port is already allocated/i);
186
- if (bindMatch) {
187
- return `host port ${bindMatch[1]} is already allocated`;
188
- }
189
- if (/port is already allocated/i.test(normalized)) {
190
- return "a required host port is already allocated";
191
- }
192
-
193
- const refusedPackages = [
194
- ...normalized.matchAll(/ConnectionRefused downloading package manifest (@[A-Za-z0-9._/-]+)/gi),
195
- ].map((match) => match[1]);
196
- if (refusedPackages.length > 0) {
197
- const unique = [...new Set(refusedPackages)];
198
- const shown = unique.slice(0, 4).join(", ");
199
- const more = unique.length > 4 ? ` (+${unique.length - 4} more)` : "";
200
- return `private registry ConnectionRefused for ${shown}${more} — Verdaccio (:4873) is down or unreachable from the build`;
201
- }
202
-
203
- if (
204
- /failed to resolve source metadata for docker\.io\/library\/(tdk-project-[^:\s]+)/i.test(
205
- normalized,
206
- )
207
- ) {
208
- const image = normalized.match(
209
- /failed to resolve source metadata for docker\.io\/library\/(tdk-project-[^:\s]+)/i,
210
- )?.[1];
211
- return `base image ${image ?? "tdk-project-*"} missing locally (golden-layer build not finished or failed)`;
212
- }
213
-
214
- if (
215
- /install-deps\.sh/i.test(normalized) ||
216
- /bun install(?: --production)?/i.test(normalized) ||
217
- /npm (?:ci|install)/i.test(normalized)
218
- ) {
219
- return "dependency install failed during ImageBuild — usually Verdaccio (:4873) unreachable or missing @scoped packages (ConnectionRefused downloading package manifest)";
220
- }
221
-
222
- const missingImage =
223
- normalized.match(/No such image:\s*([^\s]+)/i)?.[1] ??
224
- normalized.match(/pull access denied for ([^,:\s]+)/i)?.[1] ??
225
- undefined;
226
- const composeService = normalized.match(/\bup\s+-d\s+--no-build\s+([A-Za-z0-9._-]+)/i)?.[1];
227
- if (
228
- missingImage ||
229
- composeService ||
230
- /docker compose .*\bup\s+-d\s+--no-build\b/i.test(normalized)
231
- ) {
232
- const imageLabel = missingImage ?? `${composeService ?? "service"}:dev`;
233
- const serviceHint = composeService ? ` for ${composeService}` : "";
234
- return `compose run failed because image is missing (${imageLabel})${serviceHint} — wait for the ImageBuild resource to finish, then re-trigger the *-run-only resource`;
235
- }
236
-
237
- if (/bun run build/i.test(normalized)) {
238
- return "ImageBuild failed during `bun run build` (compile/typecheck) — open the resource logs in Tilt for the TypeScript/build error";
239
- }
240
-
241
- if (/ImageBuild:/i.test(normalized) || /^Command "/i.test(normalized)) {
242
- return normalized.slice(0, 220);
243
- }
244
-
245
- return normalized.slice(0, 220);
246
- }
247
-
248
- export function isRegistryRelatedBuildError(error: string): boolean {
249
- return /ConnectionRefused downloading package manifest|Verdaccio|private registry|dependency install failed during ImageBuild|install-deps\.sh|bun install/i.test(
250
- error,
251
- );
252
- }
253
-
254
- export function projectExpectsVerdaccio(
255
- projectRoot: string = findProjectRoot() ?? process.cwd(),
256
- ): boolean {
257
- const projectJsonPath = join(projectRoot, ".tdk", "project.json");
258
- if (existsSync(projectJsonPath)) {
259
- try {
260
- const parsed = JSON.parse(readFileSync(projectJsonPath, "utf-8")) as {
261
- optional_infra?: { verdaccio?: boolean };
262
- phases?: Record<string, { enabledStacks?: string[] }>;
263
- };
264
- if (parsed.optional_infra?.verdaccio === true) {
265
- return true;
266
- }
267
- if (
268
- Object.values(parsed.phases ?? {}).some((phase) =>
269
- (phase.enabledStacks ?? []).includes("verdaccio"),
270
- )
271
- ) {
272
- return true;
273
- }
274
- } catch {
275
- // Fall through to npmrc heuristics.
276
- }
277
- }
278
-
279
- // Heuristic: scoped private registry pointed at :4873
280
- for (const candidate of [join(projectRoot, ".npmrc"), join(projectRoot, "package.json")]) {
281
- if (!existsSync(candidate)) continue;
282
- try {
283
- const text = readFileSync(candidate, "utf-8");
284
- if (/:4873\b/.test(text) || /verdaccio/i.test(text)) {
285
- return true;
286
- }
287
- } catch {
288
- // ignore
289
- }
290
- }
291
-
292
- return false;
293
- }
294
-
295
- /**
296
- * When the project uses a local Verdaccio registry, fail early with a clear
297
- * fix instead of only showing truncated ImageBuild exit codes later.
298
- */
299
- export function checkPrivateNpmRegistry(
300
- exec: typeof execSync = execSync,
301
- projectRoot: string = findProjectRoot() ?? process.cwd(),
302
- registryUrl: string = process.env.VERDACCIO_URL ??
303
- process.env.NPM_REGISTRY_URL ??
304
- DEFAULT_VERDACCIO_URL,
305
- ): CheckResult {
306
- if (!projectExpectsVerdaccio(projectRoot)) {
307
- return {
308
- name: "Private npm registry",
309
- didPass: true,
310
- isSkipped: true,
311
- message: "Private npm registry (Verdaccio) not enabled for this project - skipped",
312
- };
313
- }
314
-
315
- let containerRunning = false;
316
- try {
317
- const names = exec("docker ps --format '{{.Names}}'", {
318
- stdio: "pipe",
319
- encoding: "utf-8",
320
- timeout: EXEC_TIMEOUT_MS,
321
- });
322
- containerRunning = /verdaccio/i.test(names);
323
- } catch {
324
- // Docker may be down; other doctor checks cover that.
325
- }
326
-
327
- let httpOk = false;
328
- let httpDetail = "";
329
- try {
330
- // curl is more reliable than fetch in the compiled CLI binary environments.
331
- const probe = exec(
332
- `curl -fsS -o /dev/null -w '%{http_code}' --max-time 2 ${JSON.stringify(registryUrl)}`,
333
- {
334
- stdio: "pipe",
335
- encoding: "utf-8",
336
- timeout: REGISTRY_PROBE_TIMEOUT_MS + 1_000,
337
- },
338
- ).trim();
339
- httpOk = /^[23]\d\d$/.test(probe);
340
- httpDetail = `HTTP ${probe}`;
341
- } catch (error) {
342
- httpDetail = error instanceof Error ? error.message.slice(0, 120) : "request failed";
343
- }
344
-
345
- if (httpOk) {
346
- return {
347
- name: "Private npm registry",
348
- didPass: true,
349
- message: `Private npm registry reachable at ${registryUrl}${
350
- containerRunning ? " (verdaccio container running)" : ""
351
- }`,
352
- };
353
- }
354
-
355
- if (containerRunning) {
356
- return {
357
- name: "Private npm registry",
358
- didPass: false,
359
- message: `Verdaccio container is running but ${registryUrl} is not responding (${httpDetail}). ImageBuilds that install @scoped packages will fail with ConnectionRefused downloading package manifest.`,
360
- fix: "Check `docker logs` for the verdaccio container, confirm port 4873 is published, then re-run `tdk doctor`.",
361
- };
362
- }
363
-
364
- return {
365
- name: "Private npm registry",
366
- didPass: false,
367
- message: `Private npm registry (Verdaccio) is not reachable at ${registryUrl}. Docker ImageBuilds will fail with ConnectionRefused downloading package manifests for @tdk-landscape/* and project-scoped packages.`,
368
- fix: "Start the registry with `bun run verdaccio:start` (or `docker compose -f docker-compose.verdaccio.yml up -d`), publish packages with `bun run publish:all` / `scripts/build/publish-to-verdaccio.sh`, then `tilt trigger` failed resources or re-run `tdk up`.",
369
- };
370
- }
371
-
372
- /**
373
- * Fail when another container already owns Traefik's host ports (80/443).
374
- * This is the exact failure mode that leaves apps never scheduled while doctor
375
- * previously reported "Environment ready".
376
- */
377
- export function checkIngressPorts(
378
- exec: typeof execSync = execSync,
379
- projectName: string = getProjectName(),
380
- ): CheckResult {
381
- const projectPrefix = toComposeProjectPrefix(projectName);
382
- let dockerPs = "";
383
-
384
- try {
385
- dockerPs = exec("docker ps --format '{{.Names}}\\t{{.Ports}}'", {
386
- stdio: "pipe",
387
- encoding: "utf-8",
388
- timeout: EXEC_TIMEOUT_MS,
389
- });
390
- } catch {
391
- return {
392
- name: "Ingress Ports",
393
- didPass: true,
394
- isSkipped: true,
395
- message: "Docker not available - skipped ingress port check",
396
- };
397
- }
398
-
399
- const holders = parsePublishedPortHolders(dockerPs, INGRESS_PORTS);
400
- const foreign = findForeignIngressHolders(holders, projectPrefix);
401
-
402
- if (foreign.length === 0) {
403
- const own = holders.filter((holder) => isOwnIngressContainer(holder.name, projectPrefix));
404
- if (own.length > 0) {
405
- return {
406
- name: "Ingress Ports",
407
- didPass: true,
408
- message: `Ingress ports ${INGRESS_PORTS.join("/")} held by this project's Traefik (${own
409
- .map((h) => h.name)
410
- .join(", ")})`,
411
- };
412
- }
413
- return {
414
- name: "Ingress Ports",
415
- didPass: true,
416
- message: `Ingress ports ${INGRESS_PORTS.join("/")} are free for Traefik`,
417
- };
418
- }
419
-
420
- const details = foreign
421
- .map((holder) => {
422
- const ports = holder.publishedPorts.join(", ");
423
- return `${holder.name} (host ports ${ports})`;
424
- })
425
- .join("\n ");
426
-
427
- return {
428
- name: "Ingress Ports",
429
- didPass: false,
430
- message: `Traefik cannot bind ingress ports because another container already owns them:\n ${details}`,
431
- fix: `Stop the foreign container(s), e.g. \`docker stop ${foreign[0]?.name}\`, or shut down the other TDK/Tilt project using that Traefik. Then re-run \`tdk up\`.`,
432
- };
433
- }
434
-
435
- /**
436
- * When a Tilt session is active, surface resource update errors (Traefik port
437
- * binds, image builds, etc.) instead of claiming the environment is ready
438
- * while apps sit forever in pending/none.
439
- */
440
- export function checkTiltResourceHealth(exec: typeof execSync = execSync): CheckResult {
441
- let jsonText = "";
442
- try {
443
- jsonText = exec("tilt get uiresources -o json", {
444
- stdio: "pipe",
445
- encoding: "utf-8",
446
- timeout: EXEC_TIMEOUT_MS,
447
- });
448
- } catch {
449
- return {
450
- name: "Tilt Resources",
451
- didPass: true,
452
- isSkipped: true,
453
- message: "Tilt is not running - skipped resource status check",
454
- fix: "Start them with: tdk up",
455
- };
456
- }
457
-
458
- let parsed: ReturnType<typeof parseTiltResourceFailures>;
459
- try {
460
- parsed = parseTiltResourceFailures(jsonText, getDeferredResourceNames());
461
- } catch {
462
- return {
463
- name: "Tilt Resources",
464
- didPass: true,
465
- isSkipped: true,
466
- message: "Could not parse Tilt resource status - skipped",
467
- };
468
- }
469
-
470
- if (parsed.total === 0) {
471
- return {
472
- name: "Tilt Resources",
473
- didPass: true,
474
- isSkipped: true,
475
- message: "No Tilt UIResources found",
476
- };
477
- }
478
-
479
- if (parsed.failures.length === 0) {
480
- const deferredNote = parsed.deferredCount > 0 ? `, ${parsed.deferredCount} deferred` : "";
481
- return {
482
- name: "Tilt Resources",
483
- didPass: true,
484
- message: `Tilt resources healthy (${parsed.okCount} ok, ${parsed.pendingCount} pending${deferredNote})`,
485
- };
486
- }
487
-
488
- // Always list every failed resource. Earlier logic showed only "critical"
489
- // infra matches (e.g. nats-http-bridge) and hid the other ImageBuild/run-only
490
- // failures, so doctor said "7 failed" while printing a single line.
491
- const ordered = orderTiltFailures(parsed.failures);
492
- const maxListed = 20;
493
- const listed = ordered.slice(0, maxListed);
494
- const omitted = ordered.length - listed.length;
495
-
496
- const described = listed.map((failure) => ({
497
- failure,
498
- why: describeTiltFailure(failure, exec),
499
- }));
500
- const details = described.map(({ failure, why }) => `${failure.name}: ${why}`).join("\n ");
501
- const omittedNote =
502
- omitted > 0 ? `\n …and ${formatCount(omitted, "more failed resource")}` : "";
503
-
504
- const pendingNote =
505
- parsed.pendingCount > 0
506
- ? `\n ${formatCount(parsed.pendingCount, "resource")} still pending/not started — often blocked by the failures above.`
507
- : "";
508
- const deferredNote =
509
- parsed.deferredCount > 0
510
- ? `\n ${formatCount(parsed.deferredCount, "resource")} intentionally deferred (sablier.deferStart) — not started until first request, unrelated to the failures above.`
511
- : "";
512
-
513
- const hasPortConflict = ordered.some((failure) =>
514
- /port is already allocated/i.test(failure.error),
515
- );
516
- const hasRegistryFailure = ordered.some(
517
- (failure) =>
518
- isRegistryRelatedBuildError(failure.error) ||
519
- isRegistryRelatedBuildError(summarizeTiltBuildError(failure.error)),
520
- );
521
- const hasKafkaRuntimeFailure = described.some(({ why }) =>
522
- /Kafka broker unreachable|kafka:9092/i.test(why),
523
- );
524
-
525
- let fix =
526
- "Open http://localhost:10350, inspect the red resources, fix the listed errors, then `tilt trigger <resource>` or re-run `tdk up`.";
527
- if (hasPortConflict) {
528
- fix =
529
- "Free the conflicting host port (usually 80/443): `docker ps --filter publish=80` then `docker stop <other-traefik>`. Re-trigger Traefik in the Tilt UI or run `tdk up` again.";
530
- } else if (hasRegistryFailure) {
531
- fix =
532
- "Start Verdaccio (`bun run verdaccio:start`), ensure packages are published (`bun run publish:all` or `bash scripts/build/publish-to-verdaccio.sh`), confirm `curl http://localhost:4873` works, then `tilt trigger` the failed resources.";
533
- } else if (hasKafkaRuntimeFailure) {
534
- fix =
535
- "Kafka is not running (optional infra). Start it, point the bridge at a real broker, or disable Kafka-dependent resources until Kafka is enabled.";
536
- }
537
-
538
- return {
539
- name: "Tilt Resources",
540
- didPass: false,
541
- message: `Tilt reports ${formatCount(parsed.failures.length, "failed resource")}:\n ${details}${omittedNote}${pendingNote}${deferredNote}`,
542
- fix,
543
- };
544
- }
545
-
546
- const INFRA_FAILURE_NAME = /^(traefik|postgres|nats|infisical|verdaccio|proxy)([.-]|$)/i;
547
-
548
- export function isInfraTiltFailure(name: string): boolean {
549
- return INFRA_FAILURE_NAME.test(name);
550
- }
551
-
552
- /** Critical infra first, then everything else — never drop failures. */
553
- export function orderTiltFailures(failures: TiltResourceFailure[]): TiltResourceFailure[] {
554
- return [...failures].sort((a, b) => {
555
- const aInfra = isInfraTiltFailure(a.name) ? 0 : 1;
556
- const bInfra = isInfraTiltFailure(b.name) ? 0 : 1;
557
- if (aInfra !== bInfra) return aInfra - bInfra;
558
- return a.name.localeCompare(b.name);
559
- });
560
- }
561
-
562
- /**
563
- * Best-effort root cause for runtime crashes when buildHistory has no error.
564
- * Reads recent docker logs for the matching container name.
565
- */
566
- export function probeContainerRuntimeError(
567
- resourceName: string,
568
- exec: typeof execSync = execSync,
569
- ): string | null {
570
- try {
571
- const names = exec("docker ps -a --format '{{.Names}}'", {
572
- stdio: "pipe",
573
- encoding: "utf-8",
574
- timeout: EXEC_TIMEOUT_MS,
575
- })
576
- .split("\n")
577
- .map((line) => line.trim())
578
- .filter(Boolean);
579
-
580
- const match =
581
- names.find((name) => name === resourceName) ??
582
- names.find((name) => name.includes(resourceName));
583
- if (!match) return null;
584
-
585
- const logs = exec(`docker logs --tail 120 ${JSON.stringify(match)} 2>&1`, {
586
- stdio: "pipe",
587
- encoding: "utf-8",
588
- timeout: EXEC_TIMEOUT_MS,
589
- });
590
-
591
- if (/getaddrinfo ENOTFOUND/i.test(logs) && /kafka:9092/i.test(logs)) {
592
- return "runtime crash: Kafka broker unreachable (getaddrinfo ENOTFOUND kafka:9092)";
593
- }
594
- if (/ECONNREFUSED/i.test(logs) && /kafka/i.test(logs)) {
595
- return "runtime crash: Kafka connection refused";
596
- }
597
- const refusedPkg = logs.match(
598
- /ConnectionRefused downloading package manifest (@[A-Za-z0-9._/-]+)/i,
599
- );
600
- if (refusedPkg?.[1]) {
601
- return `runtime/build log: private registry ConnectionRefused for ${refusedPkg[1]}`;
602
- }
603
-
604
- // Zod env/config validation: pull required field paths from the dump.
605
- if (/ZodError/i.test(logs)) {
606
- const requiredPaths = [...logs.matchAll(/"path"\s*:\s*\[\s*"([^"]+)"\s*\]/g)].map(
607
- (match) => match[1],
608
- );
609
- const uniquePaths = [...new Set(requiredPaths)].slice(0, 6);
610
- if (uniquePaths.length > 0) {
611
- return `runtime crash: ZodError missing required config/env: ${uniquePaths.join(", ")}`;
612
- }
613
- return "runtime crash: ZodError during config/env validation";
614
- }
615
-
616
- // Prefer structured app failures over random source lines that contain "error =".
617
- const structured =
618
- logs.match(/error:\s+Failed to [^:\n]+[^\n]{0,120}/i)?.[0] ??
619
- logs.match(/Failed to (?:start|initialize) [^\n]{0,120}/i)?.[0] ??
620
- logs.match(/^\s*error:\s+[^\n]{0,160}/im)?.[0];
621
- if (structured) {
622
- return `runtime crash: ${structured.replace(/\s+/g, " ").trim().slice(0, 180)}`;
623
- }
624
- } catch {
625
- return null;
626
- }
627
- return null;
628
- }
629
-
630
- export function describeTiltFailure(
631
- failure: TiltResourceFailure,
632
- exec: typeof execSync = execSync,
633
- ): string {
634
- if (failure.error) {
635
- return summarizeTiltBuildError(failure.error);
636
- }
637
- if (failure.runtimeStatus === "error") {
638
- return (
639
- probeContainerRuntimeError(failure.name, exec) ??
640
- "runtime error (container crashed or unhealthy — check Tilt/docker logs)"
641
- );
642
- }
643
- return failure.updateStatus || failure.runtimeStatus || "unknown error";
644
- }