@intentius/chant 0.124.51 → 0.124.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 (593) hide show
  1. package/dist/audit/discover.d.ts.map +1 -1
  2. package/dist/audit/discover.js +3 -1
  3. package/dist/behaviour.d.ts +1 -1
  4. package/dist/behaviour.d.ts.map +1 -1
  5. package/dist/capabilities/templates.d.ts +65 -0
  6. package/dist/capabilities/templates.d.ts.map +1 -0
  7. package/dist/capabilities/templates.js +193 -0
  8. package/dist/capabilities/templates.json +145 -0
  9. package/dist/change-set-graph.d.ts +35 -3
  10. package/dist/change-set-graph.d.ts.map +1 -1
  11. package/dist/change-set-graph.js +60 -9
  12. package/dist/change-set.d.ts +65 -7
  13. package/dist/change-set.d.ts.map +1 -1
  14. package/dist/change-set.js +23 -12
  15. package/dist/ci-identity.d.ts +7 -2
  16. package/dist/ci-identity.d.ts.map +1 -1
  17. package/dist/ci-identity.js +4 -1
  18. package/dist/cli/commands/import-index.d.ts +52 -0
  19. package/dist/cli/commands/import-index.d.ts.map +1 -0
  20. package/dist/cli/commands/import-index.js +226 -0
  21. package/dist/cli/commands/lint.d.ts.map +1 -1
  22. package/dist/cli/commands/lint.js +4 -2
  23. package/dist/cli/handlers/components.d.ts.map +1 -1
  24. package/dist/cli/handlers/components.js +11 -2
  25. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  26. package/dist/cli/handlers/fan-out.js +16 -3
  27. package/dist/cli/handlers/graph.d.ts.map +1 -1
  28. package/dist/cli/handlers/graph.js +22 -4
  29. package/dist/cli/handlers/index-cloud.d.ts +14 -0
  30. package/dist/cli/handlers/index-cloud.d.ts.map +1 -0
  31. package/dist/cli/handlers/index-cloud.js +22 -0
  32. package/dist/cli/handlers/index-diff.d.ts +18 -0
  33. package/dist/cli/handlers/index-diff.d.ts.map +1 -0
  34. package/dist/cli/handlers/index-diff.js +142 -0
  35. package/dist/cli/handlers/lifecycle-drift.d.ts +25 -0
  36. package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -0
  37. package/dist/cli/handlers/lifecycle-drift.js +64 -0
  38. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  39. package/dist/cli/handlers/lifecycle.js +188 -28
  40. package/dist/cli/handlers/misc.d.ts +9 -0
  41. package/dist/cli/handlers/misc.d.ts.map +1 -1
  42. package/dist/cli/handlers/misc.js +77 -0
  43. package/dist/cli/handlers/pr.d.ts.map +1 -1
  44. package/dist/cli/handlers/pr.js +17 -3
  45. package/dist/cli/handlers/promote.d.ts.map +1 -1
  46. package/dist/cli/handlers/promote.js +89 -15
  47. package/dist/cli/handlers/query.d.ts.map +1 -1
  48. package/dist/cli/handlers/query.js +28 -4
  49. package/dist/cli/handlers/scenario.d.ts.map +1 -1
  50. package/dist/cli/handlers/scenario.js +8 -7
  51. package/dist/cli/handlers/search.d.ts +34 -4
  52. package/dist/cli/handlers/search.d.ts.map +1 -1
  53. package/dist/cli/handlers/search.js +216 -36
  54. package/dist/cli/main.d.ts.map +1 -1
  55. package/dist/cli/main.js +55 -1
  56. package/dist/cli/mcp/lifecycle-tools.d.ts.map +1 -1
  57. package/dist/cli/mcp/lifecycle-tools.js +3 -2
  58. package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
  59. package/dist/cli/mcp/resource-handlers.js +4 -3
  60. package/dist/cli/mcp/workspace-tools.js +1 -1
  61. package/dist/cli/parse-args.d.ts.map +1 -1
  62. package/dist/cli/parse-args.js +55 -2
  63. package/dist/cli/registry.d.ts +19 -1
  64. package/dist/cli/registry.d.ts.map +1 -1
  65. package/dist/cloud-lister/aws.d.ts +35 -0
  66. package/dist/cloud-lister/aws.d.ts.map +1 -0
  67. package/dist/cloud-lister/aws.js +203 -0
  68. package/dist/cloud-lister/azure.d.ts +34 -0
  69. package/dist/cloud-lister/azure.d.ts.map +1 -0
  70. package/dist/cloud-lister/azure.js +129 -0
  71. package/dist/cloud-lister/common.d.ts +40 -0
  72. package/dist/cloud-lister/common.d.ts.map +1 -0
  73. package/dist/cloud-lister/common.js +83 -0
  74. package/dist/cloud-lister/credentials.d.ts +50 -0
  75. package/dist/cloud-lister/credentials.d.ts.map +1 -0
  76. package/dist/cloud-lister/credentials.js +86 -0
  77. package/dist/cloud-lister/fakes.d.ts +27 -0
  78. package/dist/cloud-lister/fakes.d.ts.map +1 -0
  79. package/dist/cloud-lister/fakes.js +50 -0
  80. package/dist/cloud-lister/gcp.d.ts +42 -0
  81. package/dist/cloud-lister/gcp.d.ts.map +1 -0
  82. package/dist/cloud-lister/gcp.js +143 -0
  83. package/dist/cloud-lister/guard.d.ts +49 -0
  84. package/dist/cloud-lister/guard.d.ts.map +1 -0
  85. package/dist/cloud-lister/guard.js +103 -0
  86. package/dist/cloud-lister/ids.d.ts +23 -0
  87. package/dist/cloud-lister/ids.d.ts.map +1 -0
  88. package/dist/cloud-lister/ids.js +42 -0
  89. package/dist/cloud-lister/index.d.ts +67 -0
  90. package/dist/cloud-lister/index.d.ts.map +1 -0
  91. package/dist/cloud-lister/index.js +102 -0
  92. package/dist/cloud-lister/kubernetes.d.ts +64 -0
  93. package/dist/cloud-lister/kubernetes.d.ts.map +1 -0
  94. package/dist/cloud-lister/kubernetes.js +276 -0
  95. package/dist/cloud-lister/markers.d.ts +31 -0
  96. package/dist/cloud-lister/markers.d.ts.map +1 -0
  97. package/dist/cloud-lister/markers.js +73 -0
  98. package/dist/cloud-lister/mask.d.ts +31 -0
  99. package/dist/cloud-lister/mask.d.ts.map +1 -0
  100. package/dist/cloud-lister/mask.js +74 -0
  101. package/dist/cloud-lister/sigv4.d.ts +29 -0
  102. package/dist/cloud-lister/sigv4.d.ts.map +1 -0
  103. package/dist/cloud-lister/sigv4.js +54 -0
  104. package/dist/cloud-lister/transport.d.ts +55 -0
  105. package/dist/cloud-lister/transport.d.ts.map +1 -0
  106. package/dist/cloud-lister/transport.js +86 -0
  107. package/dist/cloud-lister/types.d.ts +121 -0
  108. package/dist/cloud-lister/types.d.ts.map +1 -0
  109. package/dist/cloud-lister/types.js +24 -0
  110. package/dist/components/capability-plugin-loader.d.ts.map +1 -1
  111. package/dist/components/capability-plugin-loader.js +6 -0
  112. package/dist/components/capability-plugin.d.ts +9 -0
  113. package/dist/components/capability-plugin.d.ts.map +1 -1
  114. package/dist/components/capability.d.ts +224 -0
  115. package/dist/components/capability.d.ts.map +1 -1
  116. package/dist/components/cli-support.d.ts +21 -0
  117. package/dist/components/cli-support.d.ts.map +1 -1
  118. package/dist/components/cli-support.js +58 -14
  119. package/dist/components/covered-round.d.ts +173 -0
  120. package/dist/components/covered-round.d.ts.map +1 -0
  121. package/dist/components/covered-round.js +200 -0
  122. package/dist/components/declared-reads.d.ts +38 -0
  123. package/dist/components/declared-reads.d.ts.map +1 -0
  124. package/dist/components/declared-reads.js +131 -0
  125. package/dist/components/deploy-units.d.ts.map +1 -1
  126. package/dist/components/deploy-units.js +4 -0
  127. package/dist/components/driver.d.ts +42 -1
  128. package/dist/components/driver.d.ts.map +1 -1
  129. package/dist/components/driver.js +74 -3
  130. package/dist/components/fan-out-run.d.ts +23 -1
  131. package/dist/components/fan-out-run.d.ts.map +1 -1
  132. package/dist/components/fan-out-run.js +82 -14
  133. package/dist/components/fan-out-support.d.ts +6 -0
  134. package/dist/components/fan-out-support.d.ts.map +1 -1
  135. package/dist/components/fan-out-support.js +4 -1
  136. package/dist/components/fan-out.d.ts +28 -0
  137. package/dist/components/fan-out.d.ts.map +1 -1
  138. package/dist/components/groups.d.ts +229 -0
  139. package/dist/components/groups.d.ts.map +1 -0
  140. package/dist/components/groups.js +760 -0
  141. package/dist/components/index.d.ts +7 -2
  142. package/dist/components/index.d.ts.map +1 -1
  143. package/dist/components/index.js +5 -0
  144. package/dist/components/plan-shape-conformance.d.ts +48 -0
  145. package/dist/components/plan-shape-conformance.d.ts.map +1 -0
  146. package/dist/components/plan-shape-conformance.js +122 -0
  147. package/dist/components/pr-run.d.ts +62 -7
  148. package/dist/components/pr-run.d.ts.map +1 -1
  149. package/dist/components/pr-run.js +354 -53
  150. package/dist/components/promote-rounds.d.ts +9 -0
  151. package/dist/components/promote-rounds.d.ts.map +1 -1
  152. package/dist/components/promote-rounds.js +23 -2
  153. package/dist/components/promote.d.ts +17 -0
  154. package/dist/components/promote.d.ts.map +1 -1
  155. package/dist/components/promote.js +36 -6
  156. package/dist/components/release-gate.d.ts +23 -1
  157. package/dist/components/release-gate.d.ts.map +1 -1
  158. package/dist/components/release-gate.js +97 -33
  159. package/dist/components/run-groups.d.ts +58 -0
  160. package/dist/components/run-groups.d.ts.map +1 -0
  161. package/dist/components/run-groups.js +78 -0
  162. package/dist/components/starter-plugin.d.ts +1 -0
  163. package/dist/components/starter-plugin.d.ts.map +1 -1
  164. package/dist/components/starter-plugin.js +6 -1
  165. package/dist/components/verbs/index.d.ts +1 -0
  166. package/dist/components/verbs/index.d.ts.map +1 -1
  167. package/dist/components/verbs/index.js +1 -0
  168. package/dist/components/verbs/member-outputs.d.ts +187 -0
  169. package/dist/components/verbs/member-outputs.d.ts.map +1 -0
  170. package/dist/components/verbs/member-outputs.js +218 -0
  171. package/dist/components/wave-plan.d.ts +2 -0
  172. package/dist/components/wave-plan.d.ts.map +1 -1
  173. package/dist/components/wave-plan.js +4 -1
  174. package/dist/config.d.ts +60 -0
  175. package/dist/config.d.ts.map +1 -1
  176. package/dist/config.js +27 -0
  177. package/dist/deep-observation.d.ts +1 -13
  178. package/dist/deep-observation.d.ts.map +1 -1
  179. package/dist/deep-observation.js +5 -22
  180. package/dist/drift-record.d.ts +542 -0
  181. package/dist/drift-record.d.ts.map +1 -0
  182. package/dist/drift-record.js +886 -0
  183. package/dist/engine-facts.d.ts +144 -0
  184. package/dist/engine-facts.d.ts.map +1 -0
  185. package/dist/engine-facts.js +14 -0
  186. package/dist/graph-ir.d.ts +153 -2
  187. package/dist/graph-ir.d.ts.map +1 -1
  188. package/dist/graph-ir.js +224 -6
  189. package/dist/graph-refs.d.ts +145 -0
  190. package/dist/graph-refs.d.ts.map +1 -1
  191. package/dist/graph-refs.js +305 -0
  192. package/dist/graph-schema/fixtures/adopt.json +15 -0
  193. package/dist/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
  194. package/dist/graph-schema/fixtures/index.json +68 -0
  195. package/dist/graph-schema/fixtures/plunge.engine-graph.json +158 -0
  196. package/dist/graph-schema/fixtures.d.ts +23 -0
  197. package/dist/graph-schema/fixtures.d.ts.map +1 -0
  198. package/dist/graph-schema/fixtures.js +246 -0
  199. package/dist/graph-schema/generate.d.ts +15 -0
  200. package/dist/graph-schema/generate.d.ts.map +1 -0
  201. package/dist/graph-schema/generate.js +267 -0
  202. package/dist/graph-schema/graph.schema.json +1387 -0
  203. package/dist/health.schema.json +2 -1
  204. package/dist/identity.d.ts.map +1 -1
  205. package/dist/identity.js +2 -0
  206. package/dist/index.d.ts +1 -0
  207. package/dist/index.d.ts.map +1 -1
  208. package/dist/index.js +2 -0
  209. package/dist/instance-nodes.d.ts +159 -0
  210. package/dist/instance-nodes.d.ts.map +1 -0
  211. package/dist/instance-nodes.js +231 -0
  212. package/dist/lexicon.d.ts +72 -0
  213. package/dist/lexicon.d.ts.map +1 -1
  214. package/dist/lifecycle/adoption-file.d.ts +56 -0
  215. package/dist/lifecycle/adoption-file.d.ts.map +1 -0
  216. package/dist/lifecycle/adoption-file.js +123 -0
  217. package/dist/lifecycle/cloud-index.d.ts +186 -0
  218. package/dist/lifecycle/cloud-index.d.ts.map +1 -0
  219. package/dist/lifecycle/cloud-index.js +618 -0
  220. package/dist/lifecycle/derive-edges.d.ts +59 -0
  221. package/dist/lifecycle/derive-edges.d.ts.map +1 -0
  222. package/dist/lifecycle/derive-edges.js +126 -0
  223. package/dist/lifecycle/git.d.ts +10 -9
  224. package/dist/lifecycle/git.d.ts.map +1 -1
  225. package/dist/lifecycle/git.js +7 -1
  226. package/dist/lifecycle/identity-match.d.ts +133 -0
  227. package/dist/lifecycle/identity-match.d.ts.map +1 -0
  228. package/dist/lifecycle/identity-match.js +147 -0
  229. package/dist/lifecycle/index-diff.d.ts +224 -0
  230. package/dist/lifecycle/index-diff.d.ts.map +1 -0
  231. package/dist/lifecycle/index-diff.js +327 -0
  232. package/dist/lifecycle/index-document.d.ts +130 -0
  233. package/dist/lifecycle/index-document.d.ts.map +1 -0
  234. package/dist/lifecycle/index-document.js +189 -0
  235. package/dist/lifecycle/index-drift.d.ts +121 -0
  236. package/dist/lifecycle/index-drift.d.ts.map +1 -0
  237. package/dist/lifecycle/index-drift.js +178 -0
  238. package/dist/lifecycle/index-import.d.ts +168 -0
  239. package/dist/lifecycle/index-import.d.ts.map +1 -0
  240. package/dist/lifecycle/index-import.js +515 -0
  241. package/dist/lifecycle/index-join.d.ts +129 -0
  242. package/dist/lifecycle/index-join.d.ts.map +1 -0
  243. package/dist/lifecycle/index-join.js +248 -0
  244. package/dist/lifecycle/index.d.ts +4 -0
  245. package/dist/lifecycle/index.d.ts.map +1 -1
  246. package/dist/lifecycle/index.js +4 -0
  247. package/dist/lifecycle/observation-baseline.d.ts +61 -21
  248. package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
  249. package/dist/lifecycle/observation-baseline.js +144 -19
  250. package/dist/lifecycle/observe.d.ts.map +1 -1
  251. package/dist/lifecycle/observe.js +6 -1
  252. package/dist/lifecycle/query.d.ts +45 -4
  253. package/dist/lifecycle/query.d.ts.map +1 -1
  254. package/dist/lifecycle/query.js +89 -7
  255. package/dist/lifecycle/replay.d.ts +10 -3
  256. package/dist/lifecycle/replay.d.ts.map +1 -1
  257. package/dist/lifecycle/replay.js +10 -6
  258. package/dist/lifecycle/scenario.d.ts +4 -3
  259. package/dist/lifecycle/scenario.d.ts.map +1 -1
  260. package/dist/lifecycle/snapshot-store-fake.d.ts +9 -0
  261. package/dist/lifecycle/snapshot-store-fake.d.ts.map +1 -0
  262. package/dist/lifecycle/snapshot-store-fake.js +21 -0
  263. package/dist/lifecycle/snapshot-store-s3.d.ts +102 -0
  264. package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -0
  265. package/dist/lifecycle/snapshot-store-s3.js +254 -0
  266. package/dist/lifecycle/snapshot-store.d.ts +170 -0
  267. package/dist/lifecycle/snapshot-store.d.ts.map +1 -0
  268. package/dist/lifecycle/snapshot-store.js +832 -0
  269. package/dist/lifecycle/snapshot.d.ts +11 -0
  270. package/dist/lifecycle/snapshot.d.ts.map +1 -1
  271. package/dist/lifecycle/snapshot.js +18 -5
  272. package/dist/lifecycle/type-listing.d.ts +148 -0
  273. package/dist/lifecycle/type-listing.d.ts.map +1 -0
  274. package/dist/lifecycle/type-listing.js +166 -0
  275. package/dist/lint/component-checks.d.ts +15 -1
  276. package/dist/lint/component-checks.d.ts.map +1 -1
  277. package/dist/lint/component-checks.js +1 -0
  278. package/dist/lint/presets/relaxed.json +2 -1
  279. package/dist/lint/presets/strict.json +2 -1
  280. package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts +4 -0
  281. package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts.map +1 -0
  282. package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.js +13 -0
  283. package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts +4 -0
  284. package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts.map +1 -0
  285. package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.js +8 -0
  286. package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts +33 -0
  287. package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts.map +1 -0
  288. package/dist/lint/rules/comp/comp008-applies-signal-only-root.js +123 -0
  289. package/dist/lint/rules/comp/index.d.ts +2 -1
  290. package/dist/lint/rules/comp/index.d.ts.map +1 -1
  291. package/dist/lint/rules/comp/index.js +4 -1
  292. package/dist/observation.d.ts +19 -2
  293. package/dist/observation.d.ts.map +1 -1
  294. package/dist/observation.js +18 -1
  295. package/dist/op/activities/activity-contracts.d.ts +1 -1
  296. package/dist/op/activities/activity-contracts.js +1 -1
  297. package/dist/op/activities/change-set.d.ts +6 -4
  298. package/dist/op/activities/change-set.d.ts.map +1 -1
  299. package/dist/op/activities/change-set.js +4 -2
  300. package/dist/op/activity-failure.d.ts +27 -0
  301. package/dist/op/activity-failure.d.ts.map +1 -1
  302. package/dist/op/activity-failure.js +31 -0
  303. package/dist/op/index.d.ts +2 -1
  304. package/dist/op/index.d.ts.map +1 -1
  305. package/dist/op/index.js +1 -1
  306. package/dist/op/local-executor.d.ts +5 -1
  307. package/dist/op/local-executor.d.ts.map +1 -1
  308. package/dist/op/local-executor.js +22 -8
  309. package/dist/pr-loop.d.ts +92 -3
  310. package/dist/pr-loop.d.ts.map +1 -1
  311. package/dist/pr-loop.js +62 -3
  312. package/dist/pulumi-urn.d.ts +101 -0
  313. package/dist/pulumi-urn.d.ts.map +1 -0
  314. package/dist/pulumi-urn.js +131 -0
  315. package/dist/release-floors.d.ts +23 -0
  316. package/dist/release-floors.d.ts.map +1 -0
  317. package/dist/release-floors.js +22 -0
  318. package/dist/sensitive-key.d.ts +23 -0
  319. package/dist/sensitive-key.d.ts.map +1 -0
  320. package/dist/sensitive-key.js +31 -0
  321. package/dist/wave-runtime.mjs +234 -234
  322. package/dist/workspace/adoption-report.d.ts +53 -0
  323. package/dist/workspace/adoption-report.d.ts.map +1 -0
  324. package/dist/workspace/adoption-report.js +76 -0
  325. package/dist/workspace/capabilities-contract.d.ts +7 -0
  326. package/dist/workspace/capabilities-contract.d.ts.map +1 -1
  327. package/dist/workspace/capabilities-contract.js +2 -1
  328. package/dist/workspace/capabilities.schema.json +98 -0
  329. package/dist/workspace/change-set.schema.json +42 -3
  330. package/dist/workspace/ci-cloud-identity.d.ts +13 -1
  331. package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
  332. package/dist/workspace/ci-cloud-identity.js +30 -1
  333. package/dist/workspace/compose-graph.d.ts +10 -1
  334. package/dist/workspace/compose-graph.d.ts.map +1 -1
  335. package/dist/workspace/compose-graph.js +6 -1
  336. package/dist/workspace/conformance/index.d.ts +1 -1
  337. package/dist/workspace/conformance/index.d.ts.map +1 -1
  338. package/dist/workspace/conformance/index.js +6 -1
  339. package/dist/workspace/drift-cli.d.ts +81 -0
  340. package/dist/workspace/drift-cli.d.ts.map +1 -0
  341. package/dist/workspace/drift-cli.js +317 -0
  342. package/dist/workspace/drift.schema.json +672 -0
  343. package/dist/workspace/graph-cli.d.ts +2 -0
  344. package/dist/workspace/graph-cli.d.ts.map +1 -1
  345. package/dist/workspace/graph-cli.js +3 -0
  346. package/dist/workspace/graph.schema.json +72 -0
  347. package/dist/workspace/init.d.ts +5 -1
  348. package/dist/workspace/init.d.ts.map +1 -1
  349. package/dist/workspace/init.js +55 -9
  350. package/dist/workspace/ledger.schema.json +1 -1
  351. package/dist/workspace/nested-graph.d.ts.map +1 -1
  352. package/dist/workspace/nested-graph.js +2 -0
  353. package/dist/workspace/pr-report.schema.json +76 -3
  354. package/dist/workspace/promote-waves.d.ts +112 -0
  355. package/dist/workspace/promote-waves.d.ts.map +1 -0
  356. package/dist/workspace/promote-waves.js +290 -0
  357. package/dist/workspace/promote.d.ts +84 -2
  358. package/dist/workspace/promote.d.ts.map +1 -1
  359. package/dist/workspace/promote.js +347 -61
  360. package/dist/workspace/reason-codes.d.ts +12 -0
  361. package/dist/workspace/reason-codes.d.ts.map +1 -1
  362. package/dist/workspace/reason-codes.js +14 -0
  363. package/dist/workspace/search-contract.d.ts +3 -3
  364. package/dist/workspace/search-contract.d.ts.map +1 -1
  365. package/dist/workspace/search-contract.js +2 -0
  366. package/dist/workspace/search.schema.json +103 -5
  367. package/package.json +14 -1
  368. package/src/__fixtures__/drift-record/README.md +58 -0
  369. package/src/__fixtures__/drift-record/choudoufu-cone.ndjson +4 -0
  370. package/src/__fixtures__/drift-record/choudoufu-resource.ndjson +3 -0
  371. package/src/__fixtures__/drift-record/component-status-ledger.json +65 -0
  372. package/src/__fixtures__/drift-record/component-status.json +91 -0
  373. package/src/__fixtures__/drift-record/deep-diff.json +259 -0
  374. package/src/__fixtures__/drift-record/lifecycle-diff-live.json +825 -0
  375. package/src/__fixtures__/drift-record/live-diff.json +125 -0
  376. package/src/audit/discover.e2e.test.ts +14 -0
  377. package/src/audit/discover.ts +3 -1
  378. package/src/behaviour.ts +1 -1
  379. package/src/capabilities/templates.json +145 -0
  380. package/src/capabilities/templates.test.ts +212 -0
  381. package/src/capabilities/templates.ts +204 -0
  382. package/src/change-set-bundle.test.ts +83 -0
  383. package/src/change-set-graph.ts +80 -9
  384. package/src/change-set.test.ts +24 -0
  385. package/src/change-set.ts +77 -14
  386. package/src/ci-identity-targets.test.ts +23 -0
  387. package/src/ci-identity.ts +10 -4
  388. package/src/cli/commands/import-index.test.ts +117 -0
  389. package/src/cli/commands/import-index.ts +265 -0
  390. package/src/cli/commands/lint.ts +4 -2
  391. package/src/cli/handlers/components.test.ts +9 -0
  392. package/src/cli/handlers/components.ts +12 -2
  393. package/src/cli/handlers/fan-out.ts +17 -3
  394. package/src/cli/handlers/graph.test.ts +42 -0
  395. package/src/cli/handlers/graph.ts +26 -4
  396. package/src/cli/handlers/index-cloud.ts +32 -0
  397. package/src/cli/handlers/index-diff.test.ts +68 -0
  398. package/src/cli/handlers/index-diff.ts +146 -0
  399. package/src/cli/handlers/ledger-root-member.test.ts +161 -0
  400. package/src/cli/handlers/lifecycle-drift.ts +68 -0
  401. package/src/cli/handlers/lifecycle.test.ts +33 -11
  402. package/src/cli/handlers/lifecycle.ts +205 -30
  403. package/src/cli/handlers/misc.ts +73 -0
  404. package/src/cli/handlers/pr-waves-blocked.test.ts +37 -2
  405. package/src/cli/handlers/pr.ts +16 -3
  406. package/src/cli/handlers/promote.test.ts +64 -0
  407. package/src/cli/handlers/promote.ts +81 -6
  408. package/src/cli/handlers/query.ts +27 -4
  409. package/src/cli/handlers/run-declared-reads-cli.test.ts +187 -0
  410. package/src/cli/handlers/run-groups-cli.test.ts +229 -0
  411. package/src/cli/handlers/scenario.test.ts +13 -0
  412. package/src/cli/handlers/scenario.ts +8 -7
  413. package/src/cli/handlers/search-index.test.ts +255 -0
  414. package/src/cli/handlers/search-json.test.ts +1 -1
  415. package/src/cli/handlers/search-ownership.test.ts +194 -0
  416. package/src/cli/handlers/search.ts +271 -38
  417. package/src/cli/main.test.ts +7 -0
  418. package/src/cli/main.ts +56 -1
  419. package/src/cli/mcp/lifecycle-tools.ts +3 -2
  420. package/src/cli/mcp/resource-handlers.ts +4 -3
  421. package/src/cli/mcp/workspace-tools.ts +1 -1
  422. package/src/cli/parse-args.ts +40 -2
  423. package/src/cli/registry.ts +19 -1
  424. package/src/cloud-lister/aws.test.ts +202 -0
  425. package/src/cloud-lister/aws.ts +226 -0
  426. package/src/cloud-lister/azure.test.ts +132 -0
  427. package/src/cloud-lister/azure.ts +142 -0
  428. package/src/cloud-lister/common.ts +115 -0
  429. package/src/cloud-lister/credentials.ts +110 -0
  430. package/src/cloud-lister/fakes.ts +66 -0
  431. package/src/cloud-lister/gcp.test.ts +121 -0
  432. package/src/cloud-lister/gcp.ts +159 -0
  433. package/src/cloud-lister/guard.test.ts +198 -0
  434. package/src/cloud-lister/guard.ts +111 -0
  435. package/src/cloud-lister/ids.ts +54 -0
  436. package/src/cloud-lister/index.ts +134 -0
  437. package/src/cloud-lister/kubernetes.test.ts +160 -0
  438. package/src/cloud-lister/kubernetes.ts +284 -0
  439. package/src/cloud-lister/markers.ts +74 -0
  440. package/src/cloud-lister/mask.ts +77 -0
  441. package/src/cloud-lister/shape.test.ts +81 -0
  442. package/src/cloud-lister/sigv4.ts +70 -0
  443. package/src/cloud-lister/transport.ts +118 -0
  444. package/src/cloud-lister/types.ts +135 -0
  445. package/src/components/capability-plugin-loader.ts +4 -0
  446. package/src/components/capability-plugin.ts +10 -0
  447. package/src/components/capability.ts +238 -0
  448. package/src/components/cli-support.ts +70 -14
  449. package/src/components/covered-round.test.ts +166 -0
  450. package/src/components/covered-round.ts +293 -0
  451. package/src/components/declared-reads.test.ts +103 -0
  452. package/src/components/declared-reads.ts +134 -0
  453. package/src/components/deploy-units.ts +4 -0
  454. package/src/components/driver.ts +101 -4
  455. package/src/components/fan-out-run.ts +95 -15
  456. package/src/components/fan-out-support.ts +10 -1
  457. package/src/components/fan-out.ts +30 -0
  458. package/src/components/groups.test.ts +320 -0
  459. package/src/components/groups.ts +880 -0
  460. package/src/components/index.ts +59 -0
  461. package/src/components/plan-shape-conformance.ts +130 -0
  462. package/src/components/pr-env-run-bundle.test.ts +2 -0
  463. package/src/components/pr-run.test.ts +728 -4
  464. package/src/components/pr-run.ts +395 -55
  465. package/src/components/promote-rounds.ts +25 -2
  466. package/src/components/promote.ts +55 -5
  467. package/src/components/registry.test.ts +1 -1
  468. package/src/components/release-gate.ts +115 -30
  469. package/src/components/release-groups.test.ts +362 -0
  470. package/src/components/run-groups.ts +113 -0
  471. package/src/components/starter-plugin.ts +6 -0
  472. package/src/components/verbs/index.ts +1 -0
  473. package/src/components/verbs/member-outputs.test.ts +205 -0
  474. package/src/components/verbs/member-outputs.ts +308 -0
  475. package/src/components/wave-plan.ts +5 -2
  476. package/src/config.ts +44 -0
  477. package/src/deep-observation.ts +5 -23
  478. package/src/drift-record.test.ts +596 -0
  479. package/src/drift-record.ts +1206 -0
  480. package/src/engine-facts.guard.test.ts +111 -0
  481. package/src/engine-facts.test.ts +178 -0
  482. package/src/engine-facts.ts +154 -0
  483. package/src/gated-waves-bundle.test.ts +2 -0
  484. package/src/graph-ir-live.test.ts +92 -0
  485. package/src/graph-ir.ts +317 -7
  486. package/src/graph-refs.ts +416 -0
  487. package/src/graph-schema/fixtures/adopt.json +15 -0
  488. package/src/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
  489. package/src/graph-schema/fixtures/index.json +68 -0
  490. package/src/graph-schema/fixtures/plunge.engine-graph.json +158 -0
  491. package/src/graph-schema/fixtures.ts +267 -0
  492. package/src/graph-schema/generate.ts +263 -0
  493. package/src/graph-schema/graph-schema.test.ts +153 -0
  494. package/src/graph-schema/graph.schema.json +1387 -0
  495. package/src/health.schema.json +2 -1
  496. package/src/identity.ts +2 -0
  497. package/src/index.ts +2 -0
  498. package/src/instance-nodes.ts +288 -0
  499. package/src/lexicon.ts +76 -0
  500. package/src/lifecycle/__fixtures__/index-diff/20261026T120000Z-aaaaaaaaaaaa.json +149 -0
  501. package/src/lifecycle/__fixtures__/index-diff/20261026T130000Z-bbbbbbbbbbbb.json +127 -0
  502. package/src/lifecycle/adoption-file.test.ts +100 -0
  503. package/src/lifecycle/adoption-file.ts +154 -0
  504. package/src/lifecycle/cloud-index.test.ts +517 -0
  505. package/src/lifecycle/cloud-index.ts +736 -0
  506. package/src/lifecycle/derive-edges.test.ts +193 -0
  507. package/src/lifecycle/derive-edges.ts +182 -0
  508. package/src/lifecycle/git.ts +10 -4
  509. package/src/lifecycle/identity-match.test.ts +308 -0
  510. package/src/lifecycle/identity-match.ts +257 -0
  511. package/src/lifecycle/index-diff.test.ts +198 -0
  512. package/src/lifecycle/index-diff.ts +476 -0
  513. package/src/lifecycle/index-document.test.ts +64 -0
  514. package/src/lifecycle/index-document.ts +299 -0
  515. package/src/lifecycle/index-drift.test.ts +191 -0
  516. package/src/lifecycle/index-drift.ts +304 -0
  517. package/src/lifecycle/index-import.test.ts +255 -0
  518. package/src/lifecycle/index-import.ts +634 -0
  519. package/src/lifecycle/index-join.test.ts +250 -0
  520. package/src/lifecycle/index-join.ts +304 -0
  521. package/src/lifecycle/index-store-load-bearing.test.ts +187 -0
  522. package/src/lifecycle/index.ts +4 -0
  523. package/src/lifecycle/member-ledger.test.ts +25 -7
  524. package/src/lifecycle/observation-baseline.test.ts +72 -1
  525. package/src/lifecycle/observation-baseline.ts +190 -27
  526. package/src/lifecycle/observe.ts +6 -1
  527. package/src/lifecycle/query.test.ts +69 -1
  528. package/src/lifecycle/query.ts +103 -10
  529. package/src/lifecycle/replay.test.ts +9 -5
  530. package/src/lifecycle/replay.ts +9 -5
  531. package/src/lifecycle/scenario.ts +4 -3
  532. package/src/lifecycle/snapshot-store-fake.ts +29 -0
  533. package/src/lifecycle/snapshot-store-s3.ts +316 -0
  534. package/src/lifecycle/snapshot-store.test.ts +385 -0
  535. package/src/lifecycle/snapshot-store.ts +981 -0
  536. package/src/lifecycle/snapshot.test.ts +13 -0
  537. package/src/lifecycle/snapshot.ts +23 -6
  538. package/src/lifecycle/type-listing.test.ts +166 -0
  539. package/src/lifecycle/type-listing.ts +309 -0
  540. package/src/lint/component-checks.ts +17 -1
  541. package/src/lint/config.test.ts +3 -0
  542. package/src/lint/presets/relaxed.json +2 -1
  543. package/src/lint/presets/strict.json +2 -1
  544. package/src/lint/rules/__fixtures__/comp/comp008/fail/dns.component.ts +15 -0
  545. package/src/lint/rules/__fixtures__/comp/comp008/pass/dns.component.ts +10 -0
  546. package/src/lint/rules/comp/comp.test.ts +2 -1
  547. package/src/lint/rules/comp/comp008-applies-signal-only-root.ts +121 -0
  548. package/src/lint/rules/comp/comp008.test.ts +77 -0
  549. package/src/lint/rules/comp/index.ts +4 -1
  550. package/src/observation-edges.test.ts +33 -0
  551. package/src/observation.ts +36 -1
  552. package/src/op/activities/activity-contracts.ts +1 -1
  553. package/src/op/activities/change-set.ts +8 -5
  554. package/src/op/activity-failure.ts +36 -0
  555. package/src/op/index.ts +2 -1
  556. package/src/op/local-executor.test.ts +80 -0
  557. package/src/op/local-executor.ts +27 -9
  558. package/src/pr-loop-bundle.test.ts +5 -2
  559. package/src/pr-loop.test.ts +57 -1
  560. package/src/pr-loop.ts +154 -6
  561. package/src/pulumi-urn.ts +151 -0
  562. package/src/release-floors.ts +22 -0
  563. package/src/sensitive-key.ts +34 -0
  564. package/src/workspace/adoption-report.test.ts +61 -0
  565. package/src/workspace/adoption-report.ts +103 -0
  566. package/src/workspace/capabilities-contract.test.ts +4 -0
  567. package/src/workspace/capabilities-contract.ts +9 -1
  568. package/src/workspace/capabilities.schema.json +98 -0
  569. package/src/workspace/change-set.schema.json +42 -3
  570. package/src/workspace/ci-cloud-identity.ts +31 -1
  571. package/src/workspace/compose-graph.test.ts +12 -0
  572. package/src/workspace/compose-graph.ts +12 -1
  573. package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
  574. package/src/workspace/conformance/index.ts +6 -1
  575. package/src/workspace/drift-cli.test.ts +65 -0
  576. package/src/workspace/drift-cli.ts +365 -0
  577. package/src/workspace/drift.schema.json +672 -0
  578. package/src/workspace/graph-cli.ts +5 -0
  579. package/src/workspace/graph.schema.json +72 -0
  580. package/src/workspace/init.test.ts +38 -1
  581. package/src/workspace/init.ts +50 -8
  582. package/src/workspace/intent-gaps.test.ts +18 -2
  583. package/src/workspace/ledger.schema.json +1 -1
  584. package/src/workspace/nested-graph.ts +1 -0
  585. package/src/workspace/pr-report.schema.json +76 -3
  586. package/src/workspace/promote-waves.test.ts +296 -0
  587. package/src/workspace/promote-waves.ts +340 -0
  588. package/src/workspace/promote.test.ts +158 -4
  589. package/src/workspace/promote.ts +398 -57
  590. package/src/workspace/reason-codes.test.ts +4 -1
  591. package/src/workspace/reason-codes.ts +14 -0
  592. package/src/workspace/search-contract.ts +2 -0
  593. package/src/workspace/search.schema.json +103 -5
