@intentius/chant-lexicon-pulumi 0.124.97 → 0.124.99

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 (316) hide show
  1. package/dist/adopt.d.ts +0 -1
  2. package/dist/capability-plugin.d.ts +0 -1
  3. package/dist/change-set.d.ts +0 -1
  4. package/dist/changed-units.d.ts +0 -1
  5. package/dist/check-step.d.ts +0 -1
  6. package/dist/ci-setup.d.ts +0 -1
  7. package/dist/codegen/docs-cli.d.ts +0 -1
  8. package/dist/codegen/docs.d.ts +0 -1
  9. package/dist/codegen/package.d.ts +0 -1
  10. package/dist/composites/pulumi-adopt-op.d.ts +0 -1
  11. package/dist/composites/pulumi-watch-op.d.ts +0 -1
  12. package/dist/config.d.ts +0 -1
  13. package/dist/describe-resources.d.ts +0 -1
  14. package/dist/drift-read.d.ts +0 -1
  15. package/dist/drift-record.d.ts +0 -1
  16. package/dist/engine-events.d.ts +0 -1
  17. package/dist/engine-graph.d.ts +0 -1
  18. package/dist/exit-codes.d.ts +0 -1
  19. package/dist/index.d.ts +0 -1
  20. package/dist/init-templates.d.ts +0 -1
  21. package/dist/integrity.json +2 -2
  22. package/dist/lint/audit-catalog.d.ts +0 -1
  23. package/dist/lint/post-synth/index.d.ts +0 -1
  24. package/dist/lint/post-synth/member-read-helpers.d.ts +0 -1
  25. package/dist/lint/post-synth/pul001.d.ts +0 -1
  26. package/dist/lint/post-synth/pul002.d.ts +0 -1
  27. package/dist/lint/post-synth/pul003.d.ts +0 -1
  28. package/dist/lint/post-synth/pul004.d.ts +0 -1
  29. package/dist/lint/post-synth/pul005.d.ts +0 -1
  30. package/dist/lint/post-synth/pul006.d.ts +0 -1
  31. package/dist/lint/post-synth/pul007.d.ts +0 -1
  32. package/dist/lint/post-synth/pul008.d.ts +0 -1
  33. package/dist/lint/post-synth/pul009.d.ts +0 -1
  34. package/dist/lint/post-synth/pul010.d.ts +0 -1
  35. package/dist/lint/post-synth/pul011.d.ts +0 -1
  36. package/dist/lint/post-synth/pul012.d.ts +0 -1
  37. package/dist/lint/post-synth/pul013.d.ts +0 -1
  38. package/dist/lint/post-synth/pul014.d.ts +0 -1
  39. package/dist/lint/post-synth/pul015.d.ts +0 -1
  40. package/dist/lint/rules/index.d.ts +0 -1
  41. package/dist/lint/rules/member-dir-absolute.d.ts +0 -1
  42. package/dist/lock-rows.d.ts +0 -1
  43. package/dist/lsp/completions.d.ts +0 -1
  44. package/dist/lsp/documents.d.ts +0 -1
  45. package/dist/lsp/hover.d.ts +0 -1
  46. package/dist/lsp/keys.d.ts +0 -1
  47. package/dist/lsp/object-path.d.ts +0 -1
  48. package/dist/lsp/yaml-cursor.d.ts +0 -1
  49. package/dist/manifest.json +1 -1
  50. package/dist/member-engine.d.ts +0 -1
  51. package/dist/member-outputs.d.ts +0 -1
  52. package/dist/op/activities/index.d.ts +0 -1
  53. package/dist/op/activities/pulumi-adopt.d.ts +0 -1
  54. package/dist/op/activities/pulumi.d.ts +0 -1
  55. package/dist/op/activity-contracts.d.ts +0 -1
  56. package/dist/op/builders.d.ts +0 -1
  57. package/dist/package-cli.d.ts +0 -1
  58. package/dist/plan-shape.d.ts +0 -1
  59. package/dist/planned-output-changes.d.ts +0 -1
  60. package/dist/plugin.d.ts +0 -1
  61. package/dist/plunge-timings.d.ts +0 -1
  62. package/dist/preview-tips.d.ts +0 -1
  63. package/dist/pulumi-up.d.ts +0 -1
  64. package/dist/release-copy.d.ts +0 -1
  65. package/dist/review-stack.d.ts +0 -1
  66. package/dist/run.d.ts +0 -1
  67. package/dist/serializer.d.ts +0 -1
  68. package/dist/stack-export-snapshot.d.ts +0 -1
  69. package/dist/stack-ops.d.ts +0 -1
  70. package/dist/stack-outputs.d.ts +0 -1
  71. package/dist/stack-references.d.ts +0 -1
  72. package/dist/trace-facts.d.ts +0 -1
  73. package/dist/values.d.ts +0 -1
  74. package/dist/workspace-member.d.ts +0 -1
  75. package/package.json +3 -4
  76. package/dist/adopt.d.ts.map +0 -1
  77. package/dist/capability-plugin.d.ts.map +0 -1
  78. package/dist/change-set.d.ts.map +0 -1
  79. package/dist/changed-units.d.ts.map +0 -1
  80. package/dist/check-step.d.ts.map +0 -1
  81. package/dist/ci-setup.d.ts.map +0 -1
  82. package/dist/codegen/docs-cli.d.ts.map +0 -1
  83. package/dist/codegen/docs.d.ts.map +0 -1
  84. package/dist/codegen/package.d.ts.map +0 -1
  85. package/dist/composites/pulumi-adopt-op.d.ts.map +0 -1
  86. package/dist/composites/pulumi-watch-op.d.ts.map +0 -1
  87. package/dist/config.d.ts.map +0 -1
  88. package/dist/describe-resources.d.ts.map +0 -1
  89. package/dist/drift-read.d.ts.map +0 -1
  90. package/dist/drift-record.d.ts.map +0 -1
  91. package/dist/engine-events.d.ts.map +0 -1
  92. package/dist/engine-graph.d.ts.map +0 -1
  93. package/dist/exit-codes.d.ts.map +0 -1
  94. package/dist/index.d.ts.map +0 -1
  95. package/dist/init-templates.d.ts.map +0 -1
  96. package/dist/lint/audit-catalog.d.ts.map +0 -1
  97. package/dist/lint/post-synth/index.d.ts.map +0 -1
  98. package/dist/lint/post-synth/member-read-helpers.d.ts.map +0 -1
  99. package/dist/lint/post-synth/pul001.d.ts.map +0 -1
  100. package/dist/lint/post-synth/pul002.d.ts.map +0 -1
  101. package/dist/lint/post-synth/pul003.d.ts.map +0 -1
  102. package/dist/lint/post-synth/pul004.d.ts.map +0 -1
  103. package/dist/lint/post-synth/pul005.d.ts.map +0 -1
  104. package/dist/lint/post-synth/pul006.d.ts.map +0 -1
  105. package/dist/lint/post-synth/pul007.d.ts.map +0 -1
  106. package/dist/lint/post-synth/pul008.d.ts.map +0 -1
  107. package/dist/lint/post-synth/pul009.d.ts.map +0 -1
  108. package/dist/lint/post-synth/pul010.d.ts.map +0 -1
  109. package/dist/lint/post-synth/pul011.d.ts.map +0 -1
  110. package/dist/lint/post-synth/pul012.d.ts.map +0 -1
  111. package/dist/lint/post-synth/pul013.d.ts.map +0 -1
  112. package/dist/lint/post-synth/pul014.d.ts.map +0 -1
  113. package/dist/lint/post-synth/pul015.d.ts.map +0 -1
  114. package/dist/lint/rules/index.d.ts.map +0 -1
  115. package/dist/lint/rules/member-dir-absolute.d.ts.map +0 -1
  116. package/dist/lock-rows.d.ts.map +0 -1
  117. package/dist/lsp/completions.d.ts.map +0 -1
  118. package/dist/lsp/documents.d.ts.map +0 -1
  119. package/dist/lsp/hover.d.ts.map +0 -1
  120. package/dist/lsp/keys.d.ts.map +0 -1
  121. package/dist/lsp/object-path.d.ts.map +0 -1
  122. package/dist/lsp/yaml-cursor.d.ts.map +0 -1
  123. package/dist/member-engine.d.ts.map +0 -1
  124. package/dist/member-outputs.d.ts.map +0 -1
  125. package/dist/op/activities/index.d.ts.map +0 -1
  126. package/dist/op/activities/pulumi-adopt.d.ts.map +0 -1
  127. package/dist/op/activities/pulumi.d.ts.map +0 -1
  128. package/dist/op/activity-contracts.d.ts.map +0 -1
  129. package/dist/op/builders.d.ts.map +0 -1
  130. package/dist/package-cli.d.ts.map +0 -1
  131. package/dist/plan-shape.d.ts.map +0 -1
  132. package/dist/planned-output-changes.d.ts.map +0 -1
  133. package/dist/plugin.d.ts.map +0 -1
  134. package/dist/plunge-timings.d.ts.map +0 -1
  135. package/dist/preview-tips.d.ts.map +0 -1
  136. package/dist/pulumi-up.d.ts.map +0 -1
  137. package/dist/release-copy.d.ts.map +0 -1
  138. package/dist/review-stack.d.ts.map +0 -1
  139. package/dist/run.d.ts.map +0 -1
  140. package/dist/serializer.d.ts.map +0 -1
  141. package/dist/stack-export-snapshot.d.ts.map +0 -1
  142. package/dist/stack-ops.d.ts.map +0 -1
  143. package/dist/stack-outputs.d.ts.map +0 -1
  144. package/dist/stack-references.d.ts.map +0 -1
  145. package/dist/trace-facts.d.ts.map +0 -1
  146. package/dist/values.d.ts.map +0 -1
  147. package/dist/workspace-member.d.ts.map +0 -1
  148. package/src/adopt.ts +0 -202
  149. package/src/capability-plugin.ts +0 -34
  150. package/src/change-set.test.ts +0 -245
  151. package/src/change-set.ts +0 -508
  152. package/src/changed-units.test.ts +0 -87
  153. package/src/changed-units.ts +0 -96
  154. package/src/check-step.test.ts +0 -191
  155. package/src/check-step.ts +0 -316
  156. package/src/ci-setup.test.ts +0 -234
  157. package/src/ci-setup.ts +0 -224
  158. package/src/codegen/docs-cli.ts +0 -4
  159. package/src/codegen/docs.ts +0 -58
  160. package/src/codegen/package.ts +0 -63
  161. package/src/composites/pulumi-adopt-op.test.ts +0 -258
  162. package/src/composites/pulumi-adopt-op.ts +0 -193
  163. package/src/composites/pulumi-watch-op.test.ts +0 -42
  164. package/src/composites/pulumi-watch-op.ts +0 -85
  165. package/src/config.ts +0 -43
  166. package/src/describe-resources.test.ts +0 -112
  167. package/src/describe-resources.ts +0 -118
  168. package/src/drift-read.test.ts +0 -178
  169. package/src/drift-read.ts +0 -94
  170. package/src/drift-record.test.ts +0 -197
  171. package/src/drift-record.ts +0 -326
  172. package/src/engine-events.test.ts +0 -160
  173. package/src/engine-events.ts +0 -395
  174. package/src/engine-graph.test.ts +0 -141
  175. package/src/engine-graph.ts +0 -149
  176. package/src/exit-codes.test.ts +0 -21
  177. package/src/exit-codes.ts +0 -71
  178. package/src/index.ts +0 -139
  179. package/src/init-templates.ts +0 -85
  180. package/src/lint/audit-catalog.test.ts +0 -33
  181. package/src/lint/audit-catalog.ts +0 -174
  182. package/src/lint/post-synth/index.ts +0 -35
  183. package/src/lint/post-synth/member-read-helpers.ts +0 -122
  184. package/src/lint/post-synth/post-synth.test.ts +0 -245
  185. package/src/lint/post-synth/pul001.ts +0 -38
  186. package/src/lint/post-synth/pul002.ts +0 -38
  187. package/src/lint/post-synth/pul003.ts +0 -43
  188. package/src/lint/post-synth/pul004.ts +0 -32
  189. package/src/lint/post-synth/pul005.ts +0 -31
  190. package/src/lint/post-synth/pul006.ts +0 -31
  191. package/src/lint/post-synth/pul007.ts +0 -35
  192. package/src/lint/post-synth/pul008.ts +0 -35
  193. package/src/lint/post-synth/pul009.ts +0 -32
  194. package/src/lint/post-synth/pul010.ts +0 -42
  195. package/src/lint/post-synth/pul011.ts +0 -38
  196. package/src/lint/post-synth/pul012.ts +0 -35
  197. package/src/lint/post-synth/pul013.ts +0 -35
  198. package/src/lint/post-synth/pul014.ts +0 -32
  199. package/src/lint/post-synth/pul015.ts +0 -39
  200. package/src/lint/rules/index.ts +0 -7
  201. package/src/lint/rules/member-dir-absolute.test.ts +0 -37
  202. package/src/lint/rules/member-dir-absolute.ts +0 -83
  203. package/src/lock-rows.test.ts +0 -60
  204. package/src/lock-rows.ts +0 -56
  205. package/src/lsp/completions.test.ts +0 -69
  206. package/src/lsp/completions.ts +0 -119
  207. package/src/lsp/documents.ts +0 -48
  208. package/src/lsp/hover.test.ts +0 -56
  209. package/src/lsp/hover.ts +0 -83
  210. package/src/lsp/keys.ts +0 -169
  211. package/src/lsp/object-path.ts +0 -71
  212. package/src/lsp/yaml-cursor.ts +0 -85
  213. package/src/member-engine.test.ts +0 -112
  214. package/src/member-engine.ts +0 -97
  215. package/src/member-outputs.test.ts +0 -339
  216. package/src/member-outputs.ts +0 -157
  217. package/src/op/activities/index.ts +0 -36
  218. package/src/op/activities/pulumi-adopt.ts +0 -345
  219. package/src/op/activities/pulumi.ts +0 -136
  220. package/src/op/activity-contracts.ts +0 -129
  221. package/src/op/builders.ts +0 -67
  222. package/src/package-cli.ts +0 -14
  223. package/src/plan-shape.test.ts +0 -91
  224. package/src/plan-shape.ts +0 -105
  225. package/src/planned-output-changes.test.ts +0 -85
  226. package/src/planned-output-changes.ts +0 -141
  227. package/src/plugin.test.ts +0 -96
  228. package/src/plugin.ts +0 -272
  229. package/src/plunge-timings.test.ts +0 -241
  230. package/src/plunge-timings.ts +0 -115
  231. package/src/plunge-up-failed.test.ts +0 -54
  232. package/src/pr-note.test.ts +0 -87
  233. package/src/preview-generated.test.ts +0 -124
  234. package/src/preview-tips.test.ts +0 -134
  235. package/src/preview-tips.ts +0 -128
  236. package/src/pulumi-up.test.ts +0 -581
  237. package/src/pulumi-up.ts +0 -1102
  238. package/src/pulumi-urn-node.test.ts +0 -94
  239. package/src/release-copy.test.ts +0 -162
  240. package/src/release-copy.ts +0 -223
  241. package/src/review-stack.test.ts +0 -254
  242. package/src/review-stack.ts +0 -266
  243. package/src/run-plan-flags.test.ts +0 -53
  244. package/src/run.test.ts +0 -540
  245. package/src/run.ts +0 -1129
  246. package/src/serializer.test.ts +0 -9
  247. package/src/serializer.ts +0 -15
  248. package/src/skills/chant-pulumi-plunge.md +0 -51
  249. package/src/skills/chant-pulumi-stack-export.md +0 -54
  250. package/src/skills/chant-pulumi.md +0 -83
  251. package/src/stack-export-snapshot.test.ts +0 -192
  252. package/src/stack-export-snapshot.ts +0 -312
  253. package/src/stack-ops.fake-binary.test.ts +0 -323
  254. package/src/stack-ops.test.ts +0 -511
  255. package/src/stack-ops.ts +0 -1082
  256. package/src/stack-outputs.ts +0 -66
  257. package/src/stack-references.test.ts +0 -96
  258. package/src/stack-references.ts +0 -110
  259. package/src/testdata/plunge-drift/README.md +0 -10
  260. package/src/testdata/plunge-drift/assets-drifted.ndjson +0 -3
  261. package/src/testdata/plunge-drift/component-unsupported.ndjson +0 -3
  262. package/src/testdata/plunge-drift/role-in-sync.ndjson +0 -3
  263. package/src/testdata/plunge-drift/settled-empty.ndjson +0 -2
  264. package/src/testdata/plunge-graph/Pulumi.yaml +0 -4
  265. package/src/testdata/plunge-graph/README.md +0 -12
  266. package/src/testdata/plunge-graph/engine-graph.json +0 -158
  267. package/src/testdata/plunge-graph/stack-export.json +0 -49
  268. package/src/testdata/plunge-member/Pulumi.yaml +0 -4
  269. package/src/testdata/plunge-member/README.md +0 -3
  270. package/src/testdata/plunge-member/stack-export.json +0 -480
  271. package/src/testdata/plunge-outputs/Pulumi.yaml +0 -9
  272. package/src/testdata/plunge-outputs/README.md +0 -7
  273. package/src/testdata/plunge-outputs/stack-export.json +0 -2003
  274. package/src/testdata/plunge-outputs/stack-output.json +0 -19
  275. package/src/testdata/pulumi-member/Pulumi.yaml +0 -2
  276. package/src/testdata/pulumi-member/README.md +0 -50
  277. package/src/testdata/pulumi-member/recording/Pulumi.dev.yaml +0 -19
  278. package/src/testdata/pulumi-member/recording/Pulumi.yaml +0 -7
  279. package/src/testdata/pulumi-member/recording/index.js +0 -47
  280. package/src/testdata/pulumi-member/recording/package-lock.json +0 -2707
  281. package/src/testdata/pulumi-member/recording/package.json +0 -9
  282. package/src/testdata/pulumi-member/stack-export.json +0 -746
  283. package/src/testdata/pulumi-outputs/Pulumi.yaml +0 -7
  284. package/src/testdata/pulumi-outputs/README.md +0 -9
  285. package/src/testdata/pulumi-outputs/preview-replaced.json +0 -2894
  286. package/src/testdata/pulumi-outputs/preview-settled.json +0 -2894
  287. package/src/testdata/pulumi-outputs/stack-export.json +0 -1919
  288. package/src/testdata/pulumi-outputs/stack-output.json +0 -19
  289. package/src/testdata/pulumi-preview/Pulumi.yaml +0 -7
  290. package/src/testdata/pulumi-preview/README.md +0 -9
  291. package/src/testdata/pulumi-preview/preview-create.json +0 -992
  292. package/src/testdata/pulumi-preview/preview.json +0 -2894
  293. package/src/testdata/pulumi-preview/stack-export.json +0 -1919
  294. package/src/testdata/pulumi-refresh/Pulumi.yaml +0 -7
  295. package/src/testdata/pulumi-refresh/README.md +0 -14
  296. package/src/testdata/pulumi-refresh/all.json +0 -3742
  297. package/src/testdata/pulumi-refresh/bucket-edited.json +0 -468
  298. package/src/testdata/pulumi-refresh/policy-deleted.json +0 -95
  299. package/src/testdata/pulumi-refresh/queue-edited.json +0 -250
  300. package/src/testdata/pulumi-refresh/role-same.json +0 -242
  301. package/src/testdata/pulumi-refresh/secret-edited.json +0 -247
  302. package/src/testdata/pulumi-refresh/stack-export.json +0 -1907
  303. package/src/testdata/pulumi-stream/README.md +0 -16
  304. package/src/testdata/pulumi-stream/preview-stream.ndjson +0 -42
  305. package/src/testdata/pulumi-stream/up-failed-plunge.ndjson +0 -5
  306. package/src/testdata/pulumi-unexported/Pulumi.yaml +0 -2
  307. package/src/testdata/pulumi-urn-node/Pulumi.yaml +0 -7
  308. package/src/testdata/pulumi-urn-node/README.md +0 -9
  309. package/src/testdata/pulumi-urn-node/preview.json +0 -2894
  310. package/src/testdata/pulumi-urn-node/stack-export.json +0 -1919
  311. package/src/trace-facts.test.ts +0 -38
  312. package/src/trace-facts.ts +0 -83
  313. package/src/values.ts +0 -147
  314. package/src/workspace-kinds.test.ts +0 -47
  315. package/src/workspace-member.test.ts +0 -127
  316. package/src/workspace-member.ts +0 -304
