@apexops/cli 0.10.0-next.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 (401) hide show
  1. package/assets/capability-packs/azure-governance-discovery/source/scripts/discover.py +1189 -0
  2. package/assets/capability-packs/azure-governance-discovery/source/scripts/render_governance.py +676 -0
  3. package/assets/capability-packs/registry.v1.json +73 -0
  4. package/assets/client-projection-metadata/copilot-cli-agent-tools.json +92 -0
  5. package/assets/client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md +78 -0
  6. package/assets/client-projections/github-copilot-cli/.github/agents/apex-operator.agent.md +71 -0
  7. package/assets/client-projections/github-copilot-cli/.github/agents/apex-planner.agent.md +79 -0
  8. package/assets/client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md +69 -0
  9. package/assets/client-projections/github-copilot-cli/.github/agents/apex.agent.md +52 -0
  10. package/assets/client-projections/github-copilot-cli/.github/copilot-instructions.md +13 -0
  11. package/assets/client-projections/github-copilot-cli/.github/mcp.json +54 -0
  12. package/assets/client-projections/github-copilot-cli/.github/skills/apex-architecture/SKILL.md +36 -0
  13. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/SKILL.md +65 -0
  14. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
  15. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
  16. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
  17. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
  18. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
  19. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
  20. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
  21. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
  22. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/requirements.md +42 -0
  23. package/assets/client-projections/github-copilot-cli/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
  24. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/SKILL.md +52 -0
  25. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
  26. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
  27. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
  28. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
  29. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
  30. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
  31. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
  32. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
  33. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
  34. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/SKILL.md +58 -0
  35. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
  36. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
  37. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/SKILL.md +36 -0
  38. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
  39. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
  40. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
  41. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
  42. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
  43. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
  44. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/SKILL.md +59 -0
  45. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
  46. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
  47. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
  48. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
  49. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
  50. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/naming.md +47 -0
  51. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
  52. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
  53. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
  54. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
  55. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/SKILL.md +50 -0
  56. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
  57. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
  58. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
  59. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
  60. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
  61. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/SKILL.md +52 -0
  62. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
  63. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
  64. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/SKILL.md +58 -0
  65. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
  66. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
  67. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/SKILL.md +52 -0
  68. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
  69. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
  70. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/SKILL.md +53 -0
  71. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
  72. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
  73. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/SKILL.md +45 -0
  74. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
  75. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
  76. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/SKILL.md +54 -0
  77. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
  78. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
  79. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/SKILL.md +35 -0
  80. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
  81. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
  82. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
  83. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/SKILL.md +49 -0
  84. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
  85. package/assets/client-projections/github-copilot-cli/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
  86. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
  87. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
  88. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
  89. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
  90. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
  91. package/assets/client-projections/github-copilot-cli/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
  92. package/assets/client-projections/github-copilot-cli/.github/skills/apex-codegen/SKILL.md +32 -0
  93. package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
  94. package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
  95. package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
  96. package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
  97. package/assets/client-projections/github-copilot-cli/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
  98. package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/SKILL.md +44 -0
  99. package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/styling.md +33 -0
  100. package/assets/client-projections/github-copilot-cli/.github/skills/apex-mermaid/references/syntax.md +99 -0
  101. package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
  102. package/assets/client-projections/github-copilot-cli/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
  103. package/assets/client-projections/github-copilot-cli/.github/skills/apex-operations/SKILL.md +34 -0
  104. package/assets/client-projections/github-copilot-cli/.github/skills/apex-planning/SKILL.md +36 -0
  105. package/assets/client-projections/github-copilot-cli/.github/skills/apex-requirements/SKILL.md +43 -0
  106. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/SKILL.md +47 -0
  107. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
  108. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
  109. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
  110. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
  111. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
  112. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
  113. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
  114. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
  115. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
  116. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
  117. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/SKILL.md +45 -0
  118. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
  119. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
  120. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
  121. package/assets/client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/test-design.md +13 -0
  122. package/assets/client-projections/github-copilot-cli/.github/skills/apex-workflow/SKILL.md +37 -0
  123. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-architect.agent.md +87 -0
  124. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-codegen.agent.md +54 -0
  125. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-operator.agent.md +75 -0
  126. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-planner.agent.md +89 -0
  127. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md +78 -0
  128. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md +45 -0
  129. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-validator.agent.md +50 -0
  130. package/assets/client-projections/github-copilot-vscode/.github/agents/apex.agent.md +71 -0
  131. package/assets/client-projections/github-copilot-vscode/.github/copilot-instructions.md +13 -0
  132. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-architecture/SKILL.md +36 -0
  133. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/SKILL.md +65 -0
  134. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
  135. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
  136. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
  137. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
  138. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
  139. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
  140. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
  141. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
  142. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/requirements.md +42 -0
  143. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
  144. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/SKILL.md +52 -0
  145. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
  146. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
  147. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
  148. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
  149. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
  150. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
  151. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
  152. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
  153. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
  154. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/SKILL.md +58 -0
  155. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
  156. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
  157. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/SKILL.md +36 -0
  158. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
  159. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
  160. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
  161. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
  162. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
  163. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
  164. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/SKILL.md +59 -0
  165. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
  166. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
  167. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
  168. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
  169. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
  170. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/naming.md +47 -0
  171. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
  172. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
  173. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
  174. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
  175. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/SKILL.md +50 -0
  176. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
  177. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
  178. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
  179. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
  180. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
  181. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/SKILL.md +52 -0
  182. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
  183. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
  184. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/SKILL.md +58 -0
  185. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
  186. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
  187. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/SKILL.md +52 -0
  188. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
  189. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
  190. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/SKILL.md +53 -0
  191. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
  192. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
  193. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/SKILL.md +45 -0
  194. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
  195. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
  196. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/SKILL.md +54 -0
  197. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
  198. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
  199. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/SKILL.md +35 -0
  200. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
  201. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
  202. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
  203. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/SKILL.md +49 -0
  204. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
  205. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
  206. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
  207. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
  208. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
  209. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
  210. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
  211. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
  212. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-codegen/SKILL.md +32 -0
  213. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
  214. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
  215. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
  216. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
  217. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
  218. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/SKILL.md +44 -0
  219. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/styling.md +33 -0
  220. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-mermaid/references/syntax.md +99 -0
  221. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
  222. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
  223. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-operations/SKILL.md +34 -0
  224. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-planning/SKILL.md +36 -0
  225. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-requirements/SKILL.md +43 -0
  226. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/SKILL.md +47 -0
  227. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
  228. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
  229. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
  230. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
  231. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
  232. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
  233. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
  234. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
  235. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
  236. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
  237. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/SKILL.md +45 -0
  238. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
  239. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
  240. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
  241. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-terraform-test/references/test-design.md +13 -0
  242. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-workflow/SKILL.md +37 -0
  243. package/assets/client-projections/github-copilot-vscode/.vscode/mcp.json +21 -0
  244. package/assets/config/capability-packs.v1.json +43 -0
  245. package/assets/config/defaults.v1.json +98 -0
  246. package/assets/config/improvement-policy.v1.json +37 -0
  247. package/assets/config/quality-scorecard.v1.json +105 -0
  248. package/assets/config/recipe-packs.v1.json +29 -0
  249. package/assets/config/runtime-bundle.v1.json +84 -0
  250. package/assets/config/toolchain.v1.json +134 -0
  251. package/assets/config/workflow.v1.json +876 -0
  252. package/assets/customizations/.github/agents/apex-architect.agent.md +80 -0
  253. package/assets/customizations/.github/agents/apex-codegen.agent.md +51 -0
  254. package/assets/customizations/.github/agents/apex-operator.agent.md +68 -0
  255. package/assets/customizations/.github/agents/apex-planner.agent.md +82 -0
  256. package/assets/customizations/.github/agents/apex-requirements.agent.md +71 -0
  257. package/assets/customizations/.github/agents/apex-reviewer.agent.md +42 -0
  258. package/assets/customizations/.github/agents/apex-validator.agent.md +47 -0
  259. package/assets/customizations/.github/agents/apex.agent.md +64 -0
  260. package/assets/customizations/.github/copilot-instructions.md +13 -0
  261. package/assets/customizations/.github/mcp.json +54 -0
  262. package/assets/customizations/.github/skills/apex-architecture/SKILL.md +36 -0
  263. package/assets/customizations/.github/skills/apex-artifacts/SKILL.md +65 -0
  264. package/assets/customizations/.github/skills/apex-artifacts/references/presentation-conventions.md +52 -0
  265. package/assets/customizations/.github/skills/apex-artifacts/references/reference-only-outlines.md +78 -0
  266. package/assets/customizations/.github/skills/apex-artifacts/templates/architecture-assessment.md +35 -0
  267. package/assets/customizations/.github/skills/apex-artifacts/templates/cost-estimate.md +47 -0
  268. package/assets/customizations/.github/skills/apex-artifacts/templates/deployment-summary.md +35 -0
  269. package/assets/customizations/.github/skills/apex-artifacts/templates/governance-constraints.md +35 -0
  270. package/assets/customizations/.github/skills/apex-artifacts/templates/implementation-plan.md +43 -0
  271. package/assets/customizations/.github/skills/apex-artifacts/templates/operations-runbook.md +35 -0
  272. package/assets/customizations/.github/skills/apex-artifacts/templates/requirements.md +42 -0
  273. package/assets/customizations/.github/skills/apex-artifacts/templates/resource-inventory.md +29 -0
  274. package/assets/customizations/.github/skills/apex-azure-adr/SKILL.md +52 -0
  275. package/assets/customizations/.github/skills/apex-azure-adr/references/decision-examples.md +38 -0
  276. package/assets/customizations/.github/skills/apex-azure-adr/references/decision-guardrails.md +36 -0
  277. package/assets/customizations/.github/skills/apex-azure-adr/references/decision-quality.md +21 -0
  278. package/assets/customizations/.github/skills/apex-azure-adr/references/decision-record-fields.md +57 -0
  279. package/assets/customizations/.github/skills/apex-azure-cloud-migrate/SKILL.md +55 -0
  280. package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/lambda-to-functions-assessment.md +29 -0
  281. package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/migration-readiness.md +27 -0
  282. package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/staged-validation-handoff.md +26 -0
  283. package/assets/customizations/.github/skills/apex-azure-cloud-migrate/references/workload-mapping.md +27 -0
  284. package/assets/customizations/.github/skills/apex-azure-compliance/SKILL.md +58 -0
  285. package/assets/customizations/.github/skills/apex-azure-compliance/references/compliance-finding-criteria.md +63 -0
  286. package/assets/customizations/.github/skills/apex-azure-compliance/references/operational-checklist.md +24 -0
  287. package/assets/customizations/.github/skills/apex-azure-compute/SKILL.md +36 -0
  288. package/assets/customizations/.github/skills/apex-azure-compute/references/compute-selection.md +26 -0
  289. package/assets/customizations/.github/skills/apex-azure-compute/references/pricing-evidence.md +11 -0
  290. package/assets/customizations/.github/skills/apex-azure-compute/references/recommendation-and-scale-rules.md +44 -0
  291. package/assets/customizations/.github/skills/apex-azure-cost-optimization/SKILL.md +61 -0
  292. package/assets/customizations/.github/skills/apex-azure-cost-optimization/references/cost-assessment-criteria.md +61 -0
  293. package/assets/customizations/.github/skills/apex-azure-cost-optimization/references/operational-checklist.md +24 -0
  294. package/assets/customizations/.github/skills/apex-azure-defaults/SKILL.md +59 -0
  295. package/assets/customizations/.github/skills/apex-azure-defaults/references/avm-binding-guidance.md +29 -0
  296. package/assets/customizations/.github/skills/apex-azure-defaults/references/baseline-fallbacks.md +53 -0
  297. package/assets/customizations/.github/skills/apex-azure-defaults/references/cost-monitoring.md +47 -0
  298. package/assets/customizations/.github/skills/apex-azure-defaults/references/decision-boundaries.md +19 -0
  299. package/assets/customizations/.github/skills/apex-azure-defaults/references/governance-effects.md +28 -0
  300. package/assets/customizations/.github/skills/apex-azure-defaults/references/naming.md +47 -0
  301. package/assets/customizations/.github/skills/apex-azure-defaults/references/network-planning.md +47 -0
  302. package/assets/customizations/.github/skills/apex-azure-defaults/references/security-baseline.md +40 -0
  303. package/assets/customizations/.github/skills/apex-azure-defaults/references/service-selection.md +51 -0
  304. package/assets/customizations/.github/skills/apex-azure-defaults/references/tag-precedence.md +31 -0
  305. package/assets/customizations/.github/skills/apex-azure-deploy/SKILL.md +50 -0
  306. package/assets/customizations/.github/skills/apex-azure-deploy/references/operational-checklist.md +26 -0
  307. package/assets/customizations/.github/skills/apex-azure-deploy/references/preview-recovery-verification.md +48 -0
  308. package/assets/customizations/.github/skills/apex-azure-diagnostics/SKILL.md +60 -0
  309. package/assets/customizations/.github/skills/apex-azure-diagnostics/references/diagnostic-interpretation.md +42 -0
  310. package/assets/customizations/.github/skills/apex-azure-diagnostics/references/operational-checklist.md +24 -0
  311. package/assets/customizations/.github/skills/apex-azure-governance/SKILL.md +52 -0
  312. package/assets/customizations/.github/skills/apex-azure-governance/references/evidence-interpretation.md +58 -0
  313. package/assets/customizations/.github/skills/apex-azure-governance/references/operational-checklist.md +25 -0
  314. package/assets/customizations/.github/skills/apex-azure-kusto/SKILL.md +58 -0
  315. package/assets/customizations/.github/skills/apex-azure-kusto/references/kql-evidence-interpretation.md +41 -0
  316. package/assets/customizations/.github/skills/apex-azure-kusto/references/operational-checklist.md +25 -0
  317. package/assets/customizations/.github/skills/apex-azure-prepare/SKILL.md +52 -0
  318. package/assets/customizations/.github/skills/apex-azure-prepare/references/functions-recipe-pack.md +27 -0
  319. package/assets/customizations/.github/skills/apex-azure-prepare/references/preparation-lineage.md +36 -0
  320. package/assets/customizations/.github/skills/apex-azure-quotas/SKILL.md +53 -0
  321. package/assets/customizations/.github/skills/apex-azure-quotas/references/capacity-decision-rules.md +48 -0
  322. package/assets/customizations/.github/skills/apex-azure-quotas/references/operational-checklist.md +23 -0
  323. package/assets/customizations/.github/skills/apex-azure-rbac/SKILL.md +45 -0
  324. package/assets/customizations/.github/skills/apex-azure-rbac/references/assignment-intent.md +39 -0
  325. package/assets/customizations/.github/skills/apex-azure-rbac/references/least-privilege-selection.md +50 -0
  326. package/assets/customizations/.github/skills/apex-azure-resources/SKILL.md +54 -0
  327. package/assets/customizations/.github/skills/apex-azure-resources/references/inventory-query-patterns.md +49 -0
  328. package/assets/customizations/.github/skills/apex-azure-resources/references/operational-checklist.md +24 -0
  329. package/assets/customizations/.github/skills/apex-azure-storage/SKILL.md +35 -0
  330. package/assets/customizations/.github/skills/apex-azure-storage/references/security-and-governance.md +12 -0
  331. package/assets/customizations/.github/skills/apex-azure-storage/references/service-auth-and-sdk-boundary.md +33 -0
  332. package/assets/customizations/.github/skills/apex-azure-storage/references/storage-selection.md +12 -0
  333. package/assets/customizations/.github/skills/apex-azure-validate/SKILL.md +49 -0
  334. package/assets/customizations/.github/skills/apex-azure-validate/references/operational-checklist.md +24 -0
  335. package/assets/customizations/.github/skills/apex-azure-validate/references/preflight-evidence.md +43 -0
  336. package/assets/customizations/.github/skills/apex-bicep-patterns/SKILL.md +41 -0
  337. package/assets/customizations/.github/skills/apex-bicep-patterns/references/avm-and-codegen-acceptance.md +11 -0
  338. package/assets/customizations/.github/skills/apex-bicep-patterns/references/codegen-acceptance-checklist.md +46 -0
  339. package/assets/customizations/.github/skills/apex-bicep-patterns/references/compiler-and-provider-gotchas.md +74 -0
  340. package/assets/customizations/.github/skills/apex-bicep-patterns/references/module-interfaces-and-parameters.md +56 -0
  341. package/assets/customizations/.github/skills/apex-bicep-patterns/references/network-and-observability.md +52 -0
  342. package/assets/customizations/.github/skills/apex-codegen/SKILL.md +32 -0
  343. package/assets/customizations/.github/skills/apex-entra-app-registration/SKILL.md +53 -0
  344. package/assets/customizations/.github/skills/apex-entra-app-registration/references/capability-receipts.md +21 -0
  345. package/assets/customizations/.github/skills/apex-entra-app-registration/references/design-and-diagnostics.md +36 -0
  346. package/assets/customizations/.github/skills/apex-entra-app-registration/references/oauth-registration-model.md +26 -0
  347. package/assets/customizations/.github/skills/apex-entra-app-registration/references/permissions-and-credentials.md +27 -0
  348. package/assets/customizations/.github/skills/apex-mermaid/SKILL.md +44 -0
  349. package/assets/customizations/.github/skills/apex-mermaid/references/styling.md +33 -0
  350. package/assets/customizations/.github/skills/apex-mermaid/references/syntax.md +99 -0
  351. package/assets/customizations/.github/skills/apex-microsoft-docs/SKILL.md +53 -0
  352. package/assets/customizations/.github/skills/apex-microsoft-docs/references/research-method.md +91 -0
  353. package/assets/customizations/.github/skills/apex-operations/SKILL.md +34 -0
  354. package/assets/customizations/.github/skills/apex-planning/SKILL.md +36 -0
  355. package/assets/customizations/.github/skills/apex-requirements/SKILL.md +43 -0
  356. package/assets/customizations/.github/skills/apex-terraform-import/SKILL.md +47 -0
  357. package/assets/customizations/.github/skills/apex-terraform-import/references/adoption-attestation.md +10 -0
  358. package/assets/customizations/.github/skills/apex-terraform-import/references/import-assessment.md +14 -0
  359. package/assets/customizations/.github/skills/apex-terraform-import/references/import-mapping.md +27 -0
  360. package/assets/customizations/.github/skills/apex-terraform-import/references/mapping-and-adoption-attestation.md +12 -0
  361. package/assets/customizations/.github/skills/apex-terraform-patterns/SKILL.md +49 -0
  362. package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-composition-and-refactor.md +20 -0
  363. package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-composition-and-state-boundaries.md +11 -0
  364. package/assets/customizations/.github/skills/apex-terraform-patterns/references/module-locks-and-codegen-acceptance.md +14 -0
  365. package/assets/customizations/.github/skills/apex-terraform-patterns/references/network-and-observability.md +12 -0
  366. package/assets/customizations/.github/skills/apex-terraform-patterns/references/plan-and-change-assessment.md +24 -0
  367. package/assets/customizations/.github/skills/apex-terraform-test/SKILL.md +45 -0
  368. package/assets/customizations/.github/skills/apex-terraform-test/references/evidence-acceptance.md +10 -0
  369. package/assets/customizations/.github/skills/apex-terraform-test/references/plan-mode-and-mock-design.md +12 -0
  370. package/assets/customizations/.github/skills/apex-terraform-test/references/plan-mode-test-design.md +23 -0
  371. package/assets/customizations/.github/skills/apex-terraform-test/references/test-design.md +13 -0
  372. package/assets/customizations/.github/skills/apex-workflow/SKILL.md +37 -0
  373. package/assets/customizations/.vscode/mcp.json +21 -0
  374. package/assets/customizations/README.md +22 -0
  375. package/assets/customizations/manifest.json +251 -0
  376. package/assets/manifest.json +5027 -0
  377. package/dist/assets.d.ts +69 -0
  378. package/dist/assets.js +336 -0
  379. package/dist/cli.d.ts +4 -0
  380. package/dist/cli.js +643 -0
  381. package/dist/dependency-revision.d.ts +5 -0
  382. package/dist/dependency-revision.js +21 -0
  383. package/dist/errors.d.ts +19 -0
  384. package/dist/errors.js +34 -0
  385. package/dist/index.d.ts +7 -0
  386. package/dist/index.js +7 -0
  387. package/dist/mcp.d.ts +5 -0
  388. package/dist/mcp.js +210 -0
  389. package/dist/provider-runtime.d.ts +27 -0
  390. package/dist/provider-runtime.js +229 -0
  391. package/dist/provider-transfer.d.ts +52 -0
  392. package/dist/provider-transfer.js +533 -0
  393. package/dist/service.d.ts +806 -0
  394. package/dist/service.js +3817 -0
  395. package/dist/state-transfer.d.ts +51 -0
  396. package/dist/state-transfer.js +559 -0
  397. package/dist/version.d.ts +2 -0
  398. package/dist/version.js +2 -0
  399. package/dist/workflow-validators.d.ts +80 -0
  400. package/dist/workflow-validators.js +843 -0
  401. package/package.json +57 -0