@@ -175,7 +175,8 @@
175
175
  "no-credentials",
176
176
  "no-binding",
177
177
  "unsupported-kind",
178
- "filtered"
178
+ "filtered",
179
+ "not-reached"
179
180
  ]
180
181
  },
181
182
  "detail": {
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QA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SAAS,cAAc,EAAE,EAClC,OAAO,EAAE,uBAAuB,EAChC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAAC,WAAW,EAAE,CAAC,CAoBxB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAS3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAiBjF"}
package/dist/identity.js CHANGED
@@ -245,6 +245,8 @@ export function unresolvedReasonText(reason) {
245
245
  return "the substrate exposes no self-query";
246
246
  case "filtered":
247
247
  return "withheld";
248
+ case "not-reached":
249
+ return "the self-query never answered";
248
250
  default:
249
251
  return "no reason given";
250
252
  }
package/dist/index.d.ts CHANGED
@@ -31,6 +31,7 @@ export * from "./discovery/cache.js";
31
31
  export * from "./build.js";
32
32
  export * from "./env.js";
33
33
  export * from "./graph-ir.js";
34
+ export * from "./engine-facts.js";
34
35
  export * from "./graph-detail.js";
35
36
  export * from "./graph-mermaid.js";
36
37
  export * from "./graph-dot.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc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CAAC;AAC7E,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAClE,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -31,6 +31,8 @@ export * from "./discovery/cache.js";
31
31
  export * from "./build.js";
32
32
  export * from "./env.js";
33
33
  export * from "./graph-ir.js";
34
+ // Engine facts and the engine graph document (#4527): types for readers that show the graph.
35
+ export * from "./engine-facts.js";
34
36
  export * from "./graph-detail.js";
35
37
  export * from "./graph-mermaid.js";
36
38
  export * from "./graph-dot.js";
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Instance nodes (#4454): one graph node per `count` or `for_each` instance,
3
+ * under the node of the block that declares it.
4
+ *
5
+ * A lexicon whose entity is a block that expands into instances (terraform's
6
+ * `aws_eip.pool`, applied as `aws_eip.pool[0]`, `aws_eip.pool[1]`, ...) has
7
+ * one graph node per block. A plan, a state read and a drift read all speak
8
+ * per instance. This module is the contract that puts both on the graph:
9
+ *
10
+ * - An instance's node id is its block's node id followed by the instance key
11
+ * exactly as Terraform prints it: `<blockNode>[0]`, `<blockNode>["a"]`.
12
+ * Inside a workspace the member goes in front as for any node, so
13
+ * `<member>/<blockNode>[0]`.
14
+ * - The block node keeps existing and is the rollup: its verdict is the
15
+ * aggregate of its instances' ({@link rollupInstances}).
16
+ * - In the graph IR an instance node is a child of its block node. It carries
17
+ * `instanceOf`, the block node's id, and `instanceKey`, the key on its own
18
+ * (`IRNode` in `./graph-ir.ts`). It has no edges and no attrs of its own:
19
+ * both stay on the block, since a reference in the source is block to block.
20
+ * - A change-set entry and a drift row for an instance carry the instance
21
+ * node's id as `node`, and the block node's id as `instanceOf`.
22
+ *
23
+ * The graph lists the instances a read of the source can count: a literal
24
+ * `count` or a literal `for_each`, or (#4486) one that reads a variable whose
25
+ * value the root's files give. An expansion that only a plan can count has
26
+ * no instance nodes in the declared graph, and an entry
27
+ * for one of its instances still names the instance id by the rule above,
28
+ * with `instanceOf` saying which block node to hang it under.
29
+ *
30
+ * Under a module call that is itself expanded (#4486), the module key goes
31
+ * on the call segment it belongs to, as Terraform prints it, and the
32
+ * block's own key stays at the end: `module.app[0].aws_eip.pool[1]` in root
33
+ * `estate` is `estate/module.app[0]/aws_eip.pool[1]`, under the block node
34
+ * `estate/module.app/aws_eip.pool`. The node also carries `instanceScope`,
35
+ * the expanded module path as Terraform prints it (`module.app[0]`), and its
36
+ * `instanceKey` is the block's own key, absent when only the module call is
37
+ * expanded. With no module call expanded the rule is the one above. The
38
+ * module call's own node gets instance nodes by the first rule,
39
+ * `estate/module.app[0]`.
40
+ *
41
+ * Imports nothing at run time, so it bundles with `./change-set.ts`.
42
+ */
43
+ import type { EngineFacts } from "./engine-facts.js";
44
+ /**
45
+ * Why the declared graph leaves an expanded block as one node (#4489): the
46
+ * codes of a block node's `instanceRollup`. Each is in the read contract's
47
+ * closed list (`workspace/reason-codes.ts`).
48
+ */
49
+ export declare const INSTANCE_ROLLUP_CODES: readonly ["instances-each-value", "instances-merge", "instances-value-unknown", "instances-form-unread", "instances-over-limit", "instances-module-uncounted"];
50
+ export type InstanceRollupCode = (typeof INSTANCE_ROLLUP_CODES)[number];
51
+ /**
52
+ * On a block node whose `count` or `for_each` the declared graph cannot
53
+ * count (#4489): why, and the expression it could not count. `argument` and
54
+ * `expression` are the block's own, or with `call` those of the enclosing
55
+ * module call that could not be counted.
56
+ */
57
+ export interface InstanceRollup {
58
+ code: InstanceRollupCode;
59
+ /** `count` or `for_each`. */
60
+ argument: "count" | "for_each";
61
+ /** The expression as written, without the `${ }` around it. */
62
+ expression: string;
63
+ /** With `instances-module-uncounted`: the module call, `module.app` or `module.app.module.db`. */
64
+ call?: string;
65
+ }
66
+ /** An entity's duck-typed `instanceRollup`, when it is one (#4489). */
67
+ export declare function entityInstanceRollup(entity: unknown): InstanceRollup | undefined;
68
+ /** An instance key as Terraform prints it: `[0]` for a `count` index, `["a"]` for a `for_each` key. */
69
+ export declare function instanceKeyLiteral(key: string | number): string;
70
+ /** The instance node id for a block node id and an instance key as Terraform prints it. */
71
+ export declare function instanceNodeId(blockNode: string, key: string): string;
72
+ /**
73
+ * The instance key a terraform-family address ends with, as printed
74
+ * (`[0]`, `["a"]`), or undefined when it has none or when a module call on
75
+ * the way to it is expanded, which rolls up to the block (see the module doc).
76
+ */
77
+ export declare function terraformInstanceKey(address: string): string | undefined;
78
+ /** Where one terraform-family instance address sits, relative to its root (#4486). */
79
+ export interface TerraformInstancePath {
80
+ /** The block's key in its root: `module.app/aws_eip.pool`. */
81
+ block: string;
82
+ /** The instance node's key in its root: `module.app[0]/aws_eip.pool[1]`. */
83
+ instance: string;
84
+ /** The block's own instance key, `[1]`, absent when the block itself is not expanded. */
85
+ key?: string;
86
+ /** The expanded module path, `module.app[0]`, absent when no module call on the way is expanded. */
87
+ scope?: string;
88
+ }
89
+ /**
90
+ * The block key and instance node key a terraform-family address names, or
91
+ * undefined when nothing on it is expanded (no `[...]` anywhere) or the
92
+ * address is not a block's. `module.app[0].aws_eip.pool[1]` is block
93
+ * `module.app/aws_eip.pool`, instance `module.app[0]/aws_eip.pool[1]`, key
94
+ * `[1]`, scope `module.app[0]`.
95
+ */
96
+ export declare function terraformInstancePath(address: string): TerraformInstancePath | undefined;
97
+ /**
98
+ * One instance's observed verdict, carried on its block's
99
+ * `ResourceMetadata.instances` (`./lexicon.ts`) so the live graph can draw the
100
+ * instance node and paint it on its own.
101
+ */
102
+ export interface InstanceObservation {
103
+ /**
104
+ * The block's own instance key as Terraform prints it, `[0]` or `["a"]`.
105
+ * Absent on an instance that only an expanded module call makes (#4488),
106
+ * which then carries {@link scope}.
107
+ */
108
+ key?: string;
109
+ /**
110
+ * The expanded module path as Terraform prints it, `module.app[0]`, on an
111
+ * instance under an expanded module call (#4488). The live graph then
112
+ * builds the node id by {@link terraformInstancePath} from {@link address},
113
+ * the same id the declared graph lists: `estate/module.app[0]/aws_eip.pool[1]`.
114
+ */
115
+ scope?: string;
116
+ /** The engine's own instance address, `aws_eip.pool[0]` or `module.app[0].aws_eip.pool[1]`. */
117
+ address: string;
118
+ verdict: "present" | "absent" | "not-observed";
119
+ /** The provider's id, on a present instance, when the read gave one. */
120
+ physicalId?: string;
121
+ /** Same meaning as `ResourceMetadata.ownership`, on a present instance. */
122
+ ownership?: "owned" | "foreign" | "unknown";
123
+ /** Same meaning as `ResourceMetadata.facts` (#4527), on a present instance. Never read for a decision. */
124
+ facts?: EngineFacts;
125
+ /** The lexicon's status word for this instance, as on `ResourceMetadata.status`. */
126
+ status?: string;
127
+ /** Why it was not observed, on a not-observed instance. An `UnobservedReason`. */
128
+ reason?: string;
129
+ detail?: string;
130
+ }
131
+ /**
132
+ * The live graph's node id for one observed instance of the block node
133
+ * `blockNode` (#4488): `<blockNode><key>` with no expanded module call on
134
+ * the way, else the declared graph's rule (#4486) applied to the instance's
135
+ * address, so `module.app[0].aws_eip.pool[1]` under
136
+ * `estate/module.app/aws_eip.pool` is `estate/module.app[0]/aws_eip.pool[1]`.
137
+ * Undefined when the address does not belong to that block node.
138
+ */
139
+ export declare function observedInstanceNodeId(blockNode: string, inst: Pick<InstanceObservation, "key" | "scope" | "address">): string | undefined;
140
+ /**
141
+ * The block's verdict from its instances' (#4454, the one place the rollup is
142
+ * written): the first kind in `precedence` that any instance has, or
143
+ * undefined when there are no instances or none has a kind `precedence`
144
+ * names. The precedence is the caller's, most significant first; terraform's
145
+ * is {@link TERRAFORM_INSTANCE_ROLLUP}.
146
+ *
147
+ * Partial knowledge is not knowledge: put the not-observed kind first and a
148
+ * block with one unread instance is unread, never partly owned.
149
+ */
150
+ export declare function rollupInstances<V extends {
151
+ kind: string;
152
+ }>(verdicts: readonly V[], precedence: readonly V["kind"][]): V | undefined;
153
+ /**
154
+ * Terraform's block rollup over live-plan instance verdicts: any instance
155
+ * not-observed makes the block not-observed, then foreign, then adoptable,
156
+ * then owned, and a block whose instances are all absent is absent.
157
+ */
158
+ export declare const TERRAFORM_INSTANCE_ROLLUP: readonly ["unobserved", "foreign", "adoptable", "owned", "absent"];
159
+ //# sourceMappingURL=instance-nodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-nodes.d.ts","sourceRoot":"","sources":["../src/instance-nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YAChC,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,CACpB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IACzB,6BAA6B;IAC7B,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC;IAC/B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAQhF;AAMD,uGAAuG;AACvG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE/D;AAED,2FAA2F;AAC3F,wBAAgB,cAAc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1I;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAMnI;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,YAAI,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC"}
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Instance nodes (#4454): one graph node per `count` or `for_each` instance,
3
+ * under the node of the block that declares it.
4
+ *
5
+ * A lexicon whose entity is a block that expands into instances (terraform's
6
+ * `aws_eip.pool`, applied as `aws_eip.pool[0]`, `aws_eip.pool[1]`, ...) has
7
+ * one graph node per block. A plan, a state read and a drift read all speak
8
+ * per instance. This module is the contract that puts both on the graph:
9
+ *
10
+ * - An instance's node id is its block's node id followed by the instance key
11
+ * exactly as Terraform prints it: `<blockNode>[0]`, `<blockNode>["a"]`.
12
+ * Inside a workspace the member goes in front as for any node, so
13
+ * `<member>/<blockNode>[0]`.
14
+ * - The block node keeps existing and is the rollup: its verdict is the
15
+ * aggregate of its instances' ({@link rollupInstances}).
16
+ * - In the graph IR an instance node is a child of its block node. It carries
17
+ * `instanceOf`, the block node's id, and `instanceKey`, the key on its own
18
+ * (`IRNode` in `./graph-ir.ts`). It has no edges and no attrs of its own:
19
+ * both stay on the block, since a reference in the source is block to block.
20
+ * - A change-set entry and a drift row for an instance carry the instance
21
+ * node's id as `node`, and the block node's id as `instanceOf`.
22
+ *
23
+ * The graph lists the instances a read of the source can count: a literal
24
+ * `count` or a literal `for_each`, or (#4486) one that reads a variable whose
25
+ * value the root's files give. An expansion that only a plan can count has
26
+ * no instance nodes in the declared graph, and an entry
27
+ * for one of its instances still names the instance id by the rule above,
28
+ * with `instanceOf` saying which block node to hang it under.
29
+ *
30
+ * Under a module call that is itself expanded (#4486), the module key goes
31
+ * on the call segment it belongs to, as Terraform prints it, and the
32
+ * block's own key stays at the end: `module.app[0].aws_eip.pool[1]` in root
33
+ * `estate` is `estate/module.app[0]/aws_eip.pool[1]`, under the block node
34
+ * `estate/module.app/aws_eip.pool`. The node also carries `instanceScope`,
35
+ * the expanded module path as Terraform prints it (`module.app[0]`), and its
36
+ * `instanceKey` is the block's own key, absent when only the module call is
37
+ * expanded. With no module call expanded the rule is the one above. The
38
+ * module call's own node gets instance nodes by the first rule,
39
+ * `estate/module.app[0]`.
40
+ *
41
+ * Imports nothing at run time, so it bundles with `./change-set.ts`.
42
+ */
43
+ /**
44
+ * Why the declared graph leaves an expanded block as one node (#4489): the
45
+ * codes of a block node's `instanceRollup`. Each is in the read contract's
46
+ * closed list (`workspace/reason-codes.ts`).
47
+ */
48
+ export const INSTANCE_ROLLUP_CODES = [
49
+ "instances-each-value",
50
+ "instances-merge",
51
+ "instances-value-unknown",
52
+ "instances-form-unread",
53
+ "instances-over-limit",
54
+ "instances-module-uncounted",
55
+ ];
56
+ /** An entity's duck-typed `instanceRollup`, when it is one (#4489). */
57
+ export function entityInstanceRollup(entity) {
58
+ const r = entity?.instanceRollup;
59
+ if (typeof r !== "object" || r === null)
60
+ return undefined;
61
+ const { code, argument, expression, call } = r;
62
+ if (!INSTANCE_ROLLUP_CODES.includes(code))
63
+ return undefined;
64
+ if (argument !== "count" && argument !== "for_each")
65
+ return undefined;
66
+ if (typeof expression !== "string")
67
+ return undefined;
68
+ return { code: code, argument, expression, ...(typeof call === "string" ? { call } : {}) };
69
+ }
70
+ /** A `[...]` instance key, a number or a quoted string with escapes. */
71
+ const KEY = /\[(?:"(?:[^"\\]|\\.)*"|\d+)\]/;
72
+ const TRAILING_KEY = new RegExp(`(${KEY.source})$`);
73
+ /** An instance key as Terraform prints it: `[0]` for a `count` index, `["a"]` for a `for_each` key. */
74
+ export function instanceKeyLiteral(key) {
75
+ return typeof key === "number" ? `[${key}]` : `[${JSON.stringify(key)}]`;
76
+ }
77
+ /** The instance node id for a block node id and an instance key as Terraform prints it. */
78
+ export function instanceNodeId(blockNode, key) {
79
+ return `${blockNode}${key}`;
80
+ }
81
+ /**
82
+ * The instance key a terraform-family address ends with, as printed
83
+ * (`[0]`, `["a"]`), or undefined when it has none or when a module call on
84
+ * the way to it is expanded, which rolls up to the block (see the module doc).
85
+ */
86
+ export function terraformInstanceKey(address) {
87
+ const m = TRAILING_KEY.exec(address);
88
+ if (!m)
89
+ return undefined;
90
+ const head = address.slice(0, m.index);
91
+ if (head.includes("["))
92
+ return undefined;
93
+ return m[1];
94
+ }
95
+ /** Split a terraform address on its dots, keeping each part's `[...]` key. Quoted keys may hold `.` or `]`. */
96
+ function addressParts(address) {
97
+ const parts = [];
98
+ let name = "";
99
+ let key = "";
100
+ let depth = 0;
101
+ let quoted = false;
102
+ const flush = () => {
103
+ if (name.length > 0)
104
+ parts.push({ name, ...(key ? { key } : {}) });
105
+ name = "";
106
+ key = "";
107
+ };
108
+ for (let i = 0; i < address.length; i++) {
109
+ const c = address[i];
110
+ if (depth > 0) {
111
+ key += c;
112
+ if (quoted) {
113
+ if (c === "\\")
114
+ key += address[++i] ?? "";
115
+ else if (c === '"')
116
+ quoted = false;
117
+ }
118
+ else if (c === '"')
119
+ quoted = true;
120
+ else if (c === "]")
121
+ depth--;
122
+ continue;
123
+ }
124
+ if (c === "[") {
125
+ depth++;
126
+ key += c;
127
+ }
128
+ else if (c === ".")
129
+ flush();
130
+ else
131
+ name += c;
132
+ }
133
+ flush();
134
+ return parts;
135
+ }
136
+ /**
137
+ * The block key and instance node key a terraform-family address names, or
138
+ * undefined when nothing on it is expanded (no `[...]` anywhere) or the
139
+ * address is not a block's. `module.app[0].aws_eip.pool[1]` is block
140
+ * `module.app/aws_eip.pool`, instance `module.app[0]/aws_eip.pool[1]`, key
141
+ * `[1]`, scope `module.app[0]`.
142
+ */
143
+ export function terraformInstancePath(address) {
144
+ const parts = addressParts(address);
145
+ const blockScope = [];
146
+ const instanceScope = [];
147
+ let expandedScope = false;
148
+ let i = 0;
149
+ while (parts[i]?.name === "module" && i + 1 < parts.length) {
150
+ const call = parts[i + 1];
151
+ blockScope.push(`module.${call.name}`);
152
+ instanceScope.push(`module.${call.name}${call.key ?? ""}`);
153
+ if (call.key)
154
+ expandedScope = true;
155
+ i += 2;
156
+ }
157
+ const rest = parts.slice(i);
158
+ let block;
159
+ let key;
160
+ if (rest.length === 0) {
161
+ // The module call itself, a block of its caller.
162
+ if (blockScope.length === 0)
163
+ return undefined;
164
+ const call = blockScope.pop();
165
+ const inst = instanceScope.pop();
166
+ block = call;
167
+ key = inst.length > call.length ? inst.slice(call.length) : undefined;
168
+ expandedScope = instanceScope.some((s, n) => s !== blockScope[n]);
169
+ }
170
+ else if (rest[0].name === "data" && rest.length >= 3) {
171
+ block = `data.${rest[1].name}.${rest[2].name}`;
172
+ key = rest[2].key;
173
+ }
174
+ else if (rest.length >= 2) {
175
+ block = `${rest[0].name}.${rest[1].name}`;
176
+ key = rest[1].key;
177
+ }
178
+ else
179
+ return undefined;
180
+ if (key === undefined && !expandedScope)
181
+ return undefined;
182
+ const scope = expandedScope ? instanceScope.join(".") : undefined;
183
+ return {
184
+ block: [...blockScope, block].join("/"),
185
+ instance: [...(expandedScope ? instanceScope : blockScope), `${block}${key ?? ""}`].join("/"),
186
+ ...(key !== undefined ? { key } : {}),
187
+ ...(scope !== undefined ? { scope } : {}),
188
+ };
189
+ }
190
+ /**
191
+ * The live graph's node id for one observed instance of the block node
192
+ * `blockNode` (#4488): `<blockNode><key>` with no expanded module call on
193
+ * the way, else the declared graph's rule (#4486) applied to the instance's
194
+ * address, so `module.app[0].aws_eip.pool[1]` under
195
+ * `estate/module.app/aws_eip.pool` is `estate/module.app[0]/aws_eip.pool[1]`.
196
+ * Undefined when the address does not belong to that block node.
197
+ */
198
+ export function observedInstanceNodeId(blockNode, inst) {
199
+ if (inst.scope === undefined)
200
+ return inst.key === undefined ? undefined : instanceNodeId(blockNode, inst.key);
201
+ const path = terraformInstancePath(inst.address);
202
+ if (!path?.scope)
203
+ return undefined;
204
+ if (blockNode !== path.block && !blockNode.endsWith(`/${path.block}`))
205
+ return undefined;
206
+ return `${blockNode.slice(0, blockNode.length - path.block.length)}${path.instance}`;
207
+ }
208
+ /**
209
+ * The block's verdict from its instances' (#4454, the one place the rollup is
210
+ * written): the first kind in `precedence` that any instance has, or
211
+ * undefined when there are no instances or none has a kind `precedence`
212
+ * names. The precedence is the caller's, most significant first; terraform's
213
+ * is {@link TERRAFORM_INSTANCE_ROLLUP}.
214
+ *
215
+ * Partial knowledge is not knowledge: put the not-observed kind first and a
216
+ * block with one unread instance is unread, never partly owned.
217
+ */
218
+ export function rollupInstances(verdicts, precedence) {
219
+ for (const kind of precedence) {
220
+ const found = verdicts.find((v) => v.kind === kind);
221
+ if (found)
222
+ return found;
223
+ }
224
+ return undefined;
225
+ }
226
+ /**
227
+ * Terraform's block rollup over live-plan instance verdicts: any instance
228
+ * not-observed makes the block not-observed, then foreign, then adoptable,
229
+ * then owned, and a block whose instances are all absent is absent.
230
+ */
231
+ export const TERRAFORM_INSTANCE_ROLLUP = ["unobserved", "foreign", "adoptable", "owned", "absent"];
package/dist/lexicon.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { InstanceObservation } from "./instance-nodes.js";
2
+ import type { EngineFacts } from "./engine-facts.js";
1
3
  import type { CapabilityPack } from "./capabilities/view.js";
2
4
  import type { Serializer } from "./serializer.js";
3
5
  import type { Declarable } from "./declarable.js";
@@ -24,8 +26,12 @@ import type { OwnershipChannel, OwnershipMarker } from "./ownership.js";
24
26
  import type { LexiconConfigSchema } from "./lexicon-config.js";
25
27
  import type { RuleMeta } from "./audit/catalog.js";
26
28
  import type { ReferenceCatalog } from "./graph-refs.js";
29
+ import type { ListedTypeMapping } from "./lifecycle/type-listing.js";
30
+ import type { IndexIdentity } from "./lifecycle/identity-match.js";
31
+ import type { IndexImportCodegen } from "./lifecycle/index-import.js";
27
32
  import type { IREdge, LexiconGraphEdges, LexiconUnreadSource, LexiconWorkspaceLinks, LexiconWorkspaceOutputs } from "./graph-ir.js";
28
33
  import type { DescribeResourcesResult, UnobservedReason } from "./observation.js";
34
+ import type { ReadDriftOptions, ReadDriftResult } from "./drift-record.js";
29
35
  import type { DescribeIdentityOptions, DescribeIdentityResult } from "./identity.js";
30
36
  import type { DeepNormalizationHooks, DeepObservationResult } from "./deep-observation.js";
31
37
  import type { BehaviourResult, PredictBehaviourOptions } from "./behaviour.js";
@@ -1788,6 +1794,23 @@ export interface LexiconPlugin {
1788
1794
  * refusal: it says which variable, and a stack trace does not.
1789
1795
  */
1790
1796
  predictBehaviour?(options: PredictBehaviourOptions): Promise<BehaviourResult>;
1797
+ /**
1798
+ * The drift of what this lexicon reads, as drift-record stream lines
1799
+ * (behold#995, `./drift-record.ts`): a `drift-start`, one record per
1800
+ * resource instance and a `drift-settle`, for each root or stack the
1801
+ * project declares. `chant lifecycle drift` calls it and prints the lines,
1802
+ * and `chant workspace drift` runs that command in the reader project of
1803
+ * a member whose kind the lexicon reads, so a terraform or choudoufu
1804
+ * member's drift comes from the engine that owns it.
1805
+ *
1806
+ * Optional. A lexicon without it has no drift read of its own; a chant
1807
+ * member's drift comes from `lifecycle diff --live` instead. A read that
1808
+ * the lexicon cannot answer (a read its engine does not have, or one
1809
+ * resource on an engine that cannot read one alone) is a `refused`
1810
+ * answer. A read that ran and failed is records, `not-observed`, never a
1811
+ * refusal and never a throw.
1812
+ */
1813
+ readDrift?(options: ReadDriftOptions): Promise<ReadDriftResult>;
1791
1814
  /**
1792
1815
  * What this lexicon's own entity types are, to an engine that prices them
1793
1816
  * (#2382). Rows, not a capability: core resolves and predicts, and a lexicon
@@ -1976,6 +1999,36 @@ export interface LexiconPlugin {
1976
1999
  * method. Opt-in.
1977
2000
  */
1978
2001
  referenceCatalog?: ReferenceCatalog;
2002
+ /**
2003
+ * How a cloud inventory API's type names map to this lexicon's kinds
2004
+ * (#4521): CloudFormation types for aws, lowercase ARM types for azure,
2005
+ * Cloud Asset types for gcp, group/version/kind for k8s. `typeListing`
2006
+ * (./lifecycle/type-listing.ts) reads it to type an indexed resource, then
2007
+ * normalizes its properties with {@link deepNormalizationHooks}. Data plus
2008
+ * pure functions. Opt-in: a lexicon without it leaves listed objects of its
2009
+ * substrate as unknown-kind nodes.
2010
+ */
2011
+ listedTypes?: ListedTypeMapping;
2012
+ /**
2013
+ * How this lexicon's declared entities match indexed resources by identity
2014
+ * (#4523): the identifier a declaration's props spell (aws: the
2015
+ * CloudFormation `primaryIdentifier`), or why there is none (a
2016
+ * server-assigned id). `matchDeclaredToIndex`
2017
+ * (./lifecycle/identity-match.ts) runs it against an index version, and the
2018
+ * identity-match edge pass (./lifecycle/derive-edges.ts) uses it to name
2019
+ * this lexicon's indexed nodes. Data plus pure functions. Opt-in: a lexicon
2020
+ * whose live read already matches by name or state does not need it.
2021
+ */
2022
+ indexIdentity?: IndexIdentity;
2023
+ /**
2024
+ * How this lexicon writes an indexed resource as source (#4524, `chant
2025
+ * import --index`): the import IR for one indexed node, a value as a
2026
+ * reference to another imported node, and a parameter for a masked value.
2027
+ * Core hands the IR to {@link templateGenerator}, the codegen a template
2028
+ * import uses. Data plus pure functions. Opt-in: an indexed node of a
2029
+ * lexicon without it is reported as unsupported and written nowhere.
2030
+ */
2031
+ indexImport?: IndexImportCodegen;
1979
2032
  /**
1980
2033
  * This lexicon's capability pack (#4375): its mapping onto the
1981
2034
  * lexicon-neutral view the capability rules read (labels, edge names,
@@ -2279,6 +2332,14 @@ export interface ResourceMetadata {
2279
2332
  * a delete, and never escalates `unknown` to one.
2280
2333
  */
2281
2334
  ownership?: "owned" | "foreign" | "unknown";
2335
+ /**
2336
+ * What an ownership engine (choudoufu, plunge) observed about this resource
2337
+ * (#4520, #4527), read from the engine's graph document. `buildLiveGraphIr`
2338
+ * copies it onto the node beside `physicalId`. Never read for a decision:
2339
+ * the change set reads {@link ownership}, and no change set, lifecycle step
2340
+ * or Op imports `EngineFacts`. Absent unless an engine supplied it.
2341
+ */
2342
+ facts?: EngineFacts;
2282
2343
  /**
2283
2344
  * The stack/env identity read off the resource's own ownership marker
2284
2345
  * (#1222) — the tags/labels/metadata chant stamped at synthesis, read back
@@ -2308,6 +2369,17 @@ export interface ResourceMetadata {
2308
2369
  * undeclared live resource stays `orphan`.
2309
2370
  */
2310
2371
  ownerChain?: OwnerChainVerdict;
2372
+ /**
2373
+ * The instances of a `count` or `for_each` block (#4454), each with its own
2374
+ * verdict, keyed as the engine prints them (`[0]`, `["a"]`). The rest of
2375
+ * this metadata is the block's rollup over them. `buildLiveGraphIr` draws
2376
+ * each present instance as a node `<name><key>` under this one, or by the
2377
+ * declared graph's module-key rule when the instance carries a `scope`
2378
+ * (`estate/module.app[0]/aws_eip.pool[1]`, #4488), and the
2379
+ * overlay paints a declared instance from it. Absent when the lexicon reads
2380
+ * no instances, or the block is not expanded.
2381
+ */
2382
+ instances?: InstanceObservation[];
2311
2383
  /**
2312
2384
  * The declared node ids that reference this resource (#1273), set on an
2313
2385
  * undeclared resource observed only because something declared points at it —