aw-spec-cli 0.1.7 → 0.1.9

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 (261) hide show
  1. package/assets/.appweaver/DESIGN-FORMAT.md +200 -0
  2. package/assets/.appweaver/ORCH-DIALECT.md +156 -0
  3. package/assets/.appweaver/RULE-PARTITION.md +175 -0
  4. package/assets/.appweaver/STACK-PROFILES.md +461 -0
  5. package/assets/.appweaver/ai-rules.md +180 -0
  6. package/assets/.appweaver/domain.json +1 -0
  7. package/assets/.appweaver/extensions/.registry +19 -0
  8. package/assets/.appweaver/extensions/agent-context/README.md +57 -0
  9. package/assets/.appweaver/extensions/agent-context/agent-context-config.yml +4 -0
  10. package/assets/.appweaver/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
  11. package/assets/.appweaver/extensions/agent-context/extension.yml +37 -0
  12. package/assets/.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
  13. package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  14. package/assets/.appweaver/extensions.yml +16 -0
  15. package/assets/.appweaver/feature.json +3 -0
  16. package/assets/.appweaver/init-options.json +9 -0
  17. package/assets/.appweaver/integration.json +15 -0
  18. package/assets/.appweaver/integrations/aw-spec.manifest.json +9 -0
  19. package/assets/.appweaver/interpreter/run-skill.py +1176 -0
  20. package/assets/.appweaver/memory/constitution.md +50 -0
  21. package/assets/.appweaver/orchestrator/.smoke-out/smoke.md +6 -0
  22. package/assets/.appweaver/orchestrator/AGENT-PROFILE.md +94 -0
  23. package/assets/.appweaver/orchestrator/README.md +300 -0
  24. package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +74 -0
  25. package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +74 -0
  26. package/assets/.appweaver/orchestrator/modules/delta-design.orch.yaml +105 -0
  27. package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +101 -0
  28. package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +90 -0
  29. package/assets/.appweaver/orchestrator/modules/lane-gate.orch.yaml +126 -0
  30. package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +123 -0
  31. package/assets/.appweaver/orchestrator/orchestrator.py +1721 -0
  32. package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  33. package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +101 -0
  34. package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +245 -0
  35. package/assets/.appweaver/orchestrator/rev-templates/domain-constitution.skeleton.md +63 -0
  36. package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  37. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +59 -0
  38. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  39. package/assets/.appweaver/orchestrator/rev-templates/frontend-rule-file.skeleton.md +63 -0
  40. package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +116 -0
  41. package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  42. package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  43. package/assets/.appweaver/orchestrator/rev-templates/ui-constitution.skeleton.md +125 -0
  44. package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +123 -0
  45. package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +294 -0
  46. package/assets/.appweaver/orchestrator/workflows/_smoke.orch.yaml +160 -0
  47. package/assets/.appweaver/orchestrator/workflows/aw-spec-add-component.orch.yaml +270 -0
  48. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +934 -0
  49. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +251 -0
  50. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +265 -0
  51. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +437 -0
  52. package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +197 -0
  53. package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +475 -0
  54. package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  55. package/assets/.appweaver/orchestrator/workflows/aw-spec-constitution.orch.yaml +727 -0
  56. package/assets/.appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml +100 -0
  57. package/assets/.appweaver/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  58. package/assets/.appweaver/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  59. package/assets/.appweaver/orchestrator/workflows/aw-spec-design-ui.orch.yaml +386 -0
  60. package/assets/.appweaver/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  61. package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +462 -0
  62. package/assets/.appweaver/orchestrator/workflows/aw-spec-foundation.orch.yaml +265 -0
  63. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +253 -0
  64. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-ui.orch.yaml +267 -0
  65. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +287 -0
  66. package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +238 -0
  67. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1822 -0
  68. package/assets/.appweaver/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  69. package/assets/.appweaver/orchestrator/workflows/aw-spec-run.orch.yaml +194 -0
  70. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-domain.orch.yaml +83 -0
  71. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  72. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +296 -0
  73. package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +439 -0
  74. package/assets/.appweaver/scripts/bash/aw-inventory.sh +17 -0
  75. package/assets/.appweaver/scripts/bash/aw-parity.sh +13 -0
  76. package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +13 -0
  77. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +2626 -0
  78. package/assets/.appweaver/scripts/bash/aw-xref.sh +15 -0
  79. package/assets/.appweaver/scripts/bash/common.sh +533 -0
  80. package/assets/.appweaver/scripts/powershell/aw-inventory.ps1 +17 -0
  81. package/assets/.appweaver/scripts/powershell/aw-parity.ps1 +13 -0
  82. package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  83. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +2232 -0
  84. package/assets/.appweaver/scripts/powershell/aw-xref.ps1 +15 -0
  85. package/assets/.appweaver/scripts/python/aw-component-catalog.py +121 -0
  86. package/assets/.appweaver/scripts/python/aw-inventory.py +1180 -0
  87. package/assets/.appweaver/scripts/python/aw-parity.py +380 -0
  88. package/assets/.appweaver/scripts/python/aw-rev-constitution.py +329 -0
  89. package/assets/.appweaver/scripts/python/aw-stack.py +1251 -0
  90. package/assets/.appweaver/scripts/python/aw-xref.py +1330 -0
  91. package/assets/.appweaver/scripts/python/validate_okf.py +352 -0
  92. package/assets/.appweaver/stack-profiles/angular.json +16 -0
  93. package/assets/.appweaver/stack-profiles/blazor-wasm.json +17 -0
  94. package/assets/.appweaver/stack-profiles/dotnet-webapi.json +15 -0
  95. package/assets/.appweaver/stack-profiles/go-chi.json +14 -0
  96. package/assets/.appweaver/stack-profiles/java-spring.json +16 -0
  97. package/assets/.appweaver/stack-profiles/nextjs.json +16 -0
  98. package/assets/.appweaver/stack-profiles/node-express.json +15 -0
  99. package/assets/.appweaver/stack-profiles/python-fastapi.json +16 -0
  100. package/assets/.appweaver/stack-profiles/react-vite.json +17 -0
  101. package/assets/.appweaver/stack-profiles/sveltekit.json +16 -0
  102. package/assets/.appweaver/stack-profiles/vue-vite.json +17 -0
  103. package/assets/.appweaver/stacks.json +3 -0
  104. package/assets/.appweaver/templates/constitution-domain-template.md +116 -0
  105. package/assets/.appweaver/templates/constitution-technical-template.md +108 -0
  106. package/assets/.appweaver/templates/constitution-ui-template.md +116 -0
  107. package/assets/.appweaver/templates/delta-design-template.md +69 -0
  108. package/assets/.appweaver/templates/delta-spec-template.md +63 -0
  109. package/assets/.appweaver/templates/design-template.md +383 -0
  110. package/assets/.appweaver/templates/okf-concept-template.md +114 -0
  111. package/assets/.appweaver/templates/parity-manifest-template.json +49 -0
  112. package/assets/.appweaver/templates/source-map-template.md +85 -0
  113. package/assets/.appweaver/templates/spec-template.md +309 -0
  114. package/assets/.appweaver/templates/ui-design-template.md +273 -0
  115. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
  116. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.pack.txt +5726 -0
  117. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.ps1 +145 -0
  118. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.sh +196 -0
  119. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.ps1 +157 -0
  120. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.sh +209 -0
  121. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.ps1 +126 -0
  122. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.sh +217 -0
  123. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
  124. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.sh +218 -0
  125. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
  126. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.pack.txt +2833 -0
  127. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.ps1 +145 -0
  128. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.sh +196 -0
  129. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.ps1 +157 -0
  130. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.sh +209 -0
  131. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.ps1 +126 -0
  132. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.sh +217 -0
  133. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
  134. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.sh +218 -0
  135. package/assets/foundations/dotnet/components/Email/README.md +119 -0
  136. package/assets/foundations/dotnet/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
  137. package/assets/foundations/dotnet/components/Email/integration.md +300 -0
  138. package/assets/foundations/dotnet/components/Jobs/README.md +113 -0
  139. package/assets/foundations/dotnet/components/Jobs/integration.md +259 -0
  140. package/assets/foundations/dotnet/components/QrGenerator/README.md +85 -0
  141. package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
  142. package/assets/foundations/dotnet/components/QrGenerator/integration.md +230 -0
  143. package/assets/foundations/dotnet/components/README.md +74 -0
  144. package/assets/guardrails/README.md +222 -0
  145. package/assets/guardrails/domain/healthcare/ai-rules.domain.md +34 -0
  146. package/assets/guardrails/domain/healthcare/api-versioning.domain.md +17 -0
  147. package/assets/guardrails/domain/healthcare/auditing.domain.md +97 -0
  148. package/assets/guardrails/domain/healthcare/authorization.domain.md +26 -0
  149. package/assets/guardrails/domain/healthcare/clinical-terms.md +20 -0
  150. package/assets/guardrails/domain/healthcare/coding-standards.domain.md +26 -0
  151. package/assets/guardrails/domain/healthcare/consent.md +19 -0
  152. package/assets/guardrails/domain/healthcare/cqrs.domain.md +12 -0
  153. package/assets/guardrails/domain/healthcare/data-classification.domain.md +28 -0
  154. package/assets/guardrails/domain/healthcare/dependency-policy.domain.md +11 -0
  155. package/assets/guardrails/domain/healthcare/dicom.md +15 -0
  156. package/assets/guardrails/domain/healthcare/domain-constitution.md +119 -0
  157. package/assets/guardrails/domain/healthcare/domain-driven-design.domain.md +28 -0
  158. package/assets/guardrails/domain/healthcare/eventing.domain.md +18 -0
  159. package/assets/guardrails/domain/healthcare/fhir.md +36 -0
  160. package/assets/guardrails/domain/healthcare/folder-structure.domain.md +25 -0
  161. package/assets/guardrails/domain/healthcare/hipaa.md +34 -0
  162. package/assets/guardrails/domain/healthcare/hl7.md +15 -0
  163. package/assets/guardrails/domain/healthcare/ihe-conformance.md +31 -0
  164. package/assets/guardrails/domain/healthcare/integration-terms.md +21 -0
  165. package/assets/guardrails/domain/healthcare/persistence.domain.md +20 -0
  166. package/assets/guardrails/domain/healthcare/terminology.md +30 -0
  167. package/assets/guardrails/domain/healthcare/testing.domain.md +15 -0
  168. package/assets/guardrails/domain/healthcare/ux/accessibility-standards.md +36 -0
  169. package/assets/guardrails/domain/healthcare/ux/content-design.md +32 -0
  170. package/assets/guardrails/domain/healthcare/ux/interaction-states.md +44 -0
  171. package/assets/guardrails/domain/healthcare/ux/journey-mapping.md +40 -0
  172. package/assets/guardrails/domain/healthcare/vertical-slices.domain.md +18 -0
  173. package/assets/guardrails/domain/healthcare/zero-trust.domain.md +12 -0
  174. package/assets/guardrails/domain/pharma/ai-rules.domain.md +32 -0
  175. package/assets/guardrails/domain/pharma/api-versioning.domain.md +20 -0
  176. package/assets/guardrails/domain/pharma/atc.md +22 -0
  177. package/assets/guardrails/domain/pharma/auditing.domain.md +90 -0
  178. package/assets/guardrails/domain/pharma/authorization.domain.md +25 -0
  179. package/assets/guardrails/domain/pharma/coding-standards.domain.md +28 -0
  180. package/assets/guardrails/domain/pharma/cqrs.domain.md +16 -0
  181. package/assets/guardrails/domain/pharma/data-classification.domain.md +24 -0
  182. package/assets/guardrails/domain/pharma/data-provenance.md +21 -0
  183. package/assets/guardrails/domain/pharma/dependency-policy.domain.md +11 -0
  184. package/assets/guardrails/domain/pharma/domain-constitution.md +113 -0
  185. package/assets/guardrails/domain/pharma/domain-driven-design.domain.md +36 -0
  186. package/assets/guardrails/domain/pharma/domain-requirements.sample.md +103 -0
  187. package/assets/guardrails/domain/pharma/eventing.domain.md +18 -0
  188. package/assets/guardrails/domain/pharma/fhir.md +31 -0
  189. package/assets/guardrails/domain/pharma/folder-structure.domain.md +26 -0
  190. package/assets/guardrails/domain/pharma/hl7.md +17 -0
  191. package/assets/guardrails/domain/pharma/idmp.md +26 -0
  192. package/assets/guardrails/domain/pharma/integration-terms.md +21 -0
  193. package/assets/guardrails/domain/pharma/ndc.md +28 -0
  194. package/assets/guardrails/domain/pharma/persistence.domain.md +23 -0
  195. package/assets/guardrails/domain/pharma/pharma-terms.md +27 -0
  196. package/assets/guardrails/domain/pharma/product-lifecycle.domain.md +30 -0
  197. package/assets/guardrails/domain/pharma/regulatory-compliance.md +19 -0
  198. package/assets/guardrails/domain/pharma/terminology.md +32 -0
  199. package/assets/guardrails/domain/pharma/testing.domain.md +19 -0
  200. package/assets/guardrails/domain/pharma/vertical-slices.domain.md +17 -0
  201. package/assets/guardrails/domain/pharma/zero-trust.domain.md +12 -0
  202. package/assets/guardrails/projects/dotnet-default-project/domain/domain-requirements.md +58 -0
  203. package/assets/guardrails/projects/dotnet-default-project/domain-rule-bindings.md +113 -0
  204. package/assets/guardrails/projects/dotnet-default-project/frontend/ui-requirements.md +43 -0
  205. package/assets/guardrails/projects/dotnet-default-project/service/technical-requirements.md +40 -0
  206. package/assets/guardrails/projects/dotnet-default-project/tech-rule-bindings.md +263 -0
  207. package/assets/guardrails/requirement-spec.txt +27 -0
  208. package/assets/guardrails/technology/dotnet-webapi/PACKAGING.md +184 -0
  209. package/assets/guardrails/technology/dotnet-webapi/api-versioning.md +44 -0
  210. package/assets/guardrails/technology/dotnet-webapi/auditing.md +96 -0
  211. package/assets/guardrails/technology/dotnet-webapi/authorization-matrix.md +14 -0
  212. package/assets/guardrails/technology/dotnet-webapi/authorization.md +39 -0
  213. package/assets/guardrails/technology/dotnet-webapi/clean-architecture.md +54 -0
  214. package/assets/guardrails/technology/dotnet-webapi/coding-standards.md +87 -0
  215. package/assets/guardrails/technology/dotnet-webapi/cqrs.md +63 -0
  216. package/assets/guardrails/technology/dotnet-webapi/data-classification.md +38 -0
  217. package/assets/guardrails/technology/dotnet-webapi/dependency-policy.md +40 -0
  218. package/assets/guardrails/technology/dotnet-webapi/domain-driven-design.md +91 -0
  219. package/assets/guardrails/technology/dotnet-webapi/eventing.md +57 -0
  220. package/assets/guardrails/technology/dotnet-webapi/examples/api-versioning.md +75 -0
  221. package/assets/guardrails/technology/dotnet-webapi/examples/auditing.md +84 -0
  222. package/assets/guardrails/technology/dotnet-webapi/examples/authorization.md +68 -0
  223. package/assets/guardrails/technology/dotnet-webapi/examples/clean-architecture.md +37 -0
  224. package/assets/guardrails/technology/dotnet-webapi/examples/cqrs.md +97 -0
  225. package/assets/guardrails/technology/dotnet-webapi/examples/domain-driven-design.md +141 -0
  226. package/assets/guardrails/technology/dotnet-webapi/examples/eventing.md +46 -0
  227. package/assets/guardrails/technology/dotnet-webapi/examples/persistence.md +207 -0
  228. package/assets/guardrails/technology/dotnet-webapi/examples/vertical-slices.md +151 -0
  229. package/assets/guardrails/technology/dotnet-webapi/examples/zero-trust.md +48 -0
  230. package/assets/guardrails/technology/dotnet-webapi/folder-structure.md +61 -0
  231. package/assets/guardrails/technology/dotnet-webapi/modular-monolith.md +47 -0
  232. package/assets/guardrails/technology/dotnet-webapi/persistence.md +82 -0
  233. package/assets/guardrails/technology/dotnet-webapi/technology-constitution.md +162 -0
  234. package/assets/guardrails/technology/dotnet-webapi/testing.md +55 -0
  235. package/assets/guardrails/technology/dotnet-webapi/vertical-slices.md +70 -0
  236. package/assets/guardrails/technology/dotnet-webapi/zero-trust.md +48 -0
  237. package/assets/guardrails/technology/java-spring/README.md +62 -0
  238. package/assets/guardrails/technology/nextjs/accessibility-implementation.md +56 -0
  239. package/assets/guardrails/technology/nextjs/api-client.md +56 -0
  240. package/assets/guardrails/technology/nextjs/api-integration.dotnet-webapi.md +174 -0
  241. package/assets/guardrails/technology/nextjs/api-integration.java-spring.md +203 -0
  242. package/assets/guardrails/technology/nextjs/auth-session.md +68 -0
  243. package/assets/guardrails/technology/nextjs/client-security.md +69 -0
  244. package/assets/guardrails/technology/nextjs/component-architecture.md +60 -0
  245. package/assets/guardrails/technology/nextjs/component-conventions.md +58 -0
  246. package/assets/guardrails/technology/nextjs/design-system.md +60 -0
  247. package/assets/guardrails/technology/nextjs/error-handling.md +72 -0
  248. package/assets/guardrails/technology/nextjs/forms-and-validation.md +75 -0
  249. package/assets/guardrails/technology/nextjs/frontend-testing.md +94 -0
  250. package/assets/guardrails/technology/nextjs/i18n.md +57 -0
  251. package/assets/guardrails/technology/nextjs/observability.md +67 -0
  252. package/assets/guardrails/technology/nextjs/performance-budgets.md +66 -0
  253. package/assets/guardrails/technology/nextjs/routing-navigation.md +52 -0
  254. package/assets/guardrails/technology/nextjs/state-management.md +70 -0
  255. package/assets/guardrails/technology/nextjs/ui-constitution.md +166 -0
  256. package/dist/commands/init.js +2 -2
  257. package/dist/commands/init.js.map +1 -1
  258. package/dist/utils/copy-assets.js +8 -8
  259. package/dist/utils/copy-assets.js.map +1 -1
  260. package/package.json +1 -1
  261. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -0,0 +1,437 @@
