@agent-teams/engineering-foundation 0.17.0-rc.8 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/README.md +33 -47
  2. package/dist/capabilities/contract-json-schema-releases/module.d.ts.map +1 -1
  3. package/dist/capabilities/contract-json-schema-releases/module.js +4 -17
  4. package/dist/capabilities/contract-json-schema-releases/module.js.map +1 -1
  5. package/dist/capabilities/contract-protobuf-evolution/module.d.ts.map +1 -1
  6. package/dist/capabilities/contract-protobuf-evolution/module.js +4 -17
  7. package/dist/capabilities/contract-protobuf-evolution/module.js.map +1 -1
  8. package/dist/capabilities/documentation-local-references/module.d.ts.map +1 -1
  9. package/dist/capabilities/documentation-local-references/module.js +4 -17
  10. package/dist/capabilities/documentation-local-references/module.js.map +1 -1
  11. package/dist/capabilities/executable-specifications/module.d.ts.map +1 -1
  12. package/dist/capabilities/executable-specifications/module.js +4 -17
  13. package/dist/capabilities/executable-specifications/module.js.map +1 -1
  14. package/dist/capabilities/governance-architecture-decisions/module.d.ts.map +1 -1
  15. package/dist/capabilities/governance-architecture-decisions/module.js +4 -17
  16. package/dist/capabilities/governance-architecture-decisions/module.js.map +1 -1
  17. package/dist/capabilities/public-api-compatibility/module.d.ts.map +1 -1
  18. package/dist/capabilities/public-api-compatibility/module.js +4 -19
  19. package/dist/capabilities/public-api-compatibility/module.js.map +1 -1
  20. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.d.ts +3 -0
  21. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.d.ts.map +1 -0
  22. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.js +17 -0
  23. package/dist/capabilities/quality-gate-runner/adapters/inbound/cli/report-renderer.js.map +1 -0
  24. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.d.ts +7 -0
  25. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.d.ts.map +1 -0
  26. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.js +51 -0
  27. package/dist/capabilities/quality-gate-runner/adapters/outbound/filesystem/filesystem-package-script-catalog-reader.js.map +1 -0
  28. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.d.ts +22 -0
  29. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.d.ts.map +1 -0
  30. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js +90 -0
  31. package/dist/capabilities/quality-gate-runner/adapters/outbound/pnpm/pnpm-package-script-executor.js.map +1 -0
  32. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.d.ts +3 -0
  33. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.d.ts.map +1 -0
  34. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.js +5 -0
  35. package/dist/capabilities/quality-gate-runner/adapters/outbound/time/performance-monotonic-clock.js.map +1 -0
  36. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.d.ts +18 -0
  37. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.d.ts.map +1 -0
  38. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.js +2 -0
  39. package/dist/capabilities/quality-gate-runner/application/model/quality-gate-report.js.map +1 -0
  40. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts +19 -0
  41. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.d.ts.map +1 -0
  42. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.js +2 -0
  43. package/dist/capabilities/quality-gate-runner/application/model/quality-gate.js.map +1 -0
  44. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts +4 -0
  45. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.d.ts.map +1 -0
  46. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.js +64 -0
  47. package/dist/capabilities/quality-gate-runner/application/policies/evaluate-quality-gate-scripts.js.map +1 -0
  48. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts +6 -0
  49. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.d.ts.map +1 -0
  50. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.js +75 -0
  51. package/dist/capabilities/quality-gate-runner/application/policies/validate-quality-gate-graph.js.map +1 -0
  52. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.d.ts +4 -0
  53. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.d.ts.map +1 -0
  54. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.js +2 -0
  55. package/dist/capabilities/quality-gate-runner/application/ports/monotonic-clock.js.map +1 -0
  56. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.d.ts +5 -0
  57. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.d.ts.map +1 -0
  58. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.js +2 -0
  59. package/dist/capabilities/quality-gate-runner/application/ports/package-script-catalog-reader.js.map +1 -0
  60. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.d.ts +20 -0
  61. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.d.ts.map +1 -0
  62. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.js +9 -0
  63. package/dist/capabilities/quality-gate-runner/application/ports/package-script-executor.js.map +1 -0
  64. package/dist/capabilities/quality-gate-runner/application/rules.d.ts +12 -0
  65. package/dist/capabilities/quality-gate-runner/application/rules.d.ts.map +1 -0
  66. package/dist/capabilities/quality-gate-runner/application/rules.js +18 -0
  67. package/dist/capabilities/quality-gate-runner/application/rules.js.map +1 -0
  68. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts +9 -0
  69. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.d.ts.map +1 -0
  70. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.js +5 -0
  71. package/dist/capabilities/quality-gate-runner/application/use-cases/analyze-quality-gate-runner.js.map +1 -0
  72. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts +10 -0
  73. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.d.ts.map +1 -0
  74. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.js +138 -0
  75. package/dist/capabilities/quality-gate-runner/application/use-cases/run-quality-gate-profile.js.map +1 -0
  76. package/dist/capabilities/quality-gate-runner/contract/config.d.ts +5 -0
  77. package/dist/capabilities/quality-gate-runner/contract/config.d.ts.map +1 -0
  78. package/dist/capabilities/quality-gate-runner/contract/config.js +89 -0
  79. package/dist/capabilities/quality-gate-runner/contract/config.js.map +1 -0
  80. package/dist/capabilities/quality-gate-runner/gate-command.d.ts +10 -0
  81. package/dist/capabilities/quality-gate-runner/gate-command.d.ts.map +1 -0
  82. package/dist/capabilities/quality-gate-runner/gate-command.js +82 -0
  83. package/dist/capabilities/quality-gate-runner/gate-command.js.map +1 -0
  84. package/dist/capabilities/quality-gate-runner/module.d.ts +5 -0
  85. package/dist/capabilities/quality-gate-runner/module.d.ts.map +1 -0
  86. package/dist/capabilities/quality-gate-runner/module.js +36 -0
  87. package/dist/capabilities/quality-gate-runner/module.js.map +1 -0
  88. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.d.ts +2 -0
  89. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.d.ts.map +1 -1
  90. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.js +32 -0
  91. package/dist/capabilities/repository-agent-workflow/adapters/inbound/cli/report-renderer.js.map +1 -1
  92. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.d.ts +16 -0
  93. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.d.ts.map +1 -0
  94. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.js +213 -0
  95. package/dist/capabilities/repository-agent-workflow/adapters/outbound/filesystem/filesystem-effective-instructions-reader.js.map +1 -0
  96. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.d.ts +9 -0
  97. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.d.ts.map +1 -1
  98. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.js +232 -62
  99. package/dist/capabilities/repository-agent-workflow/adapters/outbound/git/git-repository-changes-reader.js.map +1 -1
  100. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.d.ts +1 -0
  101. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.d.ts.map +1 -1
  102. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.js +2 -1
  103. package/dist/capabilities/repository-agent-workflow/adapters/outbound/process/process-execution.js.map +1 -1
  104. package/dist/capabilities/repository-agent-workflow/application/model/changed-workflow.d.ts +26 -0
  105. package/dist/capabilities/repository-agent-workflow/application/model/changed-workflow.d.ts.map +1 -1
  106. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.d.ts +61 -0
  107. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.d.ts.map +1 -0
  108. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.js +7 -0
  109. package/dist/capabilities/repository-agent-workflow/application/model/effective-instructions.js.map +1 -0
  110. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.d.ts +15 -0
  111. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.d.ts.map +1 -0
  112. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.js +2 -0
  113. package/dist/capabilities/repository-agent-workflow/application/ports/effective-instructions-reader.js.map +1 -0
  114. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.d.ts +8 -0
  115. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.d.ts.map +1 -0
  116. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.js +128 -0
  117. package/dist/capabilities/repository-agent-workflow/application/use-cases/resolve-effective-instructions.js.map +1 -0
  118. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.d.ts.map +1 -1
  119. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.js +8 -0
  120. package/dist/capabilities/repository-agent-workflow/application/use-cases/run-changed-agent-workflow.js.map +1 -1
  121. package/dist/capabilities/repository-agent-workflow/instructions-command.d.ts +6 -0
  122. package/dist/capabilities/repository-agent-workflow/instructions-command.d.ts.map +1 -0
  123. package/dist/capabilities/repository-agent-workflow/instructions-command.js +26 -0
  124. package/dist/capabilities/repository-agent-workflow/instructions-command.js.map +1 -0
  125. package/dist/capabilities/repository-agent-workflow/module.d.ts.map +1 -1
  126. package/dist/capabilities/repository-agent-workflow/module.js +4 -17
  127. package/dist/capabilities/repository-agent-workflow/module.js.map +1 -1
  128. package/dist/capabilities/repository-security-baseline/adapters/outbound/filesystem/workflow-evidence-parser.d.ts.map +1 -1
  129. package/dist/capabilities/repository-security-baseline/adapters/outbound/filesystem/workflow-evidence-parser.js +33 -0
  130. package/dist/capabilities/repository-security-baseline/adapters/outbound/filesystem/workflow-evidence-parser.js.map +1 -1
  131. package/dist/capabilities/repository-security-baseline/application/model/repository-security.d.ts +1 -0
  132. package/dist/capabilities/repository-security-baseline/application/model/repository-security.d.ts.map +1 -1
  133. package/dist/capabilities/repository-security-baseline/application/model/repository-security.js.map +1 -1
  134. package/dist/capabilities/repository-security-baseline/application/policies/dependency-review-ordering.js +1 -1
  135. package/dist/capabilities/repository-security-baseline/application/policies/dependency-review-ordering.js.map +1 -1
  136. package/dist/capabilities/repository-security-baseline/application/policies/evaluate-repository-security-tools.js +1 -1
  137. package/dist/capabilities/repository-security-baseline/application/policies/evaluate-repository-security-tools.js.map +1 -1
  138. package/dist/capabilities/repository-security-baseline/application/policies/evaluate-repository-security.js +1 -1
  139. package/dist/capabilities/repository-security-baseline/application/policies/evaluate-repository-security.js.map +1 -1
  140. package/dist/capabilities/repository-security-baseline/module.d.ts.map +1 -1
  141. package/dist/capabilities/repository-security-baseline/module.js +4 -17
  142. package/dist/capabilities/repository-security-baseline/module.js.map +1 -1
  143. package/dist/capabilities/source-dependencies/module.d.ts.map +1 -1
  144. package/dist/capabilities/source-dependencies/module.js +4 -19
  145. package/dist/capabilities/source-dependencies/module.js.map +1 -1
  146. package/dist/capabilities/suppression-governance/module.d.ts.map +1 -1
  147. package/dist/capabilities/suppression-governance/module.js +4 -19
  148. package/dist/capabilities/suppression-governance/module.js.map +1 -1
  149. package/dist/capabilities/workspace-dependency-declarations/module.d.ts.map +1 -1
  150. package/dist/capabilities/workspace-dependency-declarations/module.js +4 -18
  151. package/dist/capabilities/workspace-dependency-declarations/module.js.map +1 -1
  152. package/dist/capability-runtime.d.ts +8 -0
  153. package/dist/capability-runtime.d.ts.map +1 -1
  154. package/dist/capability-runtime.js +66 -0
  155. package/dist/capability-runtime.js.map +1 -1
  156. package/dist/check-runner.d.ts.map +1 -1
  157. package/dist/check-runner.js +16 -10
  158. package/dist/check-runner.js.map +1 -1
  159. package/dist/cli-arguments.d.ts.map +1 -1
  160. package/dist/cli-arguments.js +15 -8
  161. package/dist/cli-arguments.js.map +1 -1
  162. package/dist/cli.js +31 -8
  163. package/dist/cli.js.map +1 -1
  164. package/dist/composition/capability-modules.d.ts +13 -0
  165. package/dist/composition/capability-modules.d.ts.map +1 -0
  166. package/dist/composition/capability-modules.js +30 -0
  167. package/dist/composition/capability-modules.js.map +1 -0
  168. package/dist/composition/capability-registry.d.ts +2 -0
  169. package/dist/composition/capability-registry.d.ts.map +1 -1
  170. package/dist/composition/capability-registry.js +5 -25
  171. package/dist/composition/capability-registry.js.map +1 -1
  172. package/dist/composition/rule-registry.d.ts +4 -7
  173. package/dist/composition/rule-registry.d.ts.map +1 -1
  174. package/dist/composition/rule-registry.js +17 -25
  175. package/dist/composition/rule-registry.js.map +1 -1
  176. package/dist/document-authoring/index.d.ts +6 -1
  177. package/dist/document-authoring/index.d.ts.map +1 -1
  178. package/dist/document-authoring/index.js.map +1 -1
  179. package/dist/filesystem-path-safety.d.ts +6 -0
  180. package/dist/filesystem-path-safety.d.ts.map +1 -1
  181. package/dist/filesystem-path-safety.js +76 -21
  182. package/dist/filesystem-path-safety.js.map +1 -1
  183. package/dist/index.d.ts +2 -0
  184. package/dist/index.d.ts.map +1 -1
  185. package/dist/index.js +2 -0
  186. package/dist/index.js.map +1 -1
  187. package/dist/legacy-docs-cli-deprecation.d.ts +10 -0
  188. package/dist/legacy-docs-cli-deprecation.d.ts.map +1 -0
  189. package/dist/legacy-docs-cli-deprecation.js +36 -0
  190. package/dist/legacy-docs-cli-deprecation.js.map +1 -0
  191. package/dist/local-mode/index.d.ts +5 -0
  192. package/dist/local-mode/index.d.ts.map +1 -1
  193. package/dist/local-mode/index.js +5 -0
  194. package/dist/local-mode/index.js.map +1 -1
  195. package/dist/mutation/index.d.ts +8 -0
  196. package/dist/mutation/index.d.ts.map +1 -1
  197. package/dist/mutation/index.js.map +1 -1
  198. package/dist/mutation/qualification/index.d.ts +10 -0
  199. package/dist/mutation/qualification/index.d.ts.map +1 -0
  200. package/dist/mutation/qualification/index.js +6 -0
  201. package/dist/mutation/qualification/index.js.map +1 -0
  202. package/dist/process-execution/node-process-runner.d.ts +6 -1
  203. package/dist/process-execution/node-process-runner.d.ts.map +1 -1
  204. package/dist/process-execution/node-process-runner.js +29 -6
  205. package/dist/process-execution/node-process-runner.js.map +1 -1
  206. package/dist/quality-gate-cli-command.d.ts +3 -0
  207. package/dist/quality-gate-cli-command.d.ts.map +1 -0
  208. package/dist/quality-gate-cli-command.js +37 -0
  209. package/dist/quality-gate-cli-command.js.map +1 -0
  210. package/dist/repository-mutation/adapters/node/node-known-file-apply-effects.d.ts +84 -0
  211. package/dist/repository-mutation/adapters/node/node-known-file-apply-effects.d.ts.map +1 -0
  212. package/dist/repository-mutation/adapters/node/node-known-file-apply-effects.js +232 -0
  213. package/dist/repository-mutation/adapters/node/node-known-file-apply-effects.js.map +1 -0
  214. package/dist/repository-mutation/adapters/node/node-known-file-apply-faults.d.ts +9 -0
  215. package/dist/repository-mutation/adapters/node/node-known-file-apply-faults.d.ts.map +1 -0
  216. package/dist/repository-mutation/adapters/node/node-known-file-apply-faults.js +2 -0
  217. package/dist/repository-mutation/adapters/node/node-known-file-apply-faults.js.map +1 -0
  218. package/dist/repository-mutation/adapters/node/node-known-file-apply-observation.d.ts +6 -0
  219. package/dist/repository-mutation/adapters/node/node-known-file-apply-observation.d.ts.map +1 -0
  220. package/dist/repository-mutation/adapters/node/node-known-file-apply-observation.js +30 -0
  221. package/dist/repository-mutation/adapters/node/node-known-file-apply-observation.js.map +1 -0
  222. package/dist/repository-mutation/adapters/node/node-known-file-apply-operation.d.ts +11 -0
  223. package/dist/repository-mutation/adapters/node/node-known-file-apply-operation.d.ts.map +1 -0
  224. package/dist/repository-mutation/adapters/node/node-known-file-apply-operation.js +159 -0
  225. package/dist/repository-mutation/adapters/node/node-known-file-apply-operation.js.map +1 -0
  226. package/dist/repository-mutation/adapters/node/node-known-file-apply-state.d.ts +9 -0
  227. package/dist/repository-mutation/adapters/node/node-known-file-apply-state.d.ts.map +1 -0
  228. package/dist/repository-mutation/adapters/node/node-known-file-apply-state.js +21 -0
  229. package/dist/repository-mutation/adapters/node/node-known-file-apply-state.js.map +1 -0
  230. package/dist/repository-mutation/adapters/node/node-known-file-recovery-cleanup.d.ts +9 -0
  231. package/dist/repository-mutation/adapters/node/node-known-file-recovery-cleanup.d.ts.map +1 -0
  232. package/dist/repository-mutation/adapters/node/node-known-file-recovery-cleanup.js +203 -0
  233. package/dist/repository-mutation/adapters/node/node-known-file-recovery-cleanup.js.map +1 -0
  234. package/dist/repository-mutation/adapters/node/node-known-file-recovery-executor.d.ts +17 -0
  235. package/dist/repository-mutation/adapters/node/node-known-file-recovery-executor.d.ts.map +1 -0
  236. package/dist/repository-mutation/adapters/node/node-known-file-recovery-executor.js +22 -0
  237. package/dist/repository-mutation/adapters/node/node-known-file-recovery-executor.js.map +1 -0
  238. package/dist/repository-mutation/adapters/node/node-known-file-recovery-observation.d.ts +15 -0
  239. package/dist/repository-mutation/adapters/node/node-known-file-recovery-observation.d.ts.map +1 -0
  240. package/dist/repository-mutation/adapters/node/node-known-file-recovery-observation.js +47 -0
  241. package/dist/repository-mutation/adapters/node/node-known-file-recovery-observation.js.map +1 -0
  242. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.d.ts +29 -0
  243. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.d.ts.map +1 -0
  244. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.js +72 -0
  245. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.js.map +1 -0
  246. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured.d.ts +31 -0
  247. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured.d.ts.map +1 -0
  248. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured.js +254 -0
  249. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured.js.map +1 -0
  250. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage.d.ts +13 -0
  251. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage.d.ts.map +1 -0
  252. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage.js +210 -0
  253. package/dist/repository-mutation/adapters/node/node-known-file-recovery-preimage.js.map +1 -0
  254. package/dist/repository-mutation/adapters/node/node-known-file-recovery-retirement.d.ts +15 -0
  255. package/dist/repository-mutation/adapters/node/node-known-file-recovery-retirement.d.ts.map +1 -0
  256. package/dist/repository-mutation/adapters/node/node-known-file-recovery-retirement.js +172 -0
  257. package/dist/repository-mutation/adapters/node/node-known-file-recovery-retirement.js.map +1 -0
  258. package/dist/repository-mutation/adapters/node/node-known-file-recovery-state.d.ts +12 -0
  259. package/dist/repository-mutation/adapters/node/node-known-file-recovery-state.d.ts.map +1 -0
  260. package/dist/repository-mutation/adapters/node/node-known-file-recovery-state.js +17 -0
  261. package/dist/repository-mutation/adapters/node/node-known-file-recovery-state.js.map +1 -0
  262. package/dist/repository-mutation/adapters/node/node-known-file-transaction-recovery.d.ts +2 -5
  263. package/dist/repository-mutation/adapters/node/node-known-file-transaction-recovery.d.ts.map +1 -1
  264. package/dist/repository-mutation/adapters/node/node-known-file-transaction-recovery.js +18 -860
  265. package/dist/repository-mutation/adapters/node/node-known-file-transaction-recovery.js.map +1 -1
  266. package/dist/repository-mutation/adapters/node/node-known-file-transaction.d.ts +3 -9
  267. package/dist/repository-mutation/adapters/node/node-known-file-transaction.d.ts.map +1 -1
  268. package/dist/repository-mutation/adapters/node/node-known-file-transaction.js +35 -451
  269. package/dist/repository-mutation/adapters/node/node-known-file-transaction.js.map +1 -1
  270. package/dist/repository-mutation/application/policies/classify-known-file-recovery-transition.d.ts +25 -0
  271. package/dist/repository-mutation/application/policies/classify-known-file-recovery-transition.d.ts.map +1 -0
  272. package/dist/repository-mutation/application/policies/classify-known-file-recovery-transition.js +19 -0
  273. package/dist/repository-mutation/application/policies/classify-known-file-recovery-transition.js.map +1 -0
  274. package/dist/schema-ids.d.ts +1 -1
  275. package/dist/schema-ids.d.ts.map +1 -1
  276. package/dist/schema-ids.js +2 -0
  277. package/dist/schema-ids.js.map +1 -1
  278. package/dist/unexpected-failure.d.ts +9 -0
  279. package/dist/unexpected-failure.d.ts.map +1 -0
  280. package/dist/unexpected-failure.js +105 -0
  281. package/dist/unexpected-failure.js.map +1 -0
  282. package/package.json +7 -1
  283. package/schemas/foundation-config/v1.schema.json +10 -0
  284. package/schemas/quality-gate-run-report/v1.schema.json +47 -0
  285. package/schemas/quality-gate-runner/v1.schema.json +74 -0
