@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
package/dist/config.js CHANGED
@@ -12,6 +12,19 @@ import { PublishDeclarationSchema } from "./lifecycle/publish-declaration.js";
12
12
  // needs only them stays clear of the loader below (#4356 follow-up).
13
13
  export { environmentEndpoint, environmentExecutor, environmentName, EXECUTOR_FORGES, environmentNames, isEnvironmentPattern, isOwnershipParamRef, matchesDeclaredEnvironment, matchesEnvironmentPattern, resolveOwnershipStack, } from "./config-environments.js";
14
14
  import { EXECUTOR_FORGES, isOwnershipParamRef, resolveOwnershipStack } from "./config-environments.js";
15
+ /** An s3 index store's settings (#4519, ./lifecycle/snapshot-store-s3.ts). */
16
+ const S3StoreSettingsShape = {
17
+ bucket: z.string().min(1),
18
+ prefix: z.string().optional(),
19
+ region: z.string().min(1).optional(),
20
+ endpoint: z.string().url().optional(),
21
+ forcePathStyle: z.boolean().optional(),
22
+ credentials: z.object({
23
+ accessKeyId: z.string().min(1),
24
+ secretAccessKey: z.string().min(1),
25
+ sessionToken: z.string().min(1).optional(),
26
+ }).strict().optional(),
27
+ };
15
28
  /**
16
29
  * Zod schema for ChantConfig validation.
17
30
  */
