@homeflare/alchemy 0.7.0 → 0.10.0

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 (312) hide show
  1. package/README.md +45 -45
  2. package/dist/caddy/config-lifecycle.d.ts +49 -3
  3. package/dist/caddy/config-lifecycle.d.ts.map +1 -1
  4. package/dist/caddy/config.d.ts +6 -2
  5. package/dist/caddy/config.d.ts.map +1 -1
  6. package/dist/caddy/fake-caddy.d.ts +11 -0
  7. package/dist/caddy/fake-caddy.d.ts.map +1 -1
  8. package/dist/caddy/index.d.ts +2 -1
  9. package/dist/caddy/index.d.ts.map +1 -1
  10. package/dist/caddy/index.js +270 -44
  11. package/dist/caddy/index.js.map +15 -11
  12. package/dist/caddy/with-file.d.ts +7 -3
  13. package/dist/caddy/with-file.d.ts.map +1 -1
  14. package/dist/launchd/fake-runner.d.ts +1 -0
  15. package/dist/launchd/fake-runner.d.ts.map +1 -1
  16. package/dist/launchd/fake-sudo.d.ts +51 -0
  17. package/dist/launchd/fake-sudo.d.ts.map +1 -0
  18. package/dist/launchd/host-effect.d.ts +1 -1
  19. package/dist/launchd/host-file-form.d.ts +5 -0
  20. package/dist/launchd/host-file-form.d.ts.map +1 -1
  21. package/dist/launchd/host-file-lifecycle.d.ts +14 -1
  22. package/dist/launchd/host-file-lifecycle.d.ts.map +1 -1
  23. package/dist/launchd/host-file.d.ts +2 -1
  24. package/dist/launchd/host-file.d.ts.map +1 -1
  25. package/dist/launchd/index.d.ts +2 -0
  26. package/dist/launchd/index.d.ts.map +1 -1
  27. package/dist/launchd/index.js +642 -49
  28. package/dist/launchd/index.js.map +24 -14
  29. package/dist/launchd/job-lifecycle.d.ts +8 -1
  30. package/dist/launchd/job-lifecycle.d.ts.map +1 -1
  31. package/dist/launchd/job-preflight.d.ts +13 -1
  32. package/dist/launchd/job-preflight.d.ts.map +1 -1
  33. package/dist/launchd/job-validate.d.ts +2 -0
  34. package/dist/launchd/job-validate.d.ts.map +1 -1
  35. package/dist/launchd/job.d.ts +2 -1
  36. package/dist/launchd/job.d.ts.map +1 -1
  37. package/dist/launchd/local-runner.d.ts +2 -0
  38. package/dist/launchd/local-runner.d.ts.map +1 -1
  39. package/dist/launchd/providers.d.ts +2 -1
  40. package/dist/launchd/providers.d.ts.map +1 -1
  41. package/dist/launchd/runner.d.ts +14 -5
  42. package/dist/launchd/runner.d.ts.map +1 -1
  43. package/dist/launchd/sudo-acl.d.ts +25 -0
  44. package/dist/launchd/sudo-acl.d.ts.map +1 -0
  45. package/dist/launchd/sudo-allowlist.d.ts +47 -0
  46. package/dist/launchd/sudo-allowlist.d.ts.map +1 -0
  47. package/dist/launchd/sudo-guard.d.ts +83 -0
  48. package/dist/launchd/sudo-guard.d.ts.map +1 -0
  49. package/dist/launchd/sudo-runner.d.ts +60 -0
  50. package/dist/launchd/sudo-runner.d.ts.map +1 -0
  51. package/dist/launchd/sudo-said.d.ts +10 -0
  52. package/dist/launchd/sudo-said.d.ts.map +1 -0
  53. package/dist/launchd/sudo-stage.d.ts +7 -0
  54. package/dist/launchd/sudo-stage.d.ts.map +1 -0
  55. package/dist/openbao/auth-method-reconcile.d.ts +6 -2
  56. package/dist/openbao/auth-method-reconcile.d.ts.map +1 -1
  57. package/dist/openbao/auth-method.d.ts.map +1 -1
  58. package/dist/openbao/auth-role-form.d.ts +0 -9
  59. package/dist/openbao/auth-role-form.d.ts.map +1 -1
  60. package/dist/openbao/auth-role.d.ts +3 -2
  61. package/dist/openbao/auth-role.d.ts.map +1 -1
  62. package/dist/openbao/cloudflare-role.d.ts.map +1 -1
  63. package/dist/openbao/fake-bao.d.ts +18 -0
  64. package/dist/openbao/fake-bao.d.ts.map +1 -1
  65. package/dist/openbao/fake-core.d.ts +39 -0
  66. package/dist/openbao/fake-core.d.ts.map +1 -0
  67. package/dist/openbao/fake-engines-roles.d.ts +32 -0
  68. package/dist/openbao/fake-engines-roles.d.ts.map +1 -0
  69. package/dist/openbao/fake-engines.d.ts +8 -2
  70. package/dist/openbao/fake-engines.d.ts.map +1 -1
  71. package/dist/openbao/fake-families.d.ts +52 -0
  72. package/dist/openbao/fake-families.d.ts.map +1 -0
  73. package/dist/openbao/fake-mounts.d.ts +16 -0
  74. package/dist/openbao/fake-mounts.d.ts.map +1 -0
  75. package/dist/openbao/fake-stack.d.ts +5 -1
  76. package/dist/openbao/fake-stack.d.ts.map +1 -1
  77. package/dist/openbao/host-approles.d.ts.map +1 -1
  78. package/dist/openbao/index.js +709 -359
  79. package/dist/openbao/index.js.map +32 -25
  80. package/dist/openbao/jwt-config.d.ts +5 -0
  81. package/dist/openbao/jwt-config.d.ts.map +1 -1
  82. package/dist/openbao/jwt-role.d.ts +2 -1
  83. package/dist/openbao/jwt-role.d.ts.map +1 -1
  84. package/dist/openbao/kubernetes-role.d.ts +2 -1
  85. package/dist/openbao/kubernetes-role.d.ts.map +1 -1
  86. package/dist/openbao/mfa-enforcement.d.ts +12 -5
  87. package/dist/openbao/mfa-enforcement.d.ts.map +1 -1
  88. package/dist/openbao/mfa-totp.d.ts +6 -2
  89. package/dist/openbao/mfa-totp.d.ts.map +1 -1
  90. package/dist/openbao/mount-reconcile.d.ts +5 -1
  91. package/dist/openbao/mount-reconcile.d.ts.map +1 -1
  92. package/dist/openbao/mount.d.ts.map +1 -1
  93. package/dist/openbao/pki-role.d.ts.map +1 -1
  94. package/dist/openbao/plugin-reconcile.d.ts +6 -2
  95. package/dist/openbao/plugin-reconcile.d.ts.map +1 -1
  96. package/dist/openbao/plugin.d.ts.map +1 -1
  97. package/dist/openbao/policy.d.ts.map +1 -1
  98. package/dist/openbao/proxmox-role.d.ts.map +1 -1
  99. package/dist/openbao/rename-identity.d.ts +69 -0
  100. package/dist/openbao/rename-identity.d.ts.map +1 -0
  101. package/dist/openbao/rename.d.ts +13 -12
  102. package/dist/openbao/rename.d.ts.map +1 -1
  103. package/dist/openbao/role-reconcile.d.ts +11 -1
  104. package/dist/openbao/role-reconcile.d.ts.map +1 -1
  105. package/dist/openbao/ssh-role-erase.d.ts +11 -0
  106. package/dist/openbao/ssh-role-erase.d.ts.map +1 -0
  107. package/dist/openbao/ssh-role.d.ts.map +1 -1
  108. package/dist/ownership/adopt.d.ts +52 -0
  109. package/dist/ownership/adopt.d.ts.map +1 -0
  110. package/dist/ownership/probe.d.ts +13 -0
  111. package/dist/ownership/probe.d.ts.map +1 -0
  112. package/dist/ownership/resume.d.ts +40 -0
  113. package/dist/ownership/resume.d.ts.map +1 -0
  114. package/dist/ownership/rows.d.ts +33 -0
  115. package/dist/ownership/rows.d.ts.map +1 -0
  116. package/dist/ownership/whole.d.ts +14 -0
  117. package/dist/ownership/whole.d.ts.map +1 -0
  118. package/dist/proxmox/ceph-pool-form.d.ts +3 -3
  119. package/dist/proxmox/ceph-pool.d.ts.map +1 -1
  120. package/dist/proxmox/fake-bao-env.d.ts +3 -0
  121. package/dist/proxmox/fake-bao-env.d.ts.map +1 -0
  122. package/dist/proxmox/fake-pve-lxc.d.ts +42 -0
  123. package/dist/proxmox/fake-pve-lxc.d.ts.map +1 -0
  124. package/dist/proxmox/fake-pve.d.ts +38 -0
  125. package/dist/proxmox/fake-pve.d.ts.map +1 -0
  126. package/dist/proxmox/index.d.ts +6 -2
  127. package/dist/proxmox/index.d.ts.map +1 -1
  128. package/dist/proxmox/index.js +970 -186
  129. package/dist/proxmox/index.js.map +22 -9
  130. package/dist/proxmox/lxc-create-form.d.ts +6 -0
  131. package/dist/proxmox/lxc-create-form.d.ts.map +1 -0
  132. package/dist/proxmox/lxc-harness.d.ts +34 -0
  133. package/dist/proxmox/lxc-harness.d.ts.map +1 -0
  134. package/dist/proxmox/lxc-identity.d.ts +18 -0
  135. package/dist/proxmox/lxc-identity.d.ts.map +1 -0
  136. package/dist/proxmox/lxc-judge.d.ts +46 -0
  137. package/dist/proxmox/lxc-judge.d.ts.map +1 -0
  138. package/dist/proxmox/lxc-lifecycle.d.ts +68 -0
  139. package/dist/proxmox/lxc-lifecycle.d.ts.map +1 -0
  140. package/dist/proxmox/lxc-props.d.ts +139 -0
  141. package/dist/proxmox/lxc-props.d.ts.map +1 -0
  142. package/dist/proxmox/lxc-volume.d.ts +29 -0
  143. package/dist/proxmox/lxc-volume.d.ts.map +1 -0
  144. package/dist/proxmox/lxc-wire.d.ts +51 -0
  145. package/dist/proxmox/lxc-wire.d.ts.map +1 -0
  146. package/dist/proxmox/lxc.d.ts +27 -47
  147. package/dist/proxmox/lxc.d.ts.map +1 -1
  148. package/dist/proxmox/network-apply-read.d.ts +1 -1
  149. package/dist/proxmox/network-apply-read.d.ts.map +1 -1
  150. package/dist/proxmox/pbs-datastore.d.ts.map +1 -1
  151. package/dist/proxmox/resource.d.ts.map +1 -1
  152. package/dist/proxmox/update-guard.d.ts +27 -0
  153. package/dist/proxmox/update-guard.d.ts.map +1 -0
  154. package/dist/verify/args.d.ts +16 -0
  155. package/dist/verify/args.d.ts.map +1 -0
  156. package/dist/verify/cli.d.ts +3 -0
  157. package/dist/verify/cli.d.ts.map +1 -0
  158. package/dist/verify/cli.js +320 -0
  159. package/dist/verify/cli.js.map +15 -0
  160. package/dist/verify/fake-engine.d.ts +57 -0
  161. package/dist/verify/fake-engine.d.ts.map +1 -0
  162. package/dist/verify/index.d.ts +16 -0
  163. package/dist/verify/index.d.ts.map +1 -0
  164. package/dist/verify/index.js +297 -0
  165. package/dist/verify/index.js.map +14 -0
  166. package/dist/verify/report.d.ts +6 -0
  167. package/dist/verify/report.d.ts.map +1 -0
  168. package/dist/verify/rows.d.ts +57 -0
  169. package/dist/verify/rows.d.ts.map +1 -0
  170. package/dist/verify/spy.d.ts +31 -0
  171. package/dist/verify/spy.d.ts.map +1 -0
  172. package/dist/verify/verify.d.ts +43 -0
  173. package/dist/verify/verify.d.ts.map +1 -0
  174. package/docs/adopt-verify.md +108 -0
  175. package/docs/adopted-deploys.md +85 -0
  176. package/docs/caddy-admin.md +24 -0
  177. package/docs/caddy.md +73 -54
  178. package/docs/credentials.md +15 -0
  179. package/docs/launchd-sudo.md +147 -0
  180. package/docs/launchd.md +14 -7
  181. package/docs/ownership.md +113 -0
  182. package/docs/peers.md +39 -0
  183. package/docs/proxmox-lxc.md +196 -0
  184. package/docs/proxmox.md +12 -0
  185. package/package.json +9 -2
  186. package/src/caddy/adopt-scope.test.ts +82 -0
  187. package/src/caddy/config-adopt.test.ts +235 -0
  188. package/src/caddy/config-lifecycle.test.ts +31 -53
  189. package/src/caddy/config-lifecycle.ts +98 -7
  190. package/src/caddy/config.ts +48 -10
  191. package/src/caddy/fake-caddy.ts +19 -0
  192. package/src/caddy/index.ts +2 -1
  193. package/src/caddy/providers.test.ts +8 -23
  194. package/src/caddy/with-file.ts +7 -3
  195. package/src/launchd/adopt-apply.test.ts +166 -0
  196. package/src/launchd/fake-runner.ts +26 -4
  197. package/src/launchd/fake-sudo.ts +136 -0
  198. package/src/launchd/host-effect.ts +1 -1
  199. package/src/launchd/host-file-form.ts +10 -2
  200. package/src/launchd/host-file-lifecycle.ts +41 -15
  201. package/src/launchd/host-file.ts +13 -4
  202. package/src/launchd/index.ts +2 -0
  203. package/src/launchd/job-lifecycle.ts +22 -14
  204. package/src/launchd/job-preflight.ts +21 -3
  205. package/src/launchd/job-validate.ts +1 -1
  206. package/src/launchd/job.ts +13 -4
  207. package/src/launchd/local-runner.ts +6 -3
  208. package/src/launchd/providers.test.ts +3 -0
  209. package/src/launchd/providers.ts +2 -1
  210. package/src/launchd/runner.ts +14 -5
  211. package/src/launchd/sudo-acl.ts +68 -0
  212. package/src/launchd/sudo-allowlist.test.ts +191 -0
  213. package/src/launchd/sudo-allowlist.ts +213 -0
  214. package/src/launchd/sudo-chain.test.ts +121 -0
  215. package/src/launchd/sudo-guard.test.ts +100 -0
  216. package/src/launchd/sudo-guard.ts +230 -0
  217. package/src/launchd/sudo-lifecycle.test.ts +172 -0
  218. package/src/launchd/sudo-modes.test.ts +135 -0
  219. package/src/launchd/sudo-runner-files.test.ts +240 -0
  220. package/src/launchd/sudo-runner.test.ts +126 -0
  221. package/src/launchd/sudo-runner.ts +216 -0
  222. package/src/launchd/sudo-said.ts +58 -0
  223. package/src/launchd/sudo-stage.ts +28 -0
  224. package/src/openbao/README.md +11 -2
  225. package/src/openbao/REPLACE.md +67 -37
  226. package/src/openbao/adopt-core.test.ts +119 -0
  227. package/src/openbao/adopt-families.test.ts +97 -0
  228. package/src/openbao/adopt-holes.test.ts +168 -0
  229. package/src/openbao/adopt-recovery.test.ts +71 -0
  230. package/src/openbao/auth-method-reconcile.ts +15 -3
  231. package/src/openbao/auth-method.ts +15 -6
  232. package/src/openbao/auth-role-form.test.ts +2 -16
  233. package/src/openbao/auth-role-form.ts +0 -11
  234. package/src/openbao/auth-role.ts +48 -17
  235. package/src/openbao/cloudflare-role.ts +23 -18
  236. package/src/openbao/fake-bao.ts +52 -0
  237. package/src/openbao/fake-core.ts +141 -0
  238. package/src/openbao/fake-engines-roles.ts +114 -0
  239. package/src/openbao/fake-engines.ts +18 -11
  240. package/src/openbao/fake-families.ts +188 -0
  241. package/src/openbao/fake-mounts.ts +74 -0
  242. package/src/openbao/fake-stack.ts +17 -4
  243. package/src/openbao/host-approles.test.ts +15 -2
  244. package/src/openbao/host-approles.ts +19 -4
  245. package/src/openbao/jwt-config.ts +35 -11
  246. package/src/openbao/jwt-role.ts +33 -14
  247. package/src/openbao/kubernetes-role.ts +32 -14
  248. package/src/openbao/mfa-enforcement.ts +42 -13
  249. package/src/openbao/mfa-totp.ts +42 -14
  250. package/src/openbao/mount-move.test.ts +2 -35
  251. package/src/openbao/mount-reconcile.ts +13 -2
  252. package/src/openbao/mount.ts +15 -6
  253. package/src/openbao/pki-role.ts +33 -10
  254. package/src/openbao/plugin-reconcile.ts +16 -5
  255. package/src/openbao/plugin.ts +57 -20
  256. package/src/openbao/policy.ts +24 -11
  257. package/src/openbao/proxmox-role.ts +20 -20
  258. package/src/openbao/rename-adoption.test.ts +95 -0
  259. package/src/openbao/rename-families.test.ts +122 -0
  260. package/src/openbao/rename-identity.test.ts +129 -0
  261. package/src/openbao/rename-identity.ts +117 -0
  262. package/src/openbao/rename.ts +19 -15
  263. package/src/openbao/role-reconcile.ts +23 -0
  264. package/src/openbao/ssh-role-erase.ts +50 -0
  265. package/src/openbao/ssh-role.ts +29 -57
  266. package/src/ownership/adopt.ts +122 -0
  267. package/src/ownership/ownership.test.ts +200 -0
  268. package/src/ownership/probe.ts +65 -0
  269. package/src/ownership/resume.ts +118 -0
  270. package/src/ownership/rows.ts +117 -0
  271. package/src/ownership/whole.test.ts +39 -0
  272. package/src/ownership/whole.ts +60 -0
  273. package/src/proxmox/adopt-noop.test.ts +112 -0
  274. package/src/proxmox/ceph-pool-adopt.test.ts +88 -0
  275. package/src/proxmox/ceph-pool-form.ts +3 -3
  276. package/src/proxmox/ceph-pool.ts +10 -3
  277. package/src/proxmox/fake-bao-env.ts +28 -0
  278. package/src/proxmox/fake-pve-lxc.ts +210 -0
  279. package/src/proxmox/fake-pve.ts +75 -0
  280. package/src/proxmox/index.test.ts +6 -6
  281. package/src/proxmox/index.ts +6 -2
  282. package/src/proxmox/lxc-adopt.test.ts +170 -0
  283. package/src/proxmox/lxc-create-form.ts +76 -0
  284. package/src/proxmox/lxc-create.test.ts +126 -0
  285. package/src/proxmox/lxc-guards.test.ts +158 -0
  286. package/src/proxmox/lxc-harness.ts +150 -0
  287. package/src/proxmox/lxc-identity.ts +43 -0
  288. package/src/proxmox/lxc-judge.test.ts +175 -0
  289. package/src/proxmox/lxc-judge.ts +196 -0
  290. package/src/proxmox/lxc-lifecycle.ts +200 -0
  291. package/src/proxmox/lxc-ownership.test.ts +159 -0
  292. package/src/proxmox/lxc-props.ts +215 -0
  293. package/src/proxmox/lxc-read.test.ts +60 -0
  294. package/src/proxmox/lxc-volume.test.ts +96 -0
  295. package/src/proxmox/lxc-volume.ts +153 -0
  296. package/src/proxmox/lxc-wire.ts +210 -0
  297. package/src/proxmox/lxc.ts +216 -93
  298. package/src/proxmox/network-apply-read.ts +3 -1
  299. package/src/proxmox/pbs-datastore.ts +4 -3
  300. package/src/proxmox/resource.ts +7 -7
  301. package/src/proxmox/update-guard.ts +31 -0
  302. package/src/verify/args.ts +82 -0
  303. package/src/verify/cli.test.ts +86 -0
  304. package/src/verify/cli.ts +49 -0
  305. package/src/verify/fake-engine.ts +158 -0
  306. package/src/verify/index.ts +36 -0
  307. package/src/verify/report.ts +52 -0
  308. package/src/verify/rows.ts +169 -0
  309. package/src/verify/spy.test.ts +141 -0
  310. package/src/verify/spy.ts +149 -0
  311. package/src/verify/verify.test.ts +124 -0
  312. package/src/verify/verify.ts +172 -0