@@ -0,0 +1,21 @@
1
+ import { compileKnownFileTransactionEnvelope } from "../../application/policies/known-file-transaction-envelope.js";
2
+ function replaceKnownFileOperation(journal, index, replacement) {
3
+ return Object.freeze({
4
+ ...journal,
5
+ operations: Object.freeze(journal.operations.with(index, replacement))
6
+ });
7
+ }
8
+ export function transitionKnownFileOperation(journal, index, transition) {
9
+ const current = journal.operations[index];
10
+ return replaceKnownFileOperation(journal, index, Object.freeze({ ...current, ...transition }));
11
+ }
12
+ export async function persistKnownFileApplyState(store, stored, journal, state = "APPLYING") {
13
+ const envelope = compileKnownFileTransactionEnvelope({
14
+ foundation: stored.envelope.foundation,
15
+ journal,
16
+ state
17
+ });
18
+ stored.authority = await store.replace(stored.authority, envelope);
19
+ stored.envelope = envelope;
20
+ }
21
+ //# sourceMappingURL=node-known-file-apply-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-apply-state.js","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-apply-state.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+DAA+D,CAAC;AAWpH,SAAS,yBAAyB,CAChC,OAAsC,EACtC,KAAa,EACb,WAAmD;IAEnD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,OAAO;QACV,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;KACvE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,OAAsC,EACtC,KAAa,EACb,UAA2D;IAE3D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAE,CAAC;IAC3C,OAAO,yBAAyB,CAC9B,OAAO,EACP,KAAK,EACL,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,EAAE,CAA2C,CACvF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,KAA2C,EAC3C,MAA2B,EAC3B,OAAsC,EACtC,KAAK,GAA4C,UAAU;IAE3D,MAAM,QAAQ,GAAG,mCAAmC,CAAC;QACnD,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU;QACtC,OAAO;QACP,KAAK;KACN,CAAC,CAAC;IACH,MAAM,CAAC,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { KnownFileRecoveryFaultInjector, StoredRecoveryJournal } from "./node-known-file-recovery-state.js";
2
+ import type { NodeKnownFileTransactionJournalStore } from "./node-known-file-transaction-journal-store.js";
3
+ export declare function rollbackKnownFileRecovery(options: {
4
+ readonly faultInjector?: KnownFileRecoveryFaultInjector;
5
+ readonly root: string;
6
+ readonly store: NodeKnownFileTransactionJournalStore;
7
+ readonly stored: StoredRecoveryJournal;
8
+ }): Promise<void>;
9
+ //# sourceMappingURL=node-known-file-recovery-cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-cleanup.d.ts","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-cleanup.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AAyK3G,wBAAsB,yBAAyB,CAAC,OAAO,EAAE;IACvD,QAAQ,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,oCAAoC,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DhB"}
@@ -0,0 +1,203 @@
1
+ import { lstat, rmdir } from "node:fs/promises";
2
+ import { basename, dirname, join } from "node:path";
3
+ import { deserializeKnownFileIdentity } from "../../application/model/known-file-transaction-journal.js";
4
+ import { readBoundedRegularFile } from "./node-bounded-regular-file.js";
5
+ import { syncDirectoryStrictly } from "./node-directory-durability.js";
6
+ import { knownFileErrorCode, knownFileTemporaryName, KnownFileTransactionError, matchesKnownFileImage, sameKnownFileIdentity } from "./node-known-file-transaction-filesystem.js";
7
+ import { knownFileCapturePaths } from "./node-known-file-recovery-filesystem.js";
8
+ import { restorePreimage } from "./node-known-file-recovery-preimage.js";
9
+ import { retireJournalBoundPath } from "./node-known-file-recovery-retirement.js";
10
+ async function cleanupOperationTemporaries(options) {
11
+ const operation = options.stored.envelope.journal.plan.operations[options.operationIndex];
12
+ const journalOperation = options.stored.envelope.journal.operations[options.operationIndex];
13
+ const parent = dirname(join(options.root, ...operation.path.split("/")));
14
+ const candidates = [
15
+ {
16
+ identity: "temporaryIdentity" in journalOperation
17
+ ? deserializeKnownFileIdentity(journalOperation.temporaryIdentity)
18
+ : undefined,
19
+ image: operation.postimage,
20
+ kind: "temporary",
21
+ authorizedWithoutIdentity: journalOperation.state === "temporary-authorized",
22
+ path: join(parent, knownFileTemporaryName(operation.path, options.stored.envelope.journal.plan.planDigest, options.operationIndex))
23
+ },
24
+ ...(operation.precondition.state === "known-file" &&
25
+ journalOperation.matchedPreimage !== undefined
26
+ ? [{
27
+ identity: journalOperation.rollbackTemporaryIdentity === undefined
28
+ ? undefined
29
+ : deserializeKnownFileIdentity(journalOperation.rollbackTemporaryIdentity),
30
+ image: operation.precondition.acceptedPreimages[journalOperation.matchedPreimage],
31
+ kind: "rollback-temporary",
32
+ path: join(parent, `.${basename(operation.path)}.agent-teams.rollback.${options.operationIndex}.tmp`)
33
+ }]
34
+ : [])
35
+ ];
36
+ for (const candidate of candidates) {
37
+ let observed;
38
+ try {
39
+ observed = await readBoundedRegularFile(candidate.path, candidate.image.size);
40
+ }
41
+ catch (error) {
42
+ if (knownFileErrorCode(error) === "ENOENT") {
43
+ continue;
44
+ }
45
+ throw error;
46
+ }
47
+ if (observed.outcome !== "read" || !matchesKnownFileImage({
48
+ state: "file", bytes: observed.bytes, identity: observed.identity,
49
+ mode: observed.mode & 0o777
50
+ }, candidate.image)) {
51
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Transaction temporary is foreign or modified: ${operation.path}.`);
52
+ }
53
+ if (candidate.identity === undefined && candidate.authorizedWithoutIdentity === true) {
54
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Authorized temporary exists without durable ownership identity: ${operation.path}.`);
55
+ }
56
+ if (candidate.identity === undefined ||
57
+ !sameKnownFileIdentity(observed.identity, candidate.identity)) {
58
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Transaction temporary identity is absent or changed: ${operation.path}.`);
59
+ }
60
+ await retireJournalBoundPath({
61
+ expectedIdentity: candidate.identity,
62
+ kind: candidate.kind,
63
+ operationIndex: options.operationIndex,
64
+ root: options.root,
65
+ store: options.store,
66
+ stored: options.stored
67
+ });
68
+ }
69
+ }
70
+ async function cleanupAuthorizedCapture(options) {
71
+ const operation = options.journal.plan.operations[options.operationIndex];
72
+ const parent = dirname(join(options.root, ...operation.path.split("/")));
73
+ const paths = knownFileCapturePaths({
74
+ operationIndex: options.operationIndex,
75
+ operationPath: operation.path,
76
+ parent,
77
+ planDigest: options.journal.plan.planDigest
78
+ });
79
+ const metadata = await lstat(paths.directory).catch((error) => {
80
+ if (knownFileErrorCode(error) === "ENOENT") {
81
+ return null;
82
+ }
83
+ throw error;
84
+ });
85
+ if (metadata === null) {
86
+ return;
87
+ }
88
+ if (!metadata.isDirectory() || metadata.isSymbolicLink()) {
89
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Authorized capture path is foreign: ${operation.path}.`);
90
+ }
91
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Authorized capture exists without durable ownership identity: ${operation.path}.`);
92
+ }
93
+ async function removeAuthorizedDirectories(root, directories) {
94
+ for (const repositoryPath of directories.toReversed()) {
95
+ const path = join(root, ...repositoryPath.split("/"));
96
+ const metadata = await lstat(path).catch((error) => {
97
+ if (knownFileErrorCode(error) === "ENOENT") {
98
+ return null;
99
+ }
100
+ throw error;
101
+ });
102
+ if (metadata === null) {
103
+ continue;
104
+ }
105
+ if (!metadata.isDirectory() || metadata.isSymbolicLink()) {
106
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Authorized directory path is foreign: ${repositoryPath}.`);
107
+ }
108
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Authorized directory exists without durable ownership identity: ${repositoryPath}.`);
109
+ }
110
+ }
111
+ async function removeCreatedDirectories(root, directories) {
112
+ for (const directory of directories.toReversed()) {
113
+ const path = join(root, ...directory.path.split("/"));
114
+ let metadata;
115
+ try {
116
+ metadata = await lstat(path, { bigint: true });
117
+ }
118
+ catch (error) {
119
+ if (knownFileErrorCode(error) === "ENOENT") {
120
+ continue;
121
+ }
122
+ throw error;
123
+ }
124
+ const expected = deserializeKnownFileIdentity(directory.identity);
125
+ if (!metadata.isDirectory() || metadata.isSymbolicLink() ||
126
+ metadata.dev !== expected.dev || metadata.ino !== expected.ino ||
127
+ metadata.birthtimeNs !== expected.birthtimeNs) {
128
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Transaction-created directory changed before cleanup: ${directory.path}.`);
129
+ }
130
+ try {
131
+ await rmdir(path);
132
+ await syncDirectoryStrictly(dirname(path));
133
+ }
134
+ catch (error) {
135
+ if (knownFileErrorCode(error) !== "ENOTEMPTY") {
136
+ throw error;
137
+ }
138
+ }
139
+ }
140
+ }
141
+ export async function rollbackKnownFileRecovery(options) {
142
+ for (let index = options.stored.envelope.journal.operations.length - 1; index >= 0; index -= 1) {
143
+ let journalOperation = options.stored.envelope.journal.operations[index];
144
+ if (journalOperation.retirement !== undefined) {
145
+ await retireJournalBoundPath({
146
+ expectedIdentity: deserializeKnownFileIdentity(journalOperation.retirement.pathIdentity),
147
+ ...(options.faultInjector === undefined ? {} : { faultInjector: options.faultInjector }),
148
+ kind: journalOperation.retirement.kind,
149
+ operationIndex: index,
150
+ root: options.root,
151
+ store: options.store,
152
+ stored: options.stored
153
+ });
154
+ journalOperation = options.stored.envelope.journal.operations[index];
155
+ }
156
+ if (journalOperation.state === "capture-authorized") {
157
+ await cleanupAuthorizedCapture({
158
+ journal: options.stored.envelope.journal,
159
+ operationIndex: index,
160
+ root: options.root
161
+ });
162
+ continue;
163
+ }
164
+ if (![
165
+ "capture-ready", "preimage-captured", "destination-retired",
166
+ "publishing", "published", "rollback-restored"
167
+ ].includes(journalOperation.state)) {
168
+ continue;
169
+ }
170
+ await restorePreimage({
171
+ ...(options.faultInjector === undefined ? {} : { faultInjector: options.faultInjector }),
172
+ operation: options.stored.envelope.journal.plan.operations[index],
173
+ operationIndex: index,
174
+ root: options.root,
175
+ store: options.store,
176
+ stored: options.stored
177
+ });
178
+ await cleanupOperationTemporaries({
179
+ operationIndex: index,
180
+ root: options.root,
181
+ store: options.store,
182
+ stored: options.stored
183
+ });
184
+ }
185
+ for (let index = options.stored.envelope.journal.operations.length - 1; index >= 0; index -= 1) {
186
+ const journal = options.stored.envelope.journal;
187
+ if (![
188
+ "capture-ready", "preimage-captured", "destination-retired",
189
+ "publishing", "published", "rollback-restored"
190
+ ].includes(journal.operations[index].state)) {
191
+ await cleanupOperationTemporaries({
192
+ operationIndex: index,
193
+ root: options.root,
194
+ store: options.store,
195
+ stored: options.stored
196
+ });
197
+ }
198
+ }
199
+ const journal = options.stored.envelope.journal;
200
+ await removeCreatedDirectories(options.root, journal.createdDirectories);
201
+ await removeAuthorizedDirectories(options.root, journal.authorizedDirectories);
202
+ }
203
+ //# sourceMappingURL=node-known-file-recovery-cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-cleanup.js","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAOlF,KAAK,UAAU,2BAA2B,CAAC,OAK1C;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAE,CAAC;IAC3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,CAAE,CAAC;IAC7F,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,IAAI,CA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ction.js";
2
+ import { type KnownFileRecoveryFaultInjector, type StoredRecoveryJournal } from "./node-known-file-recovery-state.js";
3
+ import type { NodeKnownFileTransactionJournalStore } from "./node-known-file-transaction-journal-store.js";
4
+ export type { KnownFileRecoveryFaultInjector } from "./node-known-file-recovery-state.js";
5
+ export declare function executeCommittedKnownFileRecovery(options: {
6
+ readonly faultInjector?: KnownFileRecoveryFaultInjector;
7
+ readonly root: string;
8
+ readonly store: NodeKnownFileTransactionJournalStore;
9
+ readonly stored: StoredRecoveryJournal;
10
+ }): Promise<KnownFileTransactionReceiptV1>;
11
+ export declare function executeApplyingKnownFileRollback(options: {
12
+ readonly faultInjector?: KnownFileRecoveryFaultInjector;
13
+ readonly root: string;
14
+ readonly store: NodeKnownFileTransactionJournalStore;
15
+ readonly stored: StoredRecoveryJournal;
16
+ }): Promise<KnownFileTransactionReceiptV1>;
17
+ //# sourceMappingURL=node-known-file-recovery-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-executor.d.ts","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAGvG,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,EAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AAQ3G,YAAY,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAE1F,wBAAsB,iCAAiC,CAAC,OAAO,EAAE;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,oCAAoC,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAczC;AAED,wBAAsB,gCAAgC,CAAC,OAAO,EAAE;IAC9D,QAAQ,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,oCAAoC,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAMzC"}
@@ -0,0 +1,22 @@
1
+ import { cleanupCommittedKnownFileCaptures } from "./node-known-file-recovery-filesystem.js";
2
+ import { rollbackKnownFileRecovery } from "./node-known-file-recovery-cleanup.js";
3
+ import {} from "./node-known-file-recovery-state.js";
4
+ import { compileKnownFileTransactionReceipt, verifyCommittedKnownFilePostimages } from "./node-known-file-transaction.js";
5
+ import { compileRolledBackReceipt } from "./node-known-file-transaction-receipt.js";
6
+ import { verifyRolledBackKnownFileState } from "./node-known-file-recovery-observation.js";
7
+ export async function executeCommittedKnownFileRecovery(options) {
8
+ await verifyCommittedKnownFilePostimages(options.root, options.stored.envelope.journal);
9
+ await cleanupCommittedKnownFileCaptures(options.root, options.stored.envelope.journal, options.faultInjector);
10
+ await verifyCommittedKnownFilePostimages(options.root, options.stored.envelope.journal);
11
+ const result = compileKnownFileTransactionReceipt(options.stored.envelope.journal, "applied");
12
+ await options.store.remove(options.stored.authority);
13
+ return result;
14
+ }
15
+ export async function executeApplyingKnownFileRollback(options) {
16
+ await rollbackKnownFileRecovery(options);
17
+ await verifyRolledBackKnownFileState(options.root, options.stored.envelope.journal);
18
+ const result = compileRolledBackReceipt(options.stored.envelope.journal);
19
+ await options.store.remove(options.stored.authority);
20
+ return result;
21
+ }
22
+ //# sourceMappingURL=node-known-file-recovery-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-executor.js","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { KnownFileTransactionEnvelopeV1, KnownFileTransactionJournalV1 } from "../../application/model/known-file-transaction-journal.js";
2
+ import type { InstalledKnownFileRecoveryBuild } from "../../application/policies/classify-known-file-recovery-transition.js";
3
+ import { NodeKnownFileTransactionJournalStore, type KnownFileJournalAuthority } from "./node-known-file-transaction-journal-store.js";
4
+ export interface StoredKnownFileRecoveryJournal {
5
+ authority: KnownFileJournalAuthority;
6
+ envelope: KnownFileTransactionEnvelopeV1;
7
+ }
8
+ export interface KnownFileRecoveryEvidence {
9
+ readonly installedBuild: InstalledKnownFileRecoveryBuild;
10
+ readonly store: NodeKnownFileTransactionJournalStore;
11
+ readonly stored: StoredKnownFileRecoveryJournal;
12
+ }
13
+ export declare function observeKnownFileRecoveryEvidence(root: string): Promise<KnownFileRecoveryEvidence>;
14
+ export declare function verifyRolledBackKnownFileState(root: string, journal: KnownFileTransactionJournalV1): Promise<void>;
15
+ //# sourceMappingURL=node-known-file-recovery-observation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-observation.d.ts","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-observation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,2DAA2D,CAAC;AACnE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uEAAuE,CAAC;AAO7H,OAAO,EACL,oCAAoC,EACpC,KAAK,yBAAyB,EAC/B,MAAM,gDAAgD,CAAC;AAExD,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,yBAAyB,CAAC;IACrC,QAAQ,EAAE,8BAA8B,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,cAAc,EAAE,+BAA+B,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,oCAAoC,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,8BAA8B,CAAC;CACjD;AAED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,yBAAyB,CAAC,CAmBpC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAmCf"}
@@ -0,0 +1,47 @@
1
+ import { join } from "node:path";
2
+ import { LOCAL_STATE_DIRECTORY } from "../../../foundation-state-contract.js";
3
+ import { installedFoundationVersion } from "../../../package-version.js";
4
+ import { installedFoundationBuildIdentity } from "../../../transaction-coordination/adapters/node/installed-foundation-build-identity.js";
5
+ import { KnownFileTransactionError, matchesKnownFileImage, maximumKnownFileEvidenceBytes, observeKnownFile } from "./node-known-file-transaction-filesystem.js";
6
+ import { NodeKnownFileTransactionJournalStore } from "./node-known-file-transaction-journal-store.js";
7
+ export async function observeKnownFileRecoveryEvidence(root) {
8
+ const store = new NodeKnownFileTransactionJournalStore(join(root, LOCAL_STATE_DIRECTORY));
9
+ await store.canonicalizeTemporary();
10
+ const observed = await store.read();
11
+ if (observed === undefined) {
12
+ throw new KnownFileTransactionError("KNOWN_FILE_JOURNAL_MISSING", "Known-file recovery journal disappeared.");
13
+ }
14
+ const [version, buildIdentity] = await Promise.all([
15
+ installedFoundationVersion(),
16
+ installedFoundationBuildIdentity()
17
+ ]);
18
+ return {
19
+ installedBuild: { buildIdentity, version },
20
+ store,
21
+ stored: observed
22
+ };
23
+ }
24
+ export async function verifyRolledBackKnownFileState(root, journal) {
25
+ for (const [index, operation] of journal.plan.operations.entries()) {
26
+ const journalOperation = journal.operations[index];
27
+ const observed = await observeKnownFile(root, operation.path, maximumKnownFileEvidenceBytes(operation));
28
+ if (journalOperation.state === "already-satisfied") {
29
+ if (!matchesKnownFileImage(observed, operation.postimage)) {
30
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Unchanged guard drifted during rollback: ${operation.path}.`);
31
+ }
32
+ continue;
33
+ }
34
+ if (operation.precondition.state === "absent") {
35
+ if (observed.state !== "absent") {
36
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Absent preimage was not restored: ${operation.path}.`);
37
+ }
38
+ continue;
39
+ }
40
+ const matched = journalOperation.matchedPreimage;
41
+ if (matched === undefined ||
42
+ !matchesKnownFileImage(observed, operation.precondition.acceptedPreimages[matched])) {
43
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Exact preimage was not restored: ${operation.path}.`);
44
+ }
45
+ }
46
+ }
47
+ //# sourceMappingURL=node-known-file-recovery-observation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-observation.js","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-observation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wFAAwF,CAAC;AAM1I,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,oCAAoC,EAErC,MAAM,gDAAgD,CAAC;AAaxD,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,IAAY;IAEZ,MAAM,KAAK,GAAG,IAAI,oCAAoC,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1F,MAAM,KAAK,CAAC,qBAAqB,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;I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C;YACJ,CAAC;YACD,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,gBAAgB,CAAC,eAAe,CAAC;QACjD,IAAI,OAAO,KAAK,SAAS;YACvB,CAAC,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAE,CAAC,EAAE,CAAC;YACvF,MAAM,IAAI,yBAAyB,CACjC,8BAA8B,EAC9B,oCAAoC,SAAS,CAAC,IAAI,GAAG,CACtD,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { KnownFileTransactionPlanV1 } from "../../application/model/known-file-transaction.js";
2
+ import type { KnownFileTransactionJournalV1 } from "../../application/model/known-file-transaction-journal.js";
3
+ import type { KnownFileRecoveryFaultInjector } from "./node-known-file-recovery-state.js";
4
+ export declare function cleanupRestoredCapturedPreimage(options: {
5
+ readonly destination: string;
6
+ readonly faultInjector?: KnownFileRecoveryFaultInjector;
7
+ readonly journalOperation: KnownFileTransactionJournalV1["operations"][number] & {
8
+ readonly captureDirectoryIdentity: NonNullable<Extract<KnownFileTransactionJournalV1["operations"][number], {
9
+ readonly temporaryIdentity: unknown;
10
+ }>["captureDirectoryIdentity"]>;
11
+ readonly capturedPreimageIdentity?: NonNullable<Extract<KnownFileTransactionJournalV1["operations"][number], {
12
+ readonly temporaryIdentity: unknown;
13
+ }>["capturedPreimageIdentity"]>;
14
+ };
15
+ readonly operation: KnownFileTransactionPlanV1["operations"][number] & {
16
+ readonly precondition: Extract<KnownFileTransactionPlanV1["operations"][number]["precondition"], {
17
+ readonly state: "known-file";
18
+ }>;
19
+ };
20
+ readonly operationIndex: number;
21
+ readonly parent: string;
22
+ readonly paths: {
23
+ readonly captured: string;
24
+ readonly directory: string;
25
+ readonly retired: string;
26
+ };
27
+ readonly recoveryMaximumBytes: number;
28
+ }): Promise<void>;
29
+ //# sourceMappingURL=node-known-file-recovery-preimage-captured-cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-preimage-captured-cleanup.d.ts","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;AACpG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAU/G,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAY1F,wBAAsB,+BAA+B,CAAC,OAAO,EAAE;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG;QAC/E,QAAQ,CAAC,wBAAwB,EAAE,WAAW,CAAC,OAAO,CACpD,6BAA6B,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EACnD;YAAE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;SAAE,CACxC,CAAC,0BAA0B,CAAC,CAAC,CAAC;QAC/B,QAAQ,CAAC,wBAAwB,CAAC,EAAE,WAAW,CAAC,OAAO,CACrD,6BAA6B,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EACnD;YAAE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;SAAE,CACxC,CAAC,0BAA0B,CAAC,CAAC,CAAC;KAChC,CAAC;IACF,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG;QACrE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAC5B,0BAA0B,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,EAChE;YAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;SAAE,CACjC,CAAC;KACH,CAAC;IACF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACpG,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FhB"}
@@ -0,0 +1,72 @@
1
+ import { lstat, rmdir, unlink } from "node:fs/promises";
2
+ import { basename, join } from "node:path";
3
+ import { deserializeKnownFileIdentity } from "../../application/model/known-file-transaction-journal.js";
4
+ import { syncDirectoryStrictly } from "./node-directory-durability.js";
5
+ import { knownFileErrorCode, KnownFileTransactionError, matchesKnownFileImage, sameKnownFileIdentity } from "./node-known-file-transaction-filesystem.js";
6
+ import { observeRecoveryFile } from "./node-known-file-recovery-filesystem.js";
7
+ function matchesRollbackCopy(observed, expected, preimage) {
8
+ return observed.state === "file" && observed.identity !== undefined &&
9
+ sameKnownFileIdentity(observed.identity, expected) &&
10
+ matchesKnownFileImage(observed, preimage);
11
+ }
12
+ export async function cleanupRestoredCapturedPreimage(options) {
13
+ const matched = options.journalOperation.matchedPreimage;
14
+ if (matched === undefined) {
15
+ throw new KnownFileTransactionError("KNOWN_FILE_JOURNAL_INVALID", `Restored replacement lacks exact preimage authority: ${options.operation.path}.`);
16
+ }
17
+ const preimage = options.operation.precondition.acceptedPreimages[matched];
18
+ const destinationObserved = await observeRecoveryFile(options.destination, options.recoveryMaximumBytes);
19
+ if (!matchesKnownFileImage(destinationObserved, preimage)) {
20
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Restored destination changed during cleanup: ${options.operation.path}.`);
21
+ }
22
+ const rollbackPath = join(options.parent, `.${basename(options.operation.path)}.agent-teams.rollback.${options.operationIndex}.tmp`);
23
+ if (options.journalOperation.rollbackTemporaryIdentity !== undefined) {
24
+ const rollbackObserved = await observeRecoveryFile(rollbackPath, preimage.size);
25
+ if (rollbackObserved.state === "file") {
26
+ const expectedRollback = deserializeKnownFileIdentity(options.journalOperation.rollbackTemporaryIdentity);
27
+ if (!matchesRollbackCopy(rollbackObserved, expectedRollback, preimage)) {
28
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Rollback copy changed during cleanup: ${options.operation.path}.`);
29
+ }
30
+ await unlink(rollbackPath);
31
+ await syncDirectoryStrictly(options.parent);
32
+ }
33
+ }
34
+ const directory = await lstat(options.paths.directory, { bigint: true }).catch((error) => {
35
+ if (knownFileErrorCode(error) === "ENOENT") {
36
+ return null;
37
+ }
38
+ throw error;
39
+ });
40
+ if (directory === null) {
41
+ return;
42
+ }
43
+ const expectedDirectory = deserializeKnownFileIdentity(options.journalOperation.captureDirectoryIdentity);
44
+ if (!directory.isDirectory() || directory.isSymbolicLink() ||
45
+ directory.birthtimeNs !== expectedDirectory.birthtimeNs ||
46
+ directory.dev !== expectedDirectory.dev || directory.ino !== expectedDirectory.ino) {
47
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Rollback capture directory changed during cleanup: ${options.operation.path}.`);
48
+ }
49
+ const capturedObserved = await observeRecoveryFile(options.paths.captured, options.recoveryMaximumBytes);
50
+ if (capturedObserved.state === "file") {
51
+ const expectedCaptured = options.journalOperation.capturedPreimageIdentity;
52
+ if (expectedCaptured === undefined || capturedObserved.identity === undefined ||
53
+ !sameKnownFileIdentity(capturedObserved.identity, deserializeKnownFileIdentity(expectedCaptured)) ||
54
+ !matchesKnownFileImage(capturedObserved, preimage)) {
55
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Rollback capture changed during cleanup: ${options.operation.path}.`);
56
+ }
57
+ await unlink(options.paths.captured);
58
+ await syncDirectoryStrictly(options.paths.directory);
59
+ await options.faultInjector?.({
60
+ phase: "after-rollback-capture-unlinked",
61
+ operationIndex: options.operationIndex,
62
+ path: options.operation.path
63
+ });
64
+ }
65
+ const retiredObserved = await observeRecoveryFile(options.paths.retired, options.recoveryMaximumBytes);
66
+ if (retiredObserved.state !== "absent") {
67
+ throw new KnownFileTransactionError("KNOWN_FILE_RECOVERY_CONFLICT", `Rollback capture retains foreign retired evidence: ${options.operation.path}.`);
68
+ }
69
+ await rmdir(options.paths.directory);
70
+ await syncDirectoryStrictly(options.parent);
71
+ }
72
+ //# sourceMappingURL=node-known-file-recovery-preimage-captured-cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-preimage-captured-cleanup.js","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured-cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,SAAS,mBAAmB,CAC1B,QAAyD,EACzD,QAAyD,EACzD,QAAuE;IAEvE,OAAO,QAAQ,CAAC,KAAK,KAAK,MAAM,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;QACjE,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAClD,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,OAuBrD;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gB,KAAK,SAAS,IAAI,gBAAgB,CAAC,QAAQ,KAAK,SAAS;YAC3E,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;YACjG,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,yBAAyB,CACjC,8BAA8B,EAC9B,4CAA4C,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,CACtE,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrD,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;YAC5B,KAAK,EAAE,iCAAiC;YACxC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI;SAC7B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,eAAe,GAAG,MAAM,mBAAmB,CAC/C,OAAO,CAAC,KAAK,CAAC,OAAO,EACrB,OAAO,CAAC,oBAAoB,CAC7B,CAAC;IACF,IAAI,eAAe,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,IAAI,yBAAyB,CACjC,8BAA8B,EAC9B,sDAAsD,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,CAChF,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { KnownFileTransactionPlanV1 } from "../../application/model/known-file-transaction.js";
2
+ import type { KnownFileTransactionJournalV1 } from "../../application/model/known-file-transaction-journal.js";
3
+ import { type KnownFileRecoveryFaultInjector, type StoredRecoveryJournal } from "./node-known-file-recovery-state.js";
4
+ import type { NodeKnownFileTransactionJournalStore } from "./node-known-file-transaction-journal-store.js";
5
+ interface CapturedPreimageOptions {
6
+ readonly faultInjector?: KnownFileRecoveryFaultInjector;
7
+ readonly journalOperation: KnownFileTransactionJournalV1["operations"][number] & {
8
+ readonly captureDirectoryIdentity: NonNullable<Extract<KnownFileTransactionJournalV1["operations"][number], {
9
+ readonly temporaryIdentity: unknown;
10
+ }>["captureDirectoryIdentity"]>;
11
+ readonly temporaryIdentity: NonNullable<Extract<KnownFileTransactionJournalV1["operations"][number], {
12
+ readonly temporaryIdentity: unknown;
13
+ }>["temporaryIdentity"]>;
14
+ readonly capturedPreimageIdentity?: NonNullable<Extract<KnownFileTransactionJournalV1["operations"][number], {
15
+ readonly temporaryIdentity: unknown;
16
+ }>["capturedPreimageIdentity"]>;
17
+ };
18
+ readonly operation: KnownFileTransactionPlanV1["operations"][number] & {
19
+ readonly precondition: Extract<KnownFileTransactionPlanV1["operations"][number]["precondition"], {
20
+ readonly state: "known-file";
21
+ }>;
22
+ };
23
+ readonly operationIndex: number;
24
+ readonly planDigest: string;
25
+ readonly root: string;
26
+ readonly store: NodeKnownFileTransactionJournalStore;
27
+ readonly stored: StoredRecoveryJournal;
28
+ }
29
+ export declare function restoreCapturedPreimage(options: CapturedPreimageOptions): Promise<void>;
30
+ export {};
31
+ //# sourceMappingURL=node-known-file-recovery-preimage-captured.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-known-file-recovery-preimage-captured.d.ts","sourceRoot":"","sources":["../../../../src/repository-mutation/adapters/node/node-known-file-recovery-preimage-captured.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;AACtH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAc/G,OAAO,EACL,KAAK,8BAA8B,EAGnC,KAAK,qBAAqB,EAC3B,MAAM,qCAAqC,CAAC;A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