@wildo-ai/platform-config-lib 1.1.10 → 1.1.12

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 (396) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  6. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  7. package/dist/esm/blueprint/anchored-region.js +263 -0
  8. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
  10. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  12. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  13. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  18. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  20. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
  22. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
  24. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
  26. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -2
  28. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  29. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  30. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  31. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  32. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  34. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  35. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  36. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  37. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  41. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  43. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  44. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  45. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  48. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  49. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  51. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  52. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  53. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  54. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  55. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  57. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  59. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  60. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  61. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  62. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  63. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  64. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  65. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  66. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  67. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  68. package/dist/esm/config-authoring.entry.js.map +1 -1
  69. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  70. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  71. package/dist/esm/index.d.ts +20 -1
  72. package/dist/esm/index.d.ts.map +1 -1
  73. package/dist/esm/index.js +20 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  76. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  78. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  79. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  80. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  81. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  82. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  84. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  85. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  86. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  87. package/dist/esm/key-management/approval-seal-verifier.d.ts +278 -0
  88. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  89. package/dist/esm/key-management/approval-seal-verifier.js +355 -0
  90. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  91. package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
  92. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  93. package/dist/esm/key-management/approval-seal.contracts.js +135 -0
  94. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  95. package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
  96. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  97. package/dist/esm/key-management/data-key.contracts.js +54 -0
  98. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  99. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  100. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  101. package/dist/esm/key-management/es256-jws.js +135 -0
  102. package/dist/esm/key-management/es256-jws.js.map +1 -0
  103. package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
  104. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  105. package/dist/esm/key-management/key-provider.spi.js +38 -0
  106. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  107. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
  108. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  109. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  110. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  111. package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
  112. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  113. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  114. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  115. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  116. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  117. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  118. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  119. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  120. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  121. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  122. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  123. package/dist/esm/key-management/qr-code.d.ts +38 -0
  124. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  125. package/dist/esm/key-management/qr-code.js +325 -0
  126. package/dist/esm/key-management/qr-code.js.map +1 -0
  127. package/dist/esm/key-management/signature-request.contracts.d.ts +91 -0
  128. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  129. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  130. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  131. package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
  132. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  133. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  134. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  135. package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
  136. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  137. package/dist/esm/key-management/vault-custody.contracts.js +154 -0
  138. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  139. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  140. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  141. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  142. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  143. package/dist/esm/lockfile/canonical-json.js +1 -1
  144. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  145. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  146. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  147. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  148. package/dist/esm/lockfile/lockfile-io.d.ts +13 -17
  149. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  150. package/dist/esm/lockfile/lockfile-io.js +29 -30
  151. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  152. package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
  153. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  154. package/dist/esm/lockfile/materialize-infra-section.js +13 -14
  155. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  156. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
  157. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
  159. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  160. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  161. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  162. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  163. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  164. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  165. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +22 -3
  166. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  167. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  168. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  169. package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
  170. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  171. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  172. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  173. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  174. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  175. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  176. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  177. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  178. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  179. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  180. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  181. package/dist/esm/project-config/config-module-resolution.js +33 -0
  182. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  183. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  184. package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
  185. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  186. package/dist/esm/project-config/define-infra-env-config.js +194 -143
  187. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  188. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  189. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/define-minion-config.js +64 -25
  191. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  192. package/dist/esm/project-config/define-saas-config.d.ts +82 -348
  193. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  194. package/dist/esm/project-config/define-saas-config.js +262 -103
  195. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  196. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  197. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  198. package/dist/esm/project-config/define-worker-config.js +10 -12
  199. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  200. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  201. package/dist/esm/project-config/hosted-infra-env-config.js +4 -1
  202. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  203. package/dist/esm/project-config/index.d.ts +5 -0
  204. package/dist/esm/project-config/index.d.ts.map +1 -1
  205. package/dist/esm/project-config/index.js +5 -0
  206. package/dist/esm/project-config/index.js.map +1 -1
  207. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  208. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  209. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  210. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  211. package/dist/esm/project-config/loader.d.ts +131 -14
  212. package/dist/esm/project-config/loader.d.ts.map +1 -1
  213. package/dist/esm/project-config/loader.js +226 -12
  214. package/dist/esm/project-config/loader.js.map +1 -1
  215. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  216. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  217. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  218. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  219. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  220. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  221. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  222. package/dist/esm/project-config/npm-version-range.js +39 -16
  223. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  224. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  225. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  226. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  227. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  228. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  229. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  230. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  231. package/dist/esm/project-config/provider-companion-discovery.js +16 -10
  232. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  233. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
  234. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  235. package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
  236. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  237. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  238. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  240. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  242. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  243. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  244. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  245. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  246. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  247. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  248. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  249. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  250. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  251. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  252. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  253. package/dist/esm/project-config/shared/csp-defaults.d.ts +36 -9
  254. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  255. package/dist/esm/project-config/shared/csp-defaults.js +54 -11
  256. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  257. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  258. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  259. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  260. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  261. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -85
  262. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/csp.schemas.js +40 -13
  264. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  266. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  270. package/dist/esm/project-config/shared/environment.schemas.d.ts +101 -8
  271. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/environment.schemas.js +128 -9
  273. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  275. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  276. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  277. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  278. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -1
  279. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +4 -1
  281. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  282. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  284. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  285. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  286. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +24 -0
  287. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  288. package/dist/esm/project-config/shared/minion-resource-access.validation.js +25 -2
  289. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  290. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  291. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  292. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +276 -0
  293. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  294. package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
  295. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  296. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  297. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  298. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  299. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  300. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  301. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  302. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  303. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  304. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  305. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  306. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  307. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  308. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  309. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  310. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  311. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  312. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  313. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  314. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  315. package/dist/esm/registry/digest.schemas.js.map +1 -1
  316. package/dist/esm/registry/index.d.ts +3 -3
  317. package/dist/esm/registry/index.d.ts.map +1 -1
  318. package/dist/esm/registry/index.js +3 -3
  319. package/dist/esm/registry/index.js.map +1 -1
  320. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  321. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  322. package/dist/esm/registry/local-checkout-source.js +66 -3
  323. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  324. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -98
  325. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  326. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  327. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  328. package/dist/esm/registry/module-artifact.schemas.d.ts +40 -17
  329. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  330. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  331. package/dist/esm/registry/module-manifest.schemas.d.ts +324 -74
  332. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  333. package/dist/esm/registry/module-manifest.schemas.js +377 -19
  334. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  335. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  336. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  337. package/dist/esm/registry/module-search.schemas.js +14 -1
  338. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  339. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  340. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  342. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  344. package/dist/esm/registry/registry-errors.d.ts +103 -5
  345. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  346. package/dist/esm/registry/registry-errors.js +213 -6
  347. package/dist/esm/registry/registry-errors.js.map +1 -1
  348. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  349. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  350. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  351. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  352. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  353. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  354. package/dist/esm/registry/registry-url-resolution.js +157 -0
  355. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  356. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  357. package/dist/esm/release/framework-release.constants.js.map +1 -1
  358. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  359. package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
  360. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  361. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  362. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  363. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  364. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  365. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  366. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  367. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  368. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  369. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  370. package/dist/esm/workspace-scope/index.js.map +1 -1
  371. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  372. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  373. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  374. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  375. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  376. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  377. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  378. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  379. package/dist/tsconfig.build.tsbuildinfo +1 -1
  380. package/package.json +12 -12
  381. package/dist/esm/_unimplemented/index.d.ts +0 -3
  382. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  383. package/dist/esm/_unimplemented/index.js +0 -3
  384. package/dist/esm/_unimplemented/index.js.map +0 -1
  385. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  386. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  387. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  388. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  389. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  390. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  391. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  392. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  393. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  394. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  395. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  396. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -0,0 +1,98 @@