@@ -1,141 +0,0 @@
1
- /**
2
- * A plunge member's checked-in `engine-graph.json` (#4529): the facts and
3
- * the `property` edges it adds to the member graph, the `instance` grain on
4
- * the export's edges, and what a stock member gets (nothing new). The
5
- * document is chant#4527's plunge fixture, copied into
6
- * `testdata/plunge-graph/`. Nothing here runs plunge.
7
- */
8
- import { afterEach, describe, expect, test } from "vitest";
9
- import { cpSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
- import { tmpdir } from "node:os";
11
- import { join } from "node:path";
12
- import { buildGraphIr } from "@intentius/chant/graph-ir";
13
- import { engineFactsOf, PULUMI_ENGINE_GRAPH_FILE, readPlungeEngineGraph } from "./engine-graph";
14
- import { readPulumiMember } from "./workspace-member";
15
-
16
- const testdata = join(import.meta.dirname, "testdata");
17
- const dir = join(testdata, "plunge-graph");
18
- const fixturePath = join(import.meta.dirname, "..", "..", "..", "packages", "core", "src", "graph-schema", "fixtures", "plunge.engine-graph.json");
19
- const fixture = JSON.parse(readFileSync(fixturePath, "utf-8")) as { nodes: { id: string; facts?: unknown }[] };
20
- const factsOf = (urn: string) => fixture.nodes.find((n) => n.id === urn)!.facts;
21
-
22
- const ASSETS = "app/aws:s3/bucketV2:BucketV2::assets";
23
- const MEDIA = "app/gcp:storage/bucket:Bucket::media";
24
- const POLICY = "app/aws:s3/bucketPolicy:BucketPolicy::assets-policy";
25
-
26
- const scratch: string[] = [];
27
- afterEach(() => {
28
- for (const d of scratch.splice(0)) rmSync(d, { recursive: true, force: true });
29
- });
30
- function copyOf(source: string): string {
31
- const d = mkdtempSync(join(tmpdir(), "chant-plunge-graph-"));
32
- scratch.push(d);
33
- cpSync(source, d, { recursive: true });
34
- return d;
35
- }
36
-
37
- describe("the fixture", () => {
38
- test("testdata/plunge-graph/engine-graph.json is chant#4527's plunge fixture, unchanged", () => {
39
- expect(readFileSync(join(dir, PULUMI_ENGINE_GRAPH_FILE), "utf-8")).toBe(readFileSync(fixturePath, "utf-8"));
40
- });
41
- });
42
-
43
- describe("readPlungeEngineGraph", () => {
44
- test("reads the fixture's nodes, edges and scope", () => {
45
- const read = readPlungeEngineGraph(fixture);
46
- if ("error" in read) throw new Error(read.error);
47
- expect(read.graph.scope).toEqual({ project: "app", stack: "dev" });
48
- expect(read.graph.engineVersion).toBe("3.272.0-plunge.1");
49
- expect(read.graph.nodes.map((n) => n.urn)).toEqual(fixture.nodes.map((n) => n.id));
50
- expect(read.graph.edges.map((e) => `${e.viaAttr}:${e.grain}`).sort()).toEqual(["bucket:property", "dependencies:instance", "provider:instance"]);
51
- });
52
-
53
- test("refuses a document that is not plunge's version 1, format 1 graph", () => {
54
- const doc = fixture as unknown as { version: number; meta: { engineGraph: { format: number; engine: { name: string } } } };
55
- expect(readPlungeEngineGraph({ ...doc, version: 2 })).toEqual({ error: expect.stringMatching(/version is 2/) });
56
- expect(readPlungeEngineGraph({ ...doc, meta: { engineGraph: { ...doc.meta.engineGraph, format: 2 } } })).toEqual({ error: expect.stringMatching(/format is 2/) });
57
- expect(readPlungeEngineGraph({ ...doc, meta: { engineGraph: { ...doc.meta.engineGraph, engine: { name: "choudoufu" } } } })).toEqual({ error: expect.stringMatching(/not plunge/) });
58
- expect(readPlungeEngineGraph({ version: 1, nodes: [] })).toEqual({ error: expect.stringMatching(/no meta.engineGraph/) });
59
- expect(readPlungeEngineGraph("x")).toEqual({ error: "it is not a JSON object" });
60
- });
61
-
62
- test("engineFactsOf keeps only the schema's fields and values", () => {
63
- expect(
64
- engineFactsOf({
65
- ownership: "mine",
66
- ownedBy: "record",
67
- markers: { owner: "app/dev", encoding: "plain", source: "guess" },
68
- cloudIds: [{ kind: "arn", value: "arn:aws:s3:::a" }, { kind: "secret", value: "x" }],
69
- outputs: { password: "hunter2" },
70
- observedAt: "2026-10-26T12:00:00Z",
71
- }),
72
- ).toEqual({ ownedBy: "record", cloudIds: [{ kind: "arn", value: "arn:aws:s3:::a" }], observedAt: "2026-10-26T12:00:00Z" });
73
- expect(engineFactsOf({ ownership: 3 })).toBeUndefined();
74
- });
75
- });
76
-
77
- describe("readPulumiMember with engine-graph.json (#4529)", () => {
78
- test("each node the export and the graph share gets the graph's facts, as plunge printed them", () => {
79
- const { entities, report, warnings } = readPulumiMember({ member: { dir, label: "app" } });
80
- expect(warnings).toEqual([]);
81
- expect([...entities.keys()].sort()).toEqual([ASSETS, POLICY, MEDIA].sort());
82
- const facts = (key: string) => (entities.get(key) as unknown as { facts?: unknown }).facts;
83
- expect(facts(ASSETS)).toEqual(factsOf("urn:pulumi:dev::app::aws:s3/bucketV2:BucketV2::assets"));
84
- expect(facts(MEDIA)).toEqual(factsOf("urn:pulumi:dev::app::gcp:storage/bucket:Bucket::media"));
85
- // The graph was taken mid-update; chant does not reconcile it with the export.
86
- expect((facts(POLICY) as { ownership?: string }).ownership).toBe("pending");
87
- // Not enumerable, so an older chant does not project it into attrs.
88
- expect(Object.keys(entities.get(ASSETS)!)).not.toContain("facts");
89
- expect(report.engineGraph).toEqual({ file: "engine-graph.json", read: true, stack: "dev", observedAt: "2026-10-26T12:00:00Z", facts: 3, propertyEdges: 1 });
90
- });
91
-
92
- test("the graph IR: facts on the nodes, property edges with grain property, export edges with grain instance", () => {
93
- const { entities } = readPulumiMember({ member: { dir, label: "app" } });
94
- const ir = buildGraphIr(entities);
95
- const node = ir.nodes.find((n) => n.id === ASSETS)!;
96
- expect(node.facts).toEqual(factsOf("urn:pulumi:dev::app::aws:s3/bucketV2:BucketV2::assets"));
97
- expect(node.attrs).toEqual({});
98
- expect(ir.edges.map((e) => [e.from, e.to, e.viaAttr, e.grain])).toEqual([
99
- [POLICY, ASSETS, "bucket", "property"],
100
- [POLICY, ASSETS, "dependencies", "instance"],
101
- ]);
102
- // The graph's provider edge has no node to land on.
103
- expect(JSON.stringify(ir)).not.toContain("pulumi:providers:aws");
104
- });
105
-
106
- test("an engine-graph.json that does not read leaves a warning, and the graph is the export's", () => {
107
- const broken = copyOf(dir);
108
- writeFileSync(join(broken, PULUMI_ENGINE_GRAPH_FILE), JSON.stringify({ version: 1, meta: { engineGraph: { format: 1, engine: { name: "choudoufu" } } }, nodes: [] }));
109
- const { entities, report, warnings } = readPulumiMember({ member: { dir: broken, label: "app" } });
110
- expect(warnings.join("\n")).toMatch(/engine-graph.json was not read: it was printed by "choudoufu", not plunge/);
111
- expect(report.engineGraph).toEqual({ file: "engine-graph.json", read: false, reason: 'it was printed by "choudoufu", not plunge' });
112
- expect([...entities.values()].every((e) => (e as unknown as { facts?: unknown }).facts === undefined)).toBe(true);
113
- writeFileSync(join(broken, PULUMI_ENGINE_GRAPH_FILE), "{");
114
- expect(readPulumiMember({ member: { dir: broken, label: "app" } }).report.engineGraph).toMatchObject({ read: false, reason: expect.stringMatching(/not readable JSON/) });
115
- });
116
-
117
- test("a member on plunge with no engine-graph.json reads as before, with grain instance on its edges", () => {
118
- const bare = copyOf(dir);
119
- rmSync(join(bare, PULUMI_ENGINE_GRAPH_FILE));
120
- const { entities, report } = readPulumiMember({ member: { dir: bare, label: "app" } });
121
- expect(report).toEqual({ export: "stack-export.json", exportSource: "file", objects: 3, exported: true });
122
- expect(buildGraphIr(entities).edges.map((e) => [e.viaAttr, e.grain])).toEqual([["dependencies", "instance"]]);
123
- });
124
- });
125
-
126
- describe("a stock member gets no facts (#4529)", () => {
127
- test("its engine-graph.json, if one is there, is not read", () => {
128
- for (const member of [{ dir, label: "app", engine: "pulumi" as const }, { dir: (() => {
129
- const d = copyOf(dir);
130
- writeFileSync(join(d, "Pulumi.yaml"), "name: app\nruntime: nodejs\n");
131
- return d;
132
- })(), label: "app" }]) {
133
- const { entities, report } = readPulumiMember({ member });
134
- expect(report.engineGraph).toBeUndefined();
135
- expect([...entities.values()].every((e) => (e as unknown as { facts?: unknown }).facts === undefined)).toBe(true);
136
- const ir = buildGraphIr(entities);
137
- expect(ir.nodes.every((n) => n.facts === undefined)).toBe(true);
138
- expect(ir.edges.map((e) => [e.viaAttr, e.grain])).toEqual([["dependencies", "instance"]]);
139
- }
140
- });
141
- });
@@ -1,149 +0,0 @@
1
- /**
2
- * Reading plunge's engine graph document (#4529): what `plunge graph --json`
3
- * prints (INTENTIUS/plunge#40, #43), in the shape chant#4520 designed and
4
- * `@intentius/chant/engine-facts` types. It is a `GraphIR` at version 1 whose
5
- * `meta.engineGraph` names the engine and the stack, whose node ids are full
6
- * URNs, and whose nodes carry the engine's facts under `facts`.
7
- *
8
- * Two readers use it:
9
- *
10
- * - the member graph read (`./workspace-member.ts`), from a checked-in
11
- * {@link PULUMI_ENGINE_GRAPH_FILE} beside `stack-export.json`. It takes the
12
- * facts and the `property` edges; `dependencies` and `parent` edges keep
13
- * coming from the export;
14
- * - the lexicon's `describeResources` (`./describe-resources.ts`), from one
15
- * `plunge graph --json --stack <stack>` run per member.
16
- *
17
- * Only what the schema names is copied. A fact with a value outside its
18
- * set is dropped, never guessed at, so a newer plunge that adds a field or a
19
- * value cannot put anything else on a node. The document holds no output
20
- * value and no secret (plunge#40's rule), and this reader carries no `attrs`
21
- * across, so none can reach the graph through it.
22
- *
23
- * Nothing in chant decides from these facts (ruled on #4520, Q1): they ride
24
- * on `IRNode.facts` for people and for readers that show the graph.
25
- */
26
- import type { EdgeGrain, EngineFacts, EngineMarkers } from "@intentius/chant/engine-facts";
27
-
28
- /** The conventional place of a plunge member's engine graph, beside the export. */
29
- export const PULUMI_ENGINE_GRAPH_FILE = "engine-graph.json";
30
-
31
- /** One node of the document: a URN, its type, and what plunge's records say about it. */
32
- export interface PlungeGraphNode {
33
- urn: string;
34
- kind: string;
35
- physicalId?: string;
36
- facts?: EngineFacts;
37
- }
38
-
39
- /** One `ref` edge of the document, between two URNs. */
40
- export interface PlungeGraphEdge {
41
- from: string;
42
- to: string;
43
- /** `dependencies`, `parent`, `provider`, or the property name of a `property` edge. */
44
- viaAttr: string;
45
- grain: EdgeGrain;
46
- }
47
-
48
- /** The parts of a plunge engine graph document chant reads. */
49
- export interface PlungeEngineGraph {
50
- /** `meta.engineGraph.engine.version`, when plunge printed it. */
51
- engineVersion?: string;
52
- /** `meta.engineGraph.scope`: the stack plunge read. */
53
- scope?: { project: string; stack: string };
54
- /** `meta.engineGraph.observedAt`: when the record read started. */
55
- observedAt?: string;
56
- nodes: PlungeGraphNode[];
57
- edges: PlungeGraphEdge[];
58
- /** How many records plunge listed under `meta.engineGraph.gaps` (it could not describe them). */
59
- gaps: number;
60
- }
61
-
62
- const OWNERSHIP = new Set(["bound", "unowned", "pending", "foreign"]);
63
- const OWNED_BY = new Set(["marker", "record", "name"]);
64
- const ENCODING = new Set(["plain", "escaped", "digest"]);
65
- const SOURCE = new Set(["live", "record"]);
66
- const CLOUD_ID_KIND = new Set(["import-id", "arn", "provider-id", "self-link", "k8s-uid"]);
67
- const GRAIN = new Set(["block", "instance", "property"]);
68
-
69
- const isObject = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null && !Array.isArray(v);
70
- const str = (v: unknown): v is string => typeof v === "string" && v.length > 0;
71
-
72
- function markersOf(v: unknown): EngineMarkers | undefined {
73
- if (!isObject(v) || !ENCODING.has(v.encoding as string) || !SOURCE.has(v.source as string)) return undefined;
74
- return {
75
- ...(str(v.owner) ? { owner: v.owner } : {}),
76
- ...(str(v.address) ? { address: v.address } : {}),
77
- encoding: v.encoding as EngineMarkers["encoding"],
78
- source: v.source as EngineMarkers["source"],
79
- };
80
- }
81
-
82
- /**
83
- * The facts one node carries, with only the fields and values the schema
84
- * names. Undefined when none is left.
85
- */
86
- export function engineFactsOf(v: unknown): EngineFacts | undefined {
87
- if (!isObject(v)) return undefined;
88
- const facts: EngineFacts = {};
89
- if (OWNERSHIP.has(v.ownership as string)) facts.ownership = v.ownership as EngineFacts["ownership"];
90
- const markers = markersOf(v.markers);
91
- if (markers) facts.markers = markers;
92
- if (OWNED_BY.has(v.ownedBy as string)) facts.ownedBy = v.ownedBy as EngineFacts["ownedBy"];
93
- if (Array.isArray(v.cloudIds)) {
94
- const ids = v.cloudIds
95
- .filter((c): c is Record<string, unknown> => isObject(c) && CLOUD_ID_KIND.has(c.kind as string) && str(c.value))
96
- .map((c) => ({ kind: c.kind as NonNullable<EngineFacts["cloudIds"]>[number]["kind"], value: c.value as string }));
97
- if (ids.length > 0) facts.cloudIds = ids;
98
- }
99
- const rv = v.recordVersions;
100
- if (isObject(rv) && typeof rv.kept === "boolean" && Array.isArray(rv.versions)) {
101
- facts.recordVersions = {
102
- kept: rv.kept,
103
- versions: rv.versions
104
- .filter((x): x is Record<string, unknown> => isObject(x) && str(x.id) && str(x.writtenAt) && typeof x.current === "boolean" && typeof x.deleted === "boolean")
105
- .map((x) => ({ id: x.id as string, writtenAt: x.writtenAt as string, current: x.current as boolean, deleted: x.deleted as boolean })),
106
- };
107
- }
108
- if (str(v.observedAt)) facts.observedAt = v.observedAt;
109
- return Object.keys(facts).length > 0 ? facts : undefined;
110
- }
111
-
112
- /**
113
- * The document, read, or why it can't be: it must be a version 1 graph whose
114
- * `meta.engineGraph` is format 1 and names plunge. A node or edge that does
115
- * not have the shape is skipped.
116
- */
117
- export function readPlungeEngineGraph(doc: unknown): { graph: PlungeEngineGraph } | { error: string } {
118
- if (!isObject(doc)) return { error: "it is not a JSON object" };
119
- if (doc.version !== 1) return { error: `its version is ${JSON.stringify(doc.version)}, and chant reads version 1` };
120
- const meta = isObject(doc.meta) && isObject(doc.meta.engineGraph) ? doc.meta.engineGraph : undefined;
121
- if (!meta) return { error: "it has no meta.engineGraph, so it is not an engine graph" };
122
- if (meta.format !== 1) return { error: `its meta.engineGraph.format is ${JSON.stringify(meta.format)}, and chant reads format 1` };
123
- const engine = isObject(meta.engine) ? meta.engine : {};
124
- if (engine.name !== "plunge") return { error: `it was printed by ${JSON.stringify(engine.name)}, not plunge` };
125
- if (!Array.isArray(doc.nodes)) return { error: "it has no nodes list" };
126
-
127
- const nodes: PlungeGraphNode[] = [];
128
- for (const n of doc.nodes) {
129
- if (!isObject(n) || !str(n.id) || !str(n.kind)) continue;
130
- const facts = engineFactsOf(n.facts);
131
- nodes.push({ urn: n.id, kind: n.kind, ...(str(n.physicalId) ? { physicalId: n.physicalId } : {}), ...(facts ? { facts } : {}) });
132
- }
133
- const edges: PlungeGraphEdge[] = [];
134
- for (const e of Array.isArray(doc.edges) ? doc.edges : []) {
135
- if (!isObject(e) || e.kind !== "ref" || !str(e.from) || !str(e.to) || !str(e.viaAttr) || !GRAIN.has(e.grain as string)) continue;
136
- edges.push({ from: e.from, to: e.to, viaAttr: e.viaAttr, grain: e.grain as EdgeGrain });
137
- }
138
- const scope = isObject(meta.scope) && str(meta.scope.project) && str(meta.scope.stack) ? { project: meta.scope.project, stack: meta.scope.stack } : undefined;
139
- return {
140
- graph: {
141
- ...(str(engine.version) ? { engineVersion: engine.version } : {}),
142
- ...(scope ? { scope } : {}),
143
- ...(str(meta.observedAt) ? { observedAt: meta.observedAt } : {}),
144
- nodes,
145
- edges,
146
- gaps: Array.isArray(meta.gaps) ? meta.gaps.length : 0,
147
- },
148
- };
149
- }
@@ -1,21 +0,0 @@
1
- import { describe, expect, test } from "vitest";
2
- import { CHANT_EXIT } from "@intentius/chant/exit-codes";
3
- import { PLUNGE_PLAN_MOVED_EXIT, PULUMI_EXIT, pulumiExitOf, pulumiPlanMoved } from "./exit-codes";
4
-
5
- describe("pulumi and plunge exit statuses on chant's table (#4553)", () => {
6
- test("plunge's moved plan is chant's moved code", () => {
7
- expect(pulumiExitOf(PLUNGE_PLAN_MOVED_EXIT)).toBe(CHANT_EXIT.moved);
8
- expect(pulumiPlanMoved(40)).toBe(true);
9
- });
10
-
11
- test("a policy violation is denied, and changes under --expect-no-changes are drift", () => {
12
- expect(pulumiExitOf(PULUMI_EXIT.policyViolation)).toBe(CHANT_EXIT.denied);
13
- expect(pulumiExitOf(PULUMI_EXIT.noChanges)).toBe(CHANT_EXIT.drift);
14
- });
15
-
16
- test("no raw Pulumi code passes through: authentication's 3 is failed, never waiting", () => {
17
- expect(pulumiExitOf(PULUMI_EXIT.authentication)).toBe(CHANT_EXIT.failed);
18
- for (const code of [1, 2, 4, 6, 8, 9, 10, 255, 99, null, undefined]) expect(pulumiExitOf(code)).toBe(CHANT_EXIT.failed);
19
- expect(pulumiExitOf(0)).toBe(CHANT_EXIT.done);
20
- });
21
- });
package/src/exit-codes.ts DELETED
@@ -1,71 +0,0 @@
1
- /**
2
- * Pulumi and plunge exit statuses mapped onto chant's exit-code table
3
- * (#4553, `CHANT_EXIT` in `@intentius/chant/exit-codes`).
4
- *
5
- * Pulumi's own codes (`pkg/cmd/pulumi/cmd/exit_codes.go` upstream) overlap
6
- * chant's numbers with other meanings: Pulumi's 3 is an authentication
7
- * failure, chant's 3 a run waiting on a person. So nothing passes a raw
8
- * Pulumi code through; every code the lexicon reads goes through
9
- * {@link pulumiExitOf}. A Pulumi older than its exit-code taxonomy exits 1 for
10
- * everything, which maps to `failed`, still right.
11
- *
12
- * The pulumi apply capability (#4541) wires this into its step: a plan that
13
- * moved throws an error with `planMoved: true`, and core exits
14
- * `CHANT_EXIT.moved`.
15
- */
16
- import { CHANT_EXIT, type ChantExitCode } from "@intentius/chant/exit-codes";
17
-
18
- /** Pulumi's exit statuses. */
19
- export const PULUMI_EXIT = {
20
- success: 0,
21
- error: 1,
22
- configuration: 2,
23
- authentication: 3,
24
- resource: 4,
25
- policyViolation: 5,
26
- stackNotFound: 6,
27
- /** `--expect-no-changes` found changes. */
28
- noChanges: 7,
29
- cancelled: 8,
30
- timeout: 9,
31
- await: 10,
32
- internal: 255,
33
- } as const;
34
-
35
- /** plunge's exit status for a saved plan that moved, or one with no stamp (`pkg/backend/plunge/planstamp.go`, `ExitPlanMoved`). */
36
- export const PLUNGE_PLAN_MOVED_EXIT = 40;
37
-
38
- /**
39
- * The table's code for a `pulumi` or `plunge` exit status.
40
- *
41
- * | Pulumi or plunge | Table |
42
- * |---|---|
43
- * | 0 | `done` |
44
- * | 5 policy violation (a mandatory CrossGuard pack) | `denied` |
45
- * | 7 changes under `--expect-no-changes` (a drift job's refresh) | `drift` |
46
- * | plunge 40, a moved or unstamped plan | `moved` |
47
- * | 1, 2 configuration, 3 authentication, 4 resource, 6 stack not found, 8 cancelled, 9 timeout, 10 await, 255, anything else | `failed` |
48
- *
49
- * A configuration error is `failed`: the table has no usage code of its own.
50
- * Stock Pulumi's moved preview shape (`PlanShapeMovedError`) is core's moved
51
- * mark already and never reaches here as a code.
52
- */
53
- export function pulumiExitOf(code: number | null | undefined): ChantExitCode {
54
- switch (code) {
55
- case PULUMI_EXIT.success:
56
- return CHANT_EXIT.done;
57
- case PULUMI_EXIT.policyViolation:
58
- return CHANT_EXIT.denied;
59
- case PULUMI_EXIT.noChanges:
60
- return CHANT_EXIT.drift;
61
- case PLUNGE_PLAN_MOVED_EXIT:
62
- return CHANT_EXIT.moved;
63
- default:
64
- return CHANT_EXIT.failed;
65
- }
66
- }
67
-
68
- /** Whether a `pulumi` or `plunge` exit status is a plan that moved since its approval. */
69
- export function pulumiPlanMoved(code: number | null | undefined): boolean {
70
- return pulumiExitOf(code) === CHANT_EXIT.moved;
71
- }
package/src/index.ts DELETED
@@ -1,139 +0,0 @@
1
- export { pulumiPlugin } from "./plugin";
2
- export { pulumiSerializer } from "./serializer";
3
- export { pulumiConfigSchema, pulumiMemberConfigSchema, type PulumiConfig } from "./config";
4
- export { readPulumiMember, PULUMI_EXPORT_FILE, type PulumiMemberConfig, type PulumiMemberReport } from "./workspace-member";
5
- export {
6
- pulumiPreviewPart,
7
- pulumiPreviewDigest,
8
- pulumiResourceDigests,
9
- pulumiPlannedInputs,
10
- PULUMI_GENERATED,
11
- pulumiSteps,
12
- pulumiExportResources,
13
- type PulumiPreviewPartInput,
14
- type PulumiStep,
15
- type PulumiStepState,
16
- type PulumiExportedResource,
17
- } from "./change-set";
18
- export {
19
- pulumiRefreshArgs,
20
- pulumiRefreshDriftRecords,
21
- pulumiRefreshDocumentRecords,
22
- type PulumiRefreshRead,
23
- type PulumiRefreshDriftInput,
24
- type PulumiRefreshDocumentInput,
25
- } from "./drift-record";
26
- export {
27
- previewPulumiMember,
28
- previewPulumiMemberRead,
29
- refreshPulumiMember,
30
- pulumiMemberEngine,
31
- pulumiMemberStackOutputs,
32
- pulumiPreviewArgs,
33
- pulumiStackOutputArgs,
34
- runAllowedPlunge,
35
- runAllowedPulumi,
36
- readMemberExport,
37
- defaultPulumiRunner,
38
- PULUMI_ALLOWED_COMMANDS,
39
- PULUMI_APPLY_COMMANDS,
40
- runApplyPulumi,
41
- runApplyPlunge,
42
- pulumiUpArgs,
43
- plungeUpArgs,
44
- pulumiUpPreviewArgs,
45
- PULUMI_REVIEW_STACK_COMMANDS,
46
- REVIEW_STACK_NAME,
47
- isReviewStackName,
48
- reviewStackInitArgs,
49
- reviewStackDestroyArgs,
50
- reviewStackRmArgs,
51
- runReviewStackPulumi,
52
- runReviewStackPlunge,
53
- type PulumiPolicyPack,
54
- type PulumiApplyTail,
55
- type PulumiRunner,
56
- type PreviewPulumiMemberOptions,
57
- type PulumiMemberPreview,
58
- type PulumiMemberEngine,
59
- type PulumiMemberStackOutputsOptions,
60
- type RefreshPulumiMemberOptions,
61
- } from "./run";
62
- export { pulumiExportedStackOutputs, pulumiPlannedStackOutputs, type PulumiStackOutput } from "./stack-outputs";
63
- export { PULUMI_UNKNOWN, PULUMI_SIG_KEY, PULUMI_SECRET_SIG } from "./values";
64
- export {
65
- pulumiOutputSource,
66
- pulumiStackOutputSource,
67
- pulumiMemberPlannedOutputs,
68
- pulumiExportedOutputValues,
69
- pulumiPartHasChanges,
70
- PULUMI_APPLIED_OUTPUTS_ENV,
71
- type PulumiAppliedFrom,
72
- type PulumiOutputSourceOptions,
73
- } from "./member-outputs";
74
- export { pulumiCapabilityPlugin, PULUMI_VERB_FAMILIES } from "./capability-plugin";
75
- // The apply capability (#4541): a Pulumi or plunge stack as a component step that plans and applies.
76
- export {
77
- createPulumiUpCapability,
78
- pulumiReviewStep,
79
- PR_ENV_TEMPLATE_VARIABLE,
80
- pulumiUpCapability,
81
- pulumiUpMember,
82
- pulumiReleaseInputs,
83
- pulumiScratchConfig,
84
- pulumiDefaultLockGrain,
85
- PulumiPlanMovedError,
86
- PulumiPolicyDeniedError,
87
- PulumiAppliedShapeError,
88
- PulumiResourceGrainRefusedError,
89
- type PulumiUpStepInput,
90
- type PulumiUpStepOutput,
91
- type PulumiUpArtifact,
92
- type PulumiUpOptions,
93
- type PulumiLockGrain,
94
- } from "./pulumi-up";
95
- export { pulumiPlanShape, pulumiShapeDifferences, type PulumiPlanShapeOptions } from "./plan-shape";
96
- export { pulumiLockRows } from "./lock-rows";
97
- export {
98
- pulumiEngineEvents,
99
- pulumiStreamPreview,
100
- pulumiAppliedSteps,
101
- pulumiPolicyEvents,
102
- pulumiPolicyFindings,
103
- pulumiStreamSummary,
104
- crossGuardRule,
105
- PULUMI_STREAMING_PREVIEW_ENV,
106
- type PulumiEngineEvent,
107
- type PulumiPolicyViolation,
108
- type PulumiApplySummary,
109
- } from "./engine-events";
110
- export { readPulumiDrift, type PulumiDriftRunners } from "./drift-read";
111
- export { pulumiAuditCatalog } from "./lint/audit-catalog";
112
- // The Preview/Drift watch composite and its step builders (#4494).
113
- export { PulumiWatchOp, type PulumiWatchOpConfig, type PulumiWatchOpResources } from "./composites/pulumi-watch-op";
114
- export { gatedStackExport, gatedStackCancel, gatedStackMove, gatedStackAction, checkStackActionUrn, stackActionScope, stackActionSubject, PulumiStackActionRefused, PULUMI_ACTION_TYPE_PREFIX, type PulumiStackActionOptions, type PulumiStackActionResult, type PulumiStackActionRefusal, moveLeftovers, pulumiMoveDestStack, pulumiStackLockToCancel, stackOpApproveCommand, type PulumiLockToCancel, type PulumiLockToCancelRefusal, diyStackLockIds, diyStackLock, pulumiStackLockIds, pulumiStackVersionSource, PulumiStackOpRefused, type PulumiStackOpRefusal, type PulumiStackOpCheck, type PulumiStackExportResult, type PulumiStackCancelResult, type PulumiStackMoveResult, type PulumiStackLocks, PULUMI_STACK_OPS_OP, type PulumiStackOpOutcome, type PulumiStackOpCommon, type PulumiStackOpKind } from "./stack-ops";
115
- // Review stacks (INTENTIUS/plywood#15): pr-<n> stacks only.
116
- export {
117
- initReviewStack,
118
- removeReviewStack,
119
- parseReviewStackLocation,
120
- prNumberOf,
121
- pulumiTemplateStack,
122
- reviewConfigSource,
123
- reviewStackFor,
124
- reviewStackLocation,
125
- reviewStackTeardown,
126
- REVIEW_STACK_TEARDOWN,
127
- type ReviewStackOptions,
128
- type ReviewStackOutcome,
129
- type ReviewStackTeardown,
130
- type ReviewStackTeardownOptions,
131
- } from "./review-stack";
132
- export { pulumiStackReferences, parsePulumiStackName, stackReferenceOwner, PULUMI_STACK_REFERENCE_TYPE, type PulumiStackReference } from "./stack-references";
133
- export { PulumiAdoptOp, type PulumiAdoptOpConfig, type PulumiAdoptOpResources, type PulumiAdoptStack } from "./composites/pulumi-adopt-op";
134
- export { parsePlungeAdoptView, pulumiAdoptDigest, adoptBucketTarget, type PlungeAdoptView, type PlungeAdoptStatus } from "./adopt";
135
- export { pulumiPreview as pulumiPreviewStep, pulumiDrift as pulumiDriftStep } from "./op/builders";
136
- // Pulumi and plunge exit statuses on chant's exit-code table (#4553).
137
- export { pulumiExitOf, pulumiPlanMoved, PULUMI_EXIT, PLUNGE_PLAN_MOVED_EXIT } from "./exit-codes";
138
- // Which stack outputs a preview changes, traced through the export (#4635).
139
- export { pulumiPlannedOutputChanges, type PulumiOutputChange, type PulumiPlannedOutputChanges } from "./planned-output-changes";
@@ -1,85 +0,0 @@
1
- /**
2
- * `chant init --lexicon pulumi` templates (#4510).
3
- *
4
- * The lexicon declares no resources, so a template never writes a Pulumi
5
- * program. Each one writes a chant project beside an existing program, which
6
- * the templates expect in `./infra` (the directory that holds `Pulumi.yaml`
7
- * and the checked-in `stack-export.json`); change `dir` if yours is
8
- * elsewhere.
9
- *
10
- * - `member` (the default): `chant.config.ts` reads the member's graph into
11
- * the project's own build, so `chant build` and `chant lint` run PUL001 to
12
- * PUL015 against its export. `src/` declares nothing.
13
- * - `watch`: the same, plus `src/watch.op.ts`, a `PulumiWatchOp` that
14
- * previews the member and reads its drift every morning. It never applies.
15
- * - `plunge`: the watch for a member on plunge, with `engine: "plunge"` on
16
- * both the member read and the Op, so drift is `plunge drift --stream`.
17
- *
18
- * Each ships its own `chant.config.ts` (`root`), which `chant init` writes in
19
- * place of its generic one.
20
- */
21
- import type { InitTemplateSet } from "@intentius/chant/lexicon";
22
-
23
- function chantConfig(member: string): string {
24
- return `import type { ChantConfig } from "@intentius/chant/config";
25
- import "@intentius/chant-lexicon-pulumi";
26
-
27
- /**
28
- * Reads the Pulumi program in ./infra as a member. Its graph is the stack
29
- * export that chant's pulumi-up apply writes to refs/chant/snapshots after
30
- * each update, so nothing is checked in. A stack applied outside chant can
31
- * check in stack-export.json beside Pulumi.yaml instead, taken with
32
- * \`pulumi stack export --file stack-export.json\` after each update.
33
- * \`dir\` is relative to this file (PUL101 warns on an absolute one).
34
- */
35
- export default {
36
- lexicons: ["pulumi"],
37
- pulumi: {
38
- member: ${member},
39
- },
40
- } satisfies ChantConfig;
41
- `;
42
- }
43
-
44
- const NOTHING_DECLARED = `/**
45
- * Nothing is declared here. The Pulumi program in ./infra stays the source of
46
- * truth and \`pulumi up\` still applies it; chant.config.ts reads its checked-in
47
- * stack export into this build.
48
- */
49
- export {};
50
- `;
51
-
52
- function watchOp(engine?: "plunge"): string {
53
- return `import { PulumiWatchOp } from "@intentius/chant-lexicon-pulumi";
54
-
55
- /**
56
- * Preview the infra member and read its drift every morning at 06:00.
57
- * The run's outcomes are \`Changes\` (the preview plans something) and
58
- * \`Drift\` (resources drifted or missing). It changes nothing.
59
- * Run it once with \`chant run infra-watch\`.
60
- */
61
- export const { op } = PulumiWatchOp({
62
- name: "infra-watch",
63
- member: "infra",
64
- dir: "./infra",${engine ? `\n engine: "${engine}",` : ""}
65
- schedule: "0 6 * * *",
66
- });
67
-
68
- export default op;
69
- `;
70
- }
71
-
72
- export const pulumiInitTemplates: Record<"member" | "watch" | "plunge", InitTemplateSet> = {
73
- member: {
74
- src: { "infra.ts": NOTHING_DECLARED },
75
- root: { "chant.config.ts": chantConfig(`{ dir: "./infra", label: "infra" }`) },
76
- },
77
- watch: {
78
- src: { "infra.ts": NOTHING_DECLARED, "watch.op.ts": watchOp() },
79
- root: { "chant.config.ts": chantConfig(`{ dir: "./infra", label: "infra" }`) },
80
- },
81
- plunge: {
82
- src: { "infra.ts": NOTHING_DECLARED, "watch.op.ts": watchOp("plunge") },
83
- root: { "chant.config.ts": chantConfig(`{ dir: "./infra", label: "infra", engine: "plunge" }`) },
84
- },
85
- };
@@ -1,33 +0,0 @@
1
- import { describe, expect, test } from "vitest";
2
- import { pulumiPlugin } from "../plugin";
3
- import { pulumiAuditCatalog } from "./audit-catalog";
4
-
5
- describe("pulumiAuditCatalog (#4494)", () => {
6
- test("covers every post-synth check the plugin ships, and nothing else", () => {
7
- const ids = (pulumiPlugin.postSynthChecks?.() ?? []).map((c) => c.id).sort();
8
- expect(Object.keys(pulumiAuditCatalog).sort()).toEqual(ids);
9
- });
10
-
11
- test("the plugin contributes it", () => {
12
- expect(pulumiPlugin.auditCatalog?.()).toBe(pulumiAuditCatalog);
13
- });
14
-
15
- test("each entry is model-based guidance with no authority (#4510)", () => {
16
- for (const [id, meta] of Object.entries(pulumiAuditCatalog)) {
17
- expect(meta.id).toBe(id);
18
- expect(meta).toMatchObject({ fixKind: "guidance", yamlBased: false });
19
- expect(meta.authority).toBeUndefined();
20
- expect(meta.remediation.length).toBeGreaterThan(0);
21
- }
22
- });
23
-
24
- test("PUL003 is the one merge-worthy security entry; the rest are report-only", () => {
25
- for (const [id, meta] of Object.entries(pulumiAuditCatalog)) {
26
- if (id === "PUL003") expect(meta).toMatchObject({ tier: "merge-worthy", category: "security" });
27
- else {
28
- expect(meta.tier).toBe("report-only");
29
- expect(["correctness", "best-practice"]).toContain(meta.category);
30
- }
31
- }
32
- });
33
- });