aw-spec-cli 0.1.8 → 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 (257) 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/package.json +1 -1
  257. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -0,0 +1,200 @@
1
+ # aw-spec design-doc format — the single high-level design (HLD)
2
+
3
+ The format the spec-anchored pipeline uses for the **Design** phase. Sibling of
4
+ `ORCH-DIALECT.md` (the orchestrator dialect) and `RULE-PARTITION.md` (which rules each
5
+ command loads): this one governs the *artifact* those workflows read and write — the
6
+ design document — not the engine. The authoring template is
7
+ `.appweaver/templates/design-template.md`.
8
+
9
+ ## The contract
10
+
11
+ A feature's design is **one document**, living beside its spec:
12
+
13
+ ```
14
+ specs/<Aggregate>/
15
+ spec.md # behaviour (tech-agnostic) — WHAT / WHY — the source of truth
16
+ design.md # structure & decisions (tech-agnostic HLD) — the MEDIATOR
17
+ changes/ # open + archived change records (delta-spec + delta-design)
18
+ ```
19
+
20
+ `design.md` is the **mediator** between the spec and the generated code:
21
+
22
+ ```
23
+ spec.md ──▶ design.md ──▶ code (+ tests)
24
+ behaviour structure & generated by `implement`
25
+ FR/BR/US/SC decisions (HLD) (stack bound at generation time)
26
+ ```
27
+
28
+ - **One design per aggregate.** The four clean-architecture layers (Domain,
29
+ Application, API, Infrastructure) are **sections** of this one document, each at
30
+ design level. Feature = aggregate; commands are user stories inside it. *(This is
31
+ the **greenfield** layout, authored from `design-template.md`. See the Brownfield
32
+ variant below for reverse-engineered / existing-codebase designs.)*
33
+ - **High-level, not code.** It carries entities/value-objects/events, behaviour as
34
+ **signatures + pre/post/invariant/raises**, use-cases, endpoint contracts, ports,
35
+ and the significant technical decisions with rationale — but **no complete method
36
+ bodies**. See `design-template.md` for the section structure (§0–§9). The domain
37
+ layer (§1) follows spec.md exactly — its entities/value-objects are the spec's Key
38
+ Entities and its invariants are the spec's Business Rules.
39
+ - **Technology-agnostic.** Behaviour and contracts use conceptual types, never a
40
+ language. The SAME design.md must be generatable on a different stack. The target
41
+ language/framework/persistence is bound only at `implement` time from the
42
+ constitution's technology base + the active stack profile.
43
+ - **Physical schema is out of scope.** PKs/FKs, columns, indexes, JSON shapes, and
44
+ migration SQL belong to a separate technical-data-model — design.md states WHAT is
45
+ stored and WHICH port persists it, not the schema.
46
+ - **Two deferral ledgers are first-class:** §7 Assumptions (`DA-n`, clarify later)
47
+ and §8 Workarounds (`WA-n`, clear later). They keep the HLD honest about what it
48
+ defers; `implement` tags generated code that leans on them.
49
+ - **Solution-wide rules live elsewhere, not per feature:** the layering/dependency
50
+ rule is the constitution's; the code-generation mechanics (folder mapping,
51
+ file-per-element, test pairing, stack binding) are a technology-specific rule
52
+ applied in the `implement` phase. `design.md` stays feature-specific and
53
+ technology-agnostic.
54
+
55
+ ## Brownfield variant (existing codebases)
56
+
57
+ A design reverse-engineered from — or added forward to — an **existing** codebase is
58
+ authored from the repo's **code-derived `design-template` override**, which
59
+ `/appweaver onboard` reverse-engineers from the repo's own structure and installs at
60
+ `.appweaver/templates/overrides/design-template.md`. Both `adopt` (reverse design) and the
61
+ forward `design` phase scaffold from it via the default template name. It is the **same
62
+ contract** as above — one living HLD per aggregate, tech-agnostic, spec-anchored, with the
63
+ same traceability spine and the two deferral ledgers — with **one difference that matters**:
64
+
65
+ - **Structure follows the code, not a fixed layering.** The **code is the source of
66
+ truth**, so the design describes the system **as-built**. Its structural sections
67
+ are **derived from the code's own organisation** (its folders / projects / modules)
68
+ rather than the fixed Domain/Application/API/Infrastructure four. A component the
69
+ code has that fits no textbook layer (a UI tier, a worker, a host project) gets its
70
+ own section; a layer the code lacks does not appear. Two neutral anchors are kept
71
+ because every system has them and the tooling keys on them: **§1 is the domain/data
72
+ model** (the cross-reference tool reads it for `<Other>Id` reference edges) and one
73
+ **§2 subsection is the External Integrations table** (matched by heading keyword, so
74
+ `aw-xref` extracts contract edges from either layout). The `debt` ledger records
75
+ only debt the **code itself** evidences (stubs, dead code, torn seams) — being
76
+ organised unlike a reference architecture is **not** debt, it is the as-built shape;
77
+ migrating toward a target is a separate modernization decision.
78
+
79
+ This keeps a brownfield design free of greenfield architectural bias while remaining a
80
+ normal feature the CR delta loop and forward pipeline consume unchanged.
81
+
82
+ Both overrides are derived against a **neutral skeleton** —
83
+ `.appweaver/orchestrator/rev-templates/{design,delta-design}-template.skeleton.md` — which
84
+ carries the bones above and names no layering, architecture style or technology. The
85
+ greenfield templates are never placed in `onboard`'s context: a template whose headings
86
+ *are* the four layers cannot be shown to an author whose job is to discover the layout
87
+ from the code.
88
+
89
+ ## Frontend lane variant (`design-ui`)
90
+
91
+ A project with a frontend lane designs it in its **own** document,
92
+ `specs/<Feature>/design.ui.md`, authored by `design-ui` — not a section inside `design.md`.
93
+ The lanes are governed by different constitution halves, take their rules from different
94
+ map headings, and are implemented by different commands. A UI section inside the service
95
+ design would put the lane's structure under the service lane's rules and hand `design-ui`
96
+ the whole service design to read.
97
+
98
+ It is the **same contract** — one living document per feature, technology-agnostic,
99
+ spec-anchored, the same traceability spine and the same two ledgers. Its sections are
100
+ navigation & screen structure · client state · component structure · interaction & flow ·
101
+ contract binding · cross-cutting · traceability · `DA-n` · `WA-n`. Technology-agnostic here
102
+ means no framework, router, state library or component library appears: a component is
103
+ described by its responsibility, its inputs as field shapes, the events it raises and the
104
+ states it can be in, and the framework binds at `implement-ui` from `constitution.ui.md`
105
+ plus that command's rule set. The authoring template is
106
+ `.appweaver/templates/ui-design-template.md`.
107
+
108
+ **§5 Contract Binding is the lane boundary.** The UI design reads the whole spec — the
109
+ experience is stated there — but only the service's **published surface**: the spec's `IC-`
110
+ ids and the API contracts `design.md` states. No table, handler or persistence choice
111
+ crosses that line, and an operation the experience needs that the surface does not offer is
112
+ a contract delta raised back to the service lane, never a client workaround. ⌛ `design`
113
+ will emit that surface as a `design-contract.md` projection; the rule does not change when
114
+ it does, only what §5 reads.
115
+
116
+ **`UX-` lives here and only here.** The service design excludes the spec's Experience
117
+ Standards by contract — it realises no experience standard, and a traceability row for one
118
+ would be a fabrication. So a `UX-` that reaches neither design is a dropped requirement,
119
+ and design.ui.md's §7 is the only place that is visible.
120
+
121
+ **Interaction & flow and cross-cutting are never omitted**, however thin the feature.
122
+ They are the two sections a backend-shaped process silently drops, and loading, empty,
123
+ error and permission-denied states are where most UI defects live. A lane whose code
124
+ handles none of them records that as-built.
125
+
126
+ In a brownfield repo `onboard` reverse-engineers this pair from the UI source and installs
127
+ it at `.appweaver/templates/overrides/{ui-design,ui-delta-design}-template.md`, on the same
128
+ terms as the service pair and from its own neutral skeletons. The files exist **only where
129
+ the code has a lane** — a backend-only repo gets neither.
130
+
131
+ ## Generate forward, reconcile only the high-level back
132
+
133
+ The design document and the code are **not** a byte-for-byte copy of each other.
134
+
135
+ | Direction | Phase | What happens |
136
+ |---|---|---|
137
+ | **Generate** (forward) | Implement | The model reads spec + design.md and **generates** the code and tests — a reasoning step the design guides and constrains, not a transcription. |
138
+ | **Reconcile** (high-level back) | Build / Run fixes | Compile/typecheck/runtime fixes happen on the **code**. Only when a fix is a **high-level technical variation** — a changed pattern, a new component, an altered contract/dependency — is that decision written back into design.md. Low-level churn stays in the code. |
139
+
140
+ > **Invariant:** design.md remains a faithful **high-level** account of the built
141
+ > system — every significant technical decision is recorded — but it is a durable
142
+ > design reference, **not** a line-by-line mirror of the code. (This retires the old
143
+ > `docs == files` extract/reconcile invariant.)
144
+
145
+ ## The traceability spine
146
+
147
+ ```
148
+ FR/BR/US/SC ↔ design section (element / decision) ↔ code (+ tests) ↔ commit
149
+ ```
150
+
151
+ Every design element traces **up** to a spec id, and the whole spec traces **down**
152
+ into a design section (§6 Traceability). This is what makes the analyze gate and the
153
+ review able to check coverage, and what keeps CR impact analysis exact.
154
+
155
+ ## Feature granularity (why a command is a delta, not a new feature)
156
+
157
+ A **feature is the largest slice whose code no other feature owns.** Because
158
+ `implement` regenerates the whole feature's code coherently, a shared file
159
+ (`src/Domain/Order.cs`) must have exactly **one** owning design. So for an aggregate
160
+ with a shared entity, **feature = the aggregate** (`Order`), and individual commands
161
+ (`CreateOrder`, `UpdateOrder`, …) are **user stories / deltas** on the same design.md:
162
+
163
+ - `CreateOrder` = US-1; `UpdateOrder` = US-2.
164
+ - Adding `UpdateOrder` is an additive CR: a Delta Spec (`+US-2`) and a Delta Design
165
+ (`ADDED` new use-case/endpoint sections, `MODIFIED` the shared Order/root and
166
+ repository sections — see `delta-design-template.md`). The design phase amends
167
+ design.md doc-first, bumps the feature version (`v1.0 → v1.1`), and archives the CR;
168
+ `implement` regenerates the touched slice; regression re-tests the shared-file
169
+ dependents.
170
+
171
+ Two command-level features would both claim `src/Domain/Order.cs` and collide —
172
+ which is exactly why the aggregate is the boundary.
173
+
174
+ ## Migration status
175
+
176
+ **Complete.** Every phase now runs this HLD model, including the executable chain.
177
+
178
+ The legacy path-tagged helpers (`design-extract` / `design-reconcile` / `design-paths`)
179
+ are **retired and deleted** from both shells. They belonged to the four-document,
180
+ full-code model in which `design.{domain,application,api,infra}.md` carried the source
181
+ inside ` ```lang path=… ` fences. That convention is gone — no template emits `path=`,
182
+ and `design-scaffold` writes a single `design.md` — so all three had been finding
183
+ nothing and no-op'ing at exit 0. (Their glob, `design.*.md`, could not have matched a
184
+ single `design.md` even if the fences had survived: the second dot required a middle
185
+ segment. The one legitimate remaining user of that glob, `list-features`'s informational
186
+ `design_docs` count, is fixed to `design*.md`.)
187
+
188
+ The question those helpers answered — *which files is this slice made of* — is now an
189
+ **OKF query**, because the knowledge bundle is where that answer is actually maintained:
190
+
191
+ | Need | Now |
192
+ | --- | --- |
193
+ | read the slice's files | `aw-xref concept-paths --feature-dir <dir>` → the concept's `source_files` |
194
+ | record files a fix loop touched | `aw-xref concept-upsert --source-files … --merge` |
195
+
196
+ `build`, `run`, and `analyze-slice` all read through `concept-paths` (feeding their fix
197
+ loops and, in `analyze-slice`, the conformance pass) and write back through
198
+ `concept-upsert --merge`. Both directions are advisory: `concept-paths` is strictly
199
+ read-only and returns an empty list rather than an error when no concept exists yet, so
200
+ a greenfield slice before its first `implement` behaves exactly as it did before.
@@ -0,0 +1,156 @@
1
+ # aw-spec.orchestrator/v1 — orchestrator workflow dialect
2
+
3
+ The workflow dialect executed by `.appweaver/orchestrator/orchestrator.py`, and the
4
+ **only** workflow dialect that ships. It grew out of the earlier declarative
5
+ `skill.yaml` dialect (`aw-spec.declarative/v1`, the `aw-spec-decl-*` skills), which
6
+ was **retired 2026-08-03** along with its reference doc: same YAML subset, same
7
+ step/`outputs:`/`condition:` conventions, but built for
8
+ the **orchestrator model**: the interpreter assembles 100% of every model
9
+ payload (system = standards/rules, user = artifacts + task) and a **fresh
10
+ agent** executes it under one of the 4 strategies. Everything here is common
11
+ across agent roots — `.claude`, `.agents`, `.kilocode` differ only in their
12
+ transport profile (`agent.json`) and their thin `/appweaver` launcher.
13
+
14
+ ## Layout (the common folder)
15
+
16
+ ```
17
+ .appweaver/orchestrator/
18
+ orchestrator.py the engine (stdlib-only; reuses run-skill's YAML loader)
19
+ ORCH-DIALECT.md → this doc lives at .appweaver/ORCH-DIALECT.md
20
+ README.md strategies, transports, checkpoint machinery
21
+ AGENT-PROFILE.md profile (agent.json) reference
22
+ adapters/ shared per-SDK adapters (claude_agent_sdk, google_antigravity)
23
+ modules/ shared includable modules (*.orch.yaml): delta-design,
24
+ delta-spec, domain-select, lane-gate, tech-select
25
+ rev-templates/ neutral (shape-only) skeletons the brownfield govern-backward
26
+ authors follow — see aw-spec-onboard.orch.yaml
27
+ workflows/ one aw-spec-<skill>.orch.yaml per converted skill (+ _smoke)
28
+ .appweaver/scripts/ 53 deterministic subcommands — 36 in aw-spec-actions (a true
29
+ bash+powershell pair) + 17 across aw-xref, aw-inventory,
30
+ aw-parity, aw-rev-constitution (thin sh/ps1 wrappers over one
31
+ python core each) — reused as-is
32
+ ```
33
+
34
+ ## Execution model (strictly held)
35
+
36
+ 1. **Context management is the orchestrator's** — as in `workflows/aw-spec-demo.orch.yaml`.
37
+ `build_context` REPLACES the per-request envelope; `load_standards`
38
+ maintains the sticky system prefix. No agent ever assembles its own context.
39
+ 2. **Execution follows any of the 4 strategies** (`--strategy`, per-step
40
+ `strategy:` override): `sdk`, `sdk-apply`, `spawn`, `agent` — they only
41
+ govern WHO fulfills a generation, never what goes into it.
42
+ 3. **The checkpoint channel is strategy-independent** (D1): `ask`,
43
+ `user_select` and `dispatch_hooks` suspend via `--checkpoint` under EVERY
44
+ strategy, so the launching agent can relay to the human. Converted-skill
45
+ launchers therefore always pass `--checkpoint`.
46
+
47
+ ## Workflow file anatomy
48
+
49
+ ```yaml
50
+ name: aw-spec-<skill>
51
+ dialect: aw-spec.orchestrator/v1 # checked by --validate
52
+
53
+ inputs: # F10 — bound from --input
54
+ user_input: { description: …, required: false, bind: USER_INPUT }
55
+
56
+ scripts: # F1 — ref map for execute_script
57
+ actions:
58
+ sh: .appweaver/scripts/bash/aw-spec-actions.sh
59
+ ps1: .appweaver/scripts/powershell/aw-spec-actions.ps1
60
+
61
+ standards: # F4 — optional seed of the sticky set
62
+ - { path: guardrails/technology/<stack>/clean-architecture.md, optional: true }
63
+
64
+ vars: { k: v } # seed variables (--var k=v overrides)
65
+ workflow: [ …steps… ]
66
+ outputs: { k: "{{v}}" } # resolved and printed at the end
67
+ ```
68
+
69
+ Every step: `id:` (required, unique), `action:`, optional `condition:`
70
+ (`==`/`!=`/truthy), optional `strategy:`/`model:` (generating actions),
71
+ optional `outputs: [{name, from: "$.field"}]` (JSONPath into the step's
72
+ structured result). `{{var}}` substitutes with dotted/index access
73
+ (`{{q.text}}`, `{{items.0}}`); a value that is EXACTLY one `{{ref}}` yields
74
+ the raw object, not its JSON string.
75
+
76
+ ## Actions
77
+
78
+ | action | who runs | what it does |
79
+ |---|---|---|
80
+ | `set` | engine | assign vars (`vars:` or decl-style `parameters:`); raw-object aware |
81
+ | `build_context` | engine | REPLACE the per-request envelope: `system:`/`context:` file lists (+ `context_from: <var>` holding paths a prior generation reported, + `vars:`) |
82
+ | `load_standards` | engine | F4 — append to the **sticky standards set** prepended to every system block (dedup, `optional:`, `files:`/`files_from_variable`). This is the byte-stable, prompt-cacheable prefix |
83
+ | `execute_script` | engine | F1 — run a `scripts:` ref (`subcommand:` + `args:`; sh/ps1 via `--os`); stdout's last line = JSON, bound via `outputs[]`; `on_error: continue` tolerated; cached across resumes; runs for real even in mock transport |
84
+ | `verify_context` | engine | F2 — gates: `required_files` (+`allow_missing`), `require_non_empty` (+`on_empty[_message]`), `require_true` (+`on_false[_message]`), `require_value`+`equals` (+`on_mismatch[_message]`). `stop` raises a terminal stop |
85
+ | `agent_generate` | fresh agent | demo contract (code work): agent DECIDES file paths per the loaded standards, writes with its tools, reports `files[]` in the trailing ```json fence. `sdk-apply` = read-only generation + invoking agent applies |
86
+ | `agent_review` | fresh agent | read-only review of `review_of_var`/`review_of` files → `{pass, issues}` |
87
+ | `agent_author` | fresh agent | F5 — **authored artifact** (decl `llm_generate`): the INTERPRETER owns `output_target: {type: file, path}`. Generation is READ-ONLY under every strategy; the ENGINE writes the returned content (sdk-apply degrades to sdk). Optional `context:` (per-request extras), `include_standards: false` (narrow payload) |
88
+ | `agent_query` | fresh agent | F6 — generic read-only structured JSON (decl `llm_query`): `schema:` shapes the required fence, `outputs[]` binds it, `mock:` supplies the mock-transport result; one malformed-JSON retry on fresh strategies |
89
+ | `ask` | human (via launcher) | F7 — question: `prompt`, `options`/`options_from`/`options_from_variable`, `multi`, `answer_key`, `answer_var` (default `answer`). Sources in order: cache → `--answer k=v` → `--non-interactive` (first option; all when multi) → checkpoint suspend `ask` → stdin |
90
+ | `user_select` | human (via launcher) | F7 — pick ONE from `options_from_variable`; `preselect_from` (direct-argument fast path), `single_option_confirm`; `--select stepid=v`; binds `selection` + `outputs[]` |
91
+ | `dispatch_hooks` | invoking agent | F8 — suspend kind `hook` with the `hooks_from_variable` list (slash commands of the LAUNCHING agent); logged-only without a checkpoint; never re-fires across resumes |
92
+ | `include` | engine | F9 — run a module `.orch.yaml` inline: shares vars/envelope/standards/scripts/replay-cache; a module's own `scripts:` EXTEND the caller's map by `setdefault`, so the caller's ref wins on a clash and every module can declare what it invokes and still validate standalone; `with:` seeds inputs; cache keys namespaced `inc:<id>/…`; module `Stop` stops the caller |
93
+ | `loop` | engine | `while: <cond>` + `max_iterations` (default 5), or F3 foreach `over: "{{list}}"` + `as: item` (binds `item`, `item_index`, `iteration`); `break` (+`condition:`) exits the innermost loop |
94
+
95
+ Decl steps may keep their `parameters:` wrapper — every ported action reads
96
+ `parameters:` or flat step keys interchangeably, so conversion is mechanical.
97
+
98
+ ## The suspend-kind protocol (checkpoint transport)
99
+
100
+ At each handoff the engine writes sidecars next to the state file, prints the
101
+ `pending` request (exit 2), and the launcher fulfills it, writes
102
+ `response_path`, and re-runs the same command. Kinds:
103
+
104
+ | kind | sidecars | launcher writes to response_path | resume ingests as |
105
+ |---|---|---|---|
106
+ | `agent_generate` | system/user | full reply ending in ```json fence | parsed fence → replay cache |
107
+ | `agent_review`, `agent_query` | system/user | read-only reply ending in ```json fence | parsed fence |
108
+ | `apply` | artifact | confirmation ```json fence after writing the named files | parsed fence |
109
+ | `author` | system/user (+`target`) | the COMPLETE file content — no fence, no commentary (the ENGINE writes `target`) | raw content |
110
+ | `ask` | none (`prompt`/`options`/`multi` inline) | the answer as plain text (comma-separated when multi) | string / list |
111
+ | `select` | none (`prompt`/`options` inline) | the chosen option's value | string |
112
+ | `hook` | none (`hooks` inline) | `done` after running the mandatory slash commands | `true` |
113
+
114
+ A rejected response re-suspends with a `note` explaining what to fix. The
115
+ state file persists vars, strategy, model, profile path, `--input`, answers,
116
+ selects, `--os` and the replay cache — a bare
117
+ `… <workflow> --checkpoint <state>` resumes with everything restored.
118
+ Completed steps (generations, scripts, answers, hooks) replay from the cache
119
+ and never re-fire; loop iterations get their own keys (`loopid#i`).
120
+
121
+ ## CLI
122
+
123
+ ```
124
+ orchestrator.py <workflow.orch.yaml>
125
+ --strategy sdk|sdk-apply|spawn|agent (per-step `strategy:` overrides)
126
+ --agent-profile <agent.json> spawn/sdk/sdk-apply
127
+ --checkpoint <statefile> the interaction channel (always, for converted skills)
128
+ --input "<text>" bound via inputs: (F10)
129
+ --answer k=v … / --select stepid=v … HITL prefills
130
+ --non-interactive CI: first option everywhere
131
+ --os posix|windows script variant (F1 / D7)
132
+ --model <name> / --budget / --isolation bare|fresh / --sdk-install
133
+ --var k=v … / --show-full / --json / --dry-run
134
+ --validate F11 — static lint, never executes
135
+ ```
136
+
137
+ ## decl → orch conversion map
138
+
139
+ | declarative (run-skill) | orchestrator |
140
+ |---|---|
141
+ | `load_context` (standards, domain rules, constitution) | `load_standards` (sticky system set — D3) |
142
+ | `load_context` (feature artifacts, templates) | `build_context` `context:` before the consuming step |
143
+ | `llm_generate` + `output_target` | `agent_author` (same `output_target`) |
144
+ | `llm_query` | `agent_query` (+ `schema:`, `mock:`) |
145
+ | `include_loaded_context: false` | narrow `build_context` + `include_standards: false` |
146
+ | `execute_script` / `verify_context` / `ask` / `user_select` / `dispatch_hooks` / `set` / `loop` / `break` / `include` | same action, `parameters:` wrapper optional |
147
+ | implement-style code tasks | `agent_generate` (+ `agent_review`), `context_from` chaining between iterations |
148
+
149
+ ## Validation & smoke
150
+
151
+ - `--validate` every workflow/module (unknown actions/strategies, duplicate
152
+ ids, script refs + files on disk, `output_target.path`, module paths,
153
+ unproduced `{{vars}}`, dialect header).
154
+ - `workflows/_smoke.orch.yaml` exercises every construct with no model and no
155
+ writes outside `.smoke-out`: run it `--non-interactive` (CI) and with
156
+ `--checkpoint` (protocol walk-through).
@@ -0,0 +1,175 @@
1
+ # Rule Partition — which command reads which rules
2
+
3
+ *AppWeaver · aw-spec · companion to [Spec-Anchored-Pipeline.md](Spec-Anchored-Pipeline.md) and
4
+ [DESIGN-FORMAT.md](DESIGN-FORMAT.md)*
5
+
6
+ The authority on how rule files are partitioned across the pipeline, so each phase gets a
7
+ focused, non-overlapping context. Domain-agnostic and technology-agnostic: it describes the
8
+ **contract**, never a particular project's files. The concrete file lists are configuration —
9
+ they live in the two rule maps, not here.
10
+
11
+ ---
12
+
13
+ ## The principle — the spec is the pivot
14
+
15
+ Domain knowledge enters the pipeline **once**, at `specify`, and is written into the spec as
16
+ identified requirements (`BR-` / `CN-` / `DC-` / `IC-` / `FR-`). From that point on the **spec is
17
+ the only domain input**. Later phases mediate against the spec, not against the domain files.
18
+
19
+ This is what makes a spec re-platformable: swap the technical rule set and the same spec still
20
+ governs. It also stops domain detail leaking straight into code authoring without ever being
21
+ pinned in a reviewable requirement.
22
+
23
+ > **Lift, then gate.** If a domain constraint is needed downstream, it must first be *lifted*
24
+ > into the spec as an id. A gate that finds a constraint in neither the spec nor the design
25
+ > reports `LIFT-FAILURE:` and routes back to `specify` — it must never invent the rule into a
26
+ > design or into code.
27
+
28
+ ---
29
+
30
+ ## The three classes of rule input
31
+
32
+ | Class | What it is | Carried by |
33
+ |---|---|---|
34
+ | **Domain rule files** | Business/domain rules of the active domain | `domain-rule-bindings.md`, read by `resolve-domain` |
35
+ | **Technical rule files** | Architecture, conventions, code-generation rules | `tech-rule-bindings.md`, read by `resolve-tech` |
36
+ | **Constitution halves** | Ratified standing principles | Referred to **directly, as-is** — never mapped |
37
+
38
+ Both maps are **configuration**: to change what a phase loads, edit the map, not the workflow.
39
+ A command with **no heading** in a map loads nothing mapped for that class and
40
+ **soft-continues** — an absent heading is a valid state, never a failure.
41
+
42
+ ### The constitution halves are not mapped
43
+
44
+ - `.appweaver/memory/constitution.technical.md` — the technology base. Standing input to
45
+ **design + implement**. Domain-agnostic.
46
+ - `.appweaver/memory/constitution.ui.md` — the **frontend lane's** base, a UX-* principle series.
47
+ Standing input to ⌛ **ui-design + ui-implement**. Domain-agnostic for the same reason the
48
+ technical base is, and it exists only where a frontend lane does — a backend-only project has
49
+ no such file.
50
+ - `.appweaver/memory/constitution.domain.md` — the active domain's addenda. Standing input to
51
+ **specify** (and the gate checklist). Deliberately **not** loaded by design or implement.
52
+ - `.appweaver/memory/constitution.md` — the composed human/compatibility view. The pipeline loads
53
+ the halves, not this file.
54
+
55
+ One lane's constitution never governs the other lane's code: `design`/`implement` load the
56
+ technical base and `ui-design`/`ui-implement` load the UI base. What they share is the spec.
57
+
58
+ ---
59
+
60
+ ## The map
61
+
62
+ ### `specify` — *domain modelling*
63
+ - **Domain rule files: yes** — the domain authority. Authored INTO the spec as ids.
64
+ - **Technical rule files: no**, with one exception: a **modelling methodology** (e.g. DDD
65
+ tactical patterns) may seed it. That is a domain-agnostic way of *modelling*, not a
66
+ technology choice. Like every other class, that exception is **configuration** — it is
67
+ wired under `## /aw-spec-specify` in `tech-rule-bindings.md`, not hardcoded in the
68
+ workflow. Nothing else may go under that heading: an architecture, persistence, or
69
+ code-generation file there would break specify's domain purity. Greenfield wires
70
+ the stack corpus's `domain-driven-design.md`; a code-derived (brownfield) project wires
71
+ `service/domain-modelling.md`, which `onboard` reverse-engineers from the code — the
72
+ as-built answer to *how does this codebase express a domain model*. Either way it is
73
+ **HOW to model**; **WHAT** the model is stays in the domain tier.
74
+ - Constitution: the **domain** half.
75
+
76
+ ### `design` — *architecture; domain input = the spec only*
77
+ - **Domain rule files: NEVER.** Domain reaches design solely as spec ids.
78
+ - **Technical rule files: yes** — architecture and cross-cutting rules the design mediates the
79
+ spec against.
80
+ - Constitution: the **technical** half.
81
+
82
+ ### `implement` / `implement-delta` — *code generation*
83
+ - **Domain rule files: NEVER.** The design is the only input describing what to build.
84
+ - **Technical rule files: yes** — the code-generation and convention set.
85
+ - Constitution: the **technical** half.
86
+
87
+ ### `build` — *compile + repair*
88
+ - **Technical rule files: yes** — the layering and convention rules the compile-fixer respects.
89
+ - No domain files: build repairs against design intent, which the domain never reaches.
90
+
91
+ ### `run` — *runtime*
92
+ - **Technical rule files:** only if the project evidences a runtime/hosting concern.
93
+
94
+ ### Gates — `analyze-design`, `analyze-delta-design`, `analyze-slice`, and the `/aw-spec-gate` overlay set
95
+ - Load the domain **gate overlays** as a **conformance checklist**.
96
+ - **Validation input ONLY — never authoring.** A gate may fail a document or a slice; it may
97
+ never write a rule into one.
98
+
99
+ ### `constitution`
100
+ - Loads both classes to author each half from its own source.
101
+ - The **UI half** is authored only where a frontend lane exists, and the technical map is the
102
+ authoritative test: `## /aw-spec-ui-constitution` resolving non-empty both proves the lane and
103
+ supplies its rules. A declared frontend lane in `.appweaver/stacks.json` or a UI stack named in
104
+ the request will also trigger it — neither is required, so nothing here constrains setup order.
105
+ With no signal at all the half is **skipped with a warning**, never an error.
106
+ - The UI half is authored **before `domain-select`**, which is what keeps it domain-free — the
107
+ same ordering that protects the technical half.
108
+
109
+ ### `onboard` (brownfield)
110
+ - Authors all three halves itself, and generates the rule set each one ratifies. The rule maps do
111
+ not exist yet when it starts, so its authority is the **code**: every principle and every
112
+ generated rule file is evidenced from source, and a greenfield rule file is never an input.
113
+ - The **UI half** is authored where the **scan** finds a UI — `frontend_signals` reaching lane
114
+ strength — not where a map heading exists, because at onboard there is no map to read. The
115
+ order is therefore inverted: the half is authored from the code, then the `frontend/` rule set is
116
+ generated as its detail layer, then `## /aw-spec-ui-constitution` is appended to the technical
117
+ map. That heading is what makes every LATER `constitution` run behave like the greenfield case
118
+ above.
119
+ - A frontend lane declared in `.appweaver/stacks.json` corroborates rather than decides: with no
120
+ UI source there is nothing to reverse-engineer, so nothing is authored.
121
+ - `onboard` also **records** the lanes it reverse-engineered in `.appweaver/stacks.json`, through
122
+ `lane-declare` — still the sole writer, now with two callers. A derived lane carries
123
+ `origin: reverse-engineered` and an existing declaration is never overwritten, so a lane a
124
+ person confirmed always outranks one a scan proposed. Confirming or correcting a lane stays
125
+ `select-stack`'s job.
126
+ - The **document templates** it derives obey the same partition as the halves that govern them:
127
+ the service design + delta-design pair is authored against `constitution.technical.md`, the
128
+ lane's pair against `constitution.ui.md` and the generated `frontend/` rules, and neither
129
+ reads a domain file. This is invariant 7 applied one level up — a lane's template describes
130
+ that lane's code and no other's.
131
+ - **No greenfield artifact is ever in context.** Where a step needs a shape reference it reads a
132
+ neutral skeleton from `.appweaver/orchestrator/rev-templates/`, which carries the format and no
133
+ principle, rule, layering or technology. The rule maps do not exist yet when `onboard` starts,
134
+ so an instruction not to copy an exemplar would be the only control — absence is the stronger
135
+ one.
136
+ - Ordering is preserved for the same reason as above: technical half → UI half → domain half.
137
+
138
+ ### `adopt` (brownfield)
139
+ - Same partition, reversed: the reversed **spec** is authored with domain rules in context; the
140
+ reversed **design** is authored with the technical set only, so design stays domain-free.
141
+ - Technical files here are **reference, not authority — the CODE wins.**
142
+
143
+ ---
144
+
145
+ ## Invariants
146
+
147
+ 1. **No domain rule file is ever loaded by `design`, `implement`, `implement-delta` or `build`.**
148
+ 2. **Domain reaches design and code only as spec ids.**
149
+ 3. **Gate overlays validate; they never author.**
150
+ 4. **A constraint not in the spec cannot be honoured downstream** — lift it first
151
+ (`LIFT-FAILURE:` → back to `specify`).
152
+ 5. **An absent map heading loads nothing and soft-continues** — it is never a blocking error.
153
+ 6. **The constitution halves are referred to directly** and never listed in either map.
154
+ 7. **A lane's constitution half governs that lane only** — `constitution.ui.md` never reaches
155
+ `design` or `implement`, and `constitution.technical.md` never reaches `ui-design` or
156
+ `ui-implement`.
157
+
158
+ ---
159
+
160
+ ## Where the concrete lists live
161
+
162
+ | Map | Reader | Class |
163
+ |---|---|---|
164
+ | `guardrails/projects/<project>/domain-rule-bindings.md` | `resolve-domain` | domain rule files |
165
+ | `guardrails/projects/<project>/tech-rule-bindings.md` | `resolve-tech` | technical rule files |
166
+
167
+ Each map keys on `## /aw-spec-<command>` headings whose `- ` bullets are workspace-relative
168
+ file paths — pointing into the shared corpora at `guardrails/technology/<stack>/` and
169
+ `guardrails/domain/<industry>/`, or at the project's own three requirements files. A map is
170
+ what binds a project to a corpus; the corpus itself belongs to no project. Shape references
171
+ for authoring a new project live in
172
+ `.appweaver/orchestrator/rev-templates/`.
173
+
174
+ Rule files may carry a `Commands:` header naming their consumers. That header is **derived from
175
+ these maps** — the maps are authoritative; a header that disagrees is a bug in the header.