@@ -0,0 +1,297 @@
1
+ // src/verify/args.ts
2
+ import { parseArgs } from "node:util";
3
+ var USAGE = `Usage: hf-adopt-verify --stage <stage> [--config alchemy.run.ts] [options]
4
+
5
+ Plans the stack with Alchemy's own planner, never writes, and reports each row
6
+ without a state row: what the engine planned, the provider's read and its own
7
+ diff (before Alchemy forces adopted rows to update), and the declared fields
8
+ that differ from the live object. Exits 0 when every row is a no-op, 1 when
9
+ any is not, 2 when it could not tell.
10
+
11
+ -c, --config <file> stack entrypoint (default alchemy.run.ts)
12
+ --stage <stage> stage to verify (default $ALCHEMY_STAGE; required)
13
+ --profile <name> Alchemy auth profile
14
+ --env-file <file> .env file layered under the environment
15
+ --all report every declared row and pending deletion
16
+ --json print the report as JSON
17
+ -h, --help this text
18
+ `;
19
+ var parse = (argv) => parseArgs({
20
+ args: [...argv],
21
+ allowPositionals: false,
22
+ options: {
23
+ all: { type: "boolean", default: false },
24
+ config: { type: "string", short: "c", default: "alchemy.run.ts" },
25
+ "env-file": { type: "string" },
26
+ help: { type: "boolean", short: "h", default: false },
27
+ json: { type: "boolean", default: false },
28
+ profile: { type: "string" },
29
+ stage: { type: "string" }
30
+ },
31
+ strict: true
32
+ });
33
+ var parseVerifyArgs = (argv, env) => {
34
+ let parsed;
35
+ try {
36
+ parsed = parse(argv);
37
+ } catch (error) {
38
+ return { kind: "error", message: error instanceof Error ? error.message : String(error) };
39
+ }
40
+ const { values } = parsed;
41
+ if (values.help)
42
+ return { kind: "help" };
43
+ const stage = values.stage ?? env["ALCHEMY_STAGE"];
44
+ if (stage === undefined || stage === "") {
45
+ return { kind: "error", message: "pass --stage (or set ALCHEMY_STAGE): no stage is guessed" };
46
+ }
47
+ const target = {
48
+ entrypoint: values.config,
49
+ stage,
50
+ ...values.profile === undefined ? {} : { profile: values.profile },
51
+ ...values["env-file"] === undefined ? {} : { envFile: values["env-file"] }
52
+ };
53
+ return { json: values.json, kind: "run", options: { all: values.all }, target };
54
+ };
55
+ // src/verify/report.ts
56
+ var exitCodeOf = (report) => report.rows.every((row) => row.ok) ? 0 : 1;
57
+ var pad = (text, width) => text.padEnd(width);
58
+ var line = (row, widths) => {
59
+ const head = [
60
+ row.ok ? "ok " : "FAIL",
61
+ pad(row.planned, widths.planned),
62
+ pad(row.diff, 8),
63
+ pad(row.read, 9),
64
+ pad(row.type, widths.type),
65
+ row.fqn
66
+ ].join(" ");
67
+ const changed = row.changed.length > 0 ? ` changed: ${row.changed.join(", ")}` : "";
68
+ return row.why === "" ? `${head}${changed}` : `${head}${changed}
69
+ ${row.why}`;
70
+ };
71
+ var formatReport = (report, all) => {
72
+ const scope = all ? "every row" : "rows without state";
73
+ const title = `hf-adopt-verify ${report.stack}/${report.stage}: ${String(report.rows.length)} ${scope} (of ${String(report.declared)} declared)`;
74
+ if (report.rows.length === 0) {
75
+ return `${title}
76
+ nothing to verify — every declared row already has state. --all checks those too.
77
+ `;
78
+ }
79
+ const widths = {
80
+ planned: Math.max(7, ...report.rows.map((row) => row.planned.length)),
81
+ type: Math.max(4, ...report.rows.map((row) => row.type.length))
82
+ };
83
+ const header = [" ", pad("planned", widths.planned), pad("diff", 8), pad("read", 9)].concat([pad("type", widths.type), "fqn"]).join(" ");
84
+ const failed = report.rows.filter((row) => !row.ok).length;
85
+ const verdict = failed === 0 ? "every row is a no-op: the deploy writes nothing to them" : `${String(failed)} row(s) are NOT a no-op: the deploy would write, create or delete`;
86
+ return [title, "", header, ...report.rows.map((row) => line(row, widths)), "", verdict, ""].join(`
87
+ `);
88
+ };
89
+ // src/verify/rows.ts
90
+ import { deepEqual, isResolved } from "alchemy/Diff";
91
+ var changedFields = (declared, live) => {
92
+ if (typeof declared !== "object" || declared === null)
93
+ return [];
94
+ if (typeof live !== "object" || live === null)
95
+ return [];
96
+ const actual = live;
97
+ return Object.entries(declared).filter(([key, value]) => value !== undefined && (key in actual) && isResolved(value)).filter(([key, value]) => !deepEqual(value, actual[key])).map(([key]) => key).sort();
98
+ };
99
+ var STILL_LIVE = new Set(["adopted", "noop"]);
100
+ var isNoop = (planned, diff, stateRow) => STILL_LIVE.has(planned) && (diff === "noop" || diff === "none" && stateRow && planned === "noop");
101
+ var reason = (row, ok) => {
102
+ if (ok)
103
+ return row.read === "unowned" ? "unowned: the deploy needs --adopt or adopt(true)" : "";
104
+ if (isNoop(row.planned, row.diff, row.stateRow)) {
105
+ return `${String(row.bindings)} binding(s) change: the deploy reconciles them though the diff is noop`;
106
+ }
107
+ if (row.planned === "delete")
108
+ return "no longer declared: the deploy deletes it";
109
+ if (row.planned === "orphaned")
110
+ return "no longer declared: the deploy drops its state (retain)";
111
+ if (row.read === "failed")
112
+ return "the verifier's own read of it failed";
113
+ if (row.planned === "create") {
114
+ if (row.stateRow)
115
+ return "an interrupted create: the deploy finishes creating it";
116
+ return row.read === "absent" ? "the read found nothing, so the deploy CREATES it (a lane that cannot see it reads the same)" : "never probed (a prop is an Output of another resource, or the provider has no read): " + "the deploy CREATES it";
117
+ }
118
+ if (row.diff === "update")
119
+ return "the provider's diff says update: the deploy writes";
120
+ if (row.diff === "replace")
121
+ return "the provider's diff says replace: a new one, then a delete";
122
+ if (row.diff === "none") {
123
+ return "the provider has no diff, so the engine compared the declaration with itself";
124
+ }
125
+ return `the engine plans ${row.planned} although the diff says ${row.diff} (a renamed row, changed bindings or --force)`;
126
+ };
127
+ var rowFor = (fqn, node, stateRow, seen) => {
128
+ const observed = seen.get(fqn);
129
+ const base = {
130
+ bindings: (node.bindings ?? []).filter((binding) => binding.action !== "noop").length,
131
+ changed: changedFields(observed?.diff?.news, observed?.read?.attributes),
132
+ diff: observed?.diff?.answer ?? "not-run",
133
+ fqn,
134
+ planned: node.action,
135
+ read: observed?.read?.answer ?? "not-read",
136
+ stateRow,
137
+ type: node.resource.Type
138
+ };
139
+ const ok = isNoop(base.planned, base.diff, stateRow) && base.bindings === 0;
140
+ return { ...base, ok, why: reason(base, ok) };
141
+ };
142
+ var taskRow = (fqn, task) => ({
143
+ bindings: 0,
144
+ changed: [],
145
+ diff: "not-run",
146
+ fqn,
147
+ ok: task.action === "noop",
148
+ planned: task.action,
149
+ read: "not-read",
150
+ stateRow: task.action !== "run",
151
+ type: task.def.Type,
152
+ why: task.action === "noop" ? "" : `a stack task: the deploy will ${task.action} it`
153
+ });
154
+ var rowsOf = (plan, stateRows, seen, all) => {
155
+ const declared = Object.entries(plan.resources).filter(([fqn]) => all || !stateRows.has(fqn)).map(([fqn, node]) => rowFor(fqn, node, stateRows.has(fqn), seen));
156
+ const removed = all ? Object.entries(plan.deletions).flatMap(([fqn, node]) => node === undefined ? [] : [rowFor(fqn, node, true, seen)]) : [];
157
+ const tasks = Object.entries(plan.actions ?? {}).flatMap(([fqn, task]) => task === undefined || !all && task.action === "noop" ? [] : [taskRow(fqn, task)]);
158
+ return [...declared, ...removed, ...tasks].sort((a, b) => a.fqn.localeCompare(b.fqn));
159
+ };
160
+ // src/verify/spy.ts
161
+ import { Unowned, stripUnowned } from "alchemy/AdoptPolicy";
162
+ import {
163
+ isProviderCollectionService,
164
+ isProviderService
165
+ } from "alchemy/Provider";
166
+ import * as Context from "effect/Context";
167
+ import * as Effect from "effect/Effect";
168
+ var seenFor = (seen, fqn) => {
169
+ const existing = seen.get(fqn);
170
+ if (existing !== undefined)
171
+ return existing;
172
+ const fresh = {};
173
+ seen.set(fqn, fresh);
174
+ return fresh;
175
+ };
176
+ var WRITE_REFUSED = "hf-adopt-verify never writes";
177
+ var refuse = (type, operation) => () => Effect.die(new Error(`${WRITE_REFUSED}: ${type}.${operation} was called during a verification. Alchemy's planner ` + "does not call it, so something other than Plan.make is driving these providers."));
178
+ var readAnswer = (attributes) => attributes === undefined ? "absent" : Unowned.is(attributes) ? "unowned" : "found";
179
+ var diffAnswer = (diff) => {
180
+ const action = diff?.action;
181
+ return action === "noop" || action === "update" || action === "replace" ? action : "none";
182
+ };
183
+ var spyService = (type, service, seen) => {
184
+ const read = service.read;
185
+ const diff = service.diff;
186
+ const modes = service.modes;
187
+ const watched = {
188
+ ...service,
189
+ diff: (input) => (diff === undefined ? Effect.succeed(undefined) : diff(input)).pipe(Effect.tap((answer) => Effect.sync(() => {
190
+ seenFor(seen, input.fqn).diff = { answer: diffAnswer(answer), news: input.news };
191
+ }))),
192
+ reconcile: refuse(type, "reconcile"),
193
+ delete: refuse(type, "delete")
194
+ };
195
+ if (read !== undefined) {
196
+ watched.read = (input) => read(input).pipe(Effect.tap((answer) => Effect.sync(() => {
197
+ const attributes = answer === undefined ? undefined : stripUnowned(answer);
198
+ seenFor(seen, input.fqn).read = { answer: readAnswer(answer), attributes };
199
+ })));
200
+ }
201
+ if (service.precreate !== undefined)
202
+ watched.precreate = refuse(type, "precreate");
203
+ if (modes !== undefined) {
204
+ watched.modes = {
205
+ live: Effect.map(modes.live, (variant) => spyService(type, variant, seen)),
206
+ local: Effect.map(modes.local, (variant) => spyService(type, variant, seen))
207
+ };
208
+ }
209
+ return watched;
210
+ };
211
+ var spyCollection = (collection, seen) => {
212
+ const providers = Object.fromEntries(Object.entries(collection.providers).map(([type, service]) => [
213
+ type,
214
+ spyService(type, service, seen)
215
+ ]));
216
+ return { ...collection, get: (type) => providers[type], providers };
217
+ };
218
+ var spyContext = (context, seen) => {
219
+ const services = new Map;
220
+ for (const [key, value] of context.mapUnsafe) {
221
+ services.set(key, isProviderService(value) ? spyService(key, value, seen) : isProviderCollectionService(value) ? spyCollection(value, seen) : value);
222
+ }
223
+ return Context.makeUnsafe(services);
224
+ };
225
+ // src/verify/verify.ts
226
+ import * as Alchemist from "alchemy/Alchemist";
227
+ import {
228
+ ArtifactStore,
229
+ Artifacts,
230
+ createArtifactStore,
231
+ makeScopedArtifacts
232
+ } from "alchemy/Artifacts";
233
+ import { InstanceId } from "alchemy/InstanceId";
234
+ import * as Plan from "alchemy/Plan";
235
+ import { State, isActionState } from "alchemy/State";
236
+ import * as Effect2 from "effect/Effect";
237
+ import * as Option from "effect/Option";
238
+ var readWithState = (fqn, node) => Effect2.gen(function* () {
239
+ const read = node.provider?.read;
240
+ if (read === undefined || node.state === undefined)
241
+ return;
242
+ const store = Option.getOrElse(yield* Effect2.serviceOption(ArtifactStore), createArtifactStore);
243
+ yield* read({
244
+ fqn,
245
+ id: node.resource.LogicalId,
246
+ instanceId: node.state.instanceId,
247
+ olds: node.state.props,
248
+ output: node.state.attr
249
+ }).pipe(Effect2.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect2.provideService(InstanceId, node.state.instanceId));
250
+ });
251
+ var withState = (stack, fqns) => Effect2.gen(function* () {
252
+ const store = yield* yield* State;
253
+ const found = yield* Effect2.all(fqns.map((fqn) => store.get({ fqn, stack: stack.name, stage: stack.stage }).pipe(Effect2.map((row) => row === undefined || isActionState(row) ? [] : [fqn]))), { concurrency: 8 });
254
+ return new Set(found.flat());
255
+ });
256
+ var verifySession = (session, options = {}) => {
257
+ const seen = new Map;
258
+ const all2 = options.all === true;
259
+ const plan = Plan.make(session.stack);
260
+ return Effect2.gen(function* () {
261
+ const planned = yield* plan;
262
+ const stateRows = yield* withState(session.stack, Object.keys(planned.resources));
263
+ if (all2) {
264
+ const stateful = Object.entries(planned.resources).filter(([fqn]) => stateRows.has(fqn));
265
+ yield* Effect2.all(stateful.map(([fqn, node]) => readWithState(fqn, node).pipe(Effect2.catchCause(() => Effect2.sync(() => {
266
+ const entry = seen.get(fqn) ?? {};
267
+ entry.read = { answer: "failed", attributes: undefined };
268
+ seen.set(fqn, entry);
269
+ })))), { concurrency: 8 });
270
+ }
271
+ return {
272
+ declared: Object.keys(planned.resources).length,
273
+ rows: rowsOf(planned, stateRows, seen, all2),
274
+ stack: session.stack.name,
275
+ stage: session.stack.stage
276
+ };
277
+ }).pipe(Effect2.provide(spyContext(session.context, seen)), Effect2.scoped);
278
+ };
279
+ var verifyStack = (target, options = {}) => Effect2.gen(function* () {
280
+ const session = yield* Alchemist.open(target, { adopt: true });
281
+ return yield* verifySession(session, options);
282
+ }).pipe(Effect2.scoped, Effect2.provide(Alchemist.layer()));
283
+ export {
284
+ USAGE,
285
+ WRITE_REFUSED,
286
+ changedFields,
287
+ exitCodeOf,
288
+ formatReport,
289
+ parseVerifyArgs,
290
+ rowsOf,
291
+ spyContext,
292
+ verifySession,
293
+ verifyStack
294
+ };
295
+
296
+ //# debugId=903C6B880AA12D2264756E2164756E21
297
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/verify/args.ts", "../src/verify/report.ts", "../src/verify/rows.ts", "../src/verify/spy.ts", "../src/verify/verify.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * `hf-adopt-verify`'s flags — the ones `alchemy plan` takes, so a stack script can swap one\n * command for the other.\n *\n * ★ `node:util` parseArgs, NOT effect's CLI module. Alchemy builds its CLI on\n * `effect/unstable/cli`, but that needs a CliConfig and a Terminal layer to parse six flags; the\n * standard library parses them with no service at all, which keeps this pure and testable.\n * ⛔ `--stage` HAS NO GUESSED DEFAULT. Alchemy falls back to `live_$USER`; a gate that silently\n * verified the wrong stage would pass for the wrong reason. It comes from the flag or from\n * `$ALCHEMY_STAGE`, or the run stops.\n */\nimport { parseArgs } from 'node:util';\nimport type { VerifyOptions, VerifyTarget } from './verify.ts';\n\nexport const USAGE = `Usage: hf-adopt-verify --stage <stage> [--config alchemy.run.ts] [options]\n\nPlans the stack with Alchemy's own planner, never writes, and reports each row\nwithout a state row: what the engine planned, the provider's read and its own\ndiff (before Alchemy forces adopted rows to update), and the declared fields\nthat differ from the live object. Exits 0 when every row is a no-op, 1 when\nany is not, 2 when it could not tell.\n\n -c, --config <file> stack entrypoint (default alchemy.run.ts)\n --stage <stage> stage to verify (default $ALCHEMY_STAGE; required)\n --profile <name> Alchemy auth profile\n --env-file <file> .env file layered under the environment\n --all report every declared row and pending deletion\n --json print the report as JSON\n -h, --help this text\n`;\n\nexport type Parsed =\n | { readonly kind: 'help' }\n | { readonly kind: 'error'; readonly message: string }\n | {\n readonly kind: 'run';\n readonly target: VerifyTarget;\n readonly options: VerifyOptions;\n readonly json: boolean;\n };\n\nconst parse = (argv: readonly string[]) =>\n parseArgs({\n args: [...argv],\n allowPositionals: false,\n options: {\n all: { type: 'boolean', default: false },\n config: { type: 'string', short: 'c', default: 'alchemy.run.ts' },\n 'env-file': { type: 'string' },\n help: { type: 'boolean', short: 'h', default: false },\n json: { type: 'boolean', default: false },\n profile: { type: 'string' },\n stage: { type: 'string' },\n },\n strict: true,\n });\n\n/** Parse argv (without the runtime and script) against the environment. Never throws. */\nexport const parseVerifyArgs = (\n argv: readonly string[],\n env: Readonly<Record<string, string | undefined>>,\n): Parsed => {\n let parsed: ReturnType<typeof parse>;\n try {\n parsed = parse(argv);\n } catch (error) {\n return { kind: 'error', message: error instanceof Error ? error.message : String(error) };\n }\n const { values } = parsed;\n if (values.help) return { kind: 'help' };\n const stage = values.stage ?? env['ALCHEMY_STAGE'];\n if (stage === undefined || stage === '') {\n return { kind: 'error', message: 'pass --stage (or set ALCHEMY_STAGE): no stage is guessed' };\n }\n const target: VerifyTarget = {\n entrypoint: values.config,\n stage,\n ...(values.profile === undefined ? {} : { profile: values.profile }),\n ...(values['env-file'] === undefined ? {} : { envFile: values['env-file'] }),\n };\n return { json: values.json, kind: 'run', options: { all: values.all }, target };\n};\n",
6
+ "/**\n * The verifier's answer, for a terminal and for a gate.\n *\n * ⛔ NAMES, NEVER VALUES. A row lists which declared fields differ from the live object, not what\n * either side holds: the tool runs over any stack, and a prop or an attribute can be a secret.\n * `alchemy plan --detailed` shows declared values; the family's own read shows live ones.\n */\nimport type { AdoptRow } from './rows.ts';\nimport type { AdoptReport } from './verify.ts';\n\n/** 0 when every reported row is a no-op, 1 when any is not. (2 is the CLI's: it could not tell.) */\nexport const exitCodeOf = (report: AdoptReport): 0 | 1 =>\n report.rows.every((row) => row.ok) ? 0 : 1;\n\nconst pad = (text: string, width: number) => text.padEnd(width);\n\nconst line = (row: AdoptRow, widths: { planned: number; type: number }) => {\n const head = [\n row.ok ? 'ok ' : 'FAIL',\n pad(row.planned, widths.planned),\n pad(row.diff, 8),\n pad(row.read, 9),\n pad(row.type, widths.type),\n row.fqn,\n ].join(' ');\n const changed = row.changed.length > 0 ? ` changed: ${row.changed.join(', ')}` : '';\n return row.why === '' ? `${head}${changed}` : `${head}${changed}\\n ${row.why}`;\n};\n\n/** Plain text, one row per line, with the reason under any row that is not a no-op. */\nexport const formatReport = (report: AdoptReport, all: boolean): string => {\n const scope = all ? 'every row' : 'rows without state';\n const title = `hf-adopt-verify ${report.stack}/${report.stage}: ${String(report.rows.length)} ${scope} (of ${String(report.declared)} declared)`;\n if (report.rows.length === 0) {\n return `${title}\\nnothing to verify — every declared row already has state. --all checks those too.\\n`;\n }\n const widths = {\n planned: Math.max(7, ...report.rows.map((row) => row.planned.length)),\n type: Math.max(4, ...report.rows.map((row) => row.type.length)),\n };\n const header = [' ', pad('planned', widths.planned), pad('diff', 8), pad('read', 9)]\n .concat([pad('type', widths.type), 'fqn'])\n .join(' ');\n const failed = report.rows.filter((row) => !row.ok).length;\n const verdict =\n failed === 0\n ? 'every row is a no-op: the deploy writes nothing to them'\n : `${String(failed)} row(s) are NOT a no-op: the deploy would write, create or delete`;\n return [title, '', header, ...report.rows.map((row) => line(row, widths)), '', verdict, ''].join(\n '\\n',\n );\n};\n",
7
+ "/**\n * One report row per planned resource: what the engine planned, what the provider said, and\n * whether that adds up to \"this deploy leaves the object alone\".\n *\n * ★ PURE, SO THE VERDICT IS TESTABLE WITHOUT AN ENGINE. verify.ts gathers the three inputs — the\n * plan, which FQNs have a state row, and what the watched providers answered (spy.ts) — and\n * this file only decides.\n */\nimport { deepEqual, isResolved } from 'alchemy/Diff';\nimport type { DiffAnswer, Observations, ReadAnswer } from './spy.ts';\n\nexport interface AdoptRow {\n readonly fqn: string;\n readonly type: string;\n /** Whether the state store holds a row for this FQN. An adoption is a row without one. */\n readonly stateRow: boolean;\n /** The engine's action — what `alchemy plan` prints (`adopted`, `create`, `noop`, …). */\n readonly planned: string;\n /** What the provider's `read` answered, or `not-read` when nothing asked it. */\n readonly read: ReadAnswer;\n /** What the provider's own `diff` answered BEFORE Plan.ts forced it (spy.ts). */\n readonly diff: DiffAnswer;\n /**\n * Declared fields whose live value differs, by NAME only — values can be secrets. Compared on\n * same-named keys of the declaration and the read's attributes, so a family whose attributes\n * rename a field cannot show it here; the diff answer, not this list, is the verdict.\n */\n readonly changed: readonly string[];\n /** Bindings the engine will create, update or delete — reconcile applies them even on `noop`. */\n readonly bindings: number;\n readonly ok: boolean;\n /** Why the row is not a no-op, or a note on one that is; empty when there is nothing to say. */\n readonly why: string;\n}\n\n/** The slice of an Alchemy plan node this file reads. */\nexport interface NodeView {\n readonly action: string;\n readonly resource: { readonly Type: string };\n readonly bindings?: readonly { readonly action: string }[];\n}\n\n/** A stack task (an Alchemy action): `run`, `noop` or `delete`. It has no provider to ask. */\nexport interface TaskView {\n readonly action: string;\n readonly def: { readonly Type: string };\n}\n\n/** The slice of an Alchemy `Plan` this file reads. */\nexport interface PlanView {\n readonly resources: Readonly<Record<string, NodeView>>;\n readonly deletions: Readonly<Record<string, NodeView | undefined>>;\n readonly actions?: Readonly<Record<string, TaskView | undefined>>;\n}\n\n/** Same-named, declared, resolved fields where the live value differs. */\nexport const changedFields = (declared: unknown, live: unknown): string[] => {\n if (typeof declared !== 'object' || declared === null) return [];\n if (typeof live !== 'object' || live === null) return [];\n const actual = live as Record<string, unknown>;\n return Object.entries(declared as Record<string, unknown>)\n .filter(([key, value]) => value !== undefined && key in actual && isResolved(value))\n .filter(([key, value]) => !deepEqual(value, actual[key]))\n .map(([key]) => key)\n .sort();\n};\n\nconst STILL_LIVE = new Set(['adopted', 'noop']);\n\n/**\n * ⛔ `adopted` NEEDS THE PROVIDER'S OWN `noop`. With no diff (`none`) the engine compared the\n * declaration with the declaration — an adopted row's state carries `props: news` (Plan.ts) — so\n * its noop proves nothing. A row with state is different: there the engine compared against the\n * props it last deployed, which is the same check `alchemy plan` makes.\n */\nconst isNoop = (planned: string, diff: DiffAnswer, stateRow: boolean) =>\n STILL_LIVE.has(planned) &&\n (diff === 'noop' || (diff === 'none' && stateRow && planned === 'noop'));\n\nconst reason = (row: Omit<AdoptRow, 'ok' | 'why'>, ok: boolean): string => {\n if (ok) return row.read === 'unowned' ? 'unowned: the deploy needs --adopt or adopt(true)' : '';\n if (isNoop(row.planned, row.diff, row.stateRow)) {\n return `${String(row.bindings)} binding(s) change: the deploy reconciles them though the diff is noop`;\n }\n if (row.planned === 'delete') return 'no longer declared: the deploy deletes it';\n if (row.planned === 'orphaned') return 'no longer declared: the deploy drops its state (retain)';\n if (row.read === 'failed') return \"the verifier's own read of it failed\";\n if (row.planned === 'create') {\n if (row.stateRow) return 'an interrupted create: the deploy finishes creating it';\n return row.read === 'absent'\n ? 'the read found nothing, so the deploy CREATES it (a lane that cannot see it reads the same)'\n : 'never probed (a prop is an Output of another resource, or the provider has no read): ' +\n 'the deploy CREATES it';\n }\n if (row.diff === 'update') return \"the provider's diff says update: the deploy writes\";\n if (row.diff === 'replace') return \"the provider's diff says replace: a new one, then a delete\";\n if (row.diff === 'none') {\n return 'the provider has no diff, so the engine compared the declaration with itself';\n }\n return `the engine plans ${row.planned} although the diff says ${row.diff} (a renamed row, changed bindings or --force)`;\n};\n\nexport const rowFor = (\n fqn: string,\n node: NodeView,\n stateRow: boolean,\n seen: Observations,\n): AdoptRow => {\n const observed = seen.get(fqn);\n const base = {\n bindings: (node.bindings ?? []).filter((binding) => binding.action !== 'noop').length,\n changed: changedFields(observed?.diff?.news, observed?.read?.attributes),\n diff: observed?.diff?.answer ?? 'not-run',\n fqn,\n planned: node.action,\n read: observed?.read?.answer ?? 'not-read',\n stateRow,\n type: node.resource.Type,\n } satisfies Omit<AdoptRow, 'ok' | 'why'>;\n /**\n * ⚠️ A NOOP DIFF DOES NOT COVER BINDINGS. Plan.ts diffs them separately and hands every\n * non-noop binding to `reconcile`, which an adopted row reaches anyway — a Worker adopted with\n * a new binding writes although its own diff said nothing changed.\n */\n const ok = isNoop(base.planned, base.diff, stateRow) && base.bindings === 0;\n return { ...base, ok, why: reason(base, ok) };\n};\n\n/**\n * ⚠️ A TASK THAT RUNS IS A WRITE THE PROVIDERS NEVER SEE, so it is reported in both modes; a task\n * that would not run appears only with `all`.\n */\nconst taskRow = (fqn: string, task: TaskView): AdoptRow => ({\n bindings: 0,\n changed: [],\n diff: 'not-run',\n fqn,\n ok: task.action === 'noop',\n planned: task.action,\n read: 'not-read',\n stateRow: task.action !== 'run',\n type: task.def.Type,\n why: task.action === 'noop' ? '' : `a stack task: the deploy will ${task.action} it`,\n});\n\n/**\n * The rows to report. Without `all`, only rows WITHOUT a state row — the adoptions and creates a\n * deploy would perform — which is the question this tool exists for, plus any task that runs. With\n * `all`, every declared row, every pending deletion and every task.\n */\nexport const rowsOf = (\n plan: PlanView,\n stateRows: ReadonlySet<string>,\n seen: Observations,\n all: boolean,\n): AdoptRow[] => {\n const declared = Object.entries(plan.resources)\n .filter(([fqn]) => all || !stateRows.has(fqn))\n .map(([fqn, node]) => rowFor(fqn, node, stateRows.has(fqn), seen));\n const removed = all\n ? Object.entries(plan.deletions).flatMap(([fqn, node]) =>\n node === undefined ? [] : [rowFor(fqn, node, true, seen)],\n )\n : [];\n const tasks = Object.entries(plan.actions ?? {}).flatMap(([fqn, task]) =>\n task === undefined || (!all && task.action === 'noop') ? [] : [taskRow(fqn, task)],\n );\n return [...declared, ...removed, ...tasks].sort((a, b) => a.fqn.localeCompare(b.fqn));\n};\n",
8
+ "/**\n * The providers a stack registered, wrapped so the plan can be watched and can never write.\n *\n * ★ WHY A WRAPPER AND NOT A LOG LINE. alchemy beta.79 Plan.ts loses the provider's answer on the one\n * path that matters: after the cold-start adoption probe it sets `forceUpdateAfterAdoption` and\n * maps a `noop` diff to `update`, and the node says `adopted` either way. Nothing is logged, and\n * `alchemy plan` has no JSON output — `describePlan` carries only the forced action. The engine\n * resolves every provider from the Effect context by resource type (Provider.ts\n * `tryFindProviderRegistrationByType`), so the one honest place to hear the raw answer is the\n * provider service itself. This hands Alchemy's own `Plan.make` a context whose providers record\n * what `read` and `diff` answered, per FQN, and otherwise behave exactly as registered.\n *\n * ⛔ EVERY WRITE PATH DIES. `reconcile`, `delete` and `precreate` are replaced, not wrapped: the\n * planner never calls them, and a verifier that could reach one by accident is worse than none.\n * `read`, `diff`, `list`, `tail` and `logs` pass through — each is a read by Alchemy's contract.\n *\n * ⚠️ A MISSING `diff` IS WRAPPED AS ONE ANSWERING `undefined`, which is exactly what the planner\n * does without one (`provider?.diff?.(…)` then its own props compare), so behaviour is unchanged\n * and the report can say `none` instead of guessing. A missing `read` stays missing: adding one\n * would make the planner probe where it otherwise would not.\n */\nimport { Unowned, stripUnowned } from 'alchemy/AdoptPolicy';\nimport {\n type ProviderCollectionService,\n type ProviderService,\n isProviderCollectionService,\n isProviderService,\n} from 'alchemy/Provider';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\n\nexport type ReadAnswer = 'found' | 'unowned' | 'absent' | 'failed' | 'not-read';\nexport type DiffAnswer = 'noop' | 'update' | 'replace' | 'none' | 'not-run';\n\n/** What one FQN's provider answered during the plan — the LAST answer of each kind. */\nexport interface Seen {\n read?: { readonly answer: ReadAnswer; readonly attributes: unknown };\n diff?: { readonly answer: DiffAnswer; readonly news: unknown };\n}\n\n/** Keyed by FQN. Filled while the plan runs; read once it is done. */\nexport type Observations = Map<string, Seen>;\n\nconst seenFor = (seen: Observations, fqn: string): Seen => {\n const existing = seen.get(fqn);\n if (existing !== undefined) return existing;\n const fresh: Seen = {};\n seen.set(fqn, fresh);\n return fresh;\n};\n\n/** The refusal every write path answers with. Exported so a test can match it. */\nexport const WRITE_REFUSED = 'hf-adopt-verify never writes';\n\nconst refuse = (type: string, operation: string) => () =>\n Effect.die(\n new Error(\n `${WRITE_REFUSED}: ${type}.${operation} was called during a verification. Alchemy's planner ` +\n 'does not call it, so something other than Plan.make is driving these providers.',\n ),\n );\n\nconst readAnswer = (attributes: unknown): ReadAnswer =>\n attributes === undefined ? 'absent' : Unowned.is(attributes) ? 'unowned' : 'found';\n\nconst diffAnswer = (diff: unknown): DiffAnswer => {\n const action = (diff as { action?: unknown } | undefined)?.action;\n return action === 'noop' || action === 'update' || action === 'replace' ? action : 'none';\n};\n\n/**\n * One provider service, watched. ⚠️ The spread keeps `version`, `aliases`, `mode`, `stables`,\n * `list` and the rest exactly as registered — the planner reads several of them.\n */\nexport const spyService = (type: string, service: ProviderService, seen: Observations) => {\n const read = service.read;\n const diff = service.diff;\n const modes = service.modes;\n const watched: ProviderService = {\n ...service,\n diff: (input) =>\n (diff === undefined ? Effect.succeed(undefined) : diff(input)).pipe(\n Effect.tap((answer) =>\n Effect.sync(() => {\n seenFor(seen, input.fqn).diff = { answer: diffAnswer(answer), news: input.news };\n }),\n ),\n ),\n reconcile: refuse(type, 'reconcile'),\n delete: refuse(type, 'delete'),\n };\n if (read !== undefined) {\n watched.read = (input) =>\n read(input).pipe(\n Effect.tap((answer) =>\n Effect.sync(() => {\n const attributes = answer === undefined ? undefined : stripUnowned(answer);\n seenFor(seen, input.fqn).read = { answer: readAnswer(answer), attributes };\n }),\n ),\n );\n }\n if (service.precreate !== undefined) watched.precreate = refuse(type, 'precreate');\n // ⚠️ A `ProviderLayer.dual` registration resolves a per-mode variant at plan time\n // (Provider.ts `providerForMode`); wrapping only the registration would miss it.\n if (modes !== undefined) {\n watched.modes = {\n live: Effect.map(modes.live, (variant) => spyService(type, variant, seen)),\n local: Effect.map(modes.local, (variant) => spyService(type, variant, seen)),\n };\n }\n return watched;\n};\n\nconst spyCollection = (\n collection: ProviderCollectionService,\n seen: Observations,\n): ProviderCollectionService => {\n const providers = Object.fromEntries(\n Object.entries(collection.providers).map(([type, service]) => [\n type,\n spyService(type, service, seen),\n ]),\n );\n return { ...collection, get: (type: string) => providers[type] as never, providers };\n};\n\n/**\n * The same context with every provider service — direct or inside a `Provider.collection` —\n * replaced by its watched copy. Everything else (the state store, the stack, credentials) is the\n * very object the session built.\n */\nexport const spyContext = <R>(\n context: Context.Context<R>,\n seen: Observations,\n): Context.Context<R> => {\n const services = new Map<string, unknown>();\n for (const [key, value] of context.mapUnsafe) {\n services.set(\n key,\n isProviderService(value)\n ? spyService(key, value, seen)\n : isProviderCollectionService(value)\n ? spyCollection(value, seen)\n : value,\n );\n }\n return Context.makeUnsafe<R>(services);\n};\n",
9
+ "/**\n * Prove a deploy's adoptions are no-ops — with Alchemy's own planner, before anything is written.\n *\n * ★ THE ENGINE PLANS, THIS ONLY WATCHES. `verifySession` runs `Plan.make` — the same call\n * `alchemy plan` makes (Alchemist routes/stack.ts) — over the session's context with every\n * provider swapped for a watched copy (spy.ts). Output resolution, the state lookup, rename\n * migrations, the adoption probe and `adopt(…)` all stay the engine's; nothing here re-derives\n * them. What it adds is the provider's own `diff` answer, which Plan.ts overwrites for every\n * adopted row (`forceUpdateAfterAdoption`), and the state-row check that says which rows ARE\n * adoptions.\n *\n * ⛔ READ-ONLY BY CONSTRUCTION. The planner calls `read` and `diff`; spy.ts replaces `reconcile`,\n * `delete` and `precreate` with refusals; nothing here calls `apply`. `--all` adds one `read` per\n * row with state — still a read by Alchemy's provider contract.\n * ⚠️ READS ARE NOT FREE FOR EVERY FAMILY. A kit PVE/PBS read mints a lease through OpenBao, which\n * creates a short-lived API token on the cluster, exactly as `alchemy plan` does.\n */\nimport * as Alchemist from 'alchemy/Alchemist';\nimport {\n ArtifactStore,\n Artifacts,\n createArtifactStore,\n makeScopedArtifacts,\n} from 'alchemy/Artifacts';\nimport { InstanceId } from 'alchemy/InstanceId';\nimport * as Plan from 'alchemy/Plan';\nimport type { ProviderService } from 'alchemy/Provider';\nimport type { CompiledStack } from 'alchemy/Stack';\nimport { State, isActionState } from 'alchemy/State';\nimport type * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\nimport { type AdoptRow, type PlanView, rowsOf } from './rows.ts';\nimport { type Observations, spyContext } from './spy.ts';\n\nexport interface VerifyOptions {\n /** Report every declared row and every pending deletion, not only rows without state. */\n readonly all?: boolean;\n}\n\nexport interface AdoptReport {\n readonly stack: string;\n readonly stage: string;\n /** Resources the stack declares. */\n readonly declared: number;\n readonly rows: readonly AdoptRow[];\n}\n\n/** An imported stack and the context it plans under — what `Alchemist.open` returns. */\nexport interface VerifySession {\n readonly stack: CompiledStack<unknown, unknown>;\n readonly context: Context.Context<unknown>;\n}\n\n/** The plan-node fields `--all` needs to read a row that has state. */\ntype StatefulNode = {\n readonly provider?: ProviderService;\n readonly resource: { readonly LogicalId: string };\n readonly state?: {\n readonly instanceId: string;\n readonly props: object;\n readonly attr: object | undefined;\n };\n};\n\n/**\n * ⚠️ THE SAME SCOPE Plan.ts GIVES ITS OWN READS (`providePlanScope`, not exported): a scoped\n * `Artifacts` bag and the row's `InstanceId`. A kit family that consults either — the ownership\n * helpers do — sees what it would see under `alchemy plan`.\n */\nconst readWithState = (fqn: string, node: StatefulNode) =>\n Effect.gen(function* () {\n const read = node.provider?.read;\n if (read === undefined || node.state === undefined) return;\n const store = Option.getOrElse(yield* Effect.serviceOption(ArtifactStore), createArtifactStore);\n yield* read({\n fqn,\n id: node.resource.LogicalId,\n instanceId: node.state.instanceId,\n olds: node.state.props,\n output: node.state.attr,\n }).pipe(\n Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)),\n Effect.provideService(InstanceId, node.state.instanceId),\n );\n });\n\n/** Which of `fqns` the stage's state store holds a resource row for. */\nconst withState = (stack: CompiledStack<unknown, unknown>, fqns: readonly string[]) =>\n Effect.gen(function* () {\n const store = yield* yield* State;\n const found = yield* Effect.all(\n fqns.map((fqn) =>\n store\n .get({ fqn, stack: stack.name, stage: stack.stage })\n .pipe(Effect.map((row) => (row === undefined || isActionState(row) ? [] : [fqn]))),\n ),\n { concurrency: 8 },\n );\n return new Set(found.flat());\n });\n\n/**\n * Plan `session.stack` with watched providers and report each row without state (or, with\n * `all`, every row). Never writes.\n */\nexport const verifySession = (\n session: VerifySession,\n options: VerifyOptions = {},\n): Effect.Effect<AdoptReport, unknown> => {\n const seen: Observations = new Map();\n const all = options.all === true;\n // ⚠️ THE CAST IS AT THE ENGINE'S TYPED BOUNDARY. `Plan.make` declares only `State` and hides the\n // rest behind a ts-expect-error; the session context carries all of it, as in routes/stack.ts.\n const plan = Plan.make(session.stack) as unknown as Effect.Effect<\n PlanView & { readonly resources: Readonly<Record<string, StatefulNode>> },\n unknown\n >;\n return Effect.gen(function* () {\n const planned = yield* plan;\n const stateRows = yield* withState(session.stack, Object.keys(planned.resources));\n if (all) {\n const stateful = Object.entries(planned.resources).filter(([fqn]) => stateRows.has(fqn));\n yield* Effect.all(\n stateful.map(([fqn, node]) =>\n readWithState(fqn, node).pipe(\n Effect.catchCause(() =>\n Effect.sync(() => {\n const entry = seen.get(fqn) ?? {};\n entry.read = { answer: 'failed', attributes: undefined };\n seen.set(fqn, entry);\n }),\n ),\n ),\n ),\n { concurrency: 8 },\n );\n }\n return {\n declared: Object.keys(planned.resources).length,\n rows: rowsOf(planned, stateRows, seen, all),\n stack: session.stack.name,\n stage: session.stack.stage,\n } satisfies AdoptReport;\n }).pipe(Effect.provide(spyContext(session.context, seen)), Effect.scoped);\n};\n\n/** Where the stack lives — the fields `alchemy plan` takes as flags. */\nexport interface VerifyTarget {\n /** The stack entrypoint, e.g. `alchemy.run.ts`. */\n readonly entrypoint: string;\n readonly stage: string;\n readonly profile?: string;\n readonly envFile?: string;\n}\n\n/**\n * Import the stack the way the Alchemy CLI does and verify it.\n *\n * ★ `adopt: true`, ALWAYS, AND IT CANNOT WRITE. Planning is side-effect free (Plan.ts keeps the\n * adopted state in memory, alchemy#793), so the flag only lets an `Unowned` row reach its\n * `diff` instead of failing the plan — the report marks it, because the real deploy then needs\n * `--adopt`. A resource declared `.pipe(adopt(false))` still fails the plan, as it would deploy.\n */\nexport const verifyStack = (\n target: VerifyTarget,\n options: VerifyOptions = {},\n): Effect.Effect<AdoptReport, unknown> =>\n Effect.gen(function* () {\n const session = yield* Alchemist.open(target, { adopt: true });\n return yield* verifySession(session, options);\n }).pipe(Effect.scoped, Effect.provide(Alchemist.layer()));\n"
10
+ ],
11
+ "mappings": ";AAWA;AAGO,IAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BrB,IAAM,QAAQ,CAAC,SACb,UAAU;AAAA,EACR,MAAM,CAAC,GAAG,IAAI;AAAA,EACd,kBAAkB;AAAA,EAClB,SAAS;AAAA,IACP,KAAK,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA,IACvC,QAAQ,EAAE,MAAM,UAAU,OAAO,KAAK,SAAS,iBAAiB;AAAA,IAChE,YAAY,EAAE,MAAM,SAAS;AAAA,IAC7B,MAAM,EAAE,MAAM,WAAW,OAAO,KAAK,SAAS,MAAM;AAAA,IACpD,MAAM,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA,IACxC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC1B,OAAO,EAAE,MAAM,SAAS;AAAA,EAC1B;AAAA,EACA,QAAQ;AACV,CAAC;AAGI,IAAM,kBAAkB,CAC7B,MACA,QACW;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AAAA,IACF,SAAS,MAAM,IAAI;AAAA,IACnB,OAAO,OAAO;AAAA,IACd,OAAO,EAAE,MAAM,SAAS,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OA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AO,UAAU,QAAQ,OAAO,OAAO,KAAK,QAAQ,SAAS,CAAC;AAAA,IAChF,IAAI,MAAK;AAAA,MACP,MAAM,WAAW,OAAO,QAAQ,QAAQ,SAAS,EAAE,OAAO,EAAE,SAAS,UAAU,IAAI,GAAG,CAAC;AAAA,MACvF,OAAc,YACZ,SAAS,IAAI,EAAE,KAAK,UAClB,cAAc,KAAK,IAAI,EAAE,KAChB,mBAAW,MACT,aAAK,MAAM;AAAA,QAChB,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC;AAAA,QAChC,MAAM,OAAO,EAAE,QAAQ,UAAU,YAAY,UAAU;AAAA,QACvD,KAAK,IAAI,KAAK,KAAK;AAAA,OACpB,CACH,CACF,CACF,GACA,EAAE,aAAa,EAAE,CACnB;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,UAAU,OAAO,KAAK,QAAQ,SAAS,EAAE;AAAA,MACzC,MAAM,OAAO,SAAS,WAAW,MAAM,IAAG;AAAA,MAC1C,OAAO,QAAQ,MAAM;AAAA,MACrB,OAAO,QAAQ,MAAM;AAAA,IACvB;AAAA,GACD,EAAE,KAAY,gBAAQ,WAAW,QAAQ,SAAS,IAAI,CAAC,GAAU,cAAM;AAAA;AAoBnE,IAAM,cAAc,CACzB,QACA,UAAyB,CAAC,MAEnB,YAAI,UAAU,GAAG;AAAA,EACtB,MAAM,UAAU,OAAiB,eAAK,QAAQ,EAAE,OAAO,KAAK,CAAC;AAAA,EAC7D,OAAO,OAAO,cAAc,SAAS,OAAO;AAAA,CAC7C,EAAE,KAAY,gBAAe,gBAAkB,gBAAM,CAAC,CAAC;",
12
+ "debugId": "903C6B880AA12D2264756E2164756E21",
13
+ "names": []
14
+ }
@@ -0,0 +1,6 @@
1
+ import type { AdoptReport } from './verify.ts';
2
+ /** 0 when every reported row is a no-op, 1 when any is not. (2 is the CLI's: it could not tell.) */
3
+ export declare const exitCodeOf: (report: AdoptReport) => 0 | 1;
4
+ /** Plain text, one row per line, with the reason under any row that is not a no-op. */
5
+ export declare const formatReport: (report: AdoptReport, all: boolean) => string;
6
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/verify/report.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,oGAAoG;AACpG,eAAO,MAAM,UAAU,WAAY,WAAW,KAAG,CAAC,GAAG,CACT,CAAC;AAiB7C,uFAAuF;AACvF,eAAO,MAAM,YAAY,WAAY,WAAW,OAAO,OAAO,KAAG,MAqBhE,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { DiffAnswer, Observations, ReadAnswer } from './spy.ts';
2
+ export interface AdoptRow {
3
+ readonly fqn: string;
4
+ readonly type: string;
5
+ /** Whether the state store holds a row for this FQN. An adoption is a row without one. */
6
+ readonly stateRow: boolean;
7
+ /** The engine's action — what `alchemy plan` prints (`adopted`, `create`, `noop`, …). */
8
+ readonly planned: string;
9
+ /** What the provider's `read` answered, or `not-read` when nothing asked it. */
10
+ readonly read: ReadAnswer;
11
+ /** What the provider's own `diff` answered BEFORE Plan.ts forced it (spy.ts). */
12
+ readonly diff: DiffAnswer;
13
+ /**
14
+ * Declared fields whose live value differs, by NAME only — values can be secrets. Compared on
15
+ * same-named keys of the declaration and the read's attributes, so a family whose attributes
16
+ * rename a field cannot show it here; the diff answer, not this list, is the verdict.
17
+ */
18
+ readonly changed: readonly string[];
19
+ /** Bindings the engine will create, update or delete — reconcile applies them even on `noop`. */
20
+ readonly bindings: number;
21
+ readonly ok: boolean;
22
+ /** Why the row is not a no-op, or a note on one that is; empty when there is nothing to say. */
23
+ readonly why: string;
24
+ }
25
+ /** The slice of an Alchemy plan node this file reads. */
26
+ export interface NodeView {
27
+ readonly action: string;
28
+ readonly resource: {
29
+ readonly Type: string;
30
+ };
31
+ readonly bindings?: readonly {
32
+ readonly action: string;
33
+ }[];
34
+ }
35
+ /** A stack task (an Alchemy action): `run`, `noop` or `delete`. It has no provider to ask. */
36
+ export interface TaskView {
37
+ readonly action: string;
38
+ readonly def: {
39
+ readonly Type: string;
40
+ };
41
+ }
42
+ /** The slice of an Alchemy `Plan` this file reads. */
43
+ export interface PlanView {
44
+ readonly resources: Readonly<Record<string, NodeView>>;
45
+ readonly deletions: Readonly<Record<string, NodeView | undefined>>;
46
+ readonly actions?: Readonly<Record<string, TaskView | undefined>>;
47
+ }
48
+ /** Same-named, declared, resolved fields where the live value differs. */
49
+ export declare const changedFields: (declared: unknown, live: unknown) => string[];
50
+ export declare const rowFor: (fqn: string, node: NodeView, stateRow: boolean, seen: Observations) => AdoptRow;
51
+ /**
52
+ * The rows to report. Without `all`, only rows WITHOUT a state row — the adoptions and creates a
53
+ * deploy would perform — which is the question this tool exists for, plus any task that runs. With
54
+ * `all`, every declared row, every pending deletion and every task.
55
+ */
56
+ export declare const rowsOf: (plan: PlanView, stateRows: ReadonlySet<string>, seen: Observations, all: boolean) => AdoptRow[];
57
+ //# sourceMappingURL=rows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/verify/rows.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM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WAAW,CAAC,MAAM,CAAC,QACxB,YAAY,OACb,OAAO,KACX,QAAQ,EAaV,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type ProviderService } from 'alchemy/Provider';
2
+ import * as Context from 'effect/Context';
3
+ export type ReadAnswer = 'found' | 'unowned' | 'absent' | 'failed' | 'not-read';
4
+ export type DiffAnswer = 'noop' | 'update' | 'replace' | 'none' | 'not-run';
5
+ /** What one FQN's provider answered during the plan — the LAST answer of each kind. */
6
+ export interface Seen {
7
+ read?: {
8
+ readonly answer: ReadAnswer;
9
+ readonly attributes: unknown;
10
+ };
11
+ diff?: {
12
+ readonly answer: DiffAnswer;
13
+ readonly news: unknown;
14
+ };
15
+ }
16
+ /** Keyed by FQN. Filled while the plan runs; read once it is done. */
17
+ export type Observations = Map<string, Seen>;
18
+ /** The refusal every write path answers with. Exported so a test can match it. */
19
+ export declare const WRITE_REFUSED = "hf-adopt-verify never writes";
20
+ /**
21
+ * One provider service, watched. ⚠️ The spread keeps `version`, `aliases`, `mode`, `stables`,
22
+ * `list` and the rest exactly as registered — the planner reads several of them.
23
+ */
24
+ export declare const spyService: (type: string, service: ProviderService, seen: Observations) => ProviderService<import("alchemy").ResourceLike<string, any, object, any, any>, never, never, never, never, never, never, never, never>;
25
+ /**
26
+ * The same context with every provider service — direct or inside a `Provider.collection` —
27
+ * replaced by its watched copy. Everything else (the state store, the stack, credentials) is the
28
+ * very object the session built.
29
+ */
30
+ export declare const spyContext: <R>(context: Context.Context<R>, seen: Observations) => Context.Context<R>;
31
+ //# sourceMappingURL=spy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spy.d.ts","sourceRoot":"","sources":["../../src/verify/spy.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5E,uFAAuF;AACvF,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IACrE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CAChE;AAED,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAU7C,kFAAkF;AAClF,eAAO,MAAM,aAAa,iCAAiC,CAAC;AAkB5D;;;GAGG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,WAAW,eAAe,QAAQ,YAAY,2IAsCpF,CAAC;AAeF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,WACjB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QACrB,YAAY,KACjB,OAAO,CAAC,OAAO,CAAC,CAAC,CAanB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { CompiledStack } from 'alchemy/Stack';
2
+ import type * as Context from 'effect/Context';
3
+ import * as Effect from 'effect/Effect';
4
+ import { type AdoptRow } from './rows.ts';
5
+ export interface VerifyOptions {
6
+ /** Report every declared row and every pending deletion, not only rows without state. */
7
+ readonly all?: boolean;
8
+ }
9
+ export interface AdoptReport {
10
+ readonly stack: string;
11
+ readonly stage: string;
12
+ /** Resources the stack declares. */
13
+ readonly declared: number;
14
+ readonly rows: readonly AdoptRow[];
15
+ }
16
+ /** An imported stack and the context it plans under — what `Alchemist.open` returns. */
17
+ export interface VerifySession {
18
+ readonly stack: CompiledStack<unknown, unknown>;
19
+ readonly context: Context.Context<unknown>;
20
+ }
21
+ /**
22
+ * Plan `session.stack` with watched providers and report each row without state (or, with
23
+ * `all`, every row). Never writes.
24
+ */
25
+ export declare const verifySession: (session: VerifySession, options?: VerifyOptions) => Effect.Effect<AdoptReport, unknown>;
26
+ /** Where the stack lives — the fields `alchemy plan` takes as flags. */
27
+ export interface VerifyTarget {
28
+ /** The stack entrypoint, e.g. `alchemy.run.ts`. */
29
+ readonly entrypoint: string;
30
+ readonly stage: string;
31
+ readonly profile?: string;
32
+ readonly envFile?: string;
33
+ }
34
+ /**
35
+ * Import the stack the way the Alchemy CLI does and verify it.
36
+ *
37
+ * ★ `adopt: true`, ALWAYS, AND IT CANNOT WRITE. Planning is side-effect free (Plan.ts keeps the
38
+ * adopted state in memory, alchemy#793), so the flag only lets an `Unowned` row reach its
39
+ * `diff` instead of failing the plan — the report marks it, because the real deploy then needs
40
+ * `--adopt`. A resource declared `.pipe(adopt(false))` still fails the plan, as it would deploy.
41
+ */
42
+ export declare const verifyStack: (target: VerifyTarget, options?: VerifyOptions) => Effect.Effect<AdoptReport, unknown>;
43
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/verify/verify.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,QAAQ,EAAyB,MAAM,WAAW,CAAC;AAGjE,MAAM,WAAW,aAAa;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,QAAQ,C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