@tdk-landscape/tdk-cli-core 1.3.14 → 1.3.22

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 (277) hide show
  1. package/README.md +3 -3
  2. package/Tiltfile +144 -0
  3. package/discovery/AGENTS.md +362 -0
  4. package/discovery/TILT_DISCOVERY.star +424 -0
  5. package/discovery/Tiltfile +58 -0
  6. package/discovery/config.star +258 -0
  7. package/discovery/constants.star +127 -0
  8. package/discovery/deterministic.star +211 -0
  9. package/discovery/discovery_daemon.star +191 -0
  10. package/discovery/discovery_orchestrator.star +460 -0
  11. package/discovery/filtering.star +5 -0
  12. package/discovery/identity-management-backend/service.yaml +26 -0
  13. package/discovery/identity-management-frontend/service.yaml +29 -0
  14. package/discovery/identity-sdk/service.yaml +9 -0
  15. package/discovery/incremental_discovery.star +213 -0
  16. package/discovery/indexing.star +7 -0
  17. package/discovery/json_manifest_scanner.star +51 -0
  18. package/discovery/libraries.star +46 -0
  19. package/discovery/loading.star +23 -0
  20. package/discovery/manifest/constants.star +104 -0
  21. package/discovery/manifest/loading.star +386 -0
  22. package/discovery/manifest/normalize.star +281 -0
  23. package/discovery/manifest/validation.star +108 -0
  24. package/discovery/normalization.star +11 -0
  25. package/discovery/registry.star +544 -0
  26. package/discovery/resource_snapshot.py +382 -0
  27. package/discovery/resource_snapshot.star +143 -0
  28. package/discovery/schemas.star +1 -0
  29. package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
  30. package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
  31. package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
  32. package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
  33. package/discovery/test_resource_snapshot.py +251 -0
  34. package/discovery/validation.star +78 -0
  35. package/discovery/versioning.star +1 -0
  36. package/dist/commands/config.d.ts.map +1 -1
  37. package/dist/commands/config.js +11 -0
  38. package/dist/commands/config.js.map +1 -1
  39. package/dist/commands/doctor.d.ts.map +1 -1
  40. package/dist/commands/doctor.js +1 -2
  41. package/dist/commands/doctor.js.map +1 -1
  42. package/dist/commands/project.d.ts.map +1 -1
  43. package/dist/commands/project.js +36 -41
  44. package/dist/commands/project.js.map +1 -1
  45. package/dist/commands/resource.d.ts.map +1 -1
  46. package/dist/commands/resource.js +51 -55
  47. package/dist/commands/resource.js.map +1 -1
  48. package/dist/commands/stack.d.ts.map +1 -1
  49. package/dist/commands/stack.js +22 -24
  50. package/dist/commands/stack.js.map +1 -1
  51. package/dist/commands/ui.d.ts.map +1 -1
  52. package/dist/commands/ui.js +1 -2
  53. package/dist/commands/ui.js.map +1 -1
  54. package/dist/commands/up.d.ts.map +1 -1
  55. package/dist/commands/up.js +1 -2
  56. package/dist/commands/up.js.map +1 -1
  57. package/dist/commands/upgrade.d.ts +8 -0
  58. package/dist/commands/upgrade.d.ts.map +1 -1
  59. package/dist/commands/upgrade.js +62 -21
  60. package/dist/commands/upgrade.js.map +1 -1
  61. package/dist/generator/extension-fetch.d.ts +19 -0
  62. package/dist/generator/extension-fetch.d.ts.map +1 -1
  63. package/dist/generator/extension-fetch.js +71 -5
  64. package/dist/generator/extension-fetch.js.map +1 -1
  65. package/dist/generator/template-engine.d.ts +1 -0
  66. package/dist/generator/template-engine.d.ts.map +1 -1
  67. package/dist/generator/template-engine.js +50 -6
  68. package/dist/generator/template-engine.js.map +1 -1
  69. package/dist/utils/command-helpers.d.ts.map +1 -1
  70. package/dist/utils/command-helpers.js +7 -9
  71. package/dist/utils/command-helpers.js.map +1 -1
  72. package/dist/utils/constants.d.ts +1 -0
  73. package/dist/utils/constants.d.ts.map +1 -1
  74. package/dist/utils/constants.js +1 -0
  75. package/dist/utils/constants.js.map +1 -1
  76. package/dist/utils/errors.d.ts +2 -0
  77. package/dist/utils/errors.d.ts.map +1 -1
  78. package/dist/utils/errors.js +6 -1
  79. package/dist/utils/errors.js.map +1 -1
  80. package/dist/utils/paths.js +1 -1
  81. package/dist/utils/paths.js.map +1 -1
  82. package/dist/utils/project-features.d.ts.map +1 -1
  83. package/dist/utils/project-features.js +1 -1
  84. package/dist/utils/project-features.js.map +1 -1
  85. package/dist/utils/resource-features.d.ts.map +1 -1
  86. package/dist/utils/resource-features.js +2 -2
  87. package/dist/utils/resource-features.js.map +1 -1
  88. package/dist/utils/tar.js +4 -4
  89. package/dist/utils/tar.js.map +1 -1
  90. package/dist/utils/validation.d.ts +7 -0
  91. package/dist/utils/validation.d.ts.map +1 -1
  92. package/dist/utils/validation.js +9 -0
  93. package/dist/utils/validation.js.map +1 -1
  94. package/engine/AGENTS.md +705 -0
  95. package/engine/README.md +29 -0
  96. package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
  97. package/engine/Tiltfile +80 -0
  98. package/engine/assets/docker/golden-layers.Dockerfile +221 -0
  99. package/engine/assets/scripts/cleanup-completed-migrator-images.sh +37 -0
  100. package/engine/assets/scripts/cleanup-tilt-images.sh +120 -0
  101. package/engine/assets/scripts/mac-m1-resource-monitor.sh +121 -0
  102. package/engine/config.star +3 -0
  103. package/engine/docs/AUTODISCOVERY_TEST.md +182 -0
  104. package/engine/docs/C4-ARCHITECTURE-operations.md +396 -0
  105. package/engine/docs/C4-ARCHITECTURE-overview.md +284 -0
  106. package/engine/docs/C4-ARCHITECTURE.md +17 -0
  107. package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +349 -0
  108. package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +357 -0
  109. package/engine/docs/README.md +284 -0
  110. package/engine/entrypoint.star +97 -0
  111. package/engine/lifecycle/orchestrator.star +260 -0
  112. package/engine/paths.star +717 -0
  113. package/engine/schemas/manifest-schema.json +301 -0
  114. package/engine/schemas/service-schema.json +301 -0
  115. package/engine/scripts/README.md +89 -0
  116. package/engine/scripts/build-and-publish-lib.sh +205 -0
  117. package/engine/scripts/check-lib-publish.sh +85 -0
  118. package/engine/scripts/debug-container.sh +258 -0
  119. package/engine/scripts/generate-manifest.sh +197 -0
  120. package/engine/spec.master +702 -0
  121. package/engine/spec.master.example +341 -0
  122. package/engine/topologies/README.md +34 -0
  123. package/engine/topologies/platform/docker/AGENTS.md +59 -0
  124. package/engine/topologies/platform/docker/auth/auth.star +167 -0
  125. package/engine/topologies/platform/docker/build/golden_image.star +37 -0
  126. package/engine/topologies/platform/docker/build/golden_image_build.star +82 -0
  127. package/engine/topologies/platform/docker/build/golden_image_constants.star +93 -0
  128. package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +291 -0
  129. package/engine/topologies/platform/docker/compose/compose.star +636 -0
  130. package/engine/topologies/platform/docker/compose/compose_helpers.star +52 -0
  131. package/engine/topologies/platform/docker/compose/traefik_standalone.star +53 -0
  132. package/engine/topologies/platform/docker/config/bunignore.star +142 -0
  133. package/engine/topologies/platform/docker/config/dockerignore.star +150 -0
  134. package/engine/topologies/platform/docker/constants.star +170 -0
  135. package/engine/topologies/platform/docker/dockerfile/dockerfile.star +54 -0
  136. package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +73 -0
  137. package/engine/topologies/platform/docker/index.star +27 -0
  138. package/engine/topologies/platform/docker/layers/bun_helpers.star +23 -0
  139. package/engine/topologies/platform/docker/layers/infisical/index.star +40 -0
  140. package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +262 -0
  141. package/engine/topologies/platform/docker/layers/l1_base_layers.star +87 -0
  142. package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +125 -0
  143. package/engine/topologies/platform/docker/layers/l3_builder_layers.star +209 -0
  144. package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +214 -0
  145. package/engine/topologies/platform/docker/layers/prisma/constants.star +135 -0
  146. package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +96 -0
  147. package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +109 -0
  148. package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +98 -0
  149. package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +126 -0
  150. package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +161 -0
  151. package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +119 -0
  152. package/engine/topologies/platform/docker/networking/api_path_constants.star +230 -0
  153. package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +27 -0
  154. package/engine/topologies/platform/docker/networking/traefik.star +232 -0
  155. package/engine/topologies/platform/docker/networking/traefik_constants.star +146 -0
  156. package/engine/topologies/platform/docker/networking/traefik_helpers.star +160 -0
  157. package/engine/topologies/platform/docker/secrets/infisical.star +135 -0
  158. package/engine/topologies/platform/net/proxy.star +4 -0
  159. package/engine/topologies/platform/registries/local.star +4 -0
  160. package/engine/topologies/platform/security/secrets.star +239 -0
  161. package/engine/topologies/platform/state/relational.star +4 -0
  162. package/engine/topologies/tilt/common/AGENTS.md +59 -0
  163. package/engine/topologies/tilt/common/utils.star +364 -0
  164. package/engine/topologies/tilt/common/utils_debug.star +69 -0
  165. package/engine/topologies/tilt/common/utils_deterministic.star +168 -0
  166. package/engine/topologies/tilt/common/utils_docker_networks.star +46 -0
  167. package/engine/topologies/tilt/common/utils_env.star +43 -0
  168. package/engine/topologies/tilt/common/utils_output.star +97 -0
  169. package/engine/topologies/tilt/config/AGENTS.md +68 -0
  170. package/engine/topologies/tilt/config/defaults.star +3 -0
  171. package/engine/topologies/tilt/config/feature_flags.star +10 -0
  172. package/engine/topologies/tilt/config/global.star +55 -0
  173. package/engine/topologies/tilt/config/profiles.star +382 -0
  174. package/engine/topologies/tilt/generators/agents_md.star +62 -0
  175. package/engine/topologies/tilt/generators/api_gateway.star +145 -0
  176. package/engine/topologies/tilt/generators/index.star +124 -0
  177. package/engine/topologies/tilt/generators/infisical/README.md +424 -0
  178. package/engine/topologies/tilt/generators/infisical/examples.star +312 -0
  179. package/engine/topologies/tilt/generators/infisical/index.star +57 -0
  180. package/engine/topologies/tilt/generators/infisical/machine_identity.star +420 -0
  181. package/engine/topologies/tilt/generators/infisical/organization.star +534 -0
  182. package/engine/topologies/tilt/generators/infisical/path_manager.star +476 -0
  183. package/engine/topologies/tilt/generators/infisical/secrets_generator.star +420 -0
  184. package/engine/topologies/tilt/generators/nginx_conf.star +143 -0
  185. package/engine/topologies/tilt/generators/npmrc.star +111 -0
  186. package/engine/topologies/tilt/generators/tsconfig.star +23 -0
  187. package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +71 -0
  188. package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +124 -0
  189. package/engine/topologies/tilt/generators/typescript/common.star +7 -0
  190. package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +76 -0
  191. package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +110 -0
  192. package/engine/topologies/tilt/generators/typescript/include.star +23 -0
  193. package/engine/topologies/tilt/generators/typescript/playwright_config.star +40 -0
  194. package/engine/topologies/tilt/generators/typescript/prisma_config.star +49 -0
  195. package/engine/topologies/tilt/generators/validators.star +853 -0
  196. package/engine/topologies/tilt/generators/vite/backend.star +78 -0
  197. package/engine/topologies/tilt/generators/vite/frontend.star +98 -0
  198. package/engine/topologies/tilt/generators/vite/generators.star +43 -0
  199. package/engine/topologies/tilt/generators/vite/helpers.star +244 -0
  200. package/engine/topologies/tilt/generators/vite/library.star +65 -0
  201. package/engine/topologies/tilt/generators/vite/sdk.star +73 -0
  202. package/engine/topologies/tilt/generators/vite/templates.star +737 -0
  203. package/engine/topologies/tilt/generators/vite_config.star +22 -0
  204. package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
  205. package/engine/topologies/tilt/manifest/README.md +693 -0
  206. package/engine/topologies/tilt/manifest/__init__.star +218 -0
  207. package/engine/topologies/tilt/manifest/constants.star +252 -0
  208. package/engine/topologies/tilt/manifest/errors.star +266 -0
  209. package/engine/topologies/tilt/manifest/integration.star +339 -0
  210. package/engine/topologies/tilt/manifest/json_to_yaml.py +54 -0
  211. package/engine/topologies/tilt/manifest/loader.star +214 -0
  212. package/engine/topologies/tilt/manifest/mapper.star +227 -0
  213. package/engine/topologies/tilt/manifest/parser.star +400 -0
  214. package/engine/topologies/tilt/manifest/schema.star +462 -0
  215. package/engine/topologies/tilt/manifest/tests/test_integration.star +276 -0
  216. package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +397 -0
  217. package/engine/topologies/tilt/manifest/tests/test_manifest.star +316 -0
  218. package/engine/topologies/tilt/manifest/tests/test_validator.star +470 -0
  219. package/engine/topologies/tilt/manifest/validator.star +717 -0
  220. package/engine/topologies/tilt/manifest/yaml_to_json.py +18 -0
  221. package/engine/topologies/tilt/resources/AGENTS.md +71 -0
  222. package/engine/topologies/tilt/resources/conditions.star +3 -0
  223. package/engine/topologies/tilt/resources/databases.star +244 -0
  224. package/engine/topologies/tilt/resources/declaration.star +3 -0
  225. package/engine/topologies/tilt/resources/deps.star +3 -0
  226. package/engine/topologies/tilt/resources/infra-loader.star +437 -0
  227. package/engine/topologies/tilt/resources/libs.star +30 -0
  228. package/engine/topologies/tilt/resources/libs_discovery.star +102 -0
  229. package/engine/topologies/tilt/resources/libs_paths.star +79 -0
  230. package/engine/topologies/tilt/resources/libs_resource_definition.star +151 -0
  231. package/engine/topologies/tilt/resources/libs_setup.star +164 -0
  232. package/engine/topologies/tilt/resources/libs_tsconfig.star +37 -0
  233. package/engine/topologies/tilt/resources/orchestrator/apply.star +77 -0
  234. package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +431 -0
  235. package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +81 -0
  236. package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +148 -0
  237. package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +36 -0
  238. package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +44 -0
  239. package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +164 -0
  240. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
  241. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +21 -0
  242. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +134 -0
  243. package/engine/topologies/tilt/resources/orchestrator/generators/env.star +258 -0
  244. package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +169 -0
  245. package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +524 -0
  246. package/engine/topologies/tilt/resources/orchestrator/helpers.star +33 -0
  247. package/engine/topologies/tilt/resources/orchestrator.star +54 -0
  248. package/engine/topologies/tilt/resources/ordering.star +3 -0
  249. package/engine/topologies/tilt/resources/triggers.star +3 -0
  250. package/engine/topologies/tilt/resources/watchers.star +299 -0
  251. package/engine/where-things-live.star +717 -0
  252. package/ext/Tiltfile +66 -0
  253. package/ext/ide-components/README.md +219 -0
  254. package/ext/ide-components/code_executor/server.py +268 -0
  255. package/ext/ide-components/code_viewer/server.py +206 -0
  256. package/ext/ide-components/config_inspector/server.py +1050 -0
  257. package/ext/ide-components/file_browser/server.py +285 -0
  258. package/ext/ide-components/shared/config_service.py +469 -0
  259. package/ext/ide-components/shared/file_utils.py +298 -0
  260. package/ext/ide-components/shared/http_utils.py +232 -0
  261. package/ext/ide-components/shared/static/styles.css +1334 -0
  262. package/ext/ide-components/shared/syntax_highlighter.py +140 -0
  263. package/ext/ide-components/shared/template_engine.py +123 -0
  264. package/ext/ide-components/shared/templates/base.html +121 -0
  265. package/ext/ide-components/shared/test_config_service.py +326 -0
  266. package/ext/ide-components/shared/tilt_integration.py +158 -0
  267. package/ext/ui-enhancements/cron-status-server.sh +49 -0
  268. package/ext/ui-enhancements/cron-status-tracker.sh +146 -0
  269. package/ext/ui-enhancements/extension.yaml +36 -0
  270. package/ext/ui-enhancements/tiltfile.py +99 -0
  271. package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
  272. package/ext/ui-enhancements/ui/help-panel.css +279 -0
  273. package/ext/ui-enhancements/ui/icons.css +125 -0
  274. package/ext/ui-enhancements/ui/tooltips.css +114 -0
  275. package/package.json +13 -9
  276. package/specs/specs/TILT_SERVICE_DEFAULTS.star +205 -0
  277. package/specs/specs/TILT_TECH_STACK.star +159 -0