1
+ # =============================================================================
2
+ # aw-spec-analyze-slice (orchestrator) — the design↔code conformance GATE
3
+ #
4
+ # The second of the two discrete conformance gates on the forward path, and the
5
+ # sibling of analyze-design:
6
+ # analyze-design gates spec ↔ design — STATIC, before implement
7
+ # analyze-slice gates design ↔ slice — DYNAMIC, after build
8
+ # "Slice" is the unit under analysis: the aggregate's code, its paired tests, and
9
+ # its OKF knowledge concept. Three passes over it —
10
+ # 1. BEHAVIOUR run the tests (paired to the spec's acceptance criteria by the
11
+ # design docs); on red, fix up to 3×.
12
+ # 2. CONFORMANCE check the code against the domain gate overlays (validate-only).
13
+ # 3. KNOWLEDGE refresh + review the slice's OKF concept (advisory).
14
+ # Every fix made here is recorded in that concept, which is also where the slice's
15
+ # file list is READ from (2.3.0 — `aw-xref concept-paths`, replacing the retired
16
+ # `design-paths` scan for ```lang path=… fences that the tech-agnostic design.md no
17
+ # longer carries; the paired `design-reconcile` write-back is retired with it, its job
18
+ # already done by the concept-upsert --merge steps in pass 3).
19
+ #
20
+ # TWO POSITIONS, one gate — and in BOTH the master spec.md is the whole truth:
21
+ # BOOTSTRAP implement → build → analyze-slice → run
22
+ # CHANGE implement-delta → build → finalize-delta → analyze-slice → close-delta
23
+ # On the CHANGE path this gate deliberately runs AFTER finalize-delta, which has already
24
+ # merged the delta into spec.md + design.md — so the master carries the change and needs
25
+ # no delta-awareness here. It runs BEFORE close-delta, so the change is still OPEN: a red
26
+ # result is recoverable ("fix and re-run"), not a defect on an already-shipped version.
27
+ # The only thing this gate reads the open change for is where to send you next.
28
+ #
29
+ # Launch: /appweaver analyze-slice [strategy]
30
+ # Prereq: /appweaver build (compiled code for the active feature).
31
+ # =============================================================================
32
+
33
+ name: aw-spec-analyze-slice
34
+ description: The design↔code conformance gate — run the slice's tests against its acceptance criteria, check the code against the domain gate overlays, verify the change did not break any referring aggregate (the OKF referrer blast radius) and write a triage report before stopping if it did, refresh + review its OKF concept, and record every fix in it. Sits after finalize-delta on the change path, so the master spec it scores against already carries the change, and before close-delta, so a red gate leaves the change open and recoverable.
35
+ version: 2.3.0
36
+ agent_agnostic: true
37
+ dialect: aw-spec.orchestrator/v1
38
+
39
+ scripts:
40
+ actions:
41
+ sh: .appweaver/scripts/bash/aw-spec-actions.sh
42
+ ps1: .appweaver/scripts/powershell/aw-spec-actions.ps1
43
+ xref:
44
+ sh: .appweaver/scripts/bash/aw-xref.sh
45
+ ps1: .appweaver/scripts/powershell/aw-xref.ps1
46
+
47
+ # No hardcoded technical standards seed. The technical rule files the code/conformance
48
+ # passes check against (testing + coding-standards) are now CONFIGURATION, loaded per-
49
+ # command from guardrails/projects/<project>/tech-rule-bindings.md under "## /aw-spec-analyze-slice"
50
+ # by the tech-select module (see the tech_select step below). The DOMAIN gate overlays are
51
+ # still loaded separately, as before (resolve_gate_overlays → load_gate_overlays). This gate
52
+ # does not reference constitution.technical.md. The seed below is behaviour-only — the kit's
53
+ # universal operating rules, which a gate needs above all: a gate passes when it RAN and
54
+ # returned a pass, never by inference.
55
+ standards:
56
+ - { path: .appweaver/ai-rules.md } # kit-resident: the universal operating rules, every flow
57
+
58
+ vars:
59
+ test_ok: "false"
60
+ conformance_ok: "false"
61
+ # NAVIGATION ONLY. Whether a change is open decides where this gate sends you next
62
+ # (close-delta vs run) — nothing else in this workflow reads them. On the CHANGE path
63
+ # finalize-delta has already merged the delta into the master docs, so the delta files
64
+ # are redundant here and are deliberately NOT loaded into any context.
65
+ active_change: ""
66
+ has_change: "false"
67
+ # Integrity pass (referrer blast radius) defaults — safe values if xref/test-run is
68
+ # skipped or errors, so the gate reads a real verdict rather than an empty var.
69
+ integrity_ok: "false"
70
+ referrer_csv: ""
71
+ referrer_count: "0"
72
+ referrer_names: ""
73
+ # Pass-3 (OKF) reporting defaults — the knowledge pass is advisory, so these stay
74
+ # readable in the outputs even when a step is skipped or errors out.
75
+ okf_ok: "unknown"
76
+ okf_orphans: "0"
77
+
78
+ workflow:
79
+
80
+ # 0. TECHNICAL rule files → sticky standards (configuration, not hardcoded).
81
+ # tech-select reads guardrails/projects/<project>/tech-rule-bindings.md under
82
+ # "## /aw-spec-analyze-slice" and loads that set (testing + coding-standards) into
83
+ # the sticky standards the conformance query reads (include_standards: true). The
84
+ # DOMAIN gate overlays are loaded separately below. No blocking gate: an unconfigured
85
+ # project soft-continues (the gate then checks only the domain overlays).
86
+ - id: tech_select
87
+ action: include
88
+ module: .appweaver/orchestrator/modules/tech-select.orch.yaml
89
+ with: { command: aw-spec-analyze-slice }
90
+
91
+ - id: feature_paths
92
+ action: execute_script
93
+ on_error: continue # never crash raw on 'no feature set' — the gate below explains it
94
+ script: { ref: actions }
95
+ subcommand: feature-paths
96
+ outputs:
97
+ - { name: feature_dir, from: "$.feature_dir" }
98
+ - { name: spec_file, from: "$.spec_file" }
99
+
100
+ - id: require_feature
101
+ action: verify_context
102
+ require_non_empty: feature_dir
103
+ on_empty: stop
104
+ on_empty_message: "No active feature. Run /appweaver select-feature first (pick or create the aggregate, e.g. Order), then re-run analyze-slice."
105
+
106
+ # Is a change OPEN on this feature? Read for NAVIGATION only — see the vars note. Safe
107
+ # on the bootstrap path: with no active_version.json, version-read returns
108
+ # active_change="" / has_change=false and exits 0, so nothing here is conditional on it.
109
+ - id: read_change
110
+ action: execute_script
111
+ script: { ref: actions }
112
+ subcommand: version-read
113
+ args: ["--feature-dir", "{{feature_dir}}"]
114
+ outputs:
115
+ - { name: active_change, from: "$.active_change" }
116
+ - { name: has_change, from: "$.has_change" }
117
+
118
+ # The slice's source files, from its OKF concept — the context all three passes below
119
+ # work over (test fix loop, integrity triage, conformance). Replaces the retired
120
+ # `design-paths` fence scan: design.md is tech-agnostic prose with no ```lang path=…
121
+ # code blocks, so that scan returned nothing and every pass ran on an EMPTY file list.
122
+ # Read-only, exits 0 with paths=[] when there is no concept yet; on_error: continue so
123
+ # a missing bundle degrades the gate to its pre-existing (empty) behaviour, never blocks.
124
+ - id: concept_paths
125
+ action: execute_script
126
+ on_error: continue
127
+ script: { ref: xref }
128
+ subcommand: concept-paths
129
+ args: ["--feature-dir", "{{feature_dir}}"]
130
+ outputs:
131
+ - { name: all_paths, from: "$.paths" }
132
+ - { name: paths_missing, from: "$.missing" }
133
+
134
+ - id: resolve_pre_hooks
135
+ action: execute_script
136
+ script: { ref: actions }
137
+ subcommand: resolve-hooks
138
+ args: ["--phase", "before_analyze_slice"]
139
+ outputs:
140
+ - { name: before_hooks, from: "$.hooks" }
141
+ - id: dispatch_pre_hooks
142
+ action: dispatch_hooks
143
+ hooks_from_variable: before_hooks
144
+
145
+ # ═══════ PASS 1 — BEHAVIOUR: the slice's tests vs the spec's acceptance criteria ═══════
146
+ # Run tests → (if red) fix → re-run, up to 3×.
147
+ - id: test_loop
148
+ action: loop
149
+ while: "{{test_ok}} != true"
150
+ max_iterations: 3
151
+ steps:
152
+ - id: run_tests
153
+ action: execute_script
154
+ on_error: continue
155
+ script: { ref: actions }
156
+ subcommand: test-run
157
+ # scope=slice: run ONLY this feature's tests in the fix loop. The loop EDITS code
158
+ # to make tests pass, and it can only repair THIS feature (its design + spec are
159
+ # what is in context) — so referring aggregates are deliberately NOT in this run;
160
+ # they are verified read-only by the integrity gate below.
161
+ args: ["--feature-dir", "{{feature_dir}}", "--scope", "slice"]
162
+ outputs:
163
+ - { name: test_ok, from: "$.fence_green" }
164
+ - { name: test_tool, from: "$.tool" }
165
+ - { name: test_log, from: "$.log_tail" }
166
+ - { name: test_matched, from: "$.matched" }
167
+ - { name: test_scoped, from: "$.scoped" }
168
+ - id: green_break
169
+ action: break
170
+ condition: "{{test_ok}} == true"
171
+ - id: ctx_fix
172
+ action: build_context
173
+ vars:
174
+ test_log: "{{test_log}}"
175
+ context:
176
+ - { path: "{{spec_file}}" }
177
+ context_from: all_paths
178
+ - id: fix
179
+ action: agent_generate
180
+ tools: "Read,Write,Edit,Bash"
181
+ permission_mode: acceptEdits
182
+ task: |
183
+ Tests failed. Make them pass by fixing the code (or a genuinely wrong
184
+ test) in the files in context, keeping behaviour aligned with the spec's
185
+ acceptance criteria (spec in context). Test log:
186
+ {{test_log}}
187
+ outputs:
188
+ - { name: fixed_files, from: "$.files" }
189
+
190
+ - id: test_gate
191
+ action: verify_context
192
+ require_true: test_ok
193
+ on_false: stop
194
+ on_false_message: >
195
+ Slice tests not green after 3 fix attempts (tool={{test_tool}}, scoped={{test_scoped}},
196
+ matched={{test_matched}}). Read those two flags before the log. scoped=true means a
197
+ per-feature name filter ran, and matched=false then means it selected ZERO tests —
198
+ the test names do not contain the aggregate name — which the fence treats as a
199
+ failure, not a vacuous pass. scoped=false means this stack has no per-test selector,
200
+ so the lane's whole declared suite ran and every failure in it counts here, including
201
+ ones this feature did not cause; matched is not meaningful in that case. Last log:
202
+ {{test_log}}
203
+
204
+ # ═══════ PASS 2 — DOMAIN CONFORMANCE: code vs the gate overlay checklist (validation) ═══════
205
+ # With tests green, scan the feature's CODE against the domain gate overlays (the
206
+ # forbidden-patterns / refusal conditions / CI gates). The overlays load as the
207
+ # checklist — VALIDATION only, never an authoring input to feature code. No-op for a
208
+ # non-domain project. Fix violations (bounded 2×); the gate stops if any remain.
209
+ - id: resolve_gate_overlays
210
+ action: execute_script
211
+ script: { ref: actions }
212
+ subcommand: resolve-domain
213
+ args: ["--command", "aw-spec-gate"]
214
+ outputs:
215
+ - { name: gate_overlays, from: "$.candidates" }
216
+ - id: load_gate_overlays
217
+ action: load_standards
218
+ files_from_variable: gate_overlays
219
+ optional: true
220
+
221
+ - id: conformance_loop
222
+ action: loop
223
+ while: "{{conformance_ok}} != true"
224
+ max_iterations: 2
225
+ steps:
226
+ - id: ctx_conformance
227
+ action: build_context
228
+ context:
229
+ - { path: "{{spec_file}}" }
230
+ context_from: all_paths
231
+ - id: check_overlays
232
+ action: agent_query
233
+ include_standards: true # the gate overlays (checklist) are in the standards
234
+ schema: { ok: true, violations: [ { rule: "<overlay rule / id>", where: "<file:symbol>", issue: "<what is violated>" } ] }
235
+ mock: { ok: true, violations: [] }
236
+ task: |
237
+ The domain gate checklist is loaded in the standards (the overlay
238
+ forbidden-patterns, refusal conditions, and CI gates). Check the feature's
239
+ generated code + tests (in context) against EACH checklist rule and list
240
+ EVERY violation, e.g.: a hard delete of a retention-protected aggregate /
241
+ version history / audit record; a second write path bypassing the aggregate
242
+ or interop adapter; an invented/free-text coded value where a validated code
243
+ is required; a missing or weakened audit emission on an audited operation; a
244
+ data-classification-restricted field exposed on the public surface or written
245
+ to logs/metrics/traces. Also confirm the constraint TESTS exist (audit is
246
+ emitted, a restricted field is not exposed, an interop projection round-trips).
247
+ ok=true ONLY when no checklist rule is violated.
248
+ outputs:
249
+ - { name: conformance_ok, from: "$.ok" }
250
+ - { name: conformance_violations, from: "$.violations" }
251
+ - id: conformance_break
252
+ action: break
253
+ condition: "{{conformance_ok}} == true"
254
+ - id: fix_violations
255
+ action: agent_generate
256
+ tools: "Read,Write,Edit,Bash"
257
+ permission_mode: acceptEdits
258
+ task: |
259
+ Fix these domain-conformance violations in the feature's code (in context),
260
+ following the gate checklist rules (in the standards) and keeping the design's
261
+ behaviour intact. Do NOT weaken or delete a test to hide a violation — fix the
262
+ code. After fixing, re-run the tests (Bash) to confirm they stay green.
263
+ Violations: {{conformance_violations}}
264
+ outputs:
265
+ - { name: conformance_fixes, from: "$.files" }
266
+
267
+ - id: conformance_gate
268
+ action: verify_context
269
+ require_true: conformance_ok
270
+ on_false: stop
271
+ on_false_message: "Code violates the domain gate checklist after 2 fix attempts (violations: {{conformance_violations}}). These are the domain constraints design/implement must satisfy — fix the code, or if the constraint itself is wrong, correct it upstream (/appweaver specify → design)."
272
+
273
+ # ═══════ INTEGRITY — did this feature's change break any aggregate that USES it? ═══════
274
+ # The slice is green + domain-conformant on its own. But a change to a feature can break
275
+ # any OTHER aggregate that references it. Ask the OKF Cross-References index "who refers to
276
+ # me?" (the transitive referrer closure — C→B→A all count), then RE-RUN the feature's tests
277
+ # PLUS every referrer's tests as one read-only fence. Unlike PASS 1 this NEVER edits code:
278
+ # analyze-slice cannot repair a referrer (that is the referrer's own slice's job), so a
279
+ # broken referrer STOPS the gate for a human to resolve, it is not auto-fixed here.
280
+ # Empty referrer set (a leaf feature, or the only aggregate in the repo) → the fence is just
281
+ # the feature's own tests again → passes trivially, blocks nothing.
282
+ - id: xref_referrers
283
+ action: execute_script
284
+ on_error: continue
285
+ script: { ref: xref }
286
+ subcommand: list
287
+ args: ["--feature-dir", "{{feature_dir}}"]
288
+ outputs:
289
+ - { name: referrer_csv, from: "$.referrer_closure_csv" }
290
+ - { name: referrer_count, from: "$.referrer_closure_count" }
291
+ - { name: referrer_names, from: "$.referrer_closure" }
292
+
293
+ - id: run_integrity
294
+ action: execute_script
295
+ on_error: continue
296
+ script: { ref: actions }
297
+ subcommand: test-run
298
+ args: ["--feature-dir", "{{feature_dir}}", "--scope", "slice", "--also", "{{referrer_csv}}"]
299
+ outputs:
300
+ - { name: integrity_ok, from: "$.fence_green" }
301
+ - { name: integrity_log, from: "$.log_tail" }
302
+
303
+ # On a RED fence, author a durable triage report BEFORE stopping — a broken referrer
304
+ # means someone must go fix ANOTHER slice, so this is a record, not scrollback (mirrors
305
+ # characterize's drifted-tests.md). Context is built unconditionally (cheap, no model
306
+ # call); the authoring model call is gated on failure, so a green run spends nothing.
307
+ # The report self-dates and is regenerated on each failing run — a later green fence
308
+ # supersedes it (no gate points here when integrity_ok is true).
309
+ - id: ctx_broken_referrers
310
+ action: build_context
311
+ vars:
312
+ referrer_names: "{{referrer_names}}"
313
+ referrer_count: "{{referrer_count}}"
314
+ integrity_log: "{{integrity_log}}"
315
+ context:
316
+ - { path: "{{spec_file}}" }
317
+ context_from: all_paths
318
+ - id: write_broken_referrers
319
+ action: agent_author
320
+ condition: "{{integrity_ok}} != true"
321
+ include_standards: false # a triage report, not generated code
322
+ output_target: { type: file, path: "{{feature_dir}}/broken-referrers.md" }
323
+ task: |
324
+ Author the BROKEN-REFERRER integrity report for this slice: the aggregates that
325
+ REFER to this feature whose tests went red when this feature's change was run
326
+ against them. This is a triage record for a human — analyze-slice does NOT fix a
327
+ referrer (that is the referrer's own slice's job). Referrer blast radius
328
+ ({{referrer_count}}): {{referrer_names}}. Failing test log:
329
+ {{integrity_log}}
330
+ Write markdown, in this order:
331
+ - `# Broken Referrers — <feature>` and a one-line statement of what this file is:
332
+ aggregates that USE this feature and whose tests went red when this feature's
333
+ change was run against them, found by analyze-slice's integrity gate. Add a line
334
+ stamping when + why it was generated (integrity fence RED for this feature), and
335
+ that it is regenerated on every FAILING analyze-slice run — a later green fence
336
+ supersedes it.
337
+ - A SUMMARY line: total referrers in the blast radius, and how many have a failing
338
+ test in the log.
339
+ - One `##` section per REFERRER that has a failing test — attribute a failure to a
340
+ referrer by matching the failing test names in the log to the referrer's name.
341
+ Under it, on their own labelled lines: the referrer aggregate, the failing
342
+ test(s) named in the log, what broke (as far as the log shows), and a RESOLUTION
343
+ line — either this feature's change broke the referrer's expected contract (fix
344
+ belongs in the referrer's OWN slice, or reconsider this feature's contract change)
345
+ or the referrer test is stale (correct it in that slice). Recommend one; do not
346
+ claim certainty the log does not support.
347
+ - A closing `## How to use this file`: resolve each finding in the referrer's own
348
+ slice (or via a CR on this feature's contract), then re-run
349
+ /appweaver analyze-slice; do not edit this file in place.
350
+ Attribute only what the log supports; invent no failures. Do NOT propose an edit to
351
+ THIS feature's production code to silence a referrer — that would hide a real
352
+ contract break.
353
+ outputs:
354
+ - { name: broken_report_file, from: "$.files" }
355
+
356
+ - id: integrity_gate
357
+ action: verify_context
358
+ require_true: integrity_ok
359
+ on_false: stop
360
+ on_false_message: "Integrity check failed — this feature's change breaks a test in an aggregate that REFERS to it. Referrer blast radius ({{referrer_count}}): {{referrer_names}}. Triage written to {{feature_dir}}/broken-referrers.md — resolve each in the referrer's own slice (or reconsider this feature's contract change), then re-run. Last log: {{integrity_log}}"
361
+
362
+ # ═══════ PASS 3 — OKF KNOWLEDGE: keep the slice's concept true to what now exists ═══════
363
+ # analyze-slice is the LAST stage that changes a greenfield slice's files: both fix loops
364
+ # above run with Write/Edit, and the conformance loop is explicitly asked to ADD missing
365
+ # constraint tests. Those files did not exist when implement wrote the OKF concept, so its
366
+ # source_files list is stale by the time we get here. Merge them in (UNION — never replace:
367
+ # the concept holds the full set implement recorded, these two vars hold only what the fix
368
+ # loops touched), then report cross-reference drift.
369
+ #
370
+ # These two steps are now the WHOLE write-back: the former `design-reconcile` step that
371
+ # preceded them was deleted (it copied on-disk file bodies into path-tagged design fences
372
+ # — meaningless once design.md became tech-agnostic prose, and it read the same
373
+ # fixed_files/paths these steps already own). Recording the files in the concept IS the
374
+ # current reconcile.
375
+ #
376
+ # Deliberately NOT re-running `record`: the Depends-On/Cross-References edges derive from
377
+ # design.md §1 + its External integrations table, and no step in this stage edits
378
+ # design.md — the edge sources
379
+ # cannot have moved here. `--origin` is likewise omitted: concept-upsert setdefaults it,
380
+ # so an adopted (brownfield) slice keeps its `reverse-engineered` provenance instead of
381
+ # being restamped greenfield.
382
+ #
383
+ # Advisory by design (on_error: continue, no gate): a green, domain-conformant slice is
384
+ # never failed over its knowledge index — drift is reported in the outputs and fixed by
385
+ # `aw-xref validate --prune` / re-running the owning slice's `record`.
386
+ - id: okf_merge_test_fixes
387
+ action: execute_script
388
+ condition: "{{fixed_files}}"
389
+ on_error: continue
390
+ script: { ref: xref }
391
+ subcommand: concept-upsert
392
+ args: ["--feature-dir", "{{feature_dir}}", "--source-files", "{{fixed_files}}", "--merge"]
393
+ outputs:
394
+ - { name: okf_concept, from: "$.concept" }
395
+
396
+ - id: okf_merge_conformance_fixes
397
+ action: execute_script
398
+ condition: "{{conformance_fixes}}"
399
+ on_error: continue
400
+ script: { ref: xref }
401
+ subcommand: concept-upsert
402
+ args: ["--feature-dir", "{{feature_dir}}", "--source-files", "{{conformance_fixes}}", "--merge"]
403
+ outputs:
404
+ - { name: okf_concept, from: "$.concept" }
405
+
406
+ - id: okf_review
407
+ action: execute_script
408
+ on_error: continue
409
+ script: { ref: xref }
410
+ subcommand: validate
411
+ outputs:
412
+ - { name: okf_ok, from: "$.ok" }
413
+ - { name: okf_orphans, from: "$.orphan_count" }
414
+
415
+ - id: resolve_post_hooks
416
+ action: execute_script
417
+ script: { ref: actions }
418
+ subcommand: resolve-hooks
419
+ args: ["--phase", "after_analyze_slice"]
420
+ outputs:
421
+ - { name: after_hooks, from: "$.hooks" }
422
+ - id: dispatch_post_hooks
423
+ action: dispatch_hooks
424
+ hooks_from_variable: after_hooks
425
+
426
+ outputs:
427
+ feature_dir: "{{feature_dir}}"
428
+ test_tool: "{{test_tool}}"
429
+ referrer_count: "{{referrer_count}}"
430
+ referrer_blast_radius: "{{referrer_names}}"
431
+ okf_concept: "{{okf_concept}}"
432
+ okf_index_ok: "{{okf_ok}}"
433
+ okf_orphans: "{{okf_orphans}}"
434
+ # Declared in the concept but absent on disk — advisory index drift, never gated.
435
+ stale_source_files: "{{paths_missing}}"
436
+ active_change: "{{active_change}}"
437
+ next: "CHANGE OPEN ({{active_change}}): /appweaver close-delta — the slice is green, domain-conformant and did not break a referrer, and its delta is already merged into the master docs, so the change may now be archived and the version bumped. NO OPEN CHANGE: /appweaver run."
@@ -0,0 +1,197 @@
1
+ # =============================================================================
2
+ # aw-spec-build (orchestrator) — compile + fix + reconcile
3
+ #
4
+ # Compile the materialized code; on failure, fix the source files (the slice's own
5
+ # source files as context, design intent as reference) up to 3×; then record whatever
6
+ # the fix loop touched in the slice's OKF concept. Run after /appweaver implement.
7
+ #
8
+ # 1.1.0 — the slice's file list now comes from the OKF concept's `source_files`
9
+ # (`aw-xref concept-paths`) instead of the retired `design-paths` scan for
10
+ # ```lang path=… fences, a convention the tech-agnostic design.md no longer carries;
11
+ # and the tail step records fix-loop files in that concept instead of copying file
12
+ # bodies back into design fences (`design-reconcile`, likewise retired).
13
+ #
14
+ # 1.2.0 — TECHNICAL RULES ONLY: the `domain-select` include is REMOVED. Build repairs
15
+ # compile errors against design intent — a purely technical job — and the domain never
16
+ # reaches this stage anyway (specify is the domain's sole carrier into the pipeline;
17
+ # build reads code and design.md, never the spec or the domain docs). The include was
18
+ # also inert: no shipped domain-rule-bindings.md carries a "## /aw-spec-build" heading, so
19
+ # `resolve-domain` — which keys `rulemap_exists` off the FILE, not the heading —
20
+ # returned `candidates: []` and every load step skipped. On a CONFIGURED project it was
21
+ # a silent no-op; on an UNCONFIGURED one it was worse, firing domain-select's
22
+ # interactive "continue or exit?" gate on every build to load rules that could never
23
+ # have been found. Removing it makes greenfield `build` non-interactive.
24
+ #
25
+ # Launch: /appweaver build [strategy]
26
+ # =============================================================================
27
+
28
+ name: aw-spec-build
29
+ description: Compile the feature, fix compile errors against the design intent, then record the touched files in the slice's knowledge concept. Loads TECHNICAL rules only (tech-rule-bindings) — no domain rules reach this stage.
30
+ version: 1.2.0
31
+ agent_agnostic: true
32
+ dialect: aw-spec.orchestrator/v1
33
+
34
+ scripts:
35
+ actions:
36
+ sh: .appweaver/scripts/bash/aw-spec-actions.sh
37
+ ps1: .appweaver/scripts/powershell/aw-spec-actions.ps1
38
+ xref:
39
+ sh: .appweaver/scripts/bash/aw-xref.sh
40
+ ps1: .appweaver/scripts/powershell/aw-xref.ps1
41
+
42
+ # Sticky standards seed = the UNIVERSAL always-on rule only (ai-rules). The technical
43
+ # rule files (the compile/fix reference set) are CONFIGURATION, loaded per-command from
44
+ # guardrails/projects/<project>/tech-rule-bindings.md by the tech-select module (see the
45
+ # tech_select step below). Technical rules ONLY — build loads no domain rules and does
46
+ # not reference constitution.technical.md. A required file that is missing is reported
47
+ # at assembly time (`[system] MISSING (required)`), an `optional:` one is skipped.
48
+ standards:
49
+ - { path: .appweaver/ai-rules.md } # kit-resident: the universal operating rules, every flow
50
+
51
+ vars:
52
+ build_ok: "false"
53
+
54
+ workflow:
55
+
56
+ # Rule files → sticky standards: TECHNICAL only, via tech-select, read from
57
+ # guardrails/projects/<project>/tech-rule-bindings.md under "## /aw-spec-build".
58
+ # NO domain-select here — see the header: build repairs compile errors, a purely
59
+ # technical job, and the domain never reaches this stage anyway (specify is its sole
60
+ # carrier; build reads code and design intent, not spec).
61
+ - id: tech_select
62
+ action: include
63
+ module: .appweaver/orchestrator/modules/tech-select.orch.yaml
64
+ with: { command: aw-spec-build }
65
+
66
+ - id: feature_paths
67
+ action: execute_script
68
+ on_error: continue # never crash raw on 'no feature set' — the gate below explains it
69
+ script: { ref: actions }
70
+ subcommand: feature-paths
71
+ outputs:
72
+ - { name: feature_dir, from: "$.feature_dir" }
73
+
74
+ - id: require_feature
75
+ action: verify_context
76
+ require_non_empty: feature_dir
77
+ on_empty: stop
78
+ on_empty_message: "No active feature. Run /appweaver select-feature first (pick or create the aggregate, e.g. Order), then re-run build."
79
+
80
+ # Require the SERVICE LANE and its source path. With a declaration, build-compile
81
+ # runs EVERY declared lane's own build command, so a two-lane project compiles
82
+ # both — the case the old first-match-wins sniffer got wrong by reporting green
83
+ # for a frontend it never touched.
84
+ - id: lane_gate
85
+ action: include
86
+ module: .appweaver/orchestrator/modules/lane-gate.orch.yaml
87
+ with: { require: backend, command: "/appweaver build" }
88
+
89
+ # The slice's source files, from its OKF concept — what the fix loop below is handed.
90
+ # This replaces the retired `design-paths` fence scan: the tech-agnostic design.md
91
+ # carries no ```lang path=… code blocks, so that scan returned nothing and the fixer
92
+ # was told to "fix the source files in context" with an EMPTY context. `source_files`
93
+ # is the maintained answer (implement writes it, analyze-slice merges fixes into it).
94
+ # Advisory: read-only, exits 0 with paths=[] when there is no concept yet, and
95
+ # on_error: continue so an unreadable bundle can never block a compile.
96
+ - id: concept_paths
97
+ action: execute_script
98
+ on_error: continue
99
+ script: { ref: xref }
100
+ subcommand: concept-paths
101
+ args: ["--feature-dir", "{{feature_dir}}"]
102
+ outputs:
103
+ - { name: all_paths, from: "$.paths" }
104
+ - { name: paths_missing, from: "$.missing" }
105
+
106
+ - id: resolve_pre_hooks
107
+ action: execute_script
108
+ script: { ref: actions }
109
+ subcommand: resolve-hooks
110
+ args: ["--phase", "before_build"]
111
+ outputs:
112
+ - { name: before_hooks, from: "$.hooks" }
113
+ - id: dispatch_pre_hooks
114
+ action: dispatch_hooks
115
+ hooks_from_variable: before_hooks
116
+
117
+ # Compile → (if red) fix the source files → recompile, up to 3×.
118
+ - id: build_loop
119
+ action: loop
120
+ while: "{{build_ok}} != true"
121
+ max_iterations: 3
122
+ steps:
123
+ - id: compile
124
+ action: execute_script
125
+ on_error: continue
126
+ script: { ref: actions }
127
+ subcommand: build-compile
128
+ args: ["--feature-dir", "{{feature_dir}}"]
129
+ outputs:
130
+ - { name: build_ok, from: "$.ok" }
131
+ - { name: build_tool, from: "$.tool" }
132
+ - { name: build_log, from: "$.log_tail" }
133
+ - id: green_break
134
+ action: break
135
+ condition: "{{build_ok}} == true"
136
+ - id: ctx_fix
137
+ action: build_context
138
+ vars:
139
+ build_log: "{{build_log}}"
140
+ context_from: all_paths
141
+ - id: fix
142
+ action: agent_generate
143
+ tools: "Read,Write,Edit,Bash"
144
+ permission_mode: acceptEdits
145
+ task: |
146
+ The build failed. Fix the COMPILE errors in the source files provided in
147
+ context, honoring the loaded standards and the design intent. Change only
148
+ what the errors require — do not alter behaviour. Build log:
149
+ {{build_log}}
150
+ outputs:
151
+ - { name: fixed_files, from: "$.files" }
152
+
153
+ - id: build_gate
154
+ action: verify_context
155
+ require_true: build_ok
156
+ on_false: stop
157
+ on_false_message: "Build still failing after 3 fix attempts. Last log: {{build_log}}"
158
+
159
+ # Record what the fix loop touched in the slice's OKF concept. This replaces the retired
160
+ # `design-reconcile` step, which copied on-disk file bodies back into the design doc's
161
+ # path-tagged fences — meaningless now that design.md describes contracts, not code (and
162
+ # a silent no-op for as long as that has been true). The fix loop can CREATE files that
163
+ # implement never recorded, so the knowledge index, not the design prose, is what has to
164
+ # be caught up. UNION (--merge), never replace: fixed_files holds only what this loop
165
+ # touched, while the concept holds the slice's full set.
166
+ #
167
+ # Advisory by design (condition + on_error: continue, no gate): a green build is never
168
+ # failed over its knowledge index — same stance as analyze-slice's OKF pass.
169
+ - id: okf_merge_build_fixes
170
+ action: execute_script
171
+ condition: "{{fixed_files}}"
172
+ on_error: continue
173
+ script: { ref: xref }
174
+ subcommand: concept-upsert
175
+ args: ["--feature-dir", "{{feature_dir}}", "--source-files", "{{fixed_files}}", "--merge"]
176
+ outputs:
177
+ - { name: okf_concept, from: "$.concept" }
178
+
179
+ - id: resolve_post_hooks
180
+ action: execute_script
181
+ script: { ref: actions }
182
+ subcommand: resolve-hooks
183
+ args: ["--phase", "after_build"]
184
+ outputs:
185
+ - { name: after_hooks, from: "$.hooks" }
186
+ - id: dispatch_post_hooks
187
+ action: dispatch_hooks
188
+ hooks_from_variable: after_hooks
189
+
190
+ outputs:
191
+ feature_dir: "{{feature_dir}}"
192
+ build_tool: "{{build_tool}}"
193
+ okf_concept: "{{okf_concept}}"
194
+ # Declared in the concept but absent on disk — index drift worth an operator's eye
195
+ # (a file moved or deleted without re-running the owning slice). Advisory, never gated.
196
+ stale_source_files: "{{paths_missing}}"
197
+ next: "/appweaver analyze-slice"