1
+ /**
2
+ * # The platform's Vault custody contract (#2933)
3
+ *
4
+ * apps-manager signs through HashiCorp Vault (or OpenBao) with TWO tokens, and least privilege is a property of the
5
+ * policy each token holds. Those policies are stated here once, because three places need the same text: the
6
+ * self-hosted OpenBao the CLI renders (it writes them at its first start), the real-container test suite, and the
7
+ * runbook an operator follows to configure their own Vault. A copy in each would drift, and a drift here is either a
8
+ * provider that cannot do its job or a token that can do more than its job.
9
+ *
10
+ * - The SIGNER token signs, wraps and reads: `transit/sign/<k>`, `transit/encrypt/<k>` and `transit/decrypt/<k>` (data
11
+ * keys wrapped and unwrapped under a wrapping key, #2894), read on `transit/keys/<k>` (the public key and the
12
+ * attributes the attestation is computed from), and read on a KV key. It can never change a key's configuration, so it can never
13
+ * make a key exportable; Vault's deny-by-default already refuses that, and the explicit `deny` lines keep it refused
14
+ * if a broader grant is ever added beside these.
15
+ * - The OPERATOR token performs lifecycle acts (create, rotate, configure, delete; KV write, delete, destroy) and can
16
+ * neither sign, wrap, unwrap nor read key material, nor send `exportable` / `allow_plaintext_backup` (`denied_parameters`), so it
17
+ * cannot make a Transit key leave Vault either.
18
+ * - Both may renew THEMSELVES (`auth/token/renew-self`), because a periodic token that is not renewed expires; nothing
19
+ * else under `auth/` is granted.
20
+ *
21
+ * spec-cite: Vault "Policies" (path globs, `deny` precedence) https://developer.hashicorp.com/vault/docs/concepts/policies;
22
+ * Transit API https://developer.hashicorp.com/vault/api-docs/secret/transit; KV v2 API
23
+ * https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2; token renew-self
24
+ * https://developer.hashicorp.com/vault/api-docs/auth/token#renew-a-token-self.
25
+ */
26
+ /** @wildo_source:part:start platform.key-management.vault-custody facet:layer:platform facet:family:security facet:audience:app-developer */
27
+ /** The Transit mount the providers use when none is configured. */
28
+ export declare const VAULT_DEFAULT_TRANSIT_MOUNT = "transit";
29
+ /** The KV v2 mount the providers use when none is configured (where a Vault dev server mounts it). */
30
+ export declare const VAULT_DEFAULT_KV_MOUNT = "secret";
31
+ /** The prefix of every key name the providers create; the policies grant nothing outside it. */
32
+ export declare const VAULT_DEFAULT_KEY_NAME_PREFIX = "wildo-";
33
+ /** The names the two policies are written under. */
34
+ export declare const VAULT_SIGNER_POLICY_NAME = "wildo-key-signer";
35
+ export declare const VAULT_OPERATOR_POLICY_NAME = "wildo-key-operator";
36
+ /** Where the providers' keys live in one Vault. */
37
+ export interface VaultCustodyLayout {
38
+ readonly transitMount: string;
39
+ readonly kvMount: string;
40
+ readonly keyNamePrefix: string;
41
+ }
42
+ /** The layout with every default applied. */
43
+ export declare function vaultCustodyLayoutOf(layout?: Partial<VaultCustodyLayout>): VaultCustodyLayout;
44
+ /** The SIGNER token's policy, as Vault HCL. */
45
+ export declare function vaultSignerPolicy(layout?: VaultCustodyLayout): string;
46
+ /** The OPERATOR token's policy, as Vault HCL. */
47
+ export declare function vaultOperatorPolicy(layout?: VaultCustodyLayout): string;
48
+ /** @wildo_source:part:end platform.key-management.vault-custody */
49
+ /**
50
+ * How long a token issued for the platform lives between renewals. apps-manager renews each token at half its lease
51
+ * (`VaultTokenRenewal`), so the period bounds how long a token that stops being renewed stays usable, not how long the
52
+ * platform runs.
53
+ */
54
+ export declare const VAULT_TOKEN_PERIOD = "768h";
55
+ /**
56
+ * # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)
57
+ *
58
+ * A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery
59
+ * keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server
60
+ * onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its
61
+ * policy is the whole of what it may do:
62
+ *
63
+ * - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006
64
+ * (which holds no such token) answers "bad token" here rather than half-way through a rotation;
65
+ * - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it
66
+ * by that accessor. Lookup returns metadata, never a secret;
67
+ * - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform
68
+ * policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other
69
+ * parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the
70
+ * policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,
71
+ * a create without `no_default_policy` was admitted and attached `default`);
72
+ * - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that
73
+ * moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old
74
+ * one previous, a rotation, and the new key alone unseals while the old one is refused).
75
+ *
76
+ * It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a
77
+ * signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in
78
+ * `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,
79
+ * apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its
80
+ * first start alone.
81
+ *
82
+ * spec-cite: OpenBao/Vault "Policies" (`allowed_parameters`, `required_parameters`, `sudo`)
83
+ * https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)
84
+ * https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.
85
+ */
86
+ export declare const VAULT_RECOVERY_POLICY_NAME = "wildo-key-recovery";
87
+ /**
88
+ * How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a
89
+ * periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the
90
+ * first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would
91
+ * have expired after 32 days.
92
+ */
93
+ export declare const VAULT_RECOVERY_TOKEN_TTL = "876000h";
94
+ /** The platform policies a recovery token may mint a token under, one per token. */
95
+ export declare const VAULT_RECOVERY_MINTABLE_POLICY_NAMES: readonly ["wildo-key-signer", "wildo-key-operator", "wildo-key-recovery"];
96
+ /** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */
97
+ export declare function vaultRecoveryPolicy(): string;
98
+ //# sourceMappingURL=vault-custody.contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-custody.contracts.d.ts","sourceRoot":"","sources":["../../../src/key-management/vault-custody.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6IAA6I;AAC7I,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,sGAAsG;AACtG,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,gGAAgG;AAChG,eAAO,MAAM,6BAA6B,WAAW,CAAC;AAEtD,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,kBAAkB,CAMjG;AAID,+CAA+C;AAC/C,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,kBAA2C,GAAG,MAAM,CAc7F;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,CAAC,MAAM,GAAE,kBAA2C,GAAG,MAAM,CAkB/F;AAED,mEAAmE;AAEnE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,2EAA8F,CAAC;AAEhJ,uHAAuH;AACvH,wBAAgB,mBAAmB,IAAI,MAAM,CAuB5C"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * # The platform's Vault custody contract (#2933)
3
+ *
4
+ * apps-manager signs through HashiCorp Vault (or OpenBao) with TWO tokens, and least privilege is a property of the
5
+ * policy each token holds. Those policies are stated here once, because three places need the same text: the
6
+ * self-hosted OpenBao the CLI renders (it writes them at its first start), the real-container test suite, and the
7
+ * runbook an operator follows to configure their own Vault. A copy in each would drift, and a drift here is either a
8
+ * provider that cannot do its job or a token that can do more than its job.
9
+ *
10
+ * - The SIGNER token signs, wraps and reads: `transit/sign/<k>`, `transit/encrypt/<k>` and `transit/decrypt/<k>` (data
11
+ * keys wrapped and unwrapped under a wrapping key, #2894), read on `transit/keys/<k>` (the public key and the
12
+ * attributes the attestation is computed from), and read on a KV key. It can never change a key's configuration, so it can never
13
+ * make a key exportable; Vault's deny-by-default already refuses that, and the explicit `deny` lines keep it refused
14
+ * if a broader grant is ever added beside these.
15
+ * - The OPERATOR token performs lifecycle acts (create, rotate, configure, delete; KV write, delete, destroy) and can
16
+ * neither sign, wrap, unwrap nor read key material, nor send `exportable` / `allow_plaintext_backup` (`denied_parameters`), so it
17
+ * cannot make a Transit key leave Vault either.
18
+ * - Both may renew THEMSELVES (`auth/token/renew-self`), because a periodic token that is not renewed expires; nothing
19
+ * else under `auth/` is granted.
20
+ *
21
+ * spec-cite: Vault "Policies" (path globs, `deny` precedence) https://developer.hashicorp.com/vault/docs/concepts/policies;
22
+ * Transit API https://developer.hashicorp.com/vault/api-docs/secret/transit; KV v2 API
23
+ * https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2; token renew-self
24
+ * https://developer.hashicorp.com/vault/api-docs/auth/token#renew-a-token-self.
25
+ */
26
+ /** @wildo_source:part:start platform.key-management.vault-custody facet:layer:platform facet:family:security facet:audience:app-developer */
27
+ /** The Transit mount the providers use when none is configured. */
28
+ export const VAULT_DEFAULT_TRANSIT_MOUNT = 'transit';
29
+ /** The KV v2 mount the providers use when none is configured (where a Vault dev server mounts it). */
30
+ export const VAULT_DEFAULT_KV_MOUNT = 'secret';
31
+ /** The prefix of every key name the providers create; the policies grant nothing outside it. */
32
+ export const VAULT_DEFAULT_KEY_NAME_PREFIX = 'wildo-';
33
+ /** The names the two policies are written under. */
34
+ export const VAULT_SIGNER_POLICY_NAME = 'wildo-key-signer';
35
+ export const VAULT_OPERATOR_POLICY_NAME = 'wildo-key-operator';
36
+ /** The layout with every default applied. */
37
+ export function vaultCustodyLayoutOf(layout = {}) {
38
+ return {
39
+ transitMount: layout.transitMount || VAULT_DEFAULT_TRANSIT_MOUNT,
40
+ kvMount: layout.kvMount || VAULT_DEFAULT_KV_MOUNT,
41
+ keyNamePrefix: layout.keyNamePrefix || VAULT_DEFAULT_KEY_NAME_PREFIX,
42
+ };
43
+ }
44
+ const RENEW_SELF = 'path "auth/token/renew-self" { capabilities = ["update"] }';
45
+ /** The SIGNER token's policy, as Vault HCL. */
46
+ export function vaultSignerPolicy(layout = vaultCustodyLayoutOf()) {
47
+ const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;
48
+ return [
49
+ `path "${t}/sign/${p}*" { capabilities = ["update"] }`,
50
+ `path "${t}/encrypt/${p}*" { capabilities = ["update"] }`,
51
+ `path "${t}/decrypt/${p}*" { capabilities = ["update"] }`,
52
+ `path "${t}/keys/${p}*" { capabilities = ["read"] }`,
53
+ `path "${kv}/data/${p}*" { capabilities = ["read"] }`,
54
+ `path "${kv}/metadata/${p}*" { capabilities = ["read"] }`,
55
+ `path "${t}/keys/+/config" { capabilities = ["deny"] }`,
56
+ `path "${t}/export/*" { capabilities = ["deny"] }`,
57
+ `path "${t}/backup/*" { capabilities = ["deny"] }`,
58
+ RENEW_SELF,
59
+ ].join('\n');
60
+ }
61
+ /** The OPERATOR token's policy, as Vault HCL. */
62
+ export function vaultOperatorPolicy(layout = vaultCustodyLayoutOf()) {
63
+ const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;
64
+ return [
65
+ // `exportable` and `allow_plaintext_backup` are one-way and turn a key into one that can leave Vault, so the
66
+ // operator may not send them at all, at creation or on `/config`: Vault refuses any request carrying a denied
67
+ // parameter, whatever its value.
68
+ `path "${t}/keys/${p}*" { capabilities = ["create", "update", "read", "delete"] denied_parameters = { "exportable" = [] "allow_plaintext_backup" = [] } }`,
69
+ `path "${kv}/data/${p}*" { capabilities = ["create", "update"] }`,
70
+ `path "${kv}/delete/${p}*" { capabilities = ["update"] }`,
71
+ `path "${kv}/destroy/${p}*" { capabilities = ["update"] }`,
72
+ `path "${kv}/metadata/${p}*" { capabilities = ["delete"] }`,
73
+ `path "${t}/sign/*" { capabilities = ["deny"] }`,
74
+ `path "${t}/encrypt/*" { capabilities = ["deny"] }`,
75
+ `path "${t}/decrypt/*" { capabilities = ["deny"] }`,
76
+ `path "${t}/export/*" { capabilities = ["deny"] }`,
77
+ `path "${t}/backup/*" { capabilities = ["deny"] }`,
78
+ RENEW_SELF,
79
+ ].join('\n');
80
+ }
81
+ /** @wildo_source:part:end platform.key-management.vault-custody */
82
+ /**
83
+ * How long a token issued for the platform lives between renewals. apps-manager renews each token at half its lease
84
+ * (`VaultTokenRenewal`), so the period bounds how long a token that stops being renewed stays usable, not how long the
85
+ * platform runs.
86
+ */
87
+ export const VAULT_TOKEN_PERIOD = '768h';
88
+ /**
89
+ * # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)
90
+ *
91
+ * A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery
92
+ * keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server
93
+ * onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its
94
+ * policy is the whole of what it may do:
95
+ *
96
+ * - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006
97
+ * (which holds no such token) answers "bad token" here rather than half-way through a rotation;
98
+ * - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it
99
+ * by that accessor. Lookup returns metadata, never a secret;
100
+ * - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform
101
+ * policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other
102
+ * parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the
103
+ * policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,
104
+ * a create without `no_default_policy` was admitted and attached `default`);
105
+ * - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that
106
+ * moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old
107
+ * one previous, a rotation, and the new key alone unseals while the old one is refused).
108
+ *
109
+ * It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a
110
+ * signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in
111
+ * `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,
112
+ * apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its
113
+ * first start alone.
114
+ *
115
+ * spec-cite: OpenBao/Vault "Policies" (`allowed_parameters`, `required_parameters`, `sudo`)
116
+ * https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)
117
+ * https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.
118
+ */
119
+ export const VAULT_RECOVERY_POLICY_NAME = 'wildo-key-recovery';
120
+ /**
121
+ * How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a
122
+ * periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the
123
+ * first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would
124
+ * have expired after 32 days.
125
+ */
126
+ export const VAULT_RECOVERY_TOKEN_TTL = '876000h';
127
+ /** The platform policies a recovery token may mint a token under, one per token. */
128
+ export const VAULT_RECOVERY_MINTABLE_POLICY_NAMES = [VAULT_SIGNER_POLICY_NAME, VAULT_OPERATOR_POLICY_NAME, VAULT_RECOVERY_POLICY_NAME];
129
+ /** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */
130
+ export function vaultRecoveryPolicy() {
131
+ const policies = VAULT_RECOVERY_MINTABLE_POLICY_NAMES.map((name) => `["${name}"]`).join(', ');
132
+ return [
133
+ 'path "auth/token/lookup-self" { capabilities = ["read"] }',
134
+ 'path "auth/token/lookup" { capabilities = ["update"] }',
135
+ 'path "auth/token/revoke-accessor" { capabilities = ["update"] }',
136
+ [
137
+ 'path "auth/token/create-orphan" {',
138
+ ' capabilities = ["update", "sudo"]',
139
+ ' required_parameters = ["id", "policies", "no_default_policy"]',
140
+ ' allowed_parameters = {',
141
+ ' "id" = []',
142
+ ` "policies" = [${policies}]`,
143
+ ' "no_default_policy" = [true]',
144
+ ` "period" = ["${VAULT_TOKEN_PERIOD}"]`,
145
+ ` "ttl" = ["${VAULT_RECOVERY_TOKEN_TTL}"]`,
146
+ ' "display_name" = []',
147
+ ' "meta" = []',
148
+ ' }',
149
+ '}',
150
+ ].join('\n'),
151
+ 'path "sys/rotate/root" { capabilities = ["update", "sudo"] }',
152
+ ].join('\n');
153
+ }
154
+ //# sourceMappingURL=vault-custody.contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-custody.contracts.js","sourceRoot":"","sources":["../../../src/key-management/vault-custody.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6IAA6I;AAC7I,mEAAmE;AACnE,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC;AACrD,sGAAsG;AACtG,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAC/C,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAEtD,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAS/D,6CAA6C;AAC7C,MAAM,UAAU,oBAAoB,CAAC,SAAsC,EAAE;IAC3E,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,2BAA2B;QAChE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,sBAAsB;QACjD,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,6BAA6B;KACrE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAEhF,+CAA+C;AAC/C,MAAM,UAAU,iBAAiB,CAAC,SAA6B,oBAAoB,EAAE;IACnF,MA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A8BG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD,oFAAoF;AACpF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,wBAAwB,EAAE,0BAA0B,EAAE,0BAA0B,CAAU,CAAC;AAEhJ,uHAAuH;AACvH,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,oCAAoC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9F,OAAO;QACL,2DAA2D;QAC3D,wDAAwD;QACxD,iEAAiE;QACjE;YACE,mCAAmC;YACnC,qCAAqC;YACrC,iEAAiE;YACjE,0BAA0B;YAC1B,eAAe;YACf,qBAAqB,QAAQ,GAAG;YAChC,kCAAkC;YAClC,oBAAoB,kBAAkB,IAAI;YAC1C,iBAAiB,wBAAwB,IAAI;YAC7C,yBAAyB;YACzB,iBAAiB;YACjB,KAAK;YACL,GAAG;SACJ,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,8DAA8D;KAC/D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["/**\n * # The platform's Vault custody contract (#2933)\n *\n * apps-manager signs through HashiCorp Vault (or OpenBao) with TWO tokens, and least privilege is a property of the\n * policy each token holds. Those policies are stated here once, because three places need the same text: the\n * self-hosted OpenBao the CLI renders (it writes them at its first start), the real-container test suite, and the\n * runbook an operator follows to configure their own Vault. A copy in each would drift, and a drift here is either a\n * provider that cannot do its job or a token that can do more than its job.\n *\n * - The SIGNER token signs, wraps and reads: `transit/sign/<k>`, `transit/encrypt/<k>` and `transit/decrypt/<k>` (data\n * keys wrapped and unwrapped under a wrapping key, #2894), read on `transit/keys/<k>` (the public key and the\n * attributes the attestation is computed from), and read on a KV key. It can never change a key's configuration, so it can never\n * make a key exportable; Vault's deny-by-default already refuses that, and the explicit `deny` lines keep it refused\n * if a broader grant is ever added beside these.\n * - The OPERATOR token performs lifecycle acts (create, rotate, configure, delete; KV write, delete, destroy) and can\n * neither sign, wrap, unwrap nor read key material, nor send `exportable` / `allow_plaintext_backup` (`denied_parameters`), so it\n * cannot make a Transit key leave Vault either.\n * - Both may renew THEMSELVES (`auth/token/renew-self`), because a periodic token that is not renewed expires; nothing\n * else under `auth/` is granted.\n *\n * spec-cite: Vault \"Policies\" (path globs, `deny` precedence) https://developer.hashicorp.com/vault/docs/concepts/policies;\n * Transit API https://developer.hashicorp.com/vault/api-docs/secret/transit; KV v2 API\n * https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2; token renew-self\n * https://developer.hashicorp.com/vault/api-docs/auth/token#renew-a-token-self.\n */\n\n/** @wildo_source:part:start platform.key-management.vault-custody facet:layer:platform facet:family:security facet:audience:app-developer */\n/** The Transit mount the providers use when none is configured. */\nexport const VAULT_DEFAULT_TRANSIT_MOUNT = 'transit';\n/** The KV v2 mount the providers use when none is configured (where a Vault dev server mounts it). */\nexport const VAULT_DEFAULT_KV_MOUNT = 'secret';\n/** The prefix of every key name the providers create; the policies grant nothing outside it. */\nexport const VAULT_DEFAULT_KEY_NAME_PREFIX = 'wildo-';\n\n/** The names the two policies are written under. */\nexport const VAULT_SIGNER_POLICY_NAME = 'wildo-key-signer';\nexport const VAULT_OPERATOR_POLICY_NAME = 'wildo-key-operator';\n\n/** Where the providers' keys live in one Vault. */\nexport interface VaultCustodyLayout {\n readonly transitMount: string;\n readonly kvMount: string;\n readonly keyNamePrefix: string;\n}\n\n/** The layout with every default applied. */\nexport function vaultCustodyLayoutOf(layout: Partial<VaultCustodyLayout> = {}): VaultCustodyLayout {\n return {\n transitMount: layout.transitMount || VAULT_DEFAULT_TRANSIT_MOUNT,\n kvMount: layout.kvMount || VAULT_DEFAULT_KV_MOUNT,\n keyNamePrefix: layout.keyNamePrefix || VAULT_DEFAULT_KEY_NAME_PREFIX,\n };\n}\n\nconst RENEW_SELF = 'path \"auth/token/renew-self\" { capabilities = [\"update\"] }';\n\n/** The SIGNER token's policy, as Vault HCL. */\nexport function vaultSignerPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n `path \"${t}/sign/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/encrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/decrypt/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${t}/keys/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"read\"] }`,\n `path \"${t}/keys/+/config\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** The OPERATOR token's policy, as Vault HCL. */\nexport function vaultOperatorPolicy(layout: VaultCustodyLayout = vaultCustodyLayoutOf()): string {\n const { transitMount: t, kvMount: kv, keyNamePrefix: p } = layout;\n return [\n // `exportable` and `allow_plaintext_backup` are one-way and turn a key into one that can leave Vault, so the\n // operator may not send them at all, at creation or on `/config`: Vault refuses any request carrying a denied\n // parameter, whatever its value.\n `path \"${t}/keys/${p}*\" { capabilities = [\"create\", \"update\", \"read\", \"delete\"] denied_parameters = { \"exportable\" = [] \"allow_plaintext_backup\" = [] } }`,\n `path \"${kv}/data/${p}*\" { capabilities = [\"create\", \"update\"] }`,\n `path \"${kv}/delete/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/destroy/${p}*\" { capabilities = [\"update\"] }`,\n `path \"${kv}/metadata/${p}*\" { capabilities = [\"delete\"] }`,\n `path \"${t}/sign/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/encrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/decrypt/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/export/*\" { capabilities = [\"deny\"] }`,\n `path \"${t}/backup/*\" { capabilities = [\"deny\"] }`,\n RENEW_SELF,\n ].join('\\n');\n}\n\n/** @wildo_source:part:end platform.key-management.vault-custody */\n\n/**\n * How long a token issued for the platform lives between renewals. apps-manager renews each token at half its lease\n * (`VaultTokenRenewal`), so the period bounds how long a token that stops being renewed stays usable, not how long the\n * platform runs.\n */\nexport const VAULT_TOKEN_PERIOD = '768h';\n\n/**\n * # The break-glass RECOVERY token of the self-hosted OpenBao (#3006)\n *\n * A self-initialized OpenBao revokes its root token when initialization ends, and a static-seal server has no recovery\n * keys, so without a third credential nothing could ever replace a leaked signer or operator token, or move the server\n * onto a new unseal key, short of wiping its storage and every key in it. The recovery token is that credential, and its\n * policy is the whole of what it may do:\n *\n * - `auth/token/lookup-self`: the CLI proves the token is live before it acts, and a server initialized before #3006\n * (which holds no such token) answers \"bad token\" here rather than half-way through a rotation;\n * - `auth/token/lookup` and `auth/token/revoke-accessor`: read the accessor of the token being replaced, then revoke it\n * by that accessor. Lookup returns metadata, never a secret;\n * - `auth/token/create-orphan` with `sudo` (a custom `id` needs it): only under exactly ONE of the three platform\n * policies, only with no default policy, and only with the period or TTL the platform's own tokens carry. Every other\n * parameter is refused (`allowed_parameters`), and `required_parameters` refuses a request that omits the id, the\n * policy or `no_default_policy` (an omitted parameter is not checked by `allowed_parameters`; measured on OpenBao 2.7.1,\n * a create without `no_default_policy` was admitted and attached `default`);\n * - `sys/rotate/root` with `sudo`: re-wraps the server's root key under the seal's CURRENT key, which is the step that\n * moves a static-seal server onto a new unseal key (measured on 2.7.1: started with the new key current and the old\n * one previous, a rotation, and the new key alone unseals while the old one is refused).\n *\n * It can neither sign, wrap, read key material, change a mount nor write a policy, so a leaked recovery token can mint a\n * signer and sign, which is the power any signer token has, but cannot make a key leave the server. It is held in\n * `secrets.json` (and the CI secret store a pipeline renders the server from); no runtime's environment carries it,\n * apps-manager's included (the env builder forbids it), and only the server's own container receives it, read at its\n * first start alone.\n *\n * spec-cite: OpenBao/Vault \"Policies\" (`allowed_parameters`, `required_parameters`, `sudo`)\n * https://openbao.org/docs/concepts/policies/; token API (`create-orphan`, `lookup`, `revoke-accessor`)\n * https://openbao.org/api-docs/auth/token/; `sys/rotate/root` https://openbao.org/api-docs/system/rotate-root/.\n */\nexport const VAULT_RECOVERY_POLICY_NAME = 'wildo-key-recovery';\n\n/**\n * How long the recovery token lives: one hundred years, i.e. it does not expire. It is offline (nobody renews it), so a\n * periodic token would be dead after one period. The token mount's maximum lease TTL is raised to the same value at the\n * first start: created by the root token with no TTL, it got the mount default, 768h (measured on OpenBao 2.7.1), and would\n * have expired after 32 days.\n */\nexport const VAULT_RECOVERY_TOKEN_TTL = '876000h';\n\n/** The platform policies a recovery token may mint a token under, one per token. */\nexport const VAULT_RECOVERY_MINTABLE_POLICY_NAMES = [VAULT_SIGNER_POLICY_NAME, VAULT_OPERATOR_POLICY_NAME, VAULT_RECOVERY_POLICY_NAME] as const;\n\n/** The RECOVERY token's policy, as Vault HCL. Depends on no layout: it touches no mount but `auth/token` and `sys`. */\nexport function vaultRecoveryPolicy(): string {\n const policies = VAULT_RECOVERY_MINTABLE_POLICY_NAMES.map((name) => `[\"${name}\"]`).join(', ');\n return [\n 'path \"auth/token/lookup-self\" { capabilities = [\"read\"] }',\n 'path \"auth/token/lookup\" { capabilities = [\"update\"] }',\n 'path \"auth/token/revoke-accessor\" { capabilities = [\"update\"] }',\n [\n 'path \"auth/token/create-orphan\" {',\n ' capabilities = [\"update\", \"sudo\"]',\n ' required_parameters = [\"id\", \"policies\", \"no_default_policy\"]',\n ' allowed_parameters = {',\n ' \"id\" = []',\n ` \"policies\" = [${policies}]`,\n ' \"no_default_policy\" = [true]',\n ` \"period\" = [\"${VAULT_TOKEN_PERIOD}\"]`,\n ` \"ttl\" = [\"${VAULT_RECOVERY_TOKEN_TTL}\"]`,\n ' \"display_name\" = []',\n ' \"meta\" = []',\n ' }',\n '}',\n ].join('\\n'),\n 'path \"sys/rotate/root\" { capabilities = [\"update\", \"sudo\"] }',\n ].join('\\n');\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAmD,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9E"}
1
+ {"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAmD,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE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O,yBAAyB,CAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAA0B,CAAC,MAAM,CAAC,CAAC;IAChH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,yBAAyB,CAAC;IACnC,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,MAAc;IACpE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACnD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,aAAa,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5H,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\n/**\n * How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).\n *\n * An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it\n * builds, so it lives in the application's machine-local state beside the workspace-mutation lock and\n * is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI\n * writes it (`wildo workbench parallelism <n>`).\n *\n * Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains\n * one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents\n * editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead\n * of preventing it.\n */\nexport const BUILD_PARALLELISM_RELATIVE_PATH: string = '.wildo-saas/state/build-parallelism.json';\n\n/**\n * Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.\n *\n * Five rather than more because each slot is a live agent spending on its own, and the wave is already\n * measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s\n * against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent\n * sessions, so the setting — not the provider — is what decides the width.\n */\nexport const DEFAULT_BUILD_PARALLELISM = 5;\n\n/**\n * A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops\n * a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.\n */\nexport const MAXIMUM_BUILD_PARALLELISM = 16;\n\n/** Absolute path of an application's build-parallelism setting. */\nexport function getBuildParallelismPath(saasRoot: string): string {\n return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);\n}\n\n/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */\nexport function normalizeBuildParallelism(value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return DEFAULT_BUILD_PARALLELISM;\n return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));\n}\n\n/**\n * The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as\n * the default, because a throughput knob that cannot be read must not stop the build.\n */\nexport function readBuildParallelism(saasRoot: string): number {\n const filePath = getBuildParallelismPath(saasRoot);\n if (!existsSync(filePath)) return DEFAULT_BUILD_PARALLELISM;\n try {\n return normalizeBuildParallelism((JSON.parse(readFileSync(filePath, 'utf8')) as { degree?: unknown }).degree);\n } catch {\n return DEFAULT_BUILD_PARALLELISM;\n }\n}\n\n/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */\nexport function writeBuildParallelism(saasRoot: string, degree: number): number {\n const recorded = normalizeBuildParallelism(degree);\n const filePath = getBuildParallelismPath(saasRoot);\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\\n`, 'utf8');\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M,CAAC;QACP,OAAO,yBAAyB,CAAC;IACnC,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,MAAc;IACpE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACnD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,aAAa,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5H,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\n/**\n * How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).\n *\n * An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it\n * builds, so it lives in the application's machine-local state beside the workspace-mutation lock and\n * is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI\n * writes it (`wildo workbench parallelism <n>`).\n *\n * Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains\n * one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents\n * editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead\n * of preventing it.\n */\nexport const BUILD_PARALLELISM_RELATIVE_PATH: string = '.wildo-saas/state/build-parallelism.json';\n\n/**\n * Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.\n *\n * Five rather than more because each slot is a live agent spending on its own, and the wave is already\n * measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s\n * against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent\n * sessions, so the setting — not the provider — is what decides the width.\n */\nexport const DEFAULT_BUILD_PARALLELISM = 5;\n\n/**\n * A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops\n * a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.\n */\nexport const MAXIMUM_BUILD_PARALLELISM = 16;\n\n/** Absolute path of an application's build-parallelism setting. */\nexport function getBuildParallelismPath(saasRoot: string): string {\n return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);\n}\n\n/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */\nexport function normalizeBuildParallelism(value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return DEFAULT_BUILD_PARALLELISM;\n return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));\n}\n\n/**\n * The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as\n * the default, because a throughput knob that cannot be read must not stop the build.\n */\nexport function readBuildParallelism(saasRoot: string): number {\n const filePath = getBuildParallelismPath(saasRoot);\n if (!existsSync(filePath)) return DEFAULT_BUILD_PARALLELISM;\n try {\n return normalizeBuildParallelism((JSON.parse(readFileSync(filePath, 'utf8')) as { degree?: unknown }).degree);\n } catch {\n return DEFAULT_BUILD_PARALLELISM;\n }\n}\n\n/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */\nexport function writeBuildParallelism(saasRoot: string, degree: number): number {\n const recorded = normalizeBuildParallelism(degree);\n const filePath = getBuildParallelismPath(saasRoot);\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\\n`, 'utf8');\n return recorded;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Canonical JSON serialization helpers shared by lockfile writers and
3
- * lockfile readers (Slice 4.A.1 / H2 of `infra-provider-planner.md`).
3
+ * lockfile readers.
4
4
  *
5
5
  * `JSON.stringify`'s built-in second argument can either filter+order
6
6
  * top-level keys (when given an array) or transform values (when given
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAW1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGzD"}
1
+ {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAW1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGzD"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Canonical JSON serialization helpers shared by lockfile writers and
3
- * lockfile readers (Slice 4.A.1 / H2 of `infra-provider-planner.md`).
3
+ * lockfile readers.
4
4
  *
5
5
  * `JSON.stringify`'s built-in second argument can either filter+order
6
6
  * top-level keys (when given an array) or transform values (when given
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,MAAM,CAAC,CAAC,CAAC,GAAI,CAA6B,CAAC,CAAC,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Canonical JSON serialization helpers shared by lockfile writers and\n * lockfile readers (Slice 4.A.1 / H2 of `infra-provider-planner.md`).\n *\n * `JSON.stringify`'s built-in second argument can either filter+order\n * top-level keys (when given an array) or transform values (when given\n * a function). To get a *recursive* canonical serialization — the\n * SAME byte output for two semantically equal inputs regardless of\n * property-insertion order at any nesting level — we need a transform\n * that returns a new object with sorted keys at every layer.\n *\n * The legacy in-line implementation in `materialize-infra-section.ts`\n * sorted only top-level keys. That meant nested objects (e.g.\n * `MongoBackingService.options: {retryWrites, w, authSource}`) drifted\n * across editor saves that re-ordered the nested keys, falsely\n * triggering lockfile-drift CI failures.\n *\n * This helper is the canonical fix.\n */\n\nimport { createHash } from 'node:crypto';\n\n/**\n * `JSON.stringify` with sorted keys at every nesting level. Stable\n * across platforms, editor save formats, and Node versions.\n *\n * Special-cases:\n * - Arrays preserve order (semantic — array order is meaningful).\n * - Objects sort their own keys (lexicographic).\n * - Primitives pass through.\n * - `undefined` values are dropped (matches `JSON.stringify` default).\n */\nexport function stableJsonStringify(value: unknown): string {\n return JSON.stringify(value, (_key, v) => {\n if (v && typeof v === 'object' && !Array.isArray(v)) {\n const sorted: Record<string, unknown> = {};\n for (const k of Object.keys(v).sort()) {\n sorted[k] = (v as Record<string, unknown>)[k];\n }\n return sorted;\n }\n return v;\n });\n}\n\n/**\n * Stable sha256 digest of any JSON-serializable value. Output format:\n * `sha256:<hex>` (matches the digest convention used elsewhere in the\n * lockfile envelope, e.g. provider-runtime artifacts).\n *\n * Two inputs with the same canonical serialization (per\n * `stableJsonStringify`) produce the same digest regardless of\n * property-insertion order at any nesting level.\n */\nexport function stableSha256Digest(value: unknown): string {\n const canonical = stableJsonStringify(value);\n return `sha256:${createHash('sha256').update(canonical).digest('hex')}`;\n}\n"]}
1
+ {"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,MAAM,CAAC,CAAC,CAAC,GAAI,CAA6B,CAAC,CAAC,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Canonical JSON serialization helpers shared by lockfile writers and\n * lockfile readers.\n *\n * `JSON.stringify`'s built-in second argument can either filter+order\n * top-level keys (when given an array) or transform values (when given\n * a function). To get a *recursive* canonical serialization — the\n * SAME byte output for two semantically equal inputs regardless of\n * property-insertion order at any nesting level — we need a transform\n * that returns a new object with sorted keys at every layer.\n *\n * The legacy in-line implementation in `materialize-infra-section.ts`\n * sorted only top-level keys. That meant nested objects (e.g.\n * `MongoBackingService.options: {retryWrites, w, authSource}`) drifted\n * across editor saves that re-ordered the nested keys, falsely\n * triggering lockfile-drift CI failures.\n *\n * This helper is the canonical fix.\n */\n\nimport { createHash } from 'node:crypto';\n\n/**\n * `JSON.stringify` with sorted keys at every nesting level. Stable\n * across platforms, editor save formats, and Node versions.\n *\n * Special-cases:\n * - Arrays preserve order (semantic — array order is meaningful).\n * - Objects sort their own keys (lexicographic).\n * - Primitives pass through.\n * - `undefined` values are dropped (matches `JSON.stringify` default).\n */\nexport function stableJsonStringify(value: unknown): string {\n return JSON.stringify(value, (_key, v) => {\n if (v && typeof v === 'object' && !Array.isArray(v)) {\n const sorted: Record<string, unknown> = {};\n for (const k of Object.keys(v).sort()) {\n sorted[k] = (v as Record<string, unknown>)[k];\n }\n return sorted;\n }\n return v;\n });\n}\n\n/**\n * Stable sha256 digest of any JSON-serializable value. Output format:\n * `sha256:<hex>` (matches the digest convention used elsewhere in the\n * lockfile envelope, e.g. provider-runtime artifacts).\n *\n * Two inputs with the same canonical serialization (per\n * `stableJsonStringify`) produce the same digest regardless of\n * property-insertion order at any nesting level.\n */\nexport function stableSha256Digest(value: unknown): string {\n const canonical = stableJsonStringify(value);\n return `sha256:${createHash('sha256').update(canonical).digest('hex')}`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"file-lock-hold.d.ts","sourceRoot":"","sources":["../../../src/lockfile/file-lock-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,QAAc,CAAC;AAE1D,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3G,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACpE;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,oGAAoG;IACpG,YAAY,CAAC,EAAE,OAAO,CAAC;gBAEX,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CASnD;AAUD;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAIhD;AAaD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGpE;AAmGD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OA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CA6E/H"}
@@ -32,6 +32,7 @@ import * as os from 'node:os';
32
32
  import * as path from 'node:path';
33
33
  import lockfile from 'proper-lockfile';
34
34
  import { z } from 'zod';
35
+ import { describeCaughtError } from '@wildo-ai/saas-models';
35
36
  /**
36
37
  * How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.
37
38
  *
@@ -51,7 +52,7 @@ export class FileLockCompromisedError extends Error {
51
52
  /** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */
52
53
  sectionError;
53
54
  constructor(lockTargetPath, cause) {
54
- super(`The lock on ${lockTargetPath} was lost while it was held (${cause instanceof Error ? cause.message : String(cause)}). `
55
+ super(`The lock on ${lockTargetPath} was lost while it was held (${describeCaughtError(cause)}). `
55
56
  + 'The critical section it guarded did not keep exclusive access and was refused.', { cause });
56
57
  this.name = 'FileLockCompromisedError';
57
58
  this.lockTargetPath = lockTargetPath;
@@ -1 +1 @@
1
- {"version":3,"file":"file-lock-hold.js","sourceRoot":"","sources":["../../../../src/lockfile/file-lock-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,MAAM,CAAC;AAc1D;;;;GAIG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACxC,IAAI,G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CAAC;QACnG,MAAM,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0FAA0F;QAC1F,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC;QAC3C,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,kBAAkB,EAAE,CAAC;IAC3B,IAAI,aAAa;QAAE,MAAM,YAAY,CAAC;IACtC,OAAO,KAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The one way this package acquires a `proper-lockfile` lock, so every holder gets the same two\n * guarantees (#2225):\n *\n * 1. **A waiter never reclaims the lock of a holder that is still alive.** proper-lockfile decides a\n * lock is stale from its directory's mtime alone (`stale`, 5 s by default here). A holder whose\n * refresh is merely LATE — an event-loop stall, a saturated libuv threadpool, a laptop waking up —\n * recovers on its own as long as nobody touched the lock directory (proper-lockfile 4.1.2,\n * `lockfile.js` `updateLock`: a successful `utimes` carries no threshold check). What turns a late\n * refresh into a lost lock is a WAITER judging the mtime stale and removing the directory. So the\n * reclaim itself is guarded: the removal is refused while the recorded holder is alive on this host.\n * 2. **Losing the lock is an error in that critical section, never a process exit.** proper-lockfile's\n * default `onCompromised` throws inside an `fs` callback, which is an uncaught exception. On\n * 2026-10-01 that killed the dev companion mid build wave, with every in-flight coding run in it.\n *\n * Why a liveness check and not simply a larger `stale`: the reclaim that matters most is by the SAME\n * process — proper-lockfile keeps no in-process guard, so a second `lock()` in the companion (a\n * concurrent run's commit retrying for minutes) takes the same mtime path as a stranger would. Any\n * fixed window is one stall away from being too short, and a long window makes a CRASHED holder's lock\n * block everyone for that long. Asking \"is the holder alive\" keeps dead-holder recovery at 5 s and makes\n * the live-holder case independent of timing. Rejected: writing the holder record INSIDE the lock\n * directory (it changes the directory's mtime, which proper-lockfile reads as another owner, and makes a\n * plain `rmdir` from an older library fail `ENOTEMPTY`) and BESIDE it (the shared\n * `.wildo-saas/wildo-saas.lock.json.lock` sits in a committed, un-ignored directory, so a record there is\n * an untracked file in the very `git status` the companion attributes writes from).\n */\n\nimport nodeFs from 'node:fs';\nimport { promises as fs } from 'node:fs';\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { createHash, randomUUID } from 'node:crypto';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport lockfile from 'proper-lockfile';\nimport { z } from 'zod';\n\n/**\n * How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.\n *\n * Ten minutes without a single mtime refresh (normally every 2.5 s) means the holder is wedged, or its\n * pid was reused by an unrelated process. Past this the reclaim proceeds, and the wedged holder learns it\n * lost the lock through {@link FileLockCompromisedError} rather than by dying.\n */\nexport const LIVE_HOLDER_RECLAIM_CEILING_MS = 10 * 60_000;\n\n/** Options every acquisition in this package resolves to. */\nexport interface FileLockAcquireOptions {\n readonly retries: number | { retries?: number; minTimeout?: number; maxTimeout?: number; factor?: number };\n readonly stale: number;\n readonly realpath: boolean;\n /**\n * Told once when the lock is lost while held. The critical section still fails with\n * {@link FileLockCompromisedError}; this is for the caller's own log. Omitted, one line goes to stderr.\n */\n readonly onCompromised?: (error: FileLockCompromisedError) => void;\n}\n\n/**\n * The lock was taken from this holder while it still held it — another acquirer removed it, or the lock\n * directory was deleted. The holder no longer has exclusivity, so whatever it was about to do as the\n * exclusive writer must not happen. `code` is `ECOMPROMISED`, the code proper-lockfile itself uses.\n */\nexport class FileLockCompromisedError extends Error {\n readonly code = 'ECOMPROMISED';\n readonly lockTargetPath: string;\n /** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */\n sectionError?: unknown;\n\n constructor(lockTargetPath: string, cause: unknown) {\n super(\n `The lock on ${lockTargetPath} was lost while it was held (${cause instanceof Error ? cause.message : String(cause)}). `\n + 'The critical section it guarded did not keep exclusive access and was refused.',\n { cause },\n );\n this.name = 'FileLockCompromisedError';\n this.lockTargetPath = lockTargetPath;\n }\n}\n\ninterface FileLockHold {\n readonly lockTargetPath: string;\n compromise: FileLockCompromisedError | null;\n}\n\n/** The holds the current async call chain is running inside, outermost first. */\nconst heldFileLocks = new AsyncLocalStorage<readonly FileLockHold[]>();\n\n/**\n * Throw if a lock the current call chain is running inside has been lost.\n *\n * Call it immediately before an act that is only safe as the lock's exclusive holder — a git commit, a\n * file write the lock serializes. Outside any lock, or with every enclosing lock intact, it does nothing.\n */\nexport function assertHeldFileLocksIntact(): void {\n for (const hold of heldFileLocks.getStore() ?? []) {\n if (hold.compromise) throw hold.compromise;\n }\n}\n\nconst FileLockHolderRecordSchema = z.object({\n pid: z.number().int().positive(),\n hostname: z.string(),\n token: z.string(),\n acquiredAt: z.string(),\n});\ntype FileLockHolderRecord = z.infer<typeof FileLockHolderRecordSchema>;\n\n/** lock directory → token of the hold THIS process currently has on it. */\nconst heldInThisProcess = new Map<string, string>();\n\n/**\n * Where a lock's holder is recorded: a per-USER temp directory (created `0700`), keyed by the lock\n * directory's path. Outside every worktree (see the module comment), and shared by every process of one\n * user on one host — which is exactly the population whose liveness `process.kill(pid, 0)` can answer.\n * Per user, not merely per `$TMPDIR`: where `os.tmpdir()` is a shared `/tmp`, another account could\n * otherwise plant a record naming a live pid and hold a crashed lock for the whole ceiling.\n */\nexport function fileLockHolderRecordPath(lockDirPath: string): string {\n const key = createHash('sha256').update(lockDirPath).digest('hex').slice(0, 32);\n return path.join(fileLockHolderRecordDirectory(), `${key}.json`);\n}\n\nfunction fileLockHolderRecordDirectory(): string {\n const user = typeof process.getuid === 'function' ? String(process.getuid()) : os.userInfo().username;\n return path.join(os.tmpdir(), `wildo-file-lock-holders-${user}`);\n}\n\n/**\n * Whether the record directory belongs to this user. `mkdir`'s `0700` holds only for a directory this\n * process CREATED; on a shared `/tmp` another account could have created it first. A directory owned by\n * someone else is never written to and never believed: the lock then keeps plain mtime staleness.\n */\nasync function holderRecordDirectoryIsOurs(): Promise<boolean> {\n if (typeof process.getuid !== 'function') return true;\n try {\n return (await fs.lstat(fileLockHolderRecordDirectory())).uid === process.getuid();\n } catch {\n return false;\n }\n}\n\nasync function readHolderRecord(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n if (!(await holderRecordDirectoryIsOurs())) return null;\n try {\n const parsed = FileLockHolderRecordSchema.safeParse(JSON.parse(await fs.readFile(fileLockHolderRecordPath(lockDirPath), 'utf8')));\n return parsed.success ? parsed.data : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n // EPERM: the process exists but belongs to someone else — alive.\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The holder a reclaim of `lockDirPath` would take the lock from, when that holder is alive and\n * refreshed within {@link LIVE_HOLDER_RECLAIM_CEILING_MS}; otherwise `null`, and the reclaim may proceed.\n *\n * No record, a record from another host, or a record naming a dead process all mean proper-lockfile's own\n * mtime judgement stands — the dead-holder recovery this lock has always had.\n */\nasync function liveHolderBlockingReclaim(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n const record = await readHolderRecord(lockDirPath);\n if (!record || record.hostname !== os.hostname()) return null;\n const alive = record.pid === process.pid\n // In this process the map is the truth: a record naming this pid with another token is left over\n // from a hold that has already ended here.\n ? heldInThisProcess.get(lockDirPath) === record.token\n : isProcessAlive(record.pid);\n if (!alive) return null;\n try {\n const { mtimeMs } = await fs.stat(lockDirPath);\n if (Date.now() - mtimeMs > LIVE_HOLDER_RECLAIM_CEILING_MS) return null;\n } catch {\n return null;\n }\n return record;\n}\n\n/**\n * The `fs` proper-lockfile is given. Identical to `node:fs` except `rmdir`, which proper-lockfile calls\n * for exactly two reasons: to REMOVE A STALE LOCK before taking it (while acquiring) and to RELEASE its\n * own lock (once held, including its exit-time cleanup). Only the first is guarded, and a refusal is\n * returned as `ELOCKED` so the caller's retry policy and conflict mapping apply unchanged.\n */\nfunction createReclaimGuardedFs(phase: { acquiring: boolean }): typeof nodeFs {\n const rmdir = (lockDirPath: string, callback: (error: NodeJS.ErrnoException | null) => void): void => {\n if (!phase.acquiring) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n liveHolderBlockingReclaim(lockDirPath).then(\n (holder) => {\n if (!holder) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n callback(Object.assign(\n new Error(`Lock file is already being held by live process ${holder.pid} (its refresh is late, so it is not reclaimed)`),\n { code: 'ELOCKED', file: lockDirPath },\n ));\n },\n () => nodeFs.rmdir(lockDirPath, callback),\n );\n };\n return { ...nodeFs, rmdir } as typeof nodeFs;\n}\n\nfunction reportCompromiseToStderr(error: FileLockCompromisedError): void {\n process.stderr.write(`[wildo] ${error.message}\\n`);\n}\n\n/**\n * Acquire `lockTargetPath` (which must exist), run `fn` holding it, release it.\n *\n * - A lost lock never throws asynchronously. It marks the hold, `assertHeldFileLocksIntact()` refuses from\n * then on inside `fn`'s call chain, and the call rejects with {@link FileLockCompromisedError} once `fn`\n * settles — with `fn`'s own error as the cause when it failed too.\n * - Contention is still proper-lockfile's `ELOCKED`, including a refused reclaim of a live holder.\n */\nexport async function holdFileLock<T>(lockTargetPath: string, fn: () => Promise<T>, options: FileLockAcquireOptions): Promise<T> {\n const canonicalTarget = options.realpath ? await fs.realpath(lockTargetPath) : path.resolve(lockTargetPath);\n const lockDirPath = `${canonicalTarget}.lock`;\n const hold: FileLockHold = { lockTargetPath, compromise: null };\n const token = randomUUID();\n const phase = { acquiring: true };\n\n const release = await lockfile.lock(lockTargetPath, {\n retries: options.retries,\n stale: options.stale,\n realpath: options.realpath,\n fs: createReclaimGuardedFs(phase),\n onCompromised: (cause: Error) => {\n hold.compromise = new FileLockCompromisedError(lockTargetPath, cause);\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n try {\n (options.onCompromised ?? reportCompromiseToStderr)(hold.compromise);\n } catch {\n // A logging callback must not reintroduce the uncaught exception this handler exists to remove.\n }\n },\n });\n phase.acquiring = false;\n heldInThisProcess.set(lockDirPath, token);\n const recordPath = fileLockHolderRecordPath(lockDirPath);\n try {\n await fs.mkdir(path.dirname(recordPath), { recursive: true, mode: 0o700 });\n if (!(await holderRecordDirectoryIsOurs())) throw new Error('holder record directory belongs to another user');\n const record: FileLockHolderRecord = { pid: process.pid, hostname: os.hostname(), token, acquiredAt: new Date().toISOString() };\n await fs.writeFile(recordPath, JSON.stringify(record), 'utf8');\n } catch {\n // Without a record the lock keeps proper-lockfile's plain mtime judgement — what it had before #2225.\n }\n\n const enclosing = heldFileLocks.getStore() ?? [];\n let value: T | undefined;\n let sectionFailed = false;\n let sectionError: unknown;\n try {\n value = await heldFileLocks.run([...enclosing, hold], fn);\n } catch (error) {\n sectionFailed = true;\n sectionError = error;\n }\n\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n /*\n * The record goes AFTER the release, never before: the release is what the next acquirer is waiting\n * for, and a caller that saw this section settle may acquire again at once with no retries. A record\n * outliving its lock is harmless — the token check means it is only ever removed by its own hold, and\n * a stale record defends nothing once the directory it names is gone.\n */\n // Residual, accepted: the read and the remove are two steps, so an acquirer whose record lands between\n // them loses it and falls back to plain mtime staleness for that one hold — what every hold had before\n // #2225. The window is the gap between two filesystem calls, after this hold has already released.\n const forgetHolderRecord = async (): Promise<void> => {\n if ((await readHolderRecord(lockDirPath))?.token === token) await fs.rm(recordPath, { force: true }).catch(() => undefined);\n };\n\n if (hold.compromise) {\n // proper-lockfile has already dropped a compromised lock, so there is nothing of ours to release —\n // and the directory now belongs to whoever took it.\n await forgetHolderRecord();\n if (sectionFailed && sectionError !== hold.compromise) hold.compromise.sectionError = sectionError;\n throw hold.compromise;\n }\n try {\n await release();\n } catch (error) {\n // Lost between the check above and the release: same answer as a loss during the section.\n await forgetHolderRecord();\n if (hold.compromise) throw hold.compromise;\n throw error;\n }\n await forgetHolderRecord();\n if (sectionFailed) throw sectionError;\n return value as T;\n}\n"]}
1
+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AAC,GAAG,CAAC,WAAW,CAAC,KAAK,KAAK;QAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACxF;;;;;OAKG;IACH,uGAAuG;IACvG,uGAAuG;IACvG,mGAAmG;IACnG,MAAM,kBAAkB,GAAG,KAAK,IAAmB,EAAE;QACnD,IAAI,CAAC,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK;YAAE,MAAM,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC9H,CAAC,CAAC;IAEF,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,mGAAmG;QACnG,oDAAoD;QACpD,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,aAAa,IAAI,YAAY,KAAK,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;QACnG,MAAM,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0FAA0F;QAC1F,MAAM,kBAAkB,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,CAAC,UAAU,CAAC;QAC3C,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,kBAAkB,EAAE,CAAC;IAC3B,IAAI,aAAa;QAAE,MAAM,YAAY,CAAC;IACtC,OAAO,KAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The one way this package acquires a `proper-lockfile` lock, so every holder gets the same two\n * guarantees (#2225):\n *\n * 1. **A waiter never reclaims the lock of a holder that is still alive.** proper-lockfile decides a\n * lock is stale from its directory's mtime alone (`stale`, 5 s by default here). A holder whose\n * refresh is merely LATE — an event-loop stall, a saturated libuv threadpool, a laptop waking up —\n * recovers on its own as long as nobody touched the lock directory (proper-lockfile 4.1.2,\n * `lockfile.js` `updateLock`: a successful `utimes` carries no threshold check). What turns a late\n * refresh into a lost lock is a WAITER judging the mtime stale and removing the directory. So the\n * reclaim itself is guarded: the removal is refused while the recorded holder is alive on this host.\n * 2. **Losing the lock is an error in that critical section, never a process exit.** proper-lockfile's\n * default `onCompromised` throws inside an `fs` callback, which is an uncaught exception. On\n * 2026-10-01 that killed the dev companion mid build wave, with every in-flight coding run in it.\n *\n * Why a liveness check and not simply a larger `stale`: the reclaim that matters most is by the SAME\n * process — proper-lockfile keeps no in-process guard, so a second `lock()` in the companion (a\n * concurrent run's commit retrying for minutes) takes the same mtime path as a stranger would. Any\n * fixed window is one stall away from being too short, and a long window makes a CRASHED holder's lock\n * block everyone for that long. Asking \"is the holder alive\" keeps dead-holder recovery at 5 s and makes\n * the live-holder case independent of timing. Rejected: writing the holder record INSIDE the lock\n * directory (it changes the directory's mtime, which proper-lockfile reads as another owner, and makes a\n * plain `rmdir` from an older library fail `ENOTEMPTY`) and BESIDE it (the shared\n * `.wildo-saas/wildo-saas.lock.json.lock` sits in a committed, un-ignored directory, so a record there is\n * an untracked file in the very `git status` the companion attributes writes from).\n */\n\nimport nodeFs from 'node:fs';\nimport { promises as fs } from 'node:fs';\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { createHash, randomUUID } from 'node:crypto';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport lockfile from 'proper-lockfile';\nimport { z } from 'zod';\nimport { describeCaughtError } from '@wildo-ai/saas-models';\n\n/**\n * How long a LIVE holder may go without refreshing its lock before a waiter may reclaim it anyway.\n *\n * Ten minutes without a single mtime refresh (normally every 2.5 s) means the holder is wedged, or its\n * pid was reused by an unrelated process. Past this the reclaim proceeds, and the wedged holder learns it\n * lost the lock through {@link FileLockCompromisedError} rather than by dying.\n */\nexport const LIVE_HOLDER_RECLAIM_CEILING_MS = 10 * 60_000;\n\n/** Options every acquisition in this package resolves to. */\nexport interface FileLockAcquireOptions {\n readonly retries: number | { retries?: number; minTimeout?: number; maxTimeout?: number; factor?: number };\n readonly stale: number;\n readonly realpath: boolean;\n /**\n * Told once when the lock is lost while held. The critical section still fails with\n * {@link FileLockCompromisedError}; this is for the caller's own log. Omitted, one line goes to stderr.\n */\n readonly onCompromised?: (error: FileLockCompromisedError) => void;\n}\n\n/**\n * The lock was taken from this holder while it still held it — another acquirer removed it, or the lock\n * directory was deleted. The holder no longer has exclusivity, so whatever it was about to do as the\n * exclusive writer must not happen. `code` is `ECOMPROMISED`, the code proper-lockfile itself uses.\n */\nexport class FileLockCompromisedError extends Error {\n readonly code = 'ECOMPROMISED';\n readonly lockTargetPath: string;\n /** What the critical section itself failed with, when it failed too; `cause` is the lock's loss. */\n sectionError?: unknown;\n\n constructor(lockTargetPath: string, cause: unknown) {\n super(\n `The lock on ${lockTargetPath} was lost while it was held (${describeCaughtError(cause)}). `\n + 'The critical section it guarded did not keep exclusive access and was refused.',\n { cause },\n );\n this.name = 'FileLockCompromisedError';\n this.lockTargetPath = lockTargetPath;\n }\n}\n\ninterface FileLockHold {\n readonly lockTargetPath: string;\n compromise: FileLockCompromisedError | null;\n}\n\n/** The holds the current async call chain is running inside, outermost first. */\nconst heldFileLocks = new AsyncLocalStorage<readonly FileLockHold[]>();\n\n/**\n * Throw if a lock the current call chain is running inside has been lost.\n *\n * Call it immediately before an act that is only safe as the lock's exclusive holder — a git commit, a\n * file write the lock serializes. Outside any lock, or with every enclosing lock intact, it does nothing.\n */\nexport function assertHeldFileLocksIntact(): void {\n for (const hold of heldFileLocks.getStore() ?? []) {\n if (hold.compromise) throw hold.compromise;\n }\n}\n\nconst FileLockHolderRecordSchema = z.object({\n pid: z.number().int().positive(),\n hostname: z.string(),\n token: z.string(),\n acquiredAt: z.string(),\n});\ntype FileLockHolderRecord = z.infer<typeof FileLockHolderRecordSchema>;\n\n/** lock directory → token of the hold THIS process currently has on it. */\nconst heldInThisProcess = new Map<string, string>();\n\n/**\n * Where a lock's holder is recorded: a per-USER temp directory (created `0700`), keyed by the lock\n * directory's path. Outside every worktree (see the module comment), and shared by every process of one\n * user on one host — which is exactly the population whose liveness `process.kill(pid, 0)` can answer.\n * Per user, not merely per `$TMPDIR`: where `os.tmpdir()` is a shared `/tmp`, another account could\n * otherwise plant a record naming a live pid and hold a crashed lock for the whole ceiling.\n */\nexport function fileLockHolderRecordPath(lockDirPath: string): string {\n const key = createHash('sha256').update(lockDirPath).digest('hex').slice(0, 32);\n return path.join(fileLockHolderRecordDirectory(), `${key}.json`);\n}\n\nfunction fileLockHolderRecordDirectory(): string {\n const user = typeof process.getuid === 'function' ? String(process.getuid()) : os.userInfo().username;\n return path.join(os.tmpdir(), `wildo-file-lock-holders-${user}`);\n}\n\n/**\n * Whether the record directory belongs to this user. `mkdir`'s `0700` holds only for a directory this\n * process CREATED; on a shared `/tmp` another account could have created it first. A directory owned by\n * someone else is never written to and never believed: the lock then keeps plain mtime staleness.\n */\nasync function holderRecordDirectoryIsOurs(): Promise<boolean> {\n if (typeof process.getuid !== 'function') return true;\n try {\n return (await fs.lstat(fileLockHolderRecordDirectory())).uid === process.getuid();\n } catch {\n return false;\n }\n}\n\nasync function readHolderRecord(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n if (!(await holderRecordDirectoryIsOurs())) return null;\n try {\n const parsed = FileLockHolderRecordSchema.safeParse(JSON.parse(await fs.readFile(fileLockHolderRecordPath(lockDirPath), 'utf8')));\n return parsed.success ? parsed.data : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n // EPERM: the process exists but belongs to someone else — alive.\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The holder a reclaim of `lockDirPath` would take the lock from, when that holder is alive and\n * refreshed within {@link LIVE_HOLDER_RECLAIM_CEILING_MS}; otherwise `null`, and the reclaim may proceed.\n *\n * No record, a record from another host, or a record naming a dead process all mean proper-lockfile's own\n * mtime judgement stands — the dead-holder recovery this lock has always had.\n */\nasync function liveHolderBlockingReclaim(lockDirPath: string): Promise<FileLockHolderRecord | null> {\n const record = await readHolderRecord(lockDirPath);\n if (!record || record.hostname !== os.hostname()) return null;\n const alive = record.pid === process.pid\n // In this process the map is the truth: a record naming this pid with another token is left over\n // from a hold that has already ended here.\n ? heldInThisProcess.get(lockDirPath) === record.token\n : isProcessAlive(record.pid);\n if (!alive) return null;\n try {\n const { mtimeMs } = await fs.stat(lockDirPath);\n if (Date.now() - mtimeMs > LIVE_HOLDER_RECLAIM_CEILING_MS) return null;\n } catch {\n return null;\n }\n return record;\n}\n\n/**\n * The `fs` proper-lockfile is given. Identical to `node:fs` except `rmdir`, which proper-lockfile calls\n * for exactly two reasons: to REMOVE A STALE LOCK before taking it (while acquiring) and to RELEASE its\n * own lock (once held, including its exit-time cleanup). Only the first is guarded, and a refusal is\n * returned as `ELOCKED` so the caller's retry policy and conflict mapping apply unchanged.\n */\nfunction createReclaimGuardedFs(phase: { acquiring: boolean }): typeof nodeFs {\n const rmdir = (lockDirPath: string, callback: (error: NodeJS.ErrnoException | null) => void): void => {\n if (!phase.acquiring) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n liveHolderBlockingReclaim(lockDirPath).then(\n (holder) => {\n if (!holder) {\n nodeFs.rmdir(lockDirPath, callback);\n return;\n }\n callback(Object.assign(\n new Error(`Lock file is already being held by live process ${holder.pid} (its refresh is late, so it is not reclaimed)`),\n { code: 'ELOCKED', file: lockDirPath },\n ));\n },\n () => nodeFs.rmdir(lockDirPath, callback),\n );\n };\n return { ...nodeFs, rmdir } as typeof nodeFs;\n}\n\nfunction reportCompromiseToStderr(error: FileLockCompromisedError): void {\n process.stderr.write(`[wildo] ${error.message}\\n`);\n}\n\n/**\n * Acquire `lockTargetPath` (which must exist), run `fn` holding it, release it.\n *\n * - A lost lock never throws asynchronously. It marks the hold, `assertHeldFileLocksIntact()` refuses from\n * then on inside `fn`'s call chain, and the call rejects with {@link FileLockCompromisedError} once `fn`\n * settles — with `fn`'s own error as the cause when it failed too.\n * - Contention is still proper-lockfile's `ELOCKED`, including a refused reclaim of a live holder.\n */\nexport async function holdFileLock<T>(lockTargetPath: string, fn: () => Promise<T>, options: FileLockAcquireOptions): Promise<T> {\n const canonicalTarget = options.realpath ? await fs.realpath(lockTargetPath) : path.resolve(lockTargetPath);\n const lockDirPath = `${canonicalTarget}.lock`;\n const hold: FileLockHold = { lockTargetPath, compromise: null };\n const token = randomUUID();\n const phase = { acquiring: true };\n\n const release = await lockfile.lock(lockTargetPath, {\n retries: options.retries,\n stale: options.stale,\n realpath: options.realpath,\n fs: createReclaimGuardedFs(phase),\n onCompromised: (cause: Error) => {\n hold.compromise = new FileLockCompromisedError(lockTargetPath, cause);\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n try {\n (options.onCompromised ?? reportCompromiseToStderr)(hold.compromise);\n } catch {\n // A logging callback must not reintroduce the uncaught exception this handler exists to remove.\n }\n },\n });\n phase.acquiring = false;\n heldInThisProcess.set(lockDirPath, token);\n const recordPath = fileLockHolderRecordPath(lockDirPath);\n try {\n await fs.mkdir(path.dirname(recordPath), { recursive: true, mode: 0o700 });\n if (!(await holderRecordDirectoryIsOurs())) throw new Error('holder record directory belongs to another user');\n const record: FileLockHolderRecord = { pid: process.pid, hostname: os.hostname(), token, acquiredAt: new Date().toISOString() };\n await fs.writeFile(recordPath, JSON.stringify(record), 'utf8');\n } catch {\n // Without a record the lock keeps proper-lockfile's plain mtime judgement — what it had before #2225.\n }\n\n const enclosing = heldFileLocks.getStore() ?? [];\n let value: T | undefined;\n let sectionFailed = false;\n let sectionError: unknown;\n try {\n value = await heldFileLocks.run([...enclosing, hold], fn);\n } catch (error) {\n sectionFailed = true;\n sectionError = error;\n }\n\n if (heldInThisProcess.get(lockDirPath) === token) heldInThisProcess.delete(lockDirPath);\n /*\n * The record goes AFTER the release, never before: the release is what the next acquirer is waiting\n * for, and a caller that saw this section settle may acquire again at once with no retries. A record\n * outliving its lock is harmless — the token check means it is only ever removed by its own hold, and\n * a stale record defends nothing once the directory it names is gone.\n */\n // Residual, accepted: the read and the remove are two steps, so an acquirer whose record lands between\n // them loses it and falls back to plain mtime staleness for that one hold — what every hold had before\n // #2225. The window is the gap between two filesystem calls, after this hold has already released.\n const forgetHolderRecord = async (): Promise<void> => {\n if ((await readHolderRecord(lockDirPath))?.token === token) await fs.rm(recordPath, { force: true }).catch(() => undefined);\n };\n\n if (hold.compromise) {\n // proper-lockfile has already dropped a compromised lock, so there is nothing of ours to release —\n // and the directory now belongs to whoever took it.\n await forgetHolderRecord();\n if (sectionFailed && sectionError !== hold.compromise) hold.compromise.sectionError = sectionError;\n throw hold.compromise;\n }\n try {\n await release();\n } catch (error) {\n // Lost between the check above and the release: same answer as a loss during the section.\n await forgetHolderRecord();\n if (hold.compromise) throw hold.compromise;\n throw error;\n }\n await forgetHolderRecord();\n if (sectionFailed) throw sectionError;\n return value as T;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Shared `wildo-saas.lock.json` IO primitives.
3
3
  *
4
- * Phase 1 graduates the locking + atomic-write surface validated by
5
- * the Phase 0.B contention spike (`module-registry-analysis.md`)
6
- * into `platform-config-lib`. Both the dev companion's
4
+ * Holds the locking + atomic-write surface, validated by a lock-contention
5
+ * spike, in `platform-config-lib`. Both the dev companion's
7
6
  * `WildoSaasLockCompanionService` and the CLI-side
8
7
  * `RegistryLockfileService` consume this module so concurrent
9
8
  * writers — across processes (CLI + companion + minions) — never
@@ -46,11 +45,10 @@ export declare const WILDO_SAAS_LOCK_RELATIVE_PATH = ".wildo-saas/wildo-saas.loc
46
45
  */
47
46
  export declare function getWildoSaasLockPath(saasRoot: string): string;
48
47
  /**
49
- * Default `proper-lockfile` options. The 5s `stale` window matches
50
- * the Phase 0.B spike (`module-registry-analysis.md` Phase 0.B
51
- * Findings): typical lock-hold time is < 50ms; 5s is generous enough
52
- * to absorb a CI pause without compromising legitimate locks. Tests
53
- * 4a-4d all passed under these settings.
48
+ * Default `proper-lockfile` options. The 5s `stale` window comes from
49
+ * a lock-contention spike: typical lock-hold time is < 50ms; 5s is generous enough
50
+ * to absorb a CI pause without compromising legitimate locks. The spike's
51
+ * contention tests all passed under these settings.
54
52
  *
55
53
  * `realpath: false` is required when the saas root is symlinked
56
54
  * (common with pnpm `dependenciesMeta.injected: true` workspaces).
@@ -126,8 +124,9 @@ export interface LockfileMutateOptions {
126
124
  *
127
125
  * - Returns a fresh empty envelope if the file does not exist
128
126
  * (and `createIfMissing` is not explicitly false).
129
- * - Validates the canonical envelope shape (schemaVersion, generatedAt,
130
- * sections) against `SaasLockfileEnvelopeSchema`.
127
+ * - Validates the canonical envelope shape (schemaVersion, sections)
128
+ * against `SaasLockfileEnvelopeSchema`, after dropping the keys earlier
129
+ * envelopes carried (`withoutRetiredLockfileEnvelopeKeys`).
131
130
  * - Applies caller-supplied `sectionSchemas` after the envelope
132
131
  * shape passes — failures throw a `ZodError` so the caller knows
133
132
  * exactly which section + field rejected.
@@ -145,13 +144,10 @@ export declare function readWildoSaasLock(options: Pick<LockfileMutateOptions, '
145
144
  * re-validated against the envelope schema (and any caller-supplied
146
145
  * `sectionSchemas`) before being atomically written.
147
146
  *
148
- * `generatedAt` is refreshed only when the mutation changes the file. When the bytes that would be
149
- * written — with the previous `generatedAt` — equal the bytes on disk, nothing is written and the
150
- * envelope is returned as it was. The lockfile is committed, and a timestamp that moved on every no-op
151
- * sync dirtied the tree with nothing in it: a `wildo registry add` + `remove` round trip left exactly
152
- * one diff, this field (#1765). The comparison is on BYTES rather than on the parsed sections so a
153
- * no-op mutation still writes back what normalization changed (schema defaults, a missing trailing
154
- * newline).
147
+ * Nothing is written when the bytes that would be written equal the bytes on disk, so a no-op
148
+ * mutation leaves the file, and its modification time, alone. The comparison is on BYTES rather than
149
+ * on the parsed sections so a no-op mutation still writes back what normalization changed (schema
150
+ * defaults, a missing trailing newline, a retired envelope key such as `generatedAt`).
155
151
  *
156
152
  * The library never inspects `sections.providers.runtimeScopes`,
157
153
  * `sections.modules`, or `sections.i18n` — it only enforces the
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile-io.d.ts","sourceRoot":"","sources":["../../../src/lockfile/lockfile-io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAA2C,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE1G;;GAEG;AACH,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAEhF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAIuB,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3G,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACpE,CAAC;AAiCF,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,cAAc,CAAC,EA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