@@ -0,0 +1,182 @@
1
+ # 🧪 Tilt Auto-Discovery Verification Test
2
+
3
+ ## ✅ Zero-Config Resource Discovery
4
+
5
+ This system implements **manifest-driven auto-discovery** - no hardcoded resource lists!
6
+
7
+ ---
8
+
9
+ ## 🚀 The "New Resource" Test
10
+
11
+ Create a new resource and watch Tilt auto-discover it:
12
+
13
+ ```bash
14
+ # 1️⃣ Create new resource directory
15
+ mkdir -p services/product/billing/billing-backend
16
+
17
+ # 2️⃣ Add minimal manifest
18
+ cat > services/product/billing/billing-backend/service.json << 'EOF'
19
+ {
20
+ "appName": "billing-backend",
21
+ "appType": "backend",
22
+ "stack": "billing",
23
+ "port": 4010
24
+ }
25
+ EOF
26
+
27
+ # 3️⃣ Add package.json
28
+ cat > services/product/billing/billing-backend/package.json << 'EOF'
29
+ {
30
+ "name": "billing-backend",
31
+ "version": "1.0.0",
32
+ "scripts": {
33
+ "dev": "bun run src/index.ts"
34
+ }
35
+ }
36
+ EOF
37
+
38
+ # 4️⃣ Add basic source file
39
+ mkdir -p services/product/billing/billing-backend/src
40
+ cat > services/product/billing/billing-backend/src/index.ts << 'EOF'
41
+ console.log('Billing resource started!');
42
+ EOF
43
+
44
+ # 5️⃣ Restart Tilt
45
+ tilt down
46
+ tilt up
47
+
48
+ # ✅ RESULT: billing-backend is auto-discovered!
49
+ # Check Tilt UI at http://localhost:10350
50
+ # You should see "billing-backend" in the resource list
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 🧹 The "Ghost" Test (Cleanup Verification)
56
+
57
+ ```bash
58
+ # 1️⃣ Remove the test resource
59
+ rm -rf services/product/billing
60
+
61
+ # 2️⃣ Restart Tilt
62
+ tilt down
63
+ tilt up
64
+
65
+ # ✅ RESULT: billing-backend disappears from Tilt UI
66
+ # No stale configurations or errors
67
+ ```
68
+
69
+ ---
70
+
71
+ ## 📋 Manifest Examples
72
+
73
+ ### Minimal Backend (Convention over Configuration)
74
+ ```json
75
+ {
76
+ "appName": "my-resource-backend",
77
+ "appType": "backend",
78
+ "stack": "mystack",
79
+ "port": 4020
80
+ }
81
+ ```
82
+
83
+ **Auto-generated defaults:**
84
+ - ✅ `databaseName`: `TDK_mystack`
85
+ - ✅ `internalPort`: `3000` (container)
86
+ - ✅ `traefik.host`: `mystack.backend.{project}.local`
87
+ - ✅ `syncs`: `['src', '.npmrc', '.autogenerated/.npmrc.docker.autogenerated', '.autogenerated/bunfig.docker.autogenerated.toml']`
88
+
89
+ ### Backend with Prisma
90
+ ```json
91
+ {
92
+ "appName": "order-backend",
93
+ "appType": "backend",
94
+ "stack": "order",
95
+ "port": 4002,
96
+ "features": ["nats", "prisma"],
97
+ "dependsOn": ["identity", "user"]
98
+ }
99
+ ```
100
+
101
+ **Auto-detects:**
102
+ - ✅ Adds `prisma/` to syncs
103
+ - ✅ Enables migrator (`order-db-migrator`)
104
+ - ✅ Creates dependency graph
105
+
106
+ ### Frontend with Backend Proxy
107
+ ```json
108
+ {
109
+ "appName": "user-frontend",
110
+ "appType": "frontend",
111
+ "stack": "user",
112
+ "port": 3001,
113
+ "backendName": "user-management-backend"
114
+ }
115
+ ```
116
+
117
+ **Auto-generates:**
118
+ - ✅ Vite proxy configuration
119
+ - ✅ Frontend → Backend dependency
120
+ - ✅ HMR port configuration
121
+
122
+ ---
123
+
124
+ ## 🔍 Discovery Output
125
+
126
+ When Tilt starts, you'll see:
127
+
128
+ ```
129
+ 🔍 ═══════════════════════════════════════════════════════════════
130
+ 🔍 MANIFEST-DRIVEN RESOURCE DISCOVERY
131
+ 🔍 ═══════════════════════════════════════════════════════════════
132
+ 📂 Working directory: /private/var/www/2025/ollamar1/tdk/.tilt/core
133
+ 📂 Resources root check: ../../services/product
134
+ 📋 Found 8 manifest files
135
+ ✅ user-management-backend | backend | Port: 4000 | Stack: user
136
+ ✅ user-management-frontend | frontend | Port: 3001 | Stack: user
137
+ ✅ order-management-backend | backend | Port: 4002 | Stack: order
138
+ ✅ staff-management-backend | backend | Port: 4004 | Stack: staff
139
+ ✅ identity-management-backend | backend | Port: 4006 | Stack: identity
140
+ ✅ treatment-management-backend | backend | Port: 4008 | Stack: treatment
141
+ ✅ inventory-management-backend | backend | Port: 4012 | Stack: inventory
142
+ ✅ order-planner-backend | backend | Port: 4014 | Stack: order-planner
143
+ 🔍 ═══════════════════════════════════════════════════════════════
144
+ 🎯 Discovered 8 stacks with 8 resources
145
+ 🔍 ═══════════════════════════════════════════════════════════════
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 🎯 Key Benefits
151
+
152
+ 1. **Zero Manual Registration**: No hardcoded resource lists
153
+ 2. **Convention over Configuration**: Minimal manifest = full resource
154
+ 3. **Merge Conflict Free**: No central file to edit
155
+ 4. **Self-Documenting**: Filesystem = source of truth
156
+ 5. **Smart Defaults**: Port ranges, syncs, dependencies auto-computed
157
+
158
+ ---
159
+
160
+ ## 📚 Related Files
161
+
162
+ - **Discovery Engine**: `.tilt/core/registry.star` (lines 212-638)
163
+ - **Manifest Loader**: `.tilt/core/manifest.star`
164
+ - **Tiltfile Integration**: `Tiltfile` (imports `APP_RESOURCES` from registry)
165
+
166
+ ---
167
+
168
+ ## 🔧 Advanced: Custom Discovery Paths
169
+
170
+ Edit `.tilt/core/registry.star` to scan additional paths:
171
+
172
+ ```starlark
173
+ GLOBAL_CONFIG = {
174
+ 'services_root': '../../services/product', # Current
175
+ # Add more roots if needed:
176
+ # 'additional_roots': ['../../services/internal', '../../services/external']
177
+ }
178
+ ```
179
+
180
+ ---
181
+
182
+ **Status**: ✅ Auto-discovery is ACTIVE and working!
@@ -0,0 +1,396 @@
1
+ ## Detailed Architecture Breakdown
2
+
3
+ ### **Core Layer** (Foundation)
4
+
5
+ ```
6
+ core/
7
+ ├── utils.star # Shared utilities, I/O, validation
8
+ ├── manifest.star # Service manifest loading & Smart Defaults
9
+ ├── registry.star # Single Source of Truth for all services
10
+ └── dependency-sync.star # Automatic config regeneration
11
+ ```
12
+
13
+ **Responsibilities**:
14
+ - File I/O with change detection
15
+ - JSON manifest parsing & validation
16
+ - Service discovery (auto-scans `services/product/`)
17
+ - Dependency resolution (package names → paths)
18
+ - Network repair utilities
19
+ - Environment validation
20
+
21
+ **Key Pattern**: Pure functions, no mutable global state (Starlark-safe)
22
+
23
+ ---
24
+
25
+ ### **Provider Layer** (Config Generators)
26
+
27
+ ```
28
+ providers/
29
+ ├── docker/
30
+ │ ├── layers/
31
+ │ │ ├── l1_base_layers.star # OS base + runtime env
32
+ │ │ ├── l2_dependency_layers.star # Package manifest + install
33
+ │ │ ├── l3_builder_layers.star # Compilation stage
34
+ │ │ └── l4_runtime_layers.star # Final runtime
35
+ │ ├── compose.star # docker-compose generation
36
+ │ ├── dockerignore.star # .dockerignore generation
37
+ │ └── golden-image.star # Golden image workflow
38
+ ├── typescript/
39
+ │ ├── backend_tsconfig.star # Backend TypeScript config
40
+ │ ├── frontend_tsconfig.star # Frontend TypeScript config
41
+ │ └── prisma_config.star # Prisma-specific config
42
+ ├── vite.star # Vite dev server config
43
+ └── npmrc.star # Package registry config
44
+ ```
45
+
46
+ **Responsibilities**:
47
+ - Generate configuration files from manifests
48
+ - Multi-stage Dockerfile orchestration (L1→L2→L3→L4)
49
+ - TypeScript path mapping automation
50
+ - Vite alias synchronization
51
+ - Registry configuration (.npmrc, bunfig.toml)
52
+
53
+ **Key Innovation**: Layered Docker builds with surgical cache invalidation
54
+
55
+ ---
56
+
57
+ ### **Lifecycle Layer** (Orchestration)
58
+
59
+ ```
60
+ lifecycle/
61
+ ├── libs.star # Shared library management
62
+ ├── databases.star # Database virtualization (per-service DBs)
63
+ ├── orchestrator.star # Service coordination & dependencies
64
+ ├── infra-loader.star # Infrastructure provisioning
65
+ └── watchers.star # File change detection & triggers
66
+ ```
67
+
68
+ **Responsibilities**:
69
+ - Shared library build orchestration
70
+ - Per-service database provisioning (`TDK_{domain}`)
71
+ - Service startup order (via dependency graph)
72
+ - Infrastructure bootstrapping (Postgres, NATS, Traefik)
73
+ - Hot-reload triggers on file changes
74
+
75
+ **Key Pattern**: Resource dependency graphs ensure correct startup order
76
+
77
+ ---
78
+
79
+ ### **Configuration Layer**
80
+
81
+ ```
82
+ config.star # Global config & Focus Mode
83
+ focus-mode.star # Service filtering (--focus=user)
84
+ ```
85
+
86
+ **Responsibilities**:
87
+ - CLI argument parsing (`--focus`, `--no-frontend`)
88
+ - Service enablement logic
89
+ - Environment variable loading
90
+ - Context building for all modules
91
+
92
+ ---
93
+
94
+ ## Data Flow Diagrams
95
+
96
+ ### **1. Service Discovery Flow**
97
+
98
+ ```mermaid
99
+ graph TD
100
+ A[Tilt Startup] --> B[Scan services/product/]
101
+ B --> C{Find manifests}
102
+ C -->|Found| D[Load JSON]
103
+ C -->|Not found| E[Skip directory]
104
+ D --> F[Apply Smart Defaults]
105
+ F --> G[Validate manifest]
106
+ G --> H{Valid?}
107
+ H -->|Yes| I[Add to APP_RESOURCES]
108
+ H -->|No| J[Log error, skip]
109
+ I --> K[Generate all configs]
110
+ K --> L[Create Tilt resources]
111
+
112
+ style A fill:#f9f,stroke:#333,stroke-width:3px
113
+ style I fill:#9f9,stroke:#333,stroke-width:2px
114
+ style J fill:#f99,stroke:#333,stroke-width:2px
115
+ ```
116
+
117
+ ### **2. Manifest-Driven Config Generation**
118
+
119
+ ```mermaid
120
+ graph LR
121
+ subgraph "Single Source of Truth"
122
+ M[service.manifest.json]
123
+ end
124
+
125
+ subgraph "Generated Configs"
126
+ D1[Dockerfile.app]
127
+ D2[Dockerfile.migrator]
128
+ DC[docker-compose.yml]
129
+ TS[tsconfig.json]
130
+ V[vite.config.ts]
131
+ N[.npmrc]
132
+ B[bunfig.toml]
133
+ end
134
+
135
+ M -->|Docker Provider| D1
136
+ M -->|Docker Provider| D2
137
+ M -->|Compose Provider| DC
138
+ M -->|TS Provider| TS
139
+ M -->|Vite Provider| V
140
+ M -->|Package Provider| N
141
+ M -->|Package Provider| B
142
+
143
+ style M fill:#ff9,stroke:#333,stroke-width:4px
144
+ ```
145
+
146
+ ### **3. Golden Image Build Strategy**
147
+
148
+ ```mermaid
149
+ graph TB
150
+ subgraph "One-Time Build"
151
+ GD[docker/golden.Dockerfile]
152
+ GB[Golden Image Build]
153
+ GI[TDK Landscape-base:latest]
154
+ end
155
+
156
+ subgraph "Per-Service Builds (Fast)"
157
+ S1[user-backend]
158
+ S2[order-backend]
159
+ S3[treatment-backend]
160
+ end
161
+
162
+ subgraph "Service Dockerfiles"
163
+ DF1[FROM TDK Landscape-base:latest]
164
+ DF2[COPY service code]
165
+ DF3[RUN bun build]
166
+ end
167
+
168
+ GD --> GB
169
+ GB --> GI
170
+ GI --> S1
171
+ GI --> S2
172
+ GI --> S3
173
+ S1 --> DF1
174
+ DF1 --> DF2
175
+ DF2 --> DF3
176
+
177
+ style GI fill:#f9f,stroke:#333,stroke-width:4px
178
+ style DF3 fill:#9f9,stroke:#333,stroke-width:2px
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Key Design Principles
184
+
185
+ ### **1. Convention over Configuration**
186
+ ```
187
+ Package name → Directory path (automatic)
188
+
189
+ @tdk-landscape/eventing → platform/packages/eventing/src
190
+ @tdk/domain → shared-ddd-layers/domain/src
191
+ ```
192
+
193
+ ### **2. Single Source of Truth**
194
+ ```
195
+ service.manifest.json → Everything else
196
+
197
+ One file defines:
198
+ - Service name, type, domain
199
+ - Port mapping
200
+ - Database name
201
+ - Dependencies
202
+ - Feature flags (prisma, nats, etc.)
203
+ ```
204
+
205
+ ### **3. Fail-Fast Validation**
206
+ ```
207
+ Checks at tilt up:
208
+ ✓ Manifest schema validation
209
+ ✓ Circular dependency detection
210
+ ✓ Network conflict resolution
211
+ ✓ Infisical environment check
212
+ ✓ Required secrets present
213
+ ```
214
+
215
+ ### **4. Self-Healing Systems**
216
+ ```
217
+ Automatic fixes:
218
+ ✓ Docker network conflicts → recreate networks
219
+ ✓ Bun install cache corruption → retry without cache
220
+ ✓ Missing golden image → build automatically
221
+ ✓ Dependency changes → regenerate all configs
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Performance Optimizations
227
+
228
+ ### **Build Time Reduction**
229
+
230
+ | Strategy | Impact | Implementation |
231
+ |----------|--------|----------------|
232
+ | **Golden images** | 98% faster | Pre-built base layers |
233
+ | **L1-L4 layering** | 5x cache hits | Surgical invalidation |
234
+ | **Parallel builds** | 3x faster | Tilt's concurrent resource loading |
235
+ | **Bun runtime** | 2x faster | vs Node.js |
236
+ | **Multi-stage builds** | 80% smaller images | Production purge layer |
237
+
238
+ ### **Developer Productivity**
239
+
240
+ | Feature | Time Saved | Comparison |
241
+ |---------|-----------|------------|
242
+ | **Auto-discovery** | 30 min/service | vs manual Tiltfile edits |
243
+ | **Dependency sync** | 10 min/change | vs manual config updates |
244
+ | **Focus mode** | 5 min/restart | vs full stack rebuild |
245
+ | **Healthchecks** | 2 hours/incident | vs blind debugging |
246
+ | **Network auto-repair** | 15 min/conflict | vs manual Docker cleanup |
247
+
248
+ ---
249
+
250
+ ## System Boundaries
251
+
252
+ ### **What Tilt Controls**
253
+ ✅ Docker image generation
254
+ ✅ Container orchestration
255
+ ✅ Configuration file generation
256
+ ✅ Dependency graph management
257
+ ✅ Local development environment
258
+ ✅ Hot reload triggers
259
+
260
+ ### **What Tilt Doesn't Control**
261
+ ❌ Production deployment
262
+ ❌ Cloud infrastructure
263
+ ❌ Monitoring/observability
264
+ ❌ CI/CD pipelines (that's GitHub Actions)
265
+ ❌ Application business logic
266
+
267
+ ---
268
+
269
+ ## Integration Points
270
+
271
+ ```mermaid
272
+ graph TB
273
+ subgraph "External Systems"
274
+ Git[Git Repository]
275
+ Docker[Docker Engine]
276
+ Bun[Bun Runtime]
277
+ Infisical[Infisical Secrets]
278
+ end
279
+
280
+ subgraph "Tilt Ecosystem"
281
+ Tiltfile[Tiltfile]
282
+ SDK[Tilt SDK Modules]
283
+ Resources[Tilt Resources]
284
+ end
285
+
286
+ subgraph "Generated Artifacts"
287
+ Dockerfiles[Auto-generated Dockerfiles]
288
+ Configs[Auto-generated Configs]
289
+ Compose[Docker Compose Files]
290
+ end
291
+
292
+ subgraph "Running System"
293
+ Containers[Service Containers]
294
+ Databases[Per-Service DBs]
295
+ Infrastructure[NATS, Traefik, etc.]
296
+ end
297
+
298
+ Git -->|watches| Tiltfile
299
+ Tiltfile -->|loads| SDK
300
+ SDK -->|generates| Dockerfiles
301
+ SDK -->|generates| Configs
302
+ SDK -->|generates| Compose
303
+
304
+ Dockerfiles -->|builds via| Docker
305
+ Compose -->|orchestrates| Containers
306
+
307
+ Containers -->|connects to| Databases
308
+ Containers -->|uses| Infrastructure
309
+
310
+ Bun -->|runs in| Containers
311
+ Infisical -->|provides secrets to| Containers
312
+
313
+ style Tiltfile fill:#f9f,stroke:#333,stroke-width:4px
314
+ style SDK fill:#9cf,stroke:#333,stroke-width:3px
315
+ style Containers fill:#9f9,stroke:#333,stroke-width:3px
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Deployment View
321
+
322
+ ```mermaid
323
+ graph TB
324
+ subgraph "Developer Machine"
325
+ Editor[VS Code / Cursor]
326
+ Git[Git]
327
+ Tilt[Tilt]
328
+ Docker[Docker / OrbStack]
329
+ end
330
+
331
+ subgraph "Tilt SDK (Starlark)"
332
+ Core[Core Modules]
333
+ Providers[Config Generators]
334
+ Lifecycle[Orchestration]
335
+ end
336
+
337
+ subgraph "Generated Artifacts (Git-ignored)"
338
+ DF[*.autogenerated Dockerfiles]
339
+ DC[docker-compose.autogenerated.yml]
340
+ TS[tsconfig.docker.autogenerated.json]
341
+ end
342
+
343
+ subgraph "Running Containers"
344
+ Services[30+ Microservices]
345
+ DBs[PostgreSQL Instances]
346
+ Infra[NATS, Traefik, Verdaccio]
347
+ end
348
+
349
+ Editor -->|edits code| Git
350
+ Git -->|triggers| Tilt
351
+ Tilt -->|executes| Core
352
+ Core --> Providers
353
+ Providers --> Lifecycle
354
+ Lifecycle --> DF
355
+ Lifecycle --> DC
356
+ Lifecycle --> TS
357
+
358
+ DF -->|builds| Docker
359
+ DC -->|orchestrates| Docker
360
+ Docker -->|runs| Services
361
+ Docker -->|runs| DBs
362
+ Docker -->|runs| Infra
363
+
364
+ style Editor fill:#bbf,stroke:#333,stroke-width:2px
365
+ style Tilt fill:#f9f,stroke:#333,stroke-width:4px
366
+ style Services fill:#9f9,stroke:#333,stroke-width:3px
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Comparison to Production Architecture
372
+
373
+ | Aspect | Tilt (Local Dev) | Production |
374
+ |--------|------------------|------------|
375
+ | **Orchestration** | Tilt + Docker Compose | Kubernetes / Cloud Run |
376
+ | **Service Discovery** | Manifest files | Service mesh / DNS |
377
+ | **Config Management** | Auto-generated files | ConfigMaps / Secrets |
378
+ | **Networking** | Docker networks | Cloud VPC / Load balancers |
379
+ | **Databases** | Local Postgres containers | Managed Postgres (Neon/RDS) |
380
+ | **Secrets** | Infisical CLI | Infisical API / Vault |
381
+ | **Observability** | Docker logs + Tilt UI | Prometheus + Grafana + Sentry |
382
+ | **Deployment** | `tilt up` | CI/CD → Cloud deploy |
383
+
384
+ ---
385
+
386
+ ## Conclusion
387
+
388
+ **Tilt SDK Architecture** = 5000+ lines of infrastructure-as-code that:
389
+
390
+ 1. **Eliminates manual toil** (19% of files autogenerated)
391
+ 2. **Enforces consistency** (one template → 30 services)
392
+ 3. **Enables rapid development** (`git clone && tilt up`)
393
+ 4. **Scales horizontally** (manifest discovery = no central file edits)
394
+ 5. **Provides escape hatches** (can override any generated config)
395
+
396
+ **This is enterprise-grade developer tooling** built by one engineer over one year.