@@ -0,0 +1,843 @@
1
+ import { ArchitectureV1Schema, GovernanceConstraintsV1Schema, IacBindingV1Schema, ImplementationIntentV1Schema, PolicyPropertyMapV1Schema, RequirementsV1Schema, WorkloadDecisionManifestV1Schema, SECRET_FIELD_PATTERN, SECRET_VALUE_PATTERN, hasValidCostArithmetic, } from "@apexops/contracts";
2
+ import { WORKFLOW_VALIDATOR_OWNERSHIP, sha256Json, } from "@apexops/kernel";
3
+ import { evaluateQualityScorecard } from "@apexops/renderers";
4
+ const VALIDATION_EVIDENCE_IDS = new Set([
5
+ "bicep:build",
6
+ "bicep:format",
7
+ "bicep:lint",
8
+ "business:logical-resource-parity",
9
+ "business:policy-property-map",
10
+ "business:security-baseline",
11
+ "terraform:format",
12
+ "terraform:init-backend-false",
13
+ "terraform:validate",
14
+ ]);
15
+ function issue(path, message) {
16
+ return [{ path, message }];
17
+ }
18
+ function secretIssues(value, path = "") {
19
+ if (Array.isArray(value))
20
+ return value.flatMap((item, index) => secretIssues(item, `${path}/${index}`));
21
+ if (value !== null && typeof value === "object") {
22
+ return Object.entries(value)
23
+ .sort(([left], [right]) => left.localeCompare(right))
24
+ .flatMap(([key, item]) => [
25
+ ...(SECRET_FIELD_PATTERN.test(key)
26
+ ? [{ path: `${path}/${key}`, message: "Secret-bearing field is not allowed" }]
27
+ : []),
28
+ ...secretIssues(item, `${path}/${key}`),
29
+ ]);
30
+ }
31
+ return typeof value === "string" && SECRET_VALUE_PATTERN.test(value)
32
+ ? [{ path, message: "Secret-bearing value is not allowed" }]
33
+ : [];
34
+ }
35
+ function taskContext(value) {
36
+ return value;
37
+ }
38
+ function requirementsCompleteness(value) {
39
+ const requirements = taskContext(value).outputs.requirements;
40
+ const ids = requirements.requirements.map(({ id }) => id);
41
+ return new Set(ids).size === ids.length ? [] : issue("/requirements", "Requirement IDs must be unique");
42
+ }
43
+ function requirementsTraceability(value) {
44
+ const context = taskContext(value);
45
+ const architecture = context.outputs.architecture;
46
+ const requirements = context.artifacts.requirements;
47
+ if (requirements === undefined)
48
+ return issue("/artifacts/requirements", "Accepted requirements are required");
49
+ const knownIds = new Set(requirements.requirements.map(({ id }) => id));
50
+ const referencedIds = architecture.components.flatMap(({ requirementIds }) => requirementIds);
51
+ const unknown = [...new Set(referencedIds.filter((id) => !knownIds.has(id)))].sort();
52
+ if (unknown.length > 0) {
53
+ return issue("/outputs/architecture/components", `Unknown requirement IDs: ${unknown.join(", ")}`);
54
+ }
55
+ const referenced = new Set(referencedIds);
56
+ const missing = requirements.requirements
57
+ .filter(({ priority, status, id }) => priority === "must" && status === "confirmed" && !referenced.has(id))
58
+ .map(({ id }) => id)
59
+ .sort();
60
+ return missing.length === 0
61
+ ? []
62
+ : issue("/outputs/architecture/components", `Uncovered confirmed must requirements: ${missing.join(", ")}`);
63
+ }
64
+ function costArithmetic(value) {
65
+ const estimate = taskContext(value).outputs["cost-estimate"];
66
+ return hasValidCostArithmetic(estimate) ? [] : issue("/outputs/cost-estimate", "Cost arithmetic does not reconcile");
67
+ }
68
+ function workloadDecisionCoverage(value) {
69
+ const context = taskContext(value);
70
+ const manifest = context.outputs["workload-decision-manifest"];
71
+ const requirements = context.artifacts.requirements;
72
+ const architecture = context.outputs.architecture;
73
+ const estimate = context.outputs["cost-estimate"];
74
+ if (requirements === undefined)
75
+ return issue("/artifacts/requirements", "Accepted requirements are required");
76
+ const requiredIds = requirements.requirements
77
+ .filter(({ priority, status }) => priority === "must" && status === "confirmed")
78
+ .map(({ id }) => id)
79
+ .sort();
80
+ if (requiredIds.length === 0) {
81
+ return issue("/artifacts/requirements", "At least one confirmed must requirement is required for workload decisions");
82
+ }
83
+ const traces = new Map(manifest.requirementTraceability.map((trace) => [trace.requirementId, trace]));
84
+ if (traces.size !== manifest.requirementTraceability.length ||
85
+ JSON.stringify([...traces.keys()].sort()) !== JSON.stringify(requiredIds)) {
86
+ return issue("/outputs/workload-decision-manifest", "Traceability must cover exactly all confirmed must requirements");
87
+ }
88
+ const components = new Map(architecture.components.map((component) => [component.id, component]));
89
+ const sku = new Map(manifest.skuDecisions.map((decision) => [decision.id, decision]));
90
+ const slo = new Map(manifest.sloDecisions.map((decision) => [decision.id, decision]));
91
+ if (sku.size !== manifest.skuDecisions.length || slo.size !== manifest.sloDecisions.length) {
92
+ return issue("/outputs/workload-decision-manifest", "SKU and SLO decision IDs must be unique");
93
+ }
94
+ for (const id of requiredIds) {
95
+ const trace = traces.get(id);
96
+ if (trace.skuDecisionIds.some((decisionId) => sku.get(decisionId)?.requirementIds.includes(id) !== true) ||
97
+ trace.sloDecisionIds.some((decisionId) => slo.get(decisionId)?.requirementIds.includes(id) !== true)) {
98
+ return issue("/outputs/workload-decision-manifest", `Decisions do not cover requirement ${id}`);
99
+ }
100
+ }
101
+ for (const decision of manifest.skuDecisions) {
102
+ const component = components.get(decision.logicalId);
103
+ const costMatches = estimate.lineItems.filter((line) => line.service === decision.service && line.sku === decision.sku && line.quantity === decision.quantity);
104
+ if (component === undefined ||
105
+ component.service !== decision.service ||
106
+ !decision.requirementIds.every((id) => component.requirementIds.includes(id)) ||
107
+ costMatches.length !== 1) {
108
+ return issue("/outputs/workload-decision-manifest/skuDecisions", `SKU decision ${decision.id} is not architecture and cost traceable`);
109
+ }
110
+ }
111
+ for (const decision of manifest.sloDecisions) {
112
+ const component = components.get(decision.logicalId);
113
+ if (component === undefined || !decision.requirementIds.every((id) => component.requirementIds.includes(id))) {
114
+ return issue("/outputs/workload-decision-manifest/sloDecisions", `SLO decision ${decision.id} is not architecture traceable`);
115
+ }
116
+ }
117
+ return [];
118
+ }
119
+ function availabilityCurrent(value) {
120
+ const context = taskContext(value);
121
+ const evidence = context.availabilityEvidence;
122
+ if (evidence === undefined)
123
+ return issue("/availabilityEvidence", "Current architecture availability evidence is required");
124
+ const architecture = context.outputs.architecture;
125
+ const issues = [];
126
+ if (evidence.projectId !== architecture.projectId ||
127
+ evidence.runId !== architecture.runId ||
128
+ evidence.targetScope !== context.targetScope) {
129
+ issues.push({
130
+ path: "/availabilityEvidence",
131
+ message: "Availability evidence does not match the architecture run",
132
+ });
133
+ }
134
+ const missingSourceRefs = Object.values(evidence.checks)
135
+ .map(({ evidenceRef }) => evidenceRef)
136
+ .filter((reference) => !context.inputRefs.includes(reference))
137
+ .sort();
138
+ if (missingSourceRefs.length > 0) {
139
+ issues.push({
140
+ path: "/availabilityEvidence/checks",
141
+ message: `Availability source evidence was not pinned to the task: ${missingSourceRefs.join(", ")}`,
142
+ });
143
+ }
144
+ const now = Date.parse(context.now);
145
+ if (Date.parse(evidence.collectedAt) > now) {
146
+ issues.push({
147
+ path: "/availabilityEvidence/collectedAt",
148
+ message: "Architecture availability evidence has a future collection timestamp",
149
+ });
150
+ }
151
+ if (Date.parse(evidence.expiresAt) <= now) {
152
+ issues.push({ path: "/availabilityEvidence/expiresAt", message: "Architecture availability evidence is expired" });
153
+ }
154
+ const unavailable = Object.entries(evidence.checks)
155
+ .filter(([, check]) => check.status !== "current")
156
+ .map(([name]) => name)
157
+ .sort();
158
+ if (unavailable.length > 0) {
159
+ issues.push({
160
+ path: "/availabilityEvidence/checks",
161
+ message: `Architecture availability checks are not current: ${unavailable.join(", ")}`,
162
+ });
163
+ }
164
+ return issues;
165
+ }
166
+ function governanceCompleteness(value) {
167
+ const governance = taskContext(value).outputs["governance-constraints"];
168
+ const discoveredItems = Object.values(governance.summary).reduce((total, count) => total + count, 0);
169
+ return discoveredItems > 0 && governance.constraintsRef.bytes === 0
170
+ ? issue("/outputs/governance-constraints/constraintsRef/bytes", "Non-empty discovery requires evidence bytes")
171
+ : [];
172
+ }
173
+ function governanceFreshness(value) {
174
+ const context = taskContext(value);
175
+ const governance = context.outputs["governance-constraints"];
176
+ const now = Date.parse(context.now);
177
+ if (Date.parse(governance.discoveredAt) > now) {
178
+ return issue("/outputs/governance-constraints/discoveredAt", "Governance discovery is from the future");
179
+ }
180
+ return Date.parse(governance.expiresAt) <= now
181
+ ? issue("/outputs/governance-constraints/expiresAt", "Governance discovery is stale")
182
+ : [];
183
+ }
184
+ function policyEffectCoverage(value) {
185
+ const context = taskContext(value);
186
+ const governance = context.artifacts["governance-constraints"];
187
+ const policyMap = context.outputs["policy-property-map"];
188
+ if (governance === undefined) {
189
+ return issue("/artifacts/governance-constraints", "Accepted governance constraints are required");
190
+ }
191
+ const counts = new Map();
192
+ for (const mapping of policyMap.mappings)
193
+ counts.set(mapping.effect, (counts.get(mapping.effect) ?? 0) + 1);
194
+ const missing = [
195
+ ["deny", governance.summary.denyCount],
196
+ ["modify", governance.summary.modifyCount],
197
+ ["audit", governance.summary.auditCount],
198
+ ].flatMap(([effect, required]) => (counts.get(effect) ?? 0) < required ? [effect] : []);
199
+ return missing.length === 0
200
+ ? []
201
+ : issue("/outputs/policy-property-map/mappings", `Missing policy effect coverage: ${missing.join(", ")}`);
202
+ }
203
+ function planSourceCoverage(value) {
204
+ const context = taskContext(value);
205
+ const intent = context.outputs["implementation-intent"];
206
+ const requiredSources = ["requirements", "architecture", "governance-constraints", "policy-property-map"].filter((kind) => context.artifactHashes[kind] !== undefined);
207
+ const invalid = requiredSources.filter((kind) => intent.sourceHashes[kind] !== context.artifactHashes[kind]);
208
+ return invalid.length === 0
209
+ ? []
210
+ : issue("/outputs/implementation-intent/sourceHashes", `Missing or stale source hashes: ${invalid.join(", ")}`);
211
+ }
212
+ function bindingTrackMatch(value) {
213
+ const context = taskContext(value);
214
+ const intent = context.outputs["implementation-intent"];
215
+ const binding = context.outputs["iac-binding"];
216
+ const resourceIds = new Set(intent.resources.map(({ id }) => id));
217
+ const bindingIds = Object.keys(binding.resourceBindings);
218
+ return binding.track === context.track &&
219
+ binding.intentHash === sha256Json(intent) &&
220
+ bindingIds.length === resourceIds.size &&
221
+ bindingIds.every((id) => resourceIds.has(id))
222
+ ? []
223
+ : issue("/outputs/iac-binding", "IaC binding track, intent, or resource coverage is invalid");
224
+ }
225
+ function dependencyAcyclic(value) {
226
+ const intent = taskContext(value).outputs["implementation-intent"];
227
+ const ids = intent.resources.map(({ id }) => id);
228
+ const known = new Set(ids);
229
+ if (known.size !== ids.length)
230
+ return issue("/outputs/implementation-intent/resources", "Resource IDs must be unique");
231
+ const unknown = intent.resources.flatMap(({ dependsOn }) => dependsOn.filter((id) => !known.has(id)));
232
+ if (unknown.length > 0) {
233
+ return issue("/outputs/implementation-intent/resources", `Unknown resource dependencies: ${[...new Set(unknown)].sort().join(", ")}`);
234
+ }
235
+ const incoming = new Map(ids.map((id) => [id, 0]));
236
+ const outgoing = new Map(ids.map((id) => [id, []]));
237
+ for (const resource of intent.resources) {
238
+ for (const dependency of resource.dependsOn) {
239
+ incoming.set(resource.id, (incoming.get(resource.id) ?? 0) + 1);
240
+ outgoing.get(dependency)?.push(resource.id);
241
+ }
242
+ }
243
+ const pending = ids.filter((id) => incoming.get(id) === 0);
244
+ let visited = 0;
245
+ while (pending.length > 0) {
246
+ const id = pending.shift();
247
+ if (id === undefined)
248
+ break;
249
+ visited += 1;
250
+ for (const dependent of outgoing.get(id) ?? []) {
251
+ const count = (incoming.get(dependent) ?? 0) - 1;
252
+ incoming.set(dependent, count);
253
+ if (count === 0)
254
+ pending.push(dependent);
255
+ }
256
+ }
257
+ return visited === ids.length ? [] : issue("/outputs/implementation-intent/resources", "Resource graph has a cycle");
258
+ }
259
+ function bindingCoverage(expectedTrack, value) {
260
+ const context = taskContext(value);
261
+ const intent = context.artifacts["implementation-intent"];
262
+ const binding = context.artifacts["iac-binding"];
263
+ const manifest = context.outputs["logical-resource-manifest"];
264
+ if (intent === undefined || binding === undefined) {
265
+ return issue("/artifacts", "Accepted implementation intent and IaC binding are required");
266
+ }
267
+ const expectedIds = intent.resources.map(({ id }) => id).sort();
268
+ const bindingIds = Object.keys(binding.resourceBindings).sort();
269
+ const manifestIds = manifest.resources.map(({ logicalId }) => logicalId).sort();
270
+ return binding.track === expectedTrack &&
271
+ manifest.track === expectedTrack &&
272
+ JSON.stringify(bindingIds) === JSON.stringify(expectedIds) &&
273
+ JSON.stringify(manifestIds) === JSON.stringify(expectedIds)
274
+ ? []
275
+ : issue("/outputs/logical-resource-manifest", `${expectedTrack} binding coverage is incomplete`);
276
+ }
277
+ function comprehensiveReview(expectedNode, value) {
278
+ const context = taskContext(value);
279
+ const review = context.outputs["review-findings"];
280
+ const subjectKind = expectedNode === "governance-reconciliation" ? "policy-property-map" : expectedNode;
281
+ const artifactKind = subjectKind === "plan" ? "implementation-intent" : subjectKind;
282
+ const expectedHash = context.artifactHashes[artifactKind];
283
+ const findingIds = review.findings.map(({ id }) => id);
284
+ if (new Set(findingIds).size !== findingIds.length) {
285
+ return issue("/outputs/review-findings/findings", "Review finding IDs must be unique");
286
+ }
287
+ return review.subjectKind === subjectKind && expectedHash !== undefined && review.subjectHash === expectedHash
288
+ ? []
289
+ : issue("/outputs/review-findings", `Review does not bind the accepted ${subjectKind} artifact`);
290
+ }
291
+ function requiredValidationEvidence(id, value) {
292
+ const evidence = value;
293
+ const matches = evidence.entries.filter(({ kind }) => kind === id);
294
+ return matches.length === 1 && matches[0]?.required === true && matches[0]?.retention === "immutable"
295
+ ? []
296
+ : issue("/entries", `Required immutable validation evidence is missing for ${id}`);
297
+ }
298
+ function gateContext(value) {
299
+ return value;
300
+ }
301
+ function gateReady(expectedGate, value) {
302
+ const context = gateContext(value);
303
+ const requiredArtifacts = {
304
+ 1: ["requirements"],
305
+ 2: ["architecture", "cost-estimate", "workload-decision-manifest", "governance-constraints", "policy-property-map"],
306
+ 3: ["implementation-intent", "iac-binding", "environment-inputs"],
307
+ };
308
+ const requiredReviews = {
309
+ 1: context.legacyRequirements ? [] : ["requirements-review"],
310
+ 2: ["architecture-review", "governance-review"],
311
+ 3: ["plan-review"],
312
+ };
313
+ const issues = [];
314
+ if (context.gateNumber !== expectedGate || context.gate.gate !== expectedGate) {
315
+ issues.push({ path: "/gateNumber", message: `Expected Gate ${expectedGate}` });
316
+ }
317
+ if (context.gate.state !== "open")
318
+ issues.push({ path: "/gate/state", message: "Gate is not open" });
319
+ const missingArtifacts = requiredArtifacts[expectedGate].filter((kind) => context.artifactHashes[kind] === undefined);
320
+ if (missingArtifacts.length > 0) {
321
+ issues.push({ path: "/artifactHashes", message: `Missing required artifacts: ${missingArtifacts.join(", ")}` });
322
+ }
323
+ const completed = new Set(context.completedNodes);
324
+ const missingReviews = requiredReviews[expectedGate].filter((nodeId) => !completed.has(nodeId));
325
+ if (missingReviews.length > 0) {
326
+ issues.push({ path: "/completedNodes", message: `Missing required reviews: ${missingReviews.join(", ")}` });
327
+ }
328
+ if (context.reviewBlockers.length > 0) {
329
+ issues.push({
330
+ path: "/reviewBlockers",
331
+ message: `Unresolved review findings: ${context.reviewBlockers.join(", ")}`,
332
+ });
333
+ }
334
+ if (context.expectedDependencyHash === undefined || context.gate.dependencyHash !== context.expectedDependencyHash) {
335
+ issues.push({ path: "/gate/dependencyHash", message: "Gate is not bound to the current review dependency" });
336
+ }
337
+ if (context.approval.dependencyHash !== context.gate.dependencyHash) {
338
+ issues.push({ path: "/approval/dependencyHash", message: "Approval is not bound to the open gate" });
339
+ }
340
+ return issues;
341
+ }
342
+ function gatePreviewCurrent(value) {
343
+ const context = gateContext(value);
344
+ const preview = context.preview;
345
+ if (preview === undefined)
346
+ return issue("/preview", "Current deployment preview is required");
347
+ const issues = [];
348
+ if (context.gateNumber !== 4 || context.gate.gate !== 4 || context.gate.state !== "open") {
349
+ issues.push({ path: "/gate", message: "Gate 4 is not open" });
350
+ }
351
+ if (context.gate.dependencyHash !== preview.previewHash) {
352
+ issues.push({ path: "/gate/dependencyHash", message: "Gate 4 is not bound to the current preview" });
353
+ }
354
+ if (preview.projectId !== context.run.projectId ||
355
+ preview.runId !== context.run.runId ||
356
+ preview.track !== context.run.iacTool ||
357
+ preview.target !== context.run.targetScope) {
358
+ issues.push({ path: "/preview", message: "Preview identity does not match the selected run" });
359
+ }
360
+ if (preview.dependencyRevision !== context.currentDependencyRevision ||
361
+ preview.commit !== context.currentDependencyRevision) {
362
+ issues.push({ path: "/preview/dependencyRevision", message: "Preview dependencies are stale" });
363
+ }
364
+ const writerCurrent = (preview.ownerEpoch === context.run.ownerEpoch && context.provedPreviewTransferClaimHash === undefined) ||
365
+ (preview.ownerEpoch + 1 === context.run.ownerEpoch && context.provedPreviewTransferClaimHash !== undefined);
366
+ if (!writerCurrent) {
367
+ issues.push({ path: "/preview/ownerEpoch", message: "Preview writer epoch is stale" });
368
+ }
369
+ const now = Date.parse(context.now);
370
+ if (Date.parse(preview.createdAt) > now || Date.parse(preview.expiresAt) <= now) {
371
+ issues.push({ path: "/preview/expiresAt", message: "Preview is not current" });
372
+ }
373
+ return issues;
374
+ }
375
+ function gateApprovalBindingComplete(value) {
376
+ const context = gateContext(value);
377
+ const preview = context.preview;
378
+ if (preview === undefined)
379
+ return issue("/preview", "Current deployment preview is required");
380
+ const approval = context.approval;
381
+ const valid = approval.gate === 4 &&
382
+ approval.decision === "approved" &&
383
+ approval.projectId === context.run.projectId &&
384
+ approval.runId === context.run.runId &&
385
+ approval.previewHash === preview.previewHash &&
386
+ approval.dependencyHash === preview.previewHash &&
387
+ approval.writerEpoch === context.run.ownerEpoch &&
388
+ approval.writerTransferClaimHash === context.provedPreviewTransferClaimHash &&
389
+ approval.recipientIdentity === context.expectedApprovalRecipientIdentity &&
390
+ approval.expiresAt !== undefined &&
391
+ Date.parse(approval.expiresAt) > Date.parse(context.now);
392
+ return valid ? [] : issue("/approval", "Approval does not completely bind the current preview and writer");
393
+ }
394
+ function gateNoHardBlockers(value) {
395
+ const context = gateContext(value);
396
+ const blockers = [...(context.preview?.blockers ?? []), ...context.reviewBlockers];
397
+ return blockers.length === 0 ? [] : issue("/blockers", `Hard blockers remain: ${blockers.join(", ")}`);
398
+ }
399
+ function previewContext(value) {
400
+ return value;
401
+ }
402
+ function previewHashBindings(value) {
403
+ const context = previewContext(value);
404
+ const preview = context.preview;
405
+ const { previewHash, ...body } = preview;
406
+ const issues = [];
407
+ if (sha256Json(body) !== previewHash)
408
+ issues.push({ path: "/previewHash", message: "Preview hash is invalid" });
409
+ if (preview.projectId !== context.run.projectId ||
410
+ preview.runId !== context.run.runId ||
411
+ preview.track !== context.run.iacTool ||
412
+ preview.environment !== context.run.environment ||
413
+ preview.target !== context.run.targetScope ||
414
+ preview.operation !== context.expectedOperation) {
415
+ issues.push({ path: "/preview", message: "Preview identity does not match the selected run" });
416
+ }
417
+ if (preview.inputHash !== context.expectedInputHash ||
418
+ preview.iacHash !== context.expectedIacHash ||
419
+ preview.policyHash !== context.expectedPolicyHash) {
420
+ issues.push({ path: "/preview", message: "Preview does not bind the accepted input, IaC, and policy artifacts" });
421
+ }
422
+ if (preview.ownerEpoch !== context.run.ownerEpoch) {
423
+ issues.push({ path: "/ownerEpoch", message: "Preview writer epoch is stale" });
424
+ }
425
+ return issues;
426
+ }
427
+ function previewPolicyPrecheck(value) {
428
+ const context = previewContext(value);
429
+ return context.preview.policyHash === context.expectedPolicyHash
430
+ ? []
431
+ : issue("/policyHash", "Preview policy precheck is not bound to the current policy artifact");
432
+ }
433
+ function previewCoverage(value) {
434
+ const context = previewContext(value);
435
+ const changes = context.preview.changes;
436
+ const resourceIds = changes.map(({ resourceId }) => resourceId);
437
+ const issues = [];
438
+ if (new Set(resourceIds).size !== resourceIds.length) {
439
+ issues.push({ path: "/changes", message: "Preview contains duplicate resource changes" });
440
+ }
441
+ if (changes.some(({ action }) => action === "unknown")) {
442
+ issues.push({ path: "/changes", message: "Preview contains unknown resource actions" });
443
+ }
444
+ if (context.provider === "fake") {
445
+ const actual = [...resourceIds].sort();
446
+ const expected = [...context.expectedResourceIds].sort();
447
+ if (JSON.stringify(actual) !== JSON.stringify(expected)) {
448
+ issues.push({ path: "/changes", message: "Fake preview does not cover every requested resource" });
449
+ }
450
+ }
451
+ return issues;
452
+ }
453
+ function previewFreshness(value) {
454
+ const context = previewContext(value);
455
+ const preview = context.preview;
456
+ const now = Date.parse(context.now);
457
+ return preview.commit === context.currentDependencyRevision &&
458
+ preview.dependencyRevision === context.currentDependencyRevision &&
459
+ Date.parse(preview.createdAt) <= now &&
460
+ Date.parse(preview.expiresAt) > now
461
+ ? []
462
+ : issue("/preview", "Preview is stale or expired");
463
+ }
464
+ function terraformSavedPlanBinding(value) {
465
+ const context = previewContext(value);
466
+ const attestation = context.attestation;
467
+ if (attestation === undefined)
468
+ return issue("/attestation", "Terraform saved-plan attestation is required");
469
+ const preview = context.preview;
470
+ const providerArtifactHash = sha256Json({
471
+ planDigest: attestation.planDigest,
472
+ configHash: attestation.configHash,
473
+ lockfileHash: attestation.lockfileHash,
474
+ recipient: attestation.recipient,
475
+ artifactRef: attestation.artifactRef,
476
+ });
477
+ const valid = attestation.projectId === preview.projectId &&
478
+ attestation.runId === preview.runId &&
479
+ attestation.track === "terraform" &&
480
+ attestation.previewHash === preview.previewHash &&
481
+ attestation.inputHash === preview.inputHash &&
482
+ attestation.iacHash === preview.iacHash &&
483
+ attestation.policyHash === preview.policyHash &&
484
+ attestation.stateLineage === preview.stateLineage &&
485
+ attestation.stateSerial === preview.stateSerial &&
486
+ attestation.recipient === attestation.transport.recipient &&
487
+ attestation.recipient === context.intendedExecutionRecipientIdentity &&
488
+ attestation.expiresAt === preview.expiresAt &&
489
+ preview.artifactHash === providerArtifactHash;
490
+ return valid ? [] : issue("/attestation", "Terraform saved plan is not bound to the exact preview");
491
+ }
492
+ function deployContext(value) {
493
+ return value;
494
+ }
495
+ function deployExactApprovedOperation(value) {
496
+ const context = deployContext(value);
497
+ const preview = context.preview;
498
+ const approval = context.approval;
499
+ const { previewHash, ...previewBody } = preview;
500
+ const valid = sha256Json(previewBody) === previewHash &&
501
+ context.expectedPreviewHash === previewHash &&
502
+ approval.projectId === context.run.projectId &&
503
+ approval.runId === context.run.runId &&
504
+ approval.gate === 4 &&
505
+ approval.decision === "approved" &&
506
+ approval.previewHash === previewHash &&
507
+ approval.dependencyHash === previewHash &&
508
+ approval.recipientIdentity !== undefined;
509
+ return valid ? [] : issue("/approval", "Deployment is not authorized by the exact approved operation");
510
+ }
511
+ function deployStaleWriterRejection(value) {
512
+ const context = deployContext(value);
513
+ const preview = context.preview;
514
+ const approval = context.approval;
515
+ const now = Date.parse(context.now);
516
+ const sameWriter = preview.ownerEpoch === context.run.ownerEpoch &&
517
+ approval.writerEpoch === context.run.ownerEpoch &&
518
+ context.provedPreviewTransferClaimHash === undefined &&
519
+ approval.writerTransferClaimHash === undefined;
520
+ const approvedAfterTransfer = preview.ownerEpoch + 1 === context.run.ownerEpoch &&
521
+ approval.writerEpoch === context.run.ownerEpoch &&
522
+ context.provedPreviewTransferClaimHash !== undefined &&
523
+ approval.writerTransferClaimHash === context.provedPreviewTransferClaimHash;
524
+ const approvedBeforeTransfer = preview.ownerEpoch + 1 === context.run.ownerEpoch &&
525
+ approval.writerEpoch === preview.ownerEpoch &&
526
+ context.provedPreviewTransferClaimHash !== undefined &&
527
+ approval.writerTransferClaimHash === undefined &&
528
+ approval.recipientIdentity !== undefined;
529
+ const valid = (sameWriter || approvedAfterTransfer || approvedBeforeTransfer) &&
530
+ preview.commit === context.currentDependencyRevision &&
531
+ preview.dependencyRevision === context.currentDependencyRevision &&
532
+ Date.parse(preview.expiresAt) > now &&
533
+ approval.expiresAt !== undefined &&
534
+ Date.parse(approval.expiresAt) > now;
535
+ return valid ? [] : issue("/run", "Deployment writer or dependency authority is stale");
536
+ }
537
+ function providerReceiptIncludes(id, context) {
538
+ const operation = context.operation;
539
+ const evidence = context.executionEvidence;
540
+ return (operation !== undefined &&
541
+ operation.state === "succeeded" &&
542
+ operation.projectId === context.run.projectId &&
543
+ operation.runId === context.run.runId &&
544
+ operation.operation === context.preview.operation &&
545
+ operation.previewHash === context.preview.previewHash &&
546
+ operation.approvalHash === sha256Json(context.approval) &&
547
+ operation.ownerEpoch === context.run.ownerEpoch &&
548
+ evidence?.mode === "native" &&
549
+ evidence.operationId === operation.operationId &&
550
+ evidence.previewHash === context.preview.previewHash &&
551
+ evidence.validatorIds.includes(id));
552
+ }
553
+ function deployBicepStackOwnership(value) {
554
+ const context = deployContext(value);
555
+ return context.provider === "bicep" && providerReceiptIncludes("deploy:bicep-stack-ownership", context)
556
+ ? []
557
+ : issue("/executionEvidence", "Native Bicep stack ownership evidence is missing");
558
+ }
559
+ function deployExactSavedPlan(value) {
560
+ const context = deployContext(value);
561
+ const attestation = context.attestation;
562
+ const valid = context.provider === "terraform" &&
563
+ providerReceiptIncludes("deploy:exact-saved-plan", context) &&
564
+ attestation !== undefined &&
565
+ attestation.previewHash === context.preview.previewHash &&
566
+ attestation.inputHash === context.preview.inputHash &&
567
+ attestation.iacHash === context.preview.iacHash &&
568
+ attestation.policyHash === context.preview.policyHash;
569
+ return valid ? [] : issue("/executionEvidence", "Native Terraform exact saved-plan evidence is missing");
570
+ }
571
+ function deployStateLineageAndSerial(value) {
572
+ const context = deployContext(value);
573
+ const attestation = context.attestation;
574
+ const valid = context.provider === "terraform" &&
575
+ providerReceiptIncludes("deploy:state-lineage-and-serial", context) &&
576
+ attestation !== undefined &&
577
+ attestation.stateLineage === context.preview.stateLineage &&
578
+ attestation.stateSerial === context.preview.stateSerial;
579
+ return valid ? [] : issue("/executionEvidence", "Terraform state lineage or serial evidence is missing");
580
+ }
581
+ function inventoryContext(value) {
582
+ return value;
583
+ }
584
+ function inventorySecretFree(value) {
585
+ return secretIssues(inventoryContext(value).inventory, "/inventory");
586
+ }
587
+ function inventorySourceCoverage(value) {
588
+ const context = inventoryContext(value);
589
+ const inventory = context.inventory;
590
+ const resourceIds = inventory.resources.map(({ resourceId }) => resourceId);
591
+ const logicalIds = inventory.resources.map(({ logicalId }) => logicalId);
592
+ const issues = [];
593
+ if (new Set(resourceIds).size !== resourceIds.length || new Set(logicalIds).size !== logicalIds.length) {
594
+ issues.push({ path: "/inventory/resources", message: "Inventory resource identities must be unique" });
595
+ }
596
+ const expected = context.preview.changes
597
+ .filter(({ material, action }) => material && action !== "delete" && action !== "no-op")
598
+ .map(({ resourceId }) => resourceId);
599
+ const missing = expected.filter((expectedId) => !inventory.resources.some(({ logicalId, resourceId }) => logicalId === expectedId || resourceId === expectedId || resourceId.endsWith(`:${expectedId}`)));
600
+ if (missing.length > 0) {
601
+ issues.push({
602
+ path: "/inventory/resources",
603
+ message: `Inventory is missing preview resources: ${missing.sort().join(", ")}`,
604
+ });
605
+ }
606
+ return issues;
607
+ }
608
+ function inventoryEventuallyReconciled(value) {
609
+ const context = inventoryContext(value);
610
+ const inventory = context.inventory;
611
+ const operation = context.operation;
612
+ const valid = operation.state === "succeeded" &&
613
+ operation.projectId === context.run.projectId &&
614
+ operation.runId === context.run.runId &&
615
+ operation.previewHash === context.preview.previewHash &&
616
+ inventory.projectId === context.run.projectId &&
617
+ inventory.runId === context.run.runId &&
618
+ Date.parse(inventory.collectedAt) >= Date.parse(operation.updatedAt) &&
619
+ (context.preview.operation !== "destroy" || inventory.resources.length === 0);
620
+ return valid ? [] : issue("/inventory", "Inventory does not reconcile the completed operation");
621
+ }
622
+ function diagnosisReadOnly(value) {
623
+ const context = taskContext(value);
624
+ const diagnosis = context.outputs.diagnosis;
625
+ const operation = context.deploymentOperation;
626
+ const inventory = context.deploymentInventory;
627
+ if (operation === undefined || inventory === undefined) {
628
+ return issue("/deployment", "Accepted operation and inventory are required for diagnosis");
629
+ }
630
+ const issues = [];
631
+ if (diagnosis.projectId !== operation.projectId ||
632
+ diagnosis.runId !== operation.runId ||
633
+ Date.parse(diagnosis.diagnosedAt) < Date.parse(inventory.collectedAt) ||
634
+ Date.parse(diagnosis.diagnosedAt) > Date.parse(context.now)) {
635
+ issues.push({
636
+ path: "/outputs/diagnosis",
637
+ message: "Diagnosis is not a read-only observation of current inventory",
638
+ });
639
+ }
640
+ const unpinned = diagnosis.causes
641
+ .flatMap(({ evidenceRefs }) => evidenceRefs)
642
+ .filter((reference) => !context.inputRefs.includes(reference))
643
+ .sort();
644
+ if (unpinned.length > 0) {
645
+ issues.push({
646
+ path: "/outputs/diagnosis/causes",
647
+ message: `Diagnosis evidence was not pinned to the task: ${unpinned.join(", ")}`,
648
+ });
649
+ }
650
+ return issues;
651
+ }
652
+ function diagnosisSecretFree(value) {
653
+ return secretIssues(taskContext(value).outputs.diagnosis, "/outputs/diagnosis");
654
+ }
655
+ function terminalRunEvidenceComplete(value) {
656
+ const context = value;
657
+ const accounted = new Set([...context.executedValidatorIds, ...context.simulatedOmittedValidatorIds]);
658
+ const missing = [...new Set(context.activeValidatorIds)]
659
+ .filter((id) => id !== "terminal:run-evidence-complete" && !accounted.has(id))
660
+ .sort();
661
+ return missing.length === 0
662
+ ? []
663
+ : issue("/validatorEvidence", `Run is missing validator evidence: ${missing.join(", ")}`);
664
+ }
665
+ function qualityContext(value) {
666
+ return value;
667
+ }
668
+ function qualityScorecardDecidable(value) {
669
+ const context = qualityContext(value);
670
+ if (context.scorecard === undefined)
671
+ return issue("/scorecard", "Quality scorecard context is required");
672
+ if (context.qualityMeasurements === undefined)
673
+ return issue("/qualityMeasurements", "Quality measurements context is required");
674
+ const report = context.outputs["quality-report"];
675
+ const measurementSet = context.qualityMeasurements;
676
+ const measurements = measurementSet.measurements;
677
+ const evaluations = evaluateQualityScorecard(context.scorecard, measurements);
678
+ const checks = new Map(report.checks.map((check) => [`${check.id}\u0000${check.scenario}`, check]));
679
+ const issues = [];
680
+ if (report.scorecardHash !== sha256Json(context.scorecard)) {
681
+ issues.push({ path: "/outputs/quality-report/scorecardHash", message: "Quality report scorecard hash is stale" });
682
+ }
683
+ if (report.measurementsHash !== sha256Json(measurementSet)) {
684
+ issues.push({ path: "/outputs/quality-report/measurementsHash", message: "Quality measurement hash is invalid" });
685
+ }
686
+ if (checks.size !== report.checks.length || checks.size !== context.scorecard.rules.length) {
687
+ issues.push({
688
+ path: "/outputs/quality-report/checks",
689
+ message: "Quality report must contain one check per scorecard rule",
690
+ });
691
+ }
692
+ for (const evaluation of evaluations) {
693
+ const check = checks.get(`${evaluation.metric}\u0000${evaluation.scenario}`);
694
+ if (check === undefined ||
695
+ check.status !== evaluation.decision ||
696
+ check.samples !== evaluation.samples ||
697
+ check.value !== evaluation.value ||
698
+ check.detail !== evaluation.reason) {
699
+ issues.push({
700
+ path: "/outputs/quality-report/checks",
701
+ message: `Quality decision does not reconcile for ${evaluation.metric}/${evaluation.scenario}`,
702
+ });
703
+ }
704
+ }
705
+ const expectedStatus = evaluations.some(({ decision }) => decision === "fail") || !evaluations.some(({ decision }) => decision === "pass")
706
+ ? "fail"
707
+ : "pass";
708
+ if (report.status !== expectedStatus) {
709
+ issues.push({ path: "/outputs/quality-report/status", message: `Quality report status must be ${expectedStatus}` });
710
+ }
711
+ return issues;
712
+ }
713
+ function qualityNoSubjectiveClaims(value) {
714
+ const context = qualityContext(value);
715
+ if (context.qualityMeasurements === undefined)
716
+ return issue("/qualityMeasurements", "Quality measurements context is required");
717
+ const report = context.outputs["quality-report"];
718
+ const measurements = new Map(context.qualityMeasurements.measurements.map((measurement) => [
719
+ `${measurement.metric}\u0000${measurement.scenario}`,
720
+ measurement,
721
+ ]));
722
+ const keys = report.checks.map(({ id, scenario }) => `${id}\u0000${scenario}`);
723
+ const measurementKeys = context.qualityMeasurements.measurements.map(({ metric, scenario }) => `${metric}\u0000${scenario}`);
724
+ const issues = [];
725
+ if (new Set(keys).size !== keys.length) {
726
+ issues.push({ path: "/outputs/quality-report/checks", message: "Quality checks must be unique" });
727
+ }
728
+ if (JSON.stringify(keys) !== JSON.stringify([...keys].sort())) {
729
+ issues.push({ path: "/outputs/quality-report/checks", message: "Quality checks must use canonical order" });
730
+ }
731
+ if (new Set(measurementKeys).size !== measurementKeys.length) {
732
+ issues.push({ path: "/qualityMeasurements/measurements", message: "Quality measurements must be unique" });
733
+ }
734
+ if (JSON.stringify(measurementKeys) !== JSON.stringify([...measurementKeys].sort())) {
735
+ issues.push({
736
+ path: "/qualityMeasurements/measurements",
737
+ message: "Quality measurements must use canonical order",
738
+ });
739
+ }
740
+ for (const check of report.checks) {
741
+ if (check.value !== undefined && !Number.isFinite(check.value)) {
742
+ issues.push({ path: "/outputs/quality-report/checks/value", message: "Quality values must be finite" });
743
+ }
744
+ const measurement = measurements.get(`${check.id}\u0000${check.scenario}`);
745
+ const requiredEvidence = new Set([report.measurementsHash, ...(measurement?.evidenceRefs ?? [])]);
746
+ if (check.status !== "omitted" && [...requiredEvidence].some((hash) => !check.evidenceRefs.includes(hash))) {
747
+ issues.push({
748
+ path: "/outputs/quality-report/checks/evidenceRefs",
749
+ message: `Quality claim ${check.id}/${check.scenario} is missing measurement evidence`,
750
+ });
751
+ }
752
+ }
753
+ return issues;
754
+ }
755
+ export function registerWorkflowValidators(registry) {
756
+ registry.register("schema:requirements-v1", RequirementsV1Schema);
757
+ registry.register("schema:architecture-v1", ArchitectureV1Schema);
758
+ registry.register("schema:workload-decision-manifest-v1", WorkloadDecisionManifestV1Schema);
759
+ registry.register("schema:governance-constraints-v1", GovernanceConstraintsV1Schema);
760
+ registry.register("schema:policy-property-map-v1", PolicyPropertyMapV1Schema);
761
+ registry.register("schema:implementation-intent-v1", ImplementationIntentV1Schema);
762
+ registry.register("schema:iac-binding-v1", IacBindingV1Schema);
763
+ registry.registerHandler("business:requirements-completeness", requirementsCompleteness);
764
+ registry.registerHandler("business:requirements-traceability", requirementsTraceability);
765
+ registry.registerHandler("business:workload-decision-manifest-coverage", workloadDecisionCoverage);
766
+ registry.registerHandler("business:cost-arithmetic", costArithmetic);
767
+ registry.registerHandler("business:availability-current", availabilityCurrent, "freshness");
768
+ registry.registerHandler("business:governance-completeness", governanceCompleteness);
769
+ registry.registerHandler("business:governance-freshness", governanceFreshness, "freshness");
770
+ registry.registerHandler("business:policy-effect-coverage", policyEffectCoverage);
771
+ registry.registerHandler("business:plan-source-coverage", planSourceCoverage);
772
+ registry.registerHandler("business:binding-track-match", bindingTrackMatch);
773
+ registry.registerHandler("business:dependency-acyclic", dependencyAcyclic);
774
+ registry.registerHandler("business:bicep-binding-coverage", (value) => bindingCoverage("bicep", value));
775
+ registry.registerHandler("business:terraform-binding-coverage", (value) => bindingCoverage("terraform", value));
776
+ registry.registerHandler("review:requirements-comprehensive", (value) => comprehensiveReview("requirements", value));
777
+ registry.registerHandler("review:architecture-comprehensive", (value) => comprehensiveReview("architecture", value));
778
+ registry.registerHandler("review:governance-reconciliation", (value) => comprehensiveReview("governance-reconciliation", value));
779
+ registry.registerHandler("review:plan-comprehensive", (value) => comprehensiveReview("plan", value));
780
+ for (const id of VALIDATION_EVIDENCE_IDS) {
781
+ registry.registerHandler(id, (value) => requiredValidationEvidence(id, value));
782
+ }
783
+ registry.registerHandler("gate:requirements-ready", (value) => gateReady(1, value), "authorization");
784
+ registry.registerHandler("gate:architecture-cost-governance-ready", (value) => gateReady(2, value), "authorization");
785
+ registry.registerHandler("gate:implementation-plan-ready", (value) => gateReady(3, value), "authorization");
786
+ registry.registerHandler("gate:preview-current", gatePreviewCurrent, "authorization");
787
+ registry.registerHandler("gate:approval-binding-complete", gateApprovalBindingComplete, "authorization");
788
+ registry.registerHandler("gate:no-hard-blockers", gateNoHardBlockers, "authorization");
789
+ registry.registerHandler("preview:hash-bindings", previewHashBindings);
790
+ registry.registerHandler("preview:policy-precheck", previewPolicyPrecheck);
791
+ registry.registerHandler("preview:coverage", previewCoverage);
792
+ registry.registerHandler("preview:freshness", previewFreshness, "freshness");
793
+ registry.registerHandler("terraform:saved-plan-binding", terraformSavedPlanBinding, "authorization");
794
+ registry.registerHandler("deploy:exact-approved-operation", deployExactApprovedOperation, "authorization");
795
+ registry.registerHandler("deploy:stale-writer-rejection", deployStaleWriterRejection, "authorization");
796
+ registry.registerHandler("deploy:bicep-stack-ownership", deployBicepStackOwnership, "authorization");
797
+ registry.registerHandler("deploy:exact-saved-plan", deployExactSavedPlan, "authorization");
798
+ registry.registerHandler("deploy:state-lineage-and-serial", deployStateLineageAndSerial, "authorization");
799
+ registry.registerHandler("inventory:secret-free", inventorySecretFree);
800
+ registry.registerHandler("inventory:source-coverage", inventorySourceCoverage);
801
+ registry.registerHandler("inventory:eventual-consistency-reconciled", inventoryEventuallyReconciled, "freshness");
802
+ registry.registerHandler("diagnosis:read-only", diagnosisReadOnly);
803
+ registry.registerHandler("diagnosis:secret-free", diagnosisSecretFree);
804
+ registry.registerHandler("quality:scorecard-decidable", qualityScorecardDecidable);
805
+ registry.registerHandler("quality:no-subjective-deterministic-claims", qualityNoSubjectiveClaims);
806
+ registry.registerHandler("terminal:run-evidence-complete", terminalRunEvidenceComplete, "authorization");
807
+ const requiredBoundaries = new Set([
808
+ "task-output",
809
+ "review",
810
+ "external-evidence",
811
+ "validation",
812
+ "gate",
813
+ "preview",
814
+ "deploy",
815
+ "inventory",
816
+ "diagnosis",
817
+ "quality",
818
+ "terminal",
819
+ ]);
820
+ for (const [id, ownership] of WORKFLOW_VALIDATOR_OWNERSHIP) {
821
+ if (requiredBoundaries.has(ownership.boundary) && !registry.has(id)) {
822
+ throw new Error(`Workflow validator ${id} has no registered ${ownership.boundary} handler`);
823
+ }
824
+ }
825
+ }
826
+ export function taskWorkflowValidatorInput(id, context) {
827
+ const schemaInputs = {
828
+ "schema:requirements-v1": "requirements",
829
+ "schema:architecture-v1": "architecture",
830
+ "schema:workload-decision-manifest-v1": "workload-decision-manifest",
831
+ "schema:governance-constraints-v1": "governance-constraints",
832
+ "schema:policy-property-map-v1": "policy-property-map",
833
+ "schema:implementation-intent-v1": "implementation-intent",
834
+ "schema:iac-binding-v1": "iac-binding",
835
+ };
836
+ const outputKind = schemaInputs[id];
837
+ if (outputKind !== undefined)
838
+ return context.outputs[outputKind];
839
+ if (VALIDATION_EVIDENCE_IDS.has(id))
840
+ return context.outputs["validation-evidence"];
841
+ return context;
842
+ }
843
+ //# sourceMappingURL=workflow-validators.js.map