@@ -112,6 +125,20 @@ export const ChantConfigSchema = z.object({
112
125
  exclude: z.array(z.string().min(1)).optional(),
113
126
  include: z.array(z.string().min(1)).optional(),
114
127
  rootOnly: z.boolean().optional(),
128
+ // Strict: a misspelt key would send snapshots somewhere nobody looks (#4519).
129
+ snapshots: z.discriminatedUnion("store", [
130
+ z.object({ store: z.literal("git-ref"), ref: z.string().regex(/^refs\/chant\//).optional(), readOrphanBranch: z.boolean().optional() }).strict(),
131
+ z.object({ store: z.literal("orphan-branch") }).strict(),
132
+ z.object({ store: z.literal("local"), dir: z.string().min(1).optional() }).strict(),
133
+ z.object({ store: z.literal("s3"), ...S3StoreSettingsShape }).strict(),
134
+ z.object({ store: z.literal("none") }).strict(),
135
+ ]).optional(),
136
+ observationBaseline: z.object({
137
+ store: z.enum(["file", "git-ref", "s3", "none"]),
138
+ dir: z.string().min(1).optional(),
139
+ ref: z.string().regex(/^refs\/chant\//).optional(),
140
+ s3: z.object(S3StoreSettingsShape).strict().optional(),
141
+ }).strict().optional(),
115
142
  }).passthrough();
116
143
  /**
117
144
  * Default configuration when no config file exists.
@@ -163,19 +163,7 @@ export declare function normalizeDeepObservation(value: DeepObservationResult |
163
163
  export declare const UNRESOLVED = "<chant:unresolved>";
164
164
  /** Value a masked (secret-bearing) property takes. Matches the thin path's convention. */
165
165
  export declare const MASKED = "[REDACTED]";
166
- /**
167
- * Property-name patterns that mark a value secret-bearing. Deliberately narrow
168
- * and key-name based: broadening this to e.g. `/key/i` would mask an AWS tag's
169
- * `Key` field and every `*KeyName` reference, which is how masking turns into
170
- * its own drift signal.
171
- *
172
- * Shared with the thin snapshot path (`./lifecycle/snapshot.ts`), which warns
173
- * on the same names — one list, so the two paths cannot disagree about what
174
- * counts as a secret.
175
- */
176
- export declare const SENSITIVE_KEY_PATTERNS: readonly RegExp[];
177
- /** True when a property name looks secret-bearing (see {@link SENSITIVE_KEY_PATTERNS}). */
178
- export declare function isSensitiveKey(key: string): boolean;
166
+ export { SENSITIVE_KEY_PATTERNS, isSensitiveKey } from "./sensitive-key.js";
179
167
  /** Which tree a hook is being invoked on. */
180
168
  export type DeepSide = "declared" | "live";
181
169
  /** One node the normalization pass offers to {@link DeepNormalizationHooks.prune}. */
@@ -1 +1 @@
1
- {"version":3,"file":"deep-observation.d.ts","sourceRoot":"","sources":["../src/deep-observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,4GAA4G;IAC5G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC;IAC/B,oDAAoD;IACpD,SAAS,EA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AChC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAoDtB;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAK9D"}
@@ -43,6 +43,7 @@
43
43
  * when nobody declared the property.
44
44
  */
45
45
  import { isHeldElsewhere, isNormalizedHeldElsewhere, normalizeHeldElsewhere } from "./held-elsewhere.js";
46
+ import { isSensitiveKey } from "./sensitive-key.js";
46
47
  /** True when `value` is the versioned {@link DeepObservationResult} envelope. */
47
48
  export function isDeepObservationResult(value) {
48
49
  return (typeof value === "object" &&
@@ -84,28 +85,10 @@ export function normalizeDeepObservation(value) {
84
85
  export const UNRESOLVED = "<chant:unresolved>";
85
86
  /** Value a masked (secret-bearing) property takes. Matches the thin path's convention. */
86
87
  export const MASKED = "[REDACTED]";
87
- /**
88
- * Property-name patterns that mark a value secret-bearing. Deliberately narrow
89
- * and key-name based: broadening this to e.g. `/key/i` would mask an AWS tag's
90
- * `Key` field and every `*KeyName` reference, which is how masking turns into
91
- * its own drift signal.
92
- *
93
- * Shared with the thin snapshot path (`./lifecycle/snapshot.ts`), which warns
94
- * on the same names — one list, so the two paths cannot disagree about what
95
- * counts as a secret.
96
- */
97
- export const SENSITIVE_KEY_PATTERNS = [
98
- /password/i,
99
- /secret/i,
100
- /token/i,
101
- /private.?key/i,
102
- /credential/i,
103
- /connection.?string/i,
104
- ];
105
- /** True when a property name looks secret-bearing (see {@link SENSITIVE_KEY_PATTERNS}). */
106
- export function isSensitiveKey(key) {
107
- return SENSITIVE_KEY_PATTERNS.some((p) => p.test(key));
108
- }
88
+ // The secret-key list lives in `./sensitive-key.ts` so the drift record
89
+ // (`./drift-record.ts`) can redact with it inside the change-set bundle,
90
+ // which may not import this module's normalization code.
91
+ export { SENSITIVE_KEY_PATTERNS, isSensitiveKey } from "./sensitive-key.js";
109
92
  /** True for a value the pass will walk into rather than treat as a leaf. */
110
93
  function isPlainObject(value) {
111
94
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -0,0 +1,542 @@
1
+ /**
2
+ * One drift record across engines (#4450, #4451).
3
+ *
4
+ * Drift had four vocabularies for one question: the converge observers'
5
+ * `in-sync | drifted | unknown` (`./lifecycle/symptoms.ts`), component
6
+ * status's `reconciled | unrecorded | stale | drifted | unknown`
7
+ * (`./lifecycle/status.ts`), the graph overlay's tones, and the live diff's
8
+ * buckets (`./lifecycle/live-diff.ts`). A renderer colouring a terraform, a
9
+ * choudoufu and a chant member side by side had to know all four, and behold
10
+ * read choudoufu's documents itself. This module is the one shape they all
11
+ * become: a {@link DriftRecord} per resource instance, and a
12
+ * {@link DriftDocument} (`drift: "v1"`) that holds them. Its schema is
13
+ * `./workspace/drift.schema.json`, `$id` {@link DRIFT_SCHEMA_ID}.
14
+ *
15
+ * A record says which read answered (`read`) and what it found (`status`).
16
+ * The two travel together because they are different claims: a `state` read
17
+ * says what the last apply recorded and can never say the account matches,
18
+ * so {@link driftRecord} refuses a state read whose status is anything but
19
+ * `recorded`, `pending` or `not-observed`. Every record goes through that
20
+ * constructor, so the rule holds for every adapter, and for a document read
21
+ * back with {@link parseDriftDocument}.
22
+ *
23
+ * `not-observed` is never absence. It always carries a reason from the
24
+ * observation contract's closed list (`./observation.ts`), and
25
+ * `not-reached` is the reason a stream gives an address it expected and
26
+ * never heard about ({@link driftSettle}).
27
+ *
28
+ * ## Redaction
29
+ *
30
+ * An attribute the planner marked sensitive keeps its path and loses both
31
+ * values (`sensitive: true`), as the change set spells it
32
+ * (`./change-set.ts`). A second pass redacts any path with a segment
33
+ * {@link isSensitiveKey} names, whatever the planner said, so an engine
34
+ * that marks nothing still never ships a `password` value. Values are
35
+ * optional: a card needs only the names.
36
+ *
37
+ * ## Not digest-bound
38
+ *
39
+ * A drift read authorizes nothing and goes stale on the next read, so a
40
+ * record is ephemeral. {@link driftDocumentDigest} exists for one case, a
41
+ * WatchOp writing its document into its own run ledger as evidence, and
42
+ * leaves out `observedAt` and `evidence`, which change on every read.
43
+ *
44
+ * ## Adapters
45
+ *
46
+ * The chant ones are here: `lifecycle diff --live` ({@link liveDiffDriftRecords}),
47
+ * deep observe ({@link deepDiffDriftRecords}, {@link mergeDeepDrift}) and
48
+ * component status ({@link componentStatusDriftRecords}). The terraform and
49
+ * choudoufu ones live in the terraform lexicon's `drift-record` subpath,
50
+ * beside its readers, and the Pulumi one (`refresh --preview-only`, #4453)
51
+ * in the pulumi lexicon's.
52
+ *
53
+ * ## The graph and the rollup
54
+ *
55
+ * A record's `node` and `instanceOf` come from the change set's own rule
56
+ * (`graphNodeFor`, #4454), and a block's status from core's one rollup
57
+ * (`rollupInstances`) over {@link DRIFT_INSTANCE_ROLLUP}. Neither is
58
+ * written a second time here.
59
+ *
60
+ * ## The import graph
61
+ *
62
+ * This module ships in the change-set bundle (`change-set-bundle.test.ts`,
63
+ * #3421): at run time it imports the plan digest, the observation
64
+ * contract's reason list, the change-set graph's node rule, the instance
65
+ * rollup and the sensitive-key list, and types only otherwise.
66
+ */
67
+ import { type ChangeSetGraphNodes } from "./change-set-graph.js";
68
+ import type { ChangeSetPlanner } from "./change-set.js";
69
+ import type { DeepDiffResult } from "./lifecycle/deep-diff.js";
70
+ import type { LiveDiffResult } from "./lifecycle/live-diff.js";
71
+ import type { ComponentStatusRow } from "./lifecycle/status.js";
72
+ import { type UnobservedReason } from "./observation.js";
73
+ /** The schema a drift document names in `$schema`. */
74
+ export declare const DRIFT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/drift/v1/drift.schema.json";
75
+ /** The document's version. */
76
+ export declare const DRIFT_VERSION = "v1";
77
+ /**
78
+ * Which engine read the resource: a change-set planner (`pulumi` among them
79
+ * since #4453), or plunge, which has no planner of its own. A plunge
80
+ * address is a Pulumi URN, so a plunge record is placed on the graph by the
81
+ * `pulumi` planner's rule ({@link driftPlanner}).
82
+ */
83
+ export type DriftEngine = ChangeSetPlanner | "plunge";
84
+ /** The planner whose node rule places an engine's records: plunge's URNs go by `pulumi`'s (#4453). */
85
+ export declare function driftPlanner(engine: DriftEngine): ChangeSetPlanner;
86
+ /** Every engine, in the order the schema lists them. */
87
+ export declare const DRIFT_ENGINES: readonly DriftEngine[];
88
+ /**
89
+ * Which read answered.
90
+ *
91
+ * - `state` — the engine's state file: what the last apply recorded.
92
+ * - `plan` — a plan: what the next apply would do, after a refresh.
93
+ * - `refresh` — a refresh preview (Pulumi's `refresh --preview-only`).
94
+ * - `live-read` — chant's own read of the provider.
95
+ * - `ownership` — an ownership read (choudoufu's `live-plan` and `live-ls`),
96
+ * which says who holds each object and not what its attributes are.
97
+ */
98
+ export type DriftRead = "state" | "plan" | "refresh" | "live-read" | "ownership";
99
+ /** Every read, in the order the schema lists them. */
100
+ export declare const DRIFT_READS: readonly DriftRead[];
101
+ /**
102
+ * What the read found.
103
+ *
104
+ * - `in-sync` — present, and nothing the read compares differs.
105
+ * - `drifted` — present, and something differs; `attributes` says what.
106
+ * - `pending` — declared and confirmed absent, never deployed.
107
+ * - `missing` — recorded or deployed, and now gone.
108
+ * - `unclaimed` — something live sits at a declared identity and does not
109
+ * carry this member's marker: adoptable, or held by someone else.
110
+ * - `undeclared` — live or recorded, and the member does not declare it.
111
+ * - `runtime` — live, undeclared, and expected: a controller's child.
112
+ * - `recorded` — in the engine's state. The only presence a state read gives.
113
+ * - `not-observed` — the read could not say; `unobserved` says why.
114
+ */
115
+ export type DriftStatus = "in-sync" | "drifted" | "pending" | "missing" | "unclaimed" | "undeclared" | "runtime" | "recorded" | "not-observed";
116
+ /** Every status, in the order the schema lists them. */
117
+ export declare const DRIFT_STATUSES: readonly DriftStatus[];
118
+ /** The only statuses a `state` read may give. It never says in-sync or drifted. */
119
+ export declare const STATE_READ_STATUSES: readonly DriftStatus[];
120
+ /** Who an ownership facet says holds the object. */
121
+ export type DriftOwnershipVerdict = "owned" | "foreign" | "adoptable" | "unknown";
122
+ /** Every ownership verdict. */
123
+ export declare const DRIFT_OWNERSHIP_VERDICTS: readonly DriftOwnershipVerdict[];
124
+ /** What the ownership verdict rests on. */
125
+ export type DriftOwnershipBy = "marker" | "derived" | "record" | "cache" | "state" | "label";
126
+ /** Every ownership basis. */
127
+ export declare const DRIFT_OWNERSHIP_BY: readonly DriftOwnershipBy[];
128
+ /**
129
+ * One attribute that differs. `before` is what was expected (the record, the
130
+ * snapshot, the declaration) and `after` what the read found. A path in the
131
+ * plan-observation grammar: keys joined with `.`, indexes and keys that are
132
+ * not identifiers in brackets (`tags["kubernetes.io/role"]`).
133
+ */
134
+ export interface DriftAttribute {
135
+ path: string;
136
+ before?: unknown;
137
+ after?: unknown;
138
+ /** The planner marked it sensitive, or its name looks secret-bearing, so neither value is carried. */
139
+ sensitive?: true;
140
+ }
141
+ /** Why a record is `not-observed`. */
142
+ export interface DriftUnobserved {
143
+ reason: UnobservedReason;
144
+ detail?: string;
145
+ /** The address the read was issued against, when the engine reported one. */
146
+ queried?: string;
147
+ }
148
+ /** Who holds the object, from an ownership read. */
149
+ export interface DriftOwnership {
150
+ verdict: DriftOwnershipVerdict;
151
+ by?: DriftOwnershipBy;
152
+ /** The marker was read off the object itself, not derived or remembered. */
153
+ markerOnObject?: boolean;
154
+ /** The estate, stack or controller that does hold it, when not this member. */
155
+ ownedBy?: string;
156
+ /** The address an adoption would write onto the object. */
157
+ adopt?: string;
158
+ }
159
+ /** What produced the record. */
160
+ export interface DriftEvidence {
161
+ tool: string;
162
+ version?: string;
163
+ command?: string;
164
+ /** The engine's own token for the verdict (`UNOWNED`, `NEEDS_DISCOVERY`, `ABSENT`), so a pane can show it. */
165
+ engineCode?: string;
166
+ }
167
+ export interface DriftRecord {
168
+ member: string;
169
+ engine: DriftEngine;
170
+ /** The engine's own address, at instance level: `aws_eip.pool[0]`, a Pulumi URN, a chant entity name. */
171
+ address: string;
172
+ /** The resource type, when the read reports one. Not `type`, which a stream line uses for its kind. */
173
+ resourceType?: string;
174
+ /**
175
+ * The graph node, by the change set's mapping rules (`graphNodeFor` in
176
+ * `./change-set-graph.ts`, {@link mapDriftToGraph}): for an instance of a
177
+ * `count` or `for_each` block the instance node, `<blockNode>[0]` or
178
+ * `<blockNode>["a"]`, and the block node otherwise. Null when the graph
179
+ * holds none. A Pulumi URN's node is `<member>/<key>` by the URN rule
180
+ * (#4456), and a plunge URN's by the same rule (#4453).
181
+ */
182
+ node: string | null;
183
+ /** On a record whose `node` is an instance node (#4454): the block node it is an instance of, the rollup. */
184
+ instanceOf?: string;
185
+ /** RFC 3339. Per record, because a stream's rows finish at different times. */
186
+ observedAt: string;
187
+ read: DriftRead;
188
+ /**
189
+ * The read that was asked for and failed, when this one answered instead:
190
+ * what `RootRead.depth` holds (`"plan"`, `"live+plan"`) on a root whose
191
+ * `RootRead.fellBackTo` is set (`./observation.ts`).
192
+ */
193
+ fellBackFrom?: string;
194
+ status: DriftStatus;
195
+ /** Set exactly when `status` is `not-observed`. */
196
+ unobserved?: DriftUnobserved;
197
+ /** What differs. Only on `drifted`. */
198
+ attributes?: DriftAttribute[];
199
+ /**
200
+ * Presence is known and the attributes are not: a deep read that failed
201
+ * for an entity the thin read found. On `in-sync` and `drifted` only.
202
+ */
203
+ attributesUnobserved?: DriftUnobserved;
204
+ ownership?: DriftOwnership;
205
+ evidence: DriftEvidence;
206
+ }
207
+ /** Counts per status, every status present. */
208
+ export type DriftCounts = Record<DriftStatus, number>;
209
+ export interface DriftDocument {
210
+ $schema: typeof DRIFT_SCHEMA_ID;
211
+ drift: typeof DRIFT_VERSION;
212
+ /** The chant that wrote it, when known. */
213
+ chant?: string;
214
+ /** Sorted by member, address and read. One per `(member, address, read)`. */
215
+ records: DriftRecord[];
216
+ counts: DriftCounts;
217
+ }
218
+ /** Which rule a refused record broke. */
219
+ export type DriftRecordRule = "shape" | "state-read-status" | "unobserved-reason" | "unobserved-on-observed" | "attributes-status" | "attributes-unobserved-status";
220
+ /** A record {@link driftRecord} refused, naming the record and the rule. */
221
+ export declare class DriftRecordError extends Error {
222
+ readonly rule: DriftRecordRule;
223
+ constructor(rule: DriftRecordRule, message: string);
224
+ }
225
+ /**
226
+ * The key segments of an attribute path, indexes left out:
227
+ * `spec.env[0]["db_password"]` is `spec`, `env`, `db_password`. A keyed
228
+ * element (`Tags[#api-token-owner].Value`, the deep read's address for an
229
+ * array it can key) is a key too: it names the element the way a map key
230
+ * does, so an environment list keyed by `DB_PASSWORD` redacts like a map's.
231
+ */
232
+ export declare function attributePathKeys(path: string): string[];
233
+ /**
234
+ * One attribute, redacted: the planner's mark first, then any key segment
235
+ * {@link isSensitiveKey} names. A redacted attribute is `{ path, sensitive:
236
+ * true }` and nothing else.
237
+ */
238
+ export declare function redactDriftAttribute(attribute: DriftAttribute): DriftAttribute;
239
+ /**
240
+ * Build one record, or refuse it. Every adapter and every reader goes
241
+ * through here, so these hold for every record that exists:
242
+ *
243
+ * - a `state` read's status is `recorded`, `pending` or `not-observed`;
244
+ * - `not-observed` carries `unobserved` with a legal reason, and no other
245
+ * status carries it;
246
+ * - `attributes` appear only on `drifted`, sorted by path, one per path,
247
+ * and redacted ({@link redactDriftAttribute});
248
+ * - `attributesUnobserved` appears only on `in-sync` or `drifted`.
249
+ *
250
+ * A refusal is a {@link DriftRecordError} naming the member, the address,
251
+ * the read and the status.
252
+ */
253
+ export declare function driftRecord(input: DriftRecord): DriftRecord;
254
+ /** Read one record from parsed JSON. The same checks as {@link driftRecord}. */
255
+ export declare function parseDriftRecord(value: unknown): DriftRecord;
256
+ /** Counts per status, zero included. */
257
+ export declare function countDriftStatuses(records: Iterable<Pick<DriftRecord, "status">>): DriftCounts;
258
+ export interface DriftDocumentOptions {
259
+ /** The chant version to record in `chant`. */
260
+ chant?: string;
261
+ }
262
+ /**
263
+ * Join records into one document. A later record for the same `(member,
264
+ * address, read)` replaces the earlier one, as a stream's later line does.
265
+ * Records are sorted by member, address and read. Every record is checked
266
+ * with {@link driftRecord}.
267
+ */
268
+ export declare function driftDocument(records: Iterable<DriftRecord>, options?: DriftDocumentOptions): DriftDocument;
269
+ /** Read a document from parsed JSON, checking every record. Counts are recomputed. */
270
+ export declare function parseDriftDocument(value: unknown): DriftDocument;
271
+ /**
272
+ * The document's digest, for a WatchOp that keeps its document as evidence
273
+ * in its own run ledger: `computePlanDigest("drift-document", …)` over the
274
+ * records sorted as {@link driftDocument} sorts them, without `observedAt`
275
+ * and `evidence`, which change on every read. No gate binds it.
276
+ */
277
+ export declare function driftDocumentDigest(doc: Pick<DriftDocument, "records">): string;
278
+ /**
279
+ * The precedence a block's instance records roll up in, most significant
280
+ * first, for core's one rollup (`rollupInstances` in `./instance-nodes.ts`,
281
+ * #4454). Partial knowledge is not knowledge, so one not-observed instance
282
+ * makes the block not-observed, as `TERRAFORM_INSTANCE_ROLLUP` puts
283
+ * `unobserved` first. A difference outranks an absence, an absence
284
+ * outranks agreement, and `runtime` is last because a controller's children
285
+ * never decide a block.
286
+ */
287
+ export declare const DRIFT_INSTANCE_ROLLUP: readonly DriftStatus[];
288
+ /** One block node's rolled-up status and the records it came from. */
289
+ export interface DriftBlockRollup {
290
+ /** The block node: the records' `instanceOf`, or their `node` when they are on the block itself. */
291
+ node: string;
292
+ status: DriftStatus;
293
+ /** Every read that answered for the block's records, sorted. */
294
+ reads: DriftRead[];
295
+ records: DriftRecord[];
296
+ }
297
+ /**
298
+ * Records grouped by block node (`instanceOf`, else `node`) and rolled up
299
+ * with `rollupInstances` over {@link DRIFT_INSTANCE_ROLLUP}. A record with a
300
+ * null `node` is on no block and is left out. Sorted by node.
301
+ */
302
+ export declare function rollupDriftByBlock(records: Iterable<DriftRecord>): DriftBlockRollup[];
303
+ /**
304
+ * The document with each record's `node` and `instanceOf` set from `graph`
305
+ * by `graphNodeFor` (`./change-set-graph.ts`), the rule a change-set entry
306
+ * uses, so a drift row and a change-set entry for one instance name the
307
+ * same node: an instance of a `count` or `for_each` block is on
308
+ * `<blockNode>[0]` with `instanceOf` the block node, and an instance under
309
+ * an expanded module call is on `<root>/module.app[0]/<block>[1]` with the
310
+ * same `instanceOf` (#4486). A Pulumi URN is on
311
+ * `<member>/<key>` by the URN rule (`./pulumi-urn.ts`, #4456), through the
312
+ * `pulumi` planner's case, and so is a plunge URN ({@link driftPlanner}).
313
+ * A null `graph` gives every record `node: null`.
314
+ */
315
+ export declare function mapDriftToGraph(doc: DriftDocument, graph: ChangeSetGraphNodes | null): DriftDocument;
316
+ /**
317
+ * The NDJSON stream, one JSON object per line, built like the run-event
318
+ * stream and in the layout choudoufu's `live-plan -resource` writes
319
+ * (choudoufu `internal/command/views/live_drift.go`): every line has a
320
+ * `type`, `drift-start`, `drift-record` or `drift-settle`, and a record
321
+ * line is the record itself with `type` beside its fields.
322
+ */
323
+ /** One address a stream expects to hear about, with the node and type a not-reached record should carry. */
324
+ export interface DriftExpected {
325
+ address: string;
326
+ node?: string | null;
327
+ instanceOf?: string;
328
+ resourceType?: string;
329
+ }
330
+ /** Opens a member's read: which member, engine and read, and every address it expects. */
331
+ export interface DriftStartLine {
332
+ type: "drift-start";
333
+ drift: typeof DRIFT_VERSION;
334
+ member: string;
335
+ engine: DriftEngine;
336
+ read: DriftRead;
337
+ /** The one address the read was asked about, on a single-resource read (`live-plan -resource`). */
338
+ resource?: string;
339
+ fellBackFrom?: string;
340
+ /** RFC 3339, when the writer gives it. */
341
+ at?: string;
342
+ /** Bare addresses, or addresses with the node and type a not-reached record is given. */
343
+ expected: Array<string | DriftExpected>;
344
+ /** The evidence a not-reached record is given. Default `{ tool: <engine> }`. */
345
+ evidence?: DriftEvidence;
346
+ }
347
+ /** One record, as its read finishes: the record's own fields beside `type`. A later line for the same `(member, address, read)` replaces it. */
348
+ export type DriftRecordLine = DriftRecord & {
349
+ type: "drift-record";
350
+ };
351
+ /** Closes a member's read. */
352
+ export interface DriftSettleLine {
353
+ type: "drift-settle";
354
+ drift: typeof DRIFT_VERSION;
355
+ member: string;
356
+ engine: DriftEngine;
357
+ read: DriftRead;
358
+ /** Records per status. A writer may leave out a status it has none of. */
359
+ counts: Partial<DriftCounts>;
360
+ /** The engine's own account of what the read cost (choudoufu: `recordsRead`, `sweepCalls`, ...). Carried, never interpreted. */
361
+ reads?: Record<string, unknown>;
362
+ /** RFC 3339, when the writer gives it: every not-reached record's `observedAt`. */
363
+ at?: string;
364
+ /**
365
+ * Expected addresses with no record line, when the writer lists them. A
366
+ * reader treats every expected address with no record as not-reached
367
+ * whether or not this is given; a writer that emits its own not-reached
368
+ * records (choudoufu does) leaves it out.
369
+ */
370
+ notReached?: string[];
371
+ }
372
+ export type DriftLine = DriftStartLine | DriftRecordLine | DriftSettleLine;
373
+ /** A start line's expected entries, bare addresses made objects. */
374
+ export declare function driftExpected(start: Pick<DriftStartLine, "expected">): DriftExpected[];
375
+ /** A record as its stream line. */
376
+ export declare function driftRecordLine(record: DriftRecord): DriftRecordLine;
377
+ /** One line of the stream, newline-terminated. */
378
+ export declare function encodeDriftLine(line: DriftLine): string;
379
+ /** The whole stream for one or more reads, in order. */
380
+ export declare function encodeDriftLines(lines: Iterable<DriftLine>): string;
381
+ /** Read one line, checking it. A record line goes through {@link driftRecord}. Unknown fields are dropped. */
382
+ export declare function decodeDriftLine(text: string): DriftLine;
383
+ /** Every non-blank line of an NDJSON stream, decoded. */
384
+ export declare function decodeDriftLines(text: string): DriftLine[];
385
+ /** Open a read: the start line for a member's expected addresses, each once. */
386
+ export declare function driftStart(input: Omit<DriftStartLine, "type" | "drift">): DriftStartLine;
387
+ /**
388
+ * Close a read. `records` are the records sent since `start`, in order; a
389
+ * later one for an address and read replaces an earlier one, and records
390
+ * for another member are ignored. A record for an expected address answers
391
+ * it whatever its read, since one read can answer an address with another
392
+ * (a plan stream's unclaimed row is an `ownership` record). Every expected
393
+ * address with no record becomes `not-observed / not-reached` at `at`.
394
+ * Returns the settle line, which lists them in `notReached`, and the
395
+ * member's final records.
396
+ */
397
+ export declare function driftSettle(start: DriftStartLine, records: Iterable<DriftRecord>, at: string): {
398
+ line: DriftSettleLine;
399
+ records: DriftRecord[];
400
+ };
401
+ /** An address a started read expects and has not reported yet. Not a status: a settle always resolves it. */
402
+ export interface DriftReading {
403
+ member: string;
404
+ read: DriftRead;
405
+ address: string;
406
+ node: string | null;
407
+ }
408
+ /**
409
+ * Fold a stream into a document. Record lines replace earlier ones for the
410
+ * same `(member, address, read)`. At a settle line, every address its start
411
+ * expected that no record answered (by member and address, whatever the
412
+ * read) becomes `not-observed / not-reached`, with the node and type the
413
+ * start gave, at the settle's `at`, else the start's, else the latest
414
+ * record's `observedAt` in the stream; `notReached` addresses the start did
415
+ * not list are added the same way. A start with no settle yet leaves its
416
+ * unanswered addresses in `reading`, which a renderer shows as "reading"
417
+ * and nothing else.
418
+ */
419
+ export declare function foldDriftLines(lines: Iterable<DriftLine>, options?: DriftDocumentOptions): {
420
+ document: DriftDocument;
421
+ reading: DriftReading[];
422
+ };
423
+ /** What every adapter takes beside its source document. */
424
+ export interface DriftAdapterBase {
425
+ member: string;
426
+ /** RFC 3339, given to every record. */
427
+ observedAt: string;
428
+ /**
429
+ * The member's graph, to place each record with `graphNodeFor` as it is
430
+ * made. Omit to leave `node` null, for {@link mapDriftToGraph} to fill.
431
+ */
432
+ graph?: ChangeSetGraphNodes | null;
433
+ /** The read that was asked for and failed, when this one answered instead. */
434
+ fellBackFrom?: string;
435
+ /** The chant or engine version, for `evidence.version`. */
436
+ version?: string;
437
+ }
438
+ /**
439
+ * Where an adapter's record for `address` sits: `graphNodeFor` on the
440
+ * input's graph, plunge's by the `pulumi` rule ({@link driftPlanner}). Exported
441
+ * for the lexicons' adapters.
442
+ */
443
+ export declare function placeDriftRecord(input: Pick<DriftAdapterBase, "member" | "graph">, engine: DriftEngine, address: string): {
444
+ node: string | null;
445
+ instanceOf?: string;
446
+ };
447
+ export interface LiveDiffDriftInput extends DriftAdapterBase {
448
+ /** `chant lifecycle diff --live --json`, parsed. */
449
+ diff: LiveDiffResult;
450
+ /** Entity types by name, for the records whose diff row carries none. */
451
+ types?: Record<string, string>;
452
+ }
453
+ /**
454
+ * A chant member's records, from `lifecycle diff --live`: `unchanged` and
455
+ * `newlyObserved` are in-sync, `driftedSinceSnapshot` drifted (before is the
456
+ * snapshot, after the read), `missing` pending, `disappeared` missing,
457
+ * `orphan` undeclared, `runtimeChildren` runtime, `unobserved` not-observed.
458
+ * An entity in both `missing` and `disappeared` was deployed and is gone,
459
+ * so it is missing.
460
+ */
461
+ export declare function liveDiffDriftRecords(input: LiveDiffDriftInput): DriftRecord[];
462
+ export interface DeepDiffDriftInput extends DriftAdapterBase {
463
+ /** `chant lifecycle diff --live --deep --json`'s deep result, parsed. */
464
+ diff: DeepDiffResult;
465
+ /**
466
+ * The command for `evidence.command`, when the deep result came from
467
+ * somewhere other than a live read: `chant lifecycle diff --index <ref>`
468
+ * (#4526) diffs against an index version. Default
469
+ * `chant lifecycle diff --live --deep`.
470
+ */
471
+ command?: string;
472
+ }
473
+ /**
474
+ * A chant member's records from the deep diff alone: `drifted` with paths
475
+ * (before is the declared value, after the live one; an `absent` path has
476
+ * no after), `unchanged` in-sync, `unobserved` not-observed and
477
+ * `undeclaredEntities` undeclared. Accepted and held paths are not drift and
478
+ * are left out. To lay these over the thin read's records, so a deep hole
479
+ * stays on the attribute surface, use {@link mergeDeepDrift}.
480
+ */
481
+ export declare function deepDiffDriftRecords(input: DeepDiffDriftInput): DriftRecord[];
482
+ /**
483
+ * The thin read's records with the deep read laid over them, by member and
484
+ * address. A thin in-sync record the deep read found drifted becomes
485
+ * drifted with the deep paths. A deep not-observed record never changes the
486
+ * thin status: presence is known, so it becomes `attributesUnobserved` on an
487
+ * in-sync or drifted record and is dropped elsewhere. Deep records with no
488
+ * thin record are added as they are.
489
+ */
490
+ export declare function mergeDeepDrift(thin: Iterable<DriftRecord>, deep: Iterable<DriftRecord>): DriftRecord[];
491
+ export interface ComponentStatusDriftInput extends DriftAdapterBase {
492
+ /** `chant components status [env] --json`'s rows. */
493
+ rows: readonly ComponentStatusRow[];
494
+ }
495
+ /**
496
+ * A member's records from component status, one per component, addressed
497
+ * by component name: `reconciled` in-sync, `drifted` drifted, `stale`
498
+ * missing (recorded and no longer observed live), `unknown` not-observed
499
+ * with the row's reason, or `not-reached` when live status was never asked
500
+ * for. `unrecorded` is drifted when the component is live, since something
501
+ * runs that no release accounts for, pending when nothing is, and
502
+ * not-observed when live status was not asked for.
503
+ */
504
+ export declare function componentStatusDriftRecords(input: ComponentStatusDriftInput): DriftRecord[];
505
+ /**
506
+ * What `chant lifecycle drift` asks a lexicon for (`LexiconPlugin.readDrift`,
507
+ * behold#995). `chant workspace drift` runs that command in a member's reader
508
+ * project, so a lexicon that reads members of a package kind (the terraform
509
+ * lexicon's `terraform` and `choudoufu` kinds) answers with its own engine,
510
+ * and chant core never imports the lexicon.
511
+ */
512
+ export interface ReadDriftOptions {
513
+ /** The workspace member the records are for. Every line the lexicon returns names it. */
514
+ member: string;
515
+ /** The directory holding the project's `chant.config.*`. */
516
+ projectRoot: string;
517
+ /** The project's resolved config, for the lexicon's own namespace. */
518
+ config: Record<string, unknown>;
519
+ /** The read asked for. Unset, the lexicon's default read for what it finds. */
520
+ read?: DriftRead;
521
+ /** One address to read, on an engine that can read one resource on its own. */
522
+ resource?: string;
523
+ /** RFC 3339, the `observedAt` of every record the lexicon builds itself. */
524
+ observedAt: string;
525
+ }
526
+ /** Why a lexicon will not answer a drift read, in a code a caller can branch on. */
527
+ export type ReadDriftRefusalCode = "read-unsupported" | "resource-unsupported" | "no-drift-read";
528
+ /**
529
+ * A lexicon's answer: the stream lines of each read it ran, in order (a
530
+ * `drift-start`, its records, a `drift-settle`, per root), or a refusal. A
531
+ * read that ran and failed is not a refusal: its addresses are records
532
+ * with status `not-observed`.
533
+ */
534
+ export type ReadDriftResult = {
535
+ lines: DriftLine[];
536
+ } | {
537
+ refused: {
538
+ code: ReadDriftRefusalCode;
539
+ message: string;
540
+ };
541
+ };
542
+ //# sourceMappingURL=drift-record.d.ts.map