@tdk-landscape/tdk-cli-core 1.3.52 → 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 (390) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +1 -1
  3. package/cli/dist/commands/config.js +1 -1
  4. package/cli/dist/commands/resource.js +1 -1
  5. package/cli/dist/generator/extension-fetch.js +16 -9
  6. package/cli/package.json +1 -1
  7. package/package.json +16 -1
  8. package/.claude/skills/layer-autoresearch/SKILL.md +0 -48
  9. package/.claude/skills/tdk-troubleshoot/SKILL.md +0 -222
  10. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -40
  11. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  12. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
  13. package/.github/dependabot.yml +0 -33
  14. package/.github/pull_request_template.md +0 -5
  15. package/.github/workflows/ci.yml +0 -200
  16. package/.github/workflows/release-binaries.yml +0 -139
  17. package/.github/zizmor.yml +0 -9
  18. package/.pre-commit-config.yaml +0 -57
  19. package/CODE_OF_CONDUCT.md +0 -9
  20. package/CONTRIBUTING.md +0 -42
  21. package/Makefile +0 -92
  22. package/SECURITY.md +0 -17
  23. package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +0 -45
  24. package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +0 -150
  25. package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +0 -73
  26. package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +0 -77
  27. package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +0 -202
  28. package/cli/AGENTS.md +0 -390
  29. package/cli/DESIGN.md +0 -735
  30. package/cli/README.md +0 -292
  31. package/cli/biome.json +0 -40
  32. package/cli/dependency-graph.svg +0 -1135
  33. package/cli/dist/cli.d.ts +0 -3
  34. package/cli/dist/cli.d.ts.map +0 -1
  35. package/cli/dist/cli.js.map +0 -1
  36. package/cli/dist/commands/completion.d.ts +0 -3
  37. package/cli/dist/commands/completion.d.ts.map +0 -1
  38. package/cli/dist/commands/completion.js.map +0 -1
  39. package/cli/dist/commands/config.d.ts +0 -3
  40. package/cli/dist/commands/config.d.ts.map +0 -1
  41. package/cli/dist/commands/config.js.map +0 -1
  42. package/cli/dist/commands/doctor.d.ts +0 -19
  43. package/cli/dist/commands/doctor.d.ts.map +0 -1
  44. package/cli/dist/commands/doctor.js.map +0 -1
  45. package/cli/dist/commands/down.d.ts +0 -3
  46. package/cli/dist/commands/down.d.ts.map +0 -1
  47. package/cli/dist/commands/down.js.map +0 -1
  48. package/cli/dist/commands/help.d.ts +0 -2
  49. package/cli/dist/commands/help.d.ts.map +0 -1
  50. package/cli/dist/commands/help.js.map +0 -1
  51. package/cli/dist/commands/networks.d.ts +0 -3
  52. package/cli/dist/commands/networks.d.ts.map +0 -1
  53. package/cli/dist/commands/networks.js.map +0 -1
  54. package/cli/dist/commands/project.d.ts +0 -9
  55. package/cli/dist/commands/project.d.ts.map +0 -1
  56. package/cli/dist/commands/project.js.map +0 -1
  57. package/cli/dist/commands/projects.d.ts +0 -3
  58. package/cli/dist/commands/projects.d.ts.map +0 -1
  59. package/cli/dist/commands/projects.js.map +0 -1
  60. package/cli/dist/commands/resource.d.ts +0 -69
  61. package/cli/dist/commands/resource.d.ts.map +0 -1
  62. package/cli/dist/commands/resource.js.map +0 -1
  63. package/cli/dist/commands/resources.d.ts +0 -3
  64. package/cli/dist/commands/resources.d.ts.map +0 -1
  65. package/cli/dist/commands/resources.js.map +0 -1
  66. package/cli/dist/commands/stack.d.ts +0 -3
  67. package/cli/dist/commands/stack.d.ts.map +0 -1
  68. package/cli/dist/commands/stack.js.map +0 -1
  69. package/cli/dist/commands/stacks.d.ts +0 -3
  70. package/cli/dist/commands/stacks.d.ts.map +0 -1
  71. package/cli/dist/commands/stacks.js.map +0 -1
  72. package/cli/dist/commands/status.d.ts +0 -3
  73. package/cli/dist/commands/status.d.ts.map +0 -1
  74. package/cli/dist/commands/status.js.map +0 -1
  75. package/cli/dist/commands/ui.d.ts +0 -3
  76. package/cli/dist/commands/ui.d.ts.map +0 -1
  77. package/cli/dist/commands/ui.js.map +0 -1
  78. package/cli/dist/commands/up.d.ts +0 -3
  79. package/cli/dist/commands/up.d.ts.map +0 -1
  80. package/cli/dist/commands/up.js.map +0 -1
  81. package/cli/dist/commands/upgrade.d.ts +0 -14
  82. package/cli/dist/commands/upgrade.d.ts.map +0 -1
  83. package/cli/dist/commands/upgrade.js.map +0 -1
  84. package/cli/dist/commands/version.d.ts +0 -3
  85. package/cli/dist/commands/version.d.ts.map +0 -1
  86. package/cli/dist/commands/version.js.map +0 -1
  87. package/cli/dist/components/Accessible.d.ts +0 -8
  88. package/cli/dist/components/Accessible.d.ts.map +0 -1
  89. package/cli/dist/components/Accessible.js.map +0 -1
  90. package/cli/dist/components/BaseTooltip.d.ts +0 -4
  91. package/cli/dist/components/BaseTooltip.d.ts.map +0 -1
  92. package/cli/dist/components/BaseTooltip.js.map +0 -1
  93. package/cli/dist/components/DetailPanel.d.ts +0 -4
  94. package/cli/dist/components/DetailPanel.d.ts.map +0 -1
  95. package/cli/dist/components/DetailPanel.js.map +0 -1
  96. package/cli/dist/components/FileTree.d.ts +0 -4
  97. package/cli/dist/components/FileTree.d.ts.map +0 -1
  98. package/cli/dist/components/FileTree.js.map +0 -1
  99. package/cli/dist/components/ResourceSelectInput.d.ts +0 -4
  100. package/cli/dist/components/ResourceSelectInput.d.ts.map +0 -1
  101. package/cli/dist/components/ResourceSelectInput.js.map +0 -1
  102. package/cli/dist/components/ResourceTable.d.ts +0 -4
  103. package/cli/dist/components/ResourceTable.d.ts.map +0 -1
  104. package/cli/dist/components/ResourceTable.js.map +0 -1
  105. package/cli/dist/components/TabBar.d.ts +0 -4
  106. package/cli/dist/components/TabBar.d.ts.map +0 -1
  107. package/cli/dist/components/TabBar.js.map +0 -1
  108. package/cli/dist/components/Tooltip.d.ts +0 -12
  109. package/cli/dist/components/Tooltip.d.ts.map +0 -1
  110. package/cli/dist/components/Tooltip.js.map +0 -1
  111. package/cli/dist/components/index.d.ts +0 -8
  112. package/cli/dist/components/index.d.ts.map +0 -1
  113. package/cli/dist/components/index.js.map +0 -1
  114. package/cli/dist/config/platform-standards.d.ts +0 -159
  115. package/cli/dist/config/platform-standards.d.ts.map +0 -1
  116. package/cli/dist/config/platform-standards.js.map +0 -1
  117. package/cli/dist/generator/extension-fetch.d.ts +0 -25
  118. package/cli/dist/generator/extension-fetch.d.ts.map +0 -1
  119. package/cli/dist/generator/extension-fetch.js.map +0 -1
  120. package/cli/dist/generator/template-engine.d.ts +0 -62
  121. package/cli/dist/generator/template-engine.d.ts.map +0 -1
  122. package/cli/dist/generator/template-engine.js.map +0 -1
  123. package/cli/dist/index.d.ts +0 -11
  124. package/cli/dist/index.d.ts.map +0 -1
  125. package/cli/dist/index.js.map +0 -1
  126. package/cli/dist/types/index.d.ts +0 -257
  127. package/cli/dist/types/index.d.ts.map +0 -1
  128. package/cli/dist/types/index.js.map +0 -1
  129. package/cli/dist/utils/cache.d.ts +0 -19
  130. package/cli/dist/utils/cache.d.ts.map +0 -1
  131. package/cli/dist/utils/cache.js.map +0 -1
  132. package/cli/dist/utils/command-helpers.d.ts +0 -17
  133. package/cli/dist/utils/command-helpers.d.ts.map +0 -1
  134. package/cli/dist/utils/command-helpers.js.map +0 -1
  135. package/cli/dist/utils/constants.d.ts +0 -53
  136. package/cli/dist/utils/constants.d.ts.map +0 -1
  137. package/cli/dist/utils/constants.js.map +0 -1
  138. package/cli/dist/utils/discovery-context.d.ts +0 -4
  139. package/cli/dist/utils/discovery-context.d.ts.map +0 -1
  140. package/cli/dist/utils/discovery-context.js.map +0 -1
  141. package/cli/dist/utils/docker.d.ts +0 -4
  142. package/cli/dist/utils/docker.d.ts.map +0 -1
  143. package/cli/dist/utils/docker.js.map +0 -1
  144. package/cli/dist/utils/doctor-runtime.d.ts +0 -81
  145. package/cli/dist/utils/doctor-runtime.d.ts.map +0 -1
  146. package/cli/dist/utils/doctor-runtime.js.map +0 -1
  147. package/cli/dist/utils/env-validator.d.ts +0 -15
  148. package/cli/dist/utils/env-validator.d.ts.map +0 -1
  149. package/cli/dist/utils/env-validator.js.map +0 -1
  150. package/cli/dist/utils/errors.d.ts +0 -31
  151. package/cli/dist/utils/errors.d.ts.map +0 -1
  152. package/cli/dist/utils/errors.js.map +0 -1
  153. package/cli/dist/utils/file-helpers.d.ts +0 -14
  154. package/cli/dist/utils/file-helpers.d.ts.map +0 -1
  155. package/cli/dist/utils/file-helpers.js.map +0 -1
  156. package/cli/dist/utils/formatting.d.ts +0 -30
  157. package/cli/dist/utils/formatting.d.ts.map +0 -1
  158. package/cli/dist/utils/formatting.js.map +0 -1
  159. package/cli/dist/utils/paths.d.ts +0 -3
  160. package/cli/dist/utils/paths.d.ts.map +0 -1
  161. package/cli/dist/utils/paths.js.map +0 -1
  162. package/cli/dist/utils/port-assignment.d.ts +0 -6
  163. package/cli/dist/utils/port-assignment.d.ts.map +0 -1
  164. package/cli/dist/utils/port-assignment.js.map +0 -1
  165. package/cli/dist/utils/project-features.d.ts +0 -23
  166. package/cli/dist/utils/project-features.d.ts.map +0 -1
  167. package/cli/dist/utils/project-features.js.map +0 -1
  168. package/cli/dist/utils/project-templates.d.ts +0 -7
  169. package/cli/dist/utils/project-templates.d.ts.map +0 -1
  170. package/cli/dist/utils/project-templates.js.map +0 -1
  171. package/cli/dist/utils/prompt.d.ts +0 -28
  172. package/cli/dist/utils/prompt.d.ts.map +0 -1
  173. package/cli/dist/utils/prompt.js.map +0 -1
  174. package/cli/dist/utils/resource-features.d.ts +0 -29
  175. package/cli/dist/utils/resource-features.d.ts.map +0 -1
  176. package/cli/dist/utils/resource-features.js.map +0 -1
  177. package/cli/dist/utils/service-urls.d.ts +0 -30
  178. package/cli/dist/utils/service-urls.d.ts.map +0 -1
  179. package/cli/dist/utils/service-urls.js.map +0 -1
  180. package/cli/dist/utils/services.d.ts +0 -18
  181. package/cli/dist/utils/services.d.ts.map +0 -1
  182. package/cli/dist/utils/services.js.map +0 -1
  183. package/cli/dist/utils/stack-features.d.ts +0 -22
  184. package/cli/dist/utils/stack-features.d.ts.map +0 -1
  185. package/cli/dist/utils/stack-features.js.map +0 -1
  186. package/cli/dist/utils/tar.d.ts +0 -7
  187. package/cli/dist/utils/tar.d.ts.map +0 -1
  188. package/cli/dist/utils/tar.js.map +0 -1
  189. package/cli/dist/utils/tilt.d.ts +0 -20
  190. package/cli/dist/utils/tilt.d.ts.map +0 -1
  191. package/cli/dist/utils/tilt.js.map +0 -1
  192. package/cli/dist/utils/validation.d.ts +0 -16
  193. package/cli/dist/utils/validation.d.ts.map +0 -1
  194. package/cli/dist/utils/validation.js.map +0 -1
  195. package/cli/knip.json +0 -6
  196. package/cli/pnpm-lock.yaml +0 -2305
  197. package/cli/pnpm-workspace.yaml +0 -2
  198. package/cli/src/cli.ts +0 -72
  199. package/cli/src/commands/__tests__/always-enabled-infra.test.ts +0 -109
  200. package/cli/src/commands/__tests__/config.test.ts +0 -146
  201. package/cli/src/commands/__tests__/doctor.test.ts +0 -730
  202. package/cli/src/commands/__tests__/error-handling.test.ts +0 -78
  203. package/cli/src/commands/__tests__/phases-model.test.ts +0 -161
  204. package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +0 -187
  205. package/cli/src/commands/__tests__/project.test.ts +0 -68
  206. package/cli/src/commands/__tests__/resource.test.ts +0 -226
  207. package/cli/src/commands/__tests__/saas-starter-integration.test.ts +0 -194
  208. package/cli/src/commands/__tests__/stack-features-e2e.test.ts +0 -135
  209. package/cli/src/commands/__tests__/upgrade.test.ts +0 -198
  210. package/cli/src/commands/completion.ts +0 -300
  211. package/cli/src/commands/config.ts +0 -299
  212. package/cli/src/commands/doctor.ts +0 -926
  213. package/cli/src/commands/down.ts +0 -37
  214. package/cli/src/commands/help.ts +0 -143
  215. package/cli/src/commands/networks-design.md +0 -80
  216. package/cli/src/commands/networks.ts +0 -332
  217. package/cli/src/commands/project.ts +0 -456
  218. package/cli/src/commands/projects.ts +0 -82
  219. package/cli/src/commands/resource.ts +0 -652
  220. package/cli/src/commands/resources.ts +0 -95
  221. package/cli/src/commands/stack.ts +0 -128
  222. package/cli/src/commands/stacks.ts +0 -52
  223. package/cli/src/commands/status.ts +0 -88
  224. package/cli/src/commands/ui.tsx +0 -843
  225. package/cli/src/commands/up.ts +0 -169
  226. package/cli/src/commands/upgrade.ts +0 -628
  227. package/cli/src/commands/version.ts +0 -9
  228. package/cli/src/components/Accessible.tsx +0 -21
  229. package/cli/src/components/BaseTooltip.tsx +0 -66
  230. package/cli/src/components/DetailPanel.tsx +0 -146
  231. package/cli/src/components/FileTree.tsx +0 -89
  232. package/cli/src/components/ResourceSelectInput.tsx +0 -30
  233. package/cli/src/components/ResourceTable.tsx +0 -78
  234. package/cli/src/components/TabBar.tsx +0 -53
  235. package/cli/src/components/Tooltip.tsx +0 -11
  236. package/cli/src/components/index.ts +0 -7
  237. package/cli/src/config/platform-standards.test.ts +0 -11
  238. package/cli/src/config/platform-standards.ts +0 -196
  239. package/cli/src/generator/__tests__/extension-fetch.test.ts +0 -242
  240. package/cli/src/generator/__tests__/template-engine.test.ts +0 -70
  241. package/cli/src/generator/extension-fetch.ts +0 -286
  242. package/cli/src/generator/template-engine.ts +0 -752
  243. package/cli/src/index.ts +0 -86
  244. package/cli/src/templates.d.ts +0 -4
  245. package/cli/src/types/index.ts +0 -353
  246. package/cli/src/utils/__tests__/cache.test.ts +0 -98
  247. package/cli/src/utils/__tests__/formatting.test.ts +0 -170
  248. package/cli/src/utils/__tests__/paths.test.ts +0 -180
  249. package/cli/src/utils/__tests__/port-assignment.test.ts +0 -121
  250. package/cli/src/utils/__tests__/service-urls.test.ts +0 -174
  251. package/cli/src/utils/__tests__/services.test.ts +0 -531
  252. package/cli/src/utils/__tests__/tilt.test.ts +0 -172
  253. package/cli/src/utils/__tests__/validation.test.ts +0 -148
  254. package/cli/src/utils/cache.ts +0 -76
  255. package/cli/src/utils/command-helpers.ts +0 -54
  256. package/cli/src/utils/constants.ts +0 -130
  257. package/cli/src/utils/discovery-context.ts +0 -49
  258. package/cli/src/utils/docker.ts +0 -20
  259. package/cli/src/utils/doctor-runtime.ts +0 -644
  260. package/cli/src/utils/env-validator.ts +0 -139
  261. package/cli/src/utils/errors.ts +0 -168
  262. package/cli/src/utils/file-helpers.ts +0 -62
  263. package/cli/src/utils/formatting.ts +0 -215
  264. package/cli/src/utils/paths.ts +0 -53
  265. package/cli/src/utils/port-assignment.ts +0 -106
  266. package/cli/src/utils/project-features.ts +0 -118
  267. package/cli/src/utils/project-templates.ts +0 -29
  268. package/cli/src/utils/prompt.ts +0 -128
  269. package/cli/src/utils/resource-features.ts +0 -215
  270. package/cli/src/utils/service-urls.ts +0 -124
  271. package/cli/src/utils/services.ts +0 -364
  272. package/cli/src/utils/stack-features.ts +0 -30
  273. package/cli/src/utils/tar.ts +0 -24
  274. package/cli/src/utils/tilt.ts +0 -133
  275. package/cli/src/utils/validation.ts +0 -67
  276. package/cli/tsconfig.json +0 -25
  277. package/cli/tsconfig.typecheck.json +0 -8
  278. package/docs/FEATURES.md +0 -279
  279. package/docs/demo.svg +0 -217
  280. package/engine/docs/AUTODISCOVERY_TEST.md +0 -182
  281. package/engine/docs/C4-ARCHITECTURE-operations.md +0 -396
  282. package/engine/docs/C4-ARCHITECTURE-overview.md +0 -284
  283. package/engine/docs/C4-ARCHITECTURE.md +0 -17
  284. package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +0 -349
  285. package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +0 -357
  286. package/engine/docs/README.md +0 -284
  287. package/install.sh +0 -19
  288. package/knip.json +0 -10
  289. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +0 -2
  290. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +0 -102
  291. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +0 -31
  292. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +0 -48
  293. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +0 -63
  294. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +0 -56
  295. package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +0 -61
  296. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +0 -2
  297. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +0 -114
  298. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +0 -32
  299. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +0 -20
  300. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +0 -20
  301. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +0 -20
  302. package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +0 -194
  303. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +0 -2
  304. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +0 -111
  305. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +0 -33
  306. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +0 -12
  307. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +0 -18
  308. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +0 -16
  309. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +0 -12
  310. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +0 -12
  311. package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +0 -194
  312. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +0 -2
  313. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +0 -84
  314. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +0 -31
  315. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +0 -27
  316. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +0 -27
  317. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +0 -23
  318. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +0 -27
  319. package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +0 -39
  320. package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +0 -2
  321. package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +0 -80
  322. package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +0 -40
  323. package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +0 -52
  324. package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +0 -51
  325. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +0 -2
  326. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +0 -43
  327. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +0 -29
  328. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +0 -67
  329. package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +0 -27
  330. package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +0 -3
  331. package/openspec/changes/optimize-runtime-docker-layers/design.md +0 -81
  332. package/openspec/changes/optimize-runtime-docker-layers/proposal.md +0 -44
  333. package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +0 -79
  334. package/openspec/changes/optimize-runtime-docker-layers/tasks.md +0 -36
  335. package/openspec/changes/prioritized-cold-start/.openspec.yaml +0 -4
  336. package/openspec/changes/prioritized-cold-start/design.md +0 -137
  337. package/openspec/changes/prioritized-cold-start/proposal.md +0 -41
  338. package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +0 -98
  339. package/openspec/changes/prioritized-cold-start/tasks.md +0 -69
  340. package/openspec/config.yaml +0 -1
  341. package/openspec/specs/manifest-field-migration/spec.md +0 -24
  342. package/openspec/specs/resource-terminology-standard/spec.md +0 -24
  343. package/openspec/specs/self-contained-generated-projects/spec.md +0 -67
  344. package/openspec/specs/stack-terminology-standard/spec.md +0 -24
  345. package/platform/services/platform/proxy/service.yaml +0 -14
  346. package/scripts/audit-codebase.sh +0 -213
  347. package/scripts/autoresearch/layer-eval.sh +0 -65
  348. package/scripts/benchmark/README.md +0 -25
  349. package/scripts/benchmark/container-scale.ts +0 -503
  350. package/scripts/benchmark/pre-release-gate.sh +0 -9
  351. package/scripts/install-git-hooks.sh +0 -14
  352. package/scripts/measure-idle-footprint.sh +0 -58
  353. package/scripts/record-demo.sh +0 -43
  354. package/scripts/release-binaries.sh +0 -97
  355. package/scripts/setup-pre-commit.sh +0 -33
  356. package/scripts/stage-npm-engine.sh +0 -36
  357. package/tests/tilt-engine/__init__.py +0 -5
  358. package/tests/tilt-engine/conftest.py +0 -182
  359. package/tests/tilt-engine/fixtures/appointment-frontend-service.json +0 -11
  360. package/tests/tilt-engine/fixtures/identity-backend-service.json +0 -12
  361. package/tests/tilt-engine/fixtures/invalid-service.json +0 -4
  362. package/tests/tilt-engine/test_agents_md_generator.py +0 -341
  363. package/tests/tilt-engine/test_agents_md_integration.py +0 -378
  364. package/tests/tilt-engine/test_cache_operations.py +0 -181
  365. package/tests/tilt-engine/test_cache_persistence.py +0 -142
  366. package/tests/tilt-engine/test_code_executor.py +0 -152
  367. package/tests/tilt-engine/test_code_viewer.py +0 -127
  368. package/tests/tilt-engine/test_compose_port_anchors.py +0 -310
  369. package/tests/tilt-engine/test_config_inspector.py +0 -162
  370. package/tests/tilt-engine/test_daemon_focus_mode.py +0 -89
  371. package/tests/tilt-engine/test_daemon_polling.py +0 -122
  372. package/tests/tilt-engine/test_daemon_registration.py +0 -115
  373. package/tests/tilt-engine/test_daemon_validation.py +0 -107
  374. package/tests/tilt-engine/test_docker_generator_bugs.py +0 -493
  375. package/tests/tilt-engine/test_docker_prune.py +0 -119
  376. package/tests/tilt-engine/test_dockerignore_path_bug.py +0 -82
  377. package/tests/tilt-engine/test_file_browser.py +0 -193
  378. package/tests/tilt-engine/test_frontend_basepath_manifest.py +0 -27
  379. package/tests/tilt-engine/test_health_dependencies.py +0 -130
  380. package/tests/tilt-engine/test_health_endpoints.py +0 -118
  381. package/tests/tilt-engine/test_health_tilt_ui.py +0 -85
  382. package/tests/tilt-engine/test_runtime_container_footprint.py +0 -162
  383. package/tests/tilt-engine/test_sablier_defer_start.py +0 -237
  384. package/tests/tilt-engine/test_safety_aliases.py +0 -84
  385. package/tests/tilt-engine/test_snapshot_diff.py +0 -136
  386. package/tests/tilt-engine/test_snapshot_persistence.py +0 -163
  387. package/tests/tilt-engine/test_snapshot_scanning.py +0 -123
  388. package/tests/tilt-engine/test_standalone_project_boot.py +0 -61
  389. package/tests/tilt-engine/test_standalone_traefik.py +0 -160
  390. 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
- }