aw-spec-cli 0.1.5 → 0.1.6

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 (205) hide show
  1. package/assets/.agents/agent.json +1 -1
  2. package/assets/.agents/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
  3. package/assets/.agents/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
  4. package/assets/.claude/agent.json +1 -1
  5. package/assets/.claude/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
  6. package/assets/.claude/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
  7. package/assets/.kilocode/agent.json +1 -1
  8. package/assets/.kilocode/workflows/{aw-spec-orch-demo.md → appweaver-demo.md} +9 -9
  9. package/assets/.kilocode/workflows/{aw-spec-orch.md → appweaver.md} +10 -10
  10. package/assets/docs/pharma-constitution.my-ref.md +86 -0
  11. package/dist/utils/paths.js +2 -2
  12. package/dist/utils/paths.js.map +1 -1
  13. package/package.json +1 -1
  14. package/assets/.aw-spec/DESIGN-FORMAT.md +0 -151
  15. package/assets/.aw-spec/ORCH-DIALECT.md +0 -156
  16. package/assets/.aw-spec/RULE-PARTITION.md +0 -126
  17. package/assets/.aw-spec/domain.json +0 -3
  18. package/assets/.aw-spec/extensions/.registry +0 -19
  19. package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
  20. package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
  21. package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
  22. package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -37
  23. package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
  24. package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
  25. package/assets/.aw-spec/extensions.yml +0 -16
  26. package/assets/.aw-spec/feature.json +0 -3
  27. package/assets/.aw-spec/init-options.json +0 -9
  28. package/assets/.aw-spec/integration.json +0 -15
  29. package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -9
  30. package/assets/.aw-spec/interpreter/run-skill.py +0 -1158
  31. package/assets/.aw-spec/memory/constitution.md +0 -50
  32. package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +0 -94
  33. package/assets/.aw-spec/orchestrator/README.md +0 -300
  34. package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +0 -74
  35. package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +0 -74
  36. package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +0 -105
  37. package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +0 -79
  38. package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +0 -81
  39. package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +0 -75
  40. package/assets/.aw-spec/orchestrator/orchestrator.py +0 -1721
  41. package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +0 -40
  42. package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +0 -59
  43. package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +0 -97
  44. package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +0 -61
  45. package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +0 -48
  46. package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +0 -39
  47. package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +0 -106
  48. package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +0 -54
  49. package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +0 -160
  50. package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +0 -244
  51. package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +0 -775
  52. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +0 -248
  53. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +0 -261
  54. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +0 -425
  55. package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +0 -188
  56. package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +0 -474
  57. package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +0 -181
  58. package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +0 -284
  59. package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +0 -103
  60. package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +0 -69
  61. package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +0 -85
  62. package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +0 -382
  63. package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +0 -382
  64. package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +0 -246
  65. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +0 -231
  66. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +0 -258
  67. package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +0 -236
  68. package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +0 -949
  69. package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +0 -293
  70. package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +0 -177
  71. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +0 -79
  72. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +0 -128
  73. package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +0 -412
  74. package/assets/.aw-spec/scripts/bash/aw-inventory.sh +0 -14
  75. package/assets/.aw-spec/scripts/bash/aw-parity.sh +0 -13
  76. package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +0 -13
  77. package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +0 -1899
  78. package/assets/.aw-spec/scripts/bash/aw-xref.sh +0 -15
  79. package/assets/.aw-spec/scripts/bash/common.sh +0 -533
  80. package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +0 -14
  81. package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +0 -13
  82. package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +0 -13
  83. package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +0 -1563
  84. package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +0 -15
  85. package/assets/.aw-spec/scripts/python/aw-inventory.py +0 -683
  86. package/assets/.aw-spec/scripts/python/aw-parity.py +0 -380
  87. package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +0 -312
  88. package/assets/.aw-spec/scripts/python/aw-xref.py +0 -1330
  89. package/assets/.aw-spec/scripts/python/validate_okf.py +0 -349
  90. package/assets/.aw-spec/templates/constitution-domain-template.md +0 -75
  91. package/assets/.aw-spec/templates/constitution-technical-template.md +0 -70
  92. package/assets/.aw-spec/templates/delta-design-template.md +0 -69
  93. package/assets/.aw-spec/templates/delta-spec-template.md +0 -60
  94. package/assets/.aw-spec/templates/design-template.md +0 -383
  95. package/assets/.aw-spec/templates/okf-concept-template.md +0 -103
  96. package/assets/.aw-spec/templates/parity-manifest-template.json +0 -49
  97. package/assets/.aw-spec/templates/source-map-template.md +0 -85
  98. package/assets/.aw-spec/templates/spec-template.md +0 -252
  99. package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
  100. package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
  101. package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
  102. package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
  103. package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
  104. package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
  105. package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
  106. package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
  107. package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
  108. package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
  109. package/assets/docs/README.md +0 -106
  110. package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
  111. package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
  112. package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
  113. package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
  114. package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
  115. package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
  116. package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
  117. package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
  118. package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
  119. package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
  120. package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
  121. package/assets/docs/architecture/clean-architecture.md +0 -71
  122. package/assets/docs/architecture/cqrs.md +0 -141
  123. package/assets/docs/architecture/eventing.md +0 -83
  124. package/assets/docs/architecture/folder-structure.md +0 -61
  125. package/assets/docs/architecture/modular-monolith.md +0 -47
  126. package/assets/docs/architecture/persistence.md +0 -269
  127. package/assets/docs/architecture/testing.md +0 -55
  128. package/assets/docs/architecture/vertical-slices.md +0 -201
  129. package/assets/docs/components/Email/README.md +0 -119
  130. package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
  131. package/assets/docs/components/Email/integration.md +0 -300
  132. package/assets/docs/components/Jobs/README.md +0 -113
  133. package/assets/docs/components/Jobs/integration.md +0 -259
  134. package/assets/docs/components/QrGenerator/README.md +0 -85
  135. package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
  136. package/assets/docs/components/QrGenerator/integration.md +0 -230
  137. package/assets/docs/components/README.md +0 -74
  138. package/assets/docs/domain/domain-driven-design.md +0 -212
  139. package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
  140. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
  141. package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -97
  142. package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
  143. package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
  144. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
  145. package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -100
  146. package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +0 -119
  147. package/assets/docs/domainspecs/healthcare/consent.md +0 -19
  148. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
  149. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
  150. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
  151. package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
  152. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
  153. package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
  154. package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
  155. package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
  156. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
  157. package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
  158. package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
  159. package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
  160. package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
  161. package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
  162. package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
  163. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
  164. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
  165. package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
  166. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
  167. package/assets/docs/domainspecs/pharma/atc.md +0 -22
  168. package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -90
  169. package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
  170. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
  171. package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -108
  172. package/assets/docs/domainspecs/pharma/commandtechrulemap.md +0 -119
  173. package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
  174. package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
  175. package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
  176. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
  177. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
  178. package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
  179. package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
  180. package/assets/docs/domainspecs/pharma/fhir.md +0 -31
  181. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
  182. package/assets/docs/domainspecs/pharma/hl7.md +0 -17
  183. package/assets/docs/domainspecs/pharma/idmp.md +0 -26
  184. package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
  185. package/assets/docs/domainspecs/pharma/ndc.md +0 -28
  186. package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
  187. package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
  188. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
  189. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
  190. package/assets/docs/domainspecs/pharma/terminology.md +0 -32
  191. package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
  192. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
  193. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
  194. package/assets/docs/glossary/ai-rules.md +0 -59
  195. package/assets/docs/governance/api-versioning.md +0 -99
  196. package/assets/docs/governance/coding-standards.md +0 -87
  197. package/assets/docs/governance/dependency-policy.md +0 -40
  198. package/assets/docs/interop/ihe-conformance.md +0 -31
  199. package/assets/docs/requirement-spec.txt +0 -27
  200. package/assets/docs/security/auditing.md +0 -160
  201. package/assets/docs/security/authorization-matrix.md +0 -14
  202. package/assets/docs/security/authorization.md +0 -87
  203. package/assets/docs/security/data-classification.md +0 -38
  204. package/assets/docs/security/zero-trust.md +0 -76
  205. package/assets/docs/technology-constitution.md +0 -172
@@ -1,775 +0,0 @@
1
- # =============================================================================
2
- # aw-spec-adopt (orchestrator) — the JUST-IN-TIME per-feature step of Brownfield DEV
3
- #
4
- # Develop an EXISTING feature by first reverse-engineering ONE aggregate / vertical
5
- # slice from its code into a living spec.md + aligned design.md (+ a source-map.md
6
- # sidecar), THEN reconciling this feature's evidence into the project governance that
7
- # /aw-spec-orch onboard established. Adopt is the inverse of implement: implement reads
8
- # spec+design and generates code; adopt reads code and generates spec+design — equally
9
- # a reasoning step, stamped `origin: reverse-engineered` with per-item confidence.
10
- #
11
- # onboard → ADOPT <Feature> (JIT, one feature at a time) → [ forward / CR delta loop ] ← you are here
12
- #
13
- # Adopt is JUST-IN-TIME and per-feature: reverse ONLY the feature you are about to
14
- # develop, never the whole codebase (that scale is what onboard's shallow feature map
15
- # avoids). A NEW feature (no existing code) is NOT adopted — it is authored straight
16
- # through the forward pipeline (/aw-spec-orch specify → design → implement), which
17
- # onboard already made brownfield-ready (the code-derived design template is the
18
- # project default). So adopt = reverse an EXISTING feature; the forward pipeline = a
19
- # new one. Both then evolve through the CR delta loop.
20
- #
21
- # The reverse output is a NORMAL feature: spec.md + design.md are the very documents
22
- # the CR delta loop + forward pipeline consume unchanged. All brownfield provenance
23
- # lives in `origin:` frontmatter + the source-map sidecar. Adopt inits
24
- # active_version.json (v1.0) so the CR loop works immediately after.
25
- #
26
- # GOVERNANCE RECONCILE (the JIT contract, gap-fix #1): onboard established the PROJECT
27
- # constitution + docs/domainspecs/<domain>/ rule pack from the whole-repo SCAN, with
28
- # per-feature specifics marked PROVISIONAL. Adopt RECONCILES this feature's real
29
- # evidence (BR-/CN-/DC-/IC- ids, code coordinates) INTO that scaffold — upgrading
30
- # provisional → evidenced. It RECONCILES, never re-authors: it never rewrites the
31
- # project's principle SET or another feature's evidence (that would re-introduce
32
- # single-feature scoping bias), so the constitution stays PROJECT-scoped.
33
- #
34
- # Rule partition (same as the forward loop): the reversed SPEC is authored with DOMAIN
35
- # authority (DDD); the reversed DESIGN is authored from the spec + TECHNICAL standards
36
- # only, NO domain files — domain reaches design as spec ids.
37
- #
38
- # Adopt does NOT generate code and does NOT modify source — writes land under
39
- # specs/<Feature>/, .aw-spec/memory/constitution*.md, and docs/domainspecs/<domain>/.
40
- # Fidelity checks spec/design ↔ CODE; the Adopt review is REPORTED for out-of-band
41
- # closure — it blocks only on structural failures (unmapped code / fabricated spec/design).
42
- # There is NO migration content here (characterize is an optional on-touch fence, not a
43
- # phase; parity/cutover belong to the separate later modernization phase).
44
- #
45
- # Launch: /aw-spec-orch adopt [strategy] # adopt the ACTIVE feature (set by select-feature)
46
- # /aw-spec-orch adopt [strategy] <Feature> # or name it directly (also selects it)
47
- # e.g. /aw-spec-orch adopt MedicinalProduct
48
- # Prereq: /aw-spec-orch onboard (the feature map names this feature + the governance
49
- # scaffold adopt reconciles into), then /aw-spec-orch select-feature to pick
50
- # the aggregate — adopt consumes it, so the no-arg form is the normal path.
51
- # =============================================================================
52
-
53
- name: aw-spec-adopt
54
- description: The JIT per-feature step of brownfield development — reverse-engineer ONE existing feature into a living spec.md + design.md + source-map.md (origin reverse-engineered, per-item confidence, code-derived design template), COMPLETE its shallow OKF concept (deepen it to the reversed reality + link the deep artifacts), then RECONCILE its real evidence into the project governance onboard established (fill the provisional rule files + constitution — reconcile, never re-author). Fidelity gate is spec/design vs code; the review is reported for out-of-band closure. A NEW feature is authored via the forward pipeline instead. Output is a normal feature for the CR + forward loop.
55
- # 1.5.0 — user_input is now OPTIONAL: adopt CONSUMES the ACTIVE feature (select-feature's
56
- # .aw-spec/feature.json) when no arg is passed, so onboard→select-feature→adopt needs
57
- # no re-typing; an explicit <Feature> still selects directly (and wins). One coalesced
58
- # feature_name (set-feature-canonicalised) replaces USER_INPUT throughout.
59
- # 1.4.0 — COMPLETE the shallow OKF aggregate concept from the trustworthy reversed docs
60
- # (deepen detail + link spec/design/source-map + mark adopted) before xref_record.
61
- # 1.3.0 — reverse design scaffolds from the DEFAULT `design-template` (onboard's code-derived
62
- # override) instead of the never-shipped `brownfield-design-template`, unifying the
63
- # whole brownfield pipeline on one code-derived template.
64
- version: 1.5.0
65
- agent_agnostic: true
66
- dialect: aw-spec.orchestrator/v1
67
-
68
- inputs:
69
- user_input:
70
- description: OPTIONAL existing feature to adopt (a candidate from the onboard feature map, e.g. MedicinalProduct). Omit it to adopt the ACTIVE feature already selected by /aw-spec-orch select-feature (.aw-spec/feature.json) — the normal onboard→select-feature→adopt flow. A NEW feature (no existing code) is developed via the forward pipeline instead, not adopt.
71
- required: false
72
- bind: USER_INPUT
73
-
74
- scripts:
75
- inventory:
76
- sh: .aw-spec/scripts/bash/aw-inventory.sh
77
- ps1: .aw-spec/scripts/powershell/aw-inventory.ps1
78
- actions:
79
- sh: .aw-spec/scripts/bash/aw-spec-actions.sh
80
- ps1: .aw-spec/scripts/powershell/aw-spec-actions.ps1
81
- xref:
82
- sh: .aw-spec/scripts/bash/aw-xref.sh
83
- ps1: .aw-spec/scripts/powershell/aw-xref.ps1
84
-
85
- # Sticky standards seed = the UNIVERSAL always-on rule only (ai-rules). The TECHNICAL/
86
- # architecture set for the reversed DESIGN step (mirrors aw-spec-design) is no longer
87
- # hardcoded here — it is now CONFIGURATION, loaded per-command from
88
- # docs/domainspecs/<domain>/commandtechrulemap.md under "## /aw-spec-adopt" by the
89
- # tech-select module (see the tech_select step below). The reversed SPEC step runs
90
- # include_standards:false and gets DOMAIN authority (DDD + domain constitution) via
91
- # build_context — so design never sees a domain rule file (rule partition preserved); the
92
- # tech map lists only technical files. constitution.technical.md is referred to directly
93
- # (context in reverse_design), never mapped. Missing files skipped at assembly time.
94
- standards:
95
- - { path: docs/glossary/ai-rules.md, optional: true }
96
-
97
- vars:
98
- bundle_dir: "knowledge" # where /aw-spec-orch onboard writes the OKF feature map (repo-root default)
99
- feature_name: "" # the aggregate to adopt: USER_INPUT if passed, else the active feature (set-feature canonicalises)
100
- concept_exists: "false"
101
- spec_exists: "false"
102
- fidelity_ok: "false"
103
- rulemap_exists: "false" # governance-present signal (onboard ran) — bound from resolve-domain
104
- reconcile_governance: "false" # HELD 2026-07-29 — the governance (constitution + rule-pack) reconcile block is PAUSED on adopt; flip to "true" to re-enable it
105
- technical_ok: "false" # technical-half reconcile lint guard
106
- domain_ok: "false" # domain-half reconcile lint guard
107
- guard_sentinel: "" # deliberately empty — the conditioned "already-adopted" gate stops on it
108
- pack_reconciled: "" # default while reconcile is HELD (no rule-pack files reconciled)
109
- composed_file: "" # default while reconcile is HELD (constitution view not recomposed)
110
-
111
- workflow:
112
-
113
- # 0. TECHNICAL rule files → sticky standards (configuration, not hardcoded). tech-select
114
- # reads docs/domainspecs/<domain>/commandtechrulemap.md under "## /aw-spec-adopt" and
115
- # loads that reference set into the sticky standards. Loaded FIRST so it is present for
116
- # reverse_design (include_standards:true) — the reversed SPEC step still turns it off
117
- # (include_standards:false), keeping design domain-free (rule partition). No domain rule
118
- # file here — the tech map lists only technical files. No blocking gate: an unconfigured
119
- # project soft-continues (constitution.technical.md still carries the tech base).
120
- - id: tech_select
121
- action: include
122
- module: .aw-spec/orchestrator/modules/tech-select.orch.yaml
123
- with: { command: aw-spec-adopt }
124
-
125
- # 1. Resolve the aggregate to adopt. TWO ways in (arg wins over active):
126
- # a) `/aw-spec-orch adopt <Feature>` — the explicit arg selects directly.
127
- # b) `/aw-spec-orch adopt` (no arg) — CONSUME the feature select-feature already
128
- # made active (.aw-spec/feature.json), so the onboard→select-feature→adopt
129
- # flow needs no re-typing. feature-paths returns the active aggregate name;
130
- # on_error:continue leaves it empty when nothing is selected yet.
131
- - id: active_feature
132
- action: execute_script
133
- on_error: continue
134
- script: { ref: actions }
135
- subcommand: feature-paths
136
- outputs:
137
- - { name: active_name, from: "$.feature" }
138
-
139
- # Coalesce: default to the active feature, then let an explicit arg override it.
140
- # (The engine has no compound conditions, so this is two ordered sets.)
141
- - id: name_from_active
142
- action: set
143
- vars: { feature_name: "{{active_name}}" }
144
- - id: name_from_arg
145
- action: set
146
- condition: "{{USER_INPUT}}"
147
- vars: { feature_name: "{{USER_INPUT}}" }
148
-
149
- - id: require_target
150
- action: verify_context
151
- require_non_empty: feature_name
152
- on_empty: stop
153
- on_empty_message: "No feature to adopt. Either run /aw-spec-orch select-feature first (pick the aggregate from the onboard feature map), then /aw-spec-orch adopt; or name it directly: /aw-spec-orch adopt <Feature>."
154
-
155
- # Create-or-select the feature dir + persist it active (idempotent in the no-arg
156
- # path where it is already active; creates it in the explicit-arg path). set-feature
157
- # canonicalises to the PascalCase aggregate id → the single feature_name used below.
158
- - id: set_feature
159
- action: execute_script
160
- script: { ref: actions }
161
- subcommand: set-feature
162
- args: ["--feature", "{{feature_name}}"]
163
- outputs:
164
- - { name: feature_name, from: "$.feature" }
165
- - { name: feature_dir, from: "$.feature_dir" }
166
- - { name: spec_file, from: "$.spec_file" }
167
- - { name: spec_exists, from: "$.spec_exists" }
168
-
169
- # 1a. One-time baseline: refuse to clobber an already-adopted / authored spec.
170
- # After adoption, changes go through the CR delta loop, not adopt.
171
- # set-feature returns spec_exists as a JSON boolean; the condition path
172
- # normalises bools to "true"/"false" (json), so gate through it — a
173
- # require_value/equals would compare str(False)="False" and mis-fire. The
174
- # gate only runs when a spec already exists, and stops on the empty sentinel.
175
- - id: guard_not_adopted
176
- condition: "{{spec_exists}} == true"
177
- action: verify_context
178
- require_non_empty: guard_sentinel
179
- on_empty: stop
180
- on_empty_message: "specs/ already has a spec.md for {{feature_name}} — adopt is a one-time baseline. For a change to an adopted slice use the CR delta loop (/aw-spec-orch specify → design → analyze-delta-design → implement-delta → build → finalize-delta → analyze-slice → close-delta); to re-adopt from scratch, remove the feature dir first."
181
-
182
- # 1b. Resolve this aggregate's OKF bundle concept → its source_files (the code
183
- # that IS the slice) + module dir. The INDEX adopt reverse-engineers FROM;
184
- # the code itself is the source of truth (read during authoring).
185
- - id: concept
186
- action: execute_script
187
- script: { ref: inventory }
188
- subcommand: concept
189
- args: ["--bundle", "{{bundle_dir}}", "--aggregate", "{{feature_name}}"]
190
- outputs:
191
- - { name: concept_exists, from: "$.exists" }
192
- - { name: concept_path, from: "$.concept_path" }
193
- - { name: source_files, from: "$.source_files" }
194
- - { name: source_count, from: "$.count" }
195
- - { name: module_dir, from: "$.module_dir" }
196
-
197
- # No feature-map concept for this name means one of two things, both handled by a
198
- # redirect (adopt reverses EXISTING code only): either onboard has not run, or this
199
- # is a NEW feature (no existing code) — which is developed via the forward pipeline,
200
- # not adopt.
201
- - id: require_concept
202
- action: verify_context
203
- require_true: concept_exists
204
- on_false: stop
205
- on_false_message: "No feature '{{feature_name}}' in the onboard feature map under {{bundle_dir}}. If you have not onboarded, run /aw-spec-orch onboard first, then use the exact feature name from {{bundle_dir}}/aggregates/index.md. If '{{feature_name}}' is a NEW feature (no existing code), do NOT adopt it — author it through the forward pipeline (/aw-spec-orch specify → design → implement), which onboard already made brownfield-ready."
206
-
207
- # Governance prerequisite (JIT contract): adopt RECONCILES this feature's evidence into
208
- # the governance onboard established (constitution + docs/domainspecs/<domain>/ pack).
209
- # Resolve the active domain now and require its rule map to exist — if it does not,
210
- # onboard has not established governance, and there is nothing for adopt to reconcile
211
- # into. (Reconciling into a project scaffold, never authoring from one feature, is what
212
- # keeps the constitution PROJECT-scoped — gap-fix #1.)
213
- - id: resolve_active_domain
214
- action: execute_script
215
- script: { ref: actions }
216
- subcommand: resolve-domain
217
- outputs:
218
- - { name: gov_domain, from: "$.domain" }
219
- - { name: rulemap_exists, from: "$.rulemap_exists" }
220
-
221
- - id: require_governance
222
- action: verify_context
223
- require_true: rulemap_exists
224
- on_false: stop
225
- on_false_message: "No active governance to reconcile into — run /aw-spec-orch onboard first. onboard establishes the PROJECT constitution + docs/domainspecs/<domain>/ rule pack (provisional-from-scan); adopt reconciles this feature's real evidence into it. Reversing '{{feature_name}}' without that scaffold would have no governance home."
226
-
227
- # 2. Scaffold the living docs. The SPEC reuses the forward spec-template (it is
228
- # tech-agnostic WHAT/WHY — no architectural bias). The DESIGN scaffolds from the
229
- # DEFAULT `design-template` — which /aw-spec-orch onboard REPLACED with the repo's
230
- # code-derived override (resolve_template Priority-1, reverse-engineered from the
231
- # code), so the reversed design's structural sections follow the code's own
232
- # architecture rather than a fixed greenfield layering, describing the system
233
- # as-built. (Falls back to the greenfield base if onboard has not run.) Both are
234
- # still normal forward docs (same identity + spine) that the CR delta loop consumes
235
- # unchanged. Then init active_version.json (v1.0).
236
- - id: scaffold_spec
237
- action: execute_script
238
- script: { ref: actions }
239
- subcommand: scaffold
240
- args: ["--feature-dir", "{{feature_dir}}", "--allow-existing"]
241
-
242
- - id: scaffold_design
243
- action: execute_script
244
- script: { ref: actions }
245
- subcommand: design-scaffold
246
- args: ["--feature-dir", "{{feature_dir}}"] # default `design-template` = onboard's code-derived override (greenfield base if onboard has not run)
247
- outputs:
248
- - { name: design_doc, from: "$.design_doc" }
249
-
250
- - id: version_init
251
- action: execute_script
252
- script: { ref: actions }
253
- subcommand: version-init
254
- args: ["--feature-dir", "{{feature_dir}}"]
255
-
256
- # 3. Pre-execution hooks.
257
- - id: resolve_pre_hooks
258
- action: execute_script
259
- script: { ref: actions }
260
- subcommand: resolve-hooks
261
- args: ["--phase", "before_adopt"]
262
- outputs:
263
- - { name: before_hooks, from: "$.hooks" }
264
- - id: dispatch_pre_hooks
265
- action: dispatch_hooks
266
- hooks_from_variable: before_hooks
267
-
268
- # ══════════════ REVERSE SPEC — from CODE, with DOMAIN authority ═════════════
269
- # The bundle concept is the INDEX (source_files, seam, open_questions); the
270
- # CODE is the source of truth. DDD is fed via context (NOT the sticky set) so
271
- # the spec is domain-classified but the technical/arch set stays off the spec.
272
- - id: ctx_reverse_spec
273
- action: build_context
274
- context:
275
- - { path: "{{spec_file}}" } # the scaffolded template = section structure
276
- - { path: "{{concept_path}}" } # the OKF concept: source_files, seam, open_questions
277
- - { path: docs/domain/domain-driven-design.md, optional: true } # DDD authority (classification)
278
- - { path: .aw-spec/memory/constitution.domain.md, optional: true } # the domain frame
279
- - id: reverse_spec
280
- action: agent_author
281
- include_standards: false # domain via context; technical/arch sticky set is for design
282
- output_target: { type: file, path: "{{spec_file}}" }
283
- task: |
284
- Reverse-engineer the MASTER specification (the target spec.md in context)
285
- for the aggregate '{{feature_name}}' FROM ITS CODE. The bundle concept (in
286
- context) is the INDEX — its `source_files` list the code that IS this slice;
287
- READ those files (under {{module_dir}}, listed below) as the SOURCE OF TRUTH.
288
- The concept is a summary; the CODE is authoritative — if they disagree, the
289
- code wins (and note the drift). Fill the template; preserve its section order.
290
-
291
- Capture what the code ACTUALLY DOES, as-built (bugs/quirks included), in the
292
- template's vocabulary:
293
- - The feature IS the aggregate; set the Aggregate field, keep US-1.
294
- - Each command / endpoint / use-case the code exposes is a USER STORY (US-n),
295
- never a separate feature. Derive its Given/When/Then from the code's paths.
296
- - System Requirements in EARS (THE SYSTEM SHALL / WHEN / IF…THEN / WHILE /
297
- WHERE), each atomic + testable, derived from observed behaviour.
298
- - Always-true invariants the code enforces → Business Rules (BR-n).
299
- - DDD (in context) IS the modelling standard: express the domain as a
300
- ubiquitous language, the aggregate + root, entities vs value objects, and
301
- aggregate-owned invariants — as domain MODEL, not code / not C# types.
302
- - DOMAIN LIFT — where the CODE enforces them, lift into the three sections
303
- (cite the source file): Constraints & NFRs (CN-, e.g. retention /
304
- immutability / append-only audit the code implements), Data Classification
305
- (DC-, sensitive fields + where they may/mustn't appear), Integration
306
- Contracts (IC-, external services/feeds the code calls). "None (as of v1.0)"
307
- if the code shows none — never delete a section.
308
- - Always include "## Success Criteria" with 2-4 measurable SC-nnn.
309
-
310
- PROVENANCE + honesty (this is a REVERSED spec):
311
- - Add `origin: reverse-engineered` to the spec's identity block (near Version).
312
- - Mark CONFIDENCE: where you had to INFER intent the code does not state
313
- outright, tag the item "(inferred)" and add a `[NEEDS CLARIFICATION: …]`
314
- marker (at most 3, highest-impact) or an Assumption — NEVER fabricate a
315
- rule the code does not exhibit. Behaviour that is clearly present is
316
- "(certain)".
317
- - Reference the source-map: note that legacy-artefact ↔ requirement links
318
- live in `specs/{{feature_name}}/source-map.md` (authored next).
319
- - This is v1.0: fill the Change History row; keep US-1's "Added: v1.0".
320
- - Business-facing + testable; NO implementation mechanics (an external interop
321
- OBLIGATION is an IC- requirement, never the adapter design).
322
-
323
- Source files to read (the slice's code): {{source_files}}
324
-
325
- # ═══════════ REVERSE DESIGN — from the reversed SPEC + CODE, AS-BUILT ═══════
326
- # Anchored to the reversed spec's ids (§4 Traceability → forward-compatible),
327
- # grounded in the code's ACTUAL structure, tech-agnostic. NO domain files (rule
328
- # partition). The scaffolded design.md IS onboard's code-derived `design-template`
329
- # override — its §2 component sections follow the code's own folders/modules, not a
330
- # fixed layering.
331
- - id: ctx_reverse_design
332
- action: build_context
333
- context:
334
- - { path: "{{design_doc}}" } # the scaffolded code-derived template = structure + embedded guidance
335
- - { path: "{{spec_file}}" } # the reversed spec = the ONLY domain input
336
- - { path: "{{concept_path}}" } # source_files + seam (structure hints)
337
- - { path: .aw-spec/DESIGN-FORMAT.md } # the HLD contract (see its Brownfield variant note)
338
- - { path: knowledge/architecture/overview.md, optional: true } # the as-built architecture (inventory) — cite, don't re-derive
339
- - { path: .aw-spec/memory/constitution.technical.md, optional: true } # technology base ONLY — no domain
340
- - id: reverse_design
341
- action: agent_author
342
- include_standards: true # the technical/architecture sticky set (reference only — the CODE wins)
343
- output_target: { type: file, path: "{{design_doc}}" }
344
- task: |
345
- Reverse-engineer the MASTER high-level design (the target design.md in
346
- context — it is the BROWNFIELD design template) — the tech-agnostic HLD that
347
- MEDIATES the reversed spec ↔ the existing code. Ground every element in the
348
- CODE (read the source files listed below) but ANCHOR each to a spec id from
349
- the reversed spec (in context) so §4 Traceability is complete and the doc is
350
- forward-compatible. Guidance: {{feature_name}}
351
-
352
- THE CODE IS THE SOURCE OF TRUTH — describe the system AS-BUILT. Do NOT reshape
353
- it toward any reference architecture; the technical standards in context are a
354
- vocabulary to NAME what you find, never a target to bend the code toward.
355
- Rules:
356
- - THE SPEC IS THE ONLY DOMAIN INPUT. You have the reversed spec + the code's
357
- actual STRUCTURE — and NO domain rule files. Realise the spec ids; introduce
358
- no domain rule the spec omits. A concept the code exhibits but the spec lacks
359
- → surface it (it belongs in the spec) and record a §5 DA-n; do not smuggle it in.
360
- - STRUCTURE FOLLOWS THE CODE. Fill §1.1 As-Built Architecture from the code's
361
- real shape (its folders / projects / modules — name the style, don't prescribe
362
- one). Then create ONE §2 subsection per structural axis the slice's code
363
- ACTUALLY has (its use-cases, endpoints/UI, persistence, external adapters,
364
- jobs, host/composition) — titled after the CODE's own units, NOT a fixed
365
- Domain/Application/API/Infrastructure layering. A component the code has that
366
- fits no textbook layer (a UI tier, a worker, a shared library) gets its own
367
- section; a layer the code lacks does NOT appear.
368
- - KEEP THE NEUTRAL ANCHORS (the template pins these): §1.2 is the domain/data
369
- MODEL and MUST match the spec's Key Entities / Business Rules (same names,
370
- cite BR-/CN-) with cross-slice References-by-id kept here; one §2 subsection
371
- is the EXTERNAL INTEGRATIONS table (heading contains "Integration") realising
372
- the spec's IC-. Realise CN- (structural → §1.2 invariants/events; retention/
373
- audit → §2 persistence / §3 cross-cutting), DC- (§3 + projection surface).
374
- - AS-BUILT DEBT, not architecture drift. §6 records ONLY debt the CODE ITSELF
375
- evidences — stubs/no-ops, dead or duplicate code, torn seams (shared table/
376
- transaction), TODOs, hard-coded values. The code being organised differently
377
- from any textbook layering is NOT debt — it is the as-built architecture (§1.1).
378
- The concrete stack lives in the source-map, NOT here.
379
- - TECHNOLOGY-AGNOSTIC: signatures + pre/post/invariant/raises pseudocode and
380
- field-shape contracts — NEVER language code. Conceptual types only.
381
- - Fill §4 Traceability completely (a row for EVERY FR/BR/CN/DC/IC/US/SC), and
382
- the §5 Assumptions (DA-n) / §6 As-Built Deviations (WA-n) ledgers.
383
- - Add `origin: reverse-engineered` near the Version field. This is v1.0.
384
- - Omit a section only if the slice genuinely has nothing there (say why); no
385
- complete code anywhere.
386
-
387
- Source files to read (the slice's code): {{source_files}}
388
-
389
- # ═══════════════ SOURCE MAP — the source anchor sidecar ════════════════════
390
- - id: ctx_source_map
391
- action: build_context
392
- context:
393
- - { path: .aw-spec/templates/source-map-template.md } # the sidecar structure
394
- - { path: "{{spec_file}}" }
395
- - { path: "{{design_doc}}" }
396
- - { path: "{{concept_path}}" } # the full source_files list to map
397
- - id: source_map
398
- action: agent_author
399
- include_standards: false
400
- output_target: { type: file, path: "{{feature_dir}}/source-map.md" }
401
- task: |
402
- Author the source-map sidecar (the target in context) from the template,
403
- for aggregate '{{feature_name}}'. It is the SOURCE ANCHOR of the traceability
404
- spine — it keeps spec.md / design.md clean while recording provenance here.
405
- - One row per legacy artefact in the bundle concept's `source_files` (read
406
- them under {{module_dir}}): map each to the spec ids (FR/BR/US/CN/DC/IC)
407
- and the design element (§/name) that now describe it, with CONFIDENCE
408
- (certain | inferred). EVERY source file MUST appear — the Fidelity gate
409
- checks full coverage both ways.
410
- - Also map DB tables, endpoints, and background jobs the slice owns.
411
- - Fill the Seam section: the boundary this slice owns (endpoint / table
412
- owner / queue / interface), and note whether it is self-contained or SHARES
413
- a transaction/table with another slice — a coupling fact for CR blast-radius
414
- analysis (not a migration item).
415
- - Record as-built quirks captured verbatim (candidate deviations), and any
416
- unmapped code / unanchored spec ids.
417
- - Baseline commit = the inventory HEAD.
418
- Source files to map: {{source_files}}
419
-
420
- # ═══════════════ FIDELITY — does spec+design describe the CODE? ═════════════
421
- # spec/design ↔ CODE (NOT spec ↔ design). The agent can READ the source files.
422
- # BLOCKING gaps = unmapped code / fabricated spec-or-design (structural). The
423
- # rest (inferred items, quirks, missing-invariant candidates) are REVIEW items
424
- # → written to an Adopt Review report and closed OUT OF BAND (Brownfield B1·R).
425
- - id: fidelity
426
- action: agent_query
427
- context:
428
- - "{{spec_file}}"
429
- - "{{design_doc}}"
430
- - "{{feature_dir}}/source-map.md"
431
- - "{{concept_path}}"
432
- include_standards: false
433
- schema: { ok: true, report_needed: false, blocking_gaps: [ { severity: "high", artefact: "<source file / spec id / design element>", kind: "unmapped-code | fabricated-spec | fabricated-design", detail: "<why>" } ], review_items: [ { kind: "inferred | as-built-quirk | missing-invariant | confidence", where: "<spec/design/source-map location>", note: "<what to confirm out of band>" } ] }
434
- mock: { ok: true, report_needed: false, blocking_gaps: [], review_items: [] }
435
- task: |
436
- FIDELITY CHECK — does the reversed spec.md + design.md actually describe the
437
- CODE (spec/design ↔ CODE, NOT spec ↔ design)? Use the source-map (in context)
438
- and READ the slice's source files (the concept's `source_files`, under
439
- {{module_dir}}). Classify findings:
440
- - BLOCKING (structural — set ok=false if any):
441
- (1) unmapped-code: a source file with NO spec/design home in the source-map;
442
- (2) fabricated-spec / fabricated-design: a spec id or design element with NO
443
- basis in the code (reverse-engineering must not invent behaviour).
444
- - REVIEW (does NOT block ok — these are the Adopt review worklist, closed out
445
- of band): items marked "(inferred)"; as-built quirks the code shows but the
446
- spec under-states; invariants the code enforces that may be missing/weak;
447
- confidence miscalibration (marked inferred but clearly certain, or vice versa).
448
- Set ok=true when there are NO blocking gaps (review_items may still be listed).
449
- Set report_needed=true if there is ANY blocking gap OR any review item.
450
- outputs:
451
- - { name: fidelity_ok, from: "$.ok" }
452
- - { name: report_needed, from: "$.report_needed" }
453
- - { name: blocking_gaps, from: "$.blocking_gaps" }
454
- - { name: review_items, from: "$.review_items" }
455
-
456
- # Write the Adopt Review report when there's anything to close out of band
457
- # (blocking gaps to fix, or review items to confirm). The B1·R worklist.
458
- - id: write_review_report
459
- condition: "{{report_needed}} == true"
460
- action: agent_author
461
- include_standards: false
462
- context: ["{{spec_file}}", "{{design_doc}}", "{{feature_dir}}/source-map.md"]
463
- output_target: { type: file, path: "{{feature_dir}}/adopt-review-report.md" }
464
- task: |
465
- Write an Adopt Review report (the target) for aggregate '{{feature_name}}' —
466
- the out-of-band worklist for this reverse-engineered baseline. Markdown:
467
- - "# Adopt Review — {{feature_name}}" + today's date + "origin: reverse-engineered".
468
- - "verdict:" line — "BLOCKING ✗ · <n>" if blocking gaps exist, else "REVIEW ○ · <m> item(s)".
469
- - "## Blocking gaps" (if any): table | # | kind | artefact | detail | — MUST be
470
- resolved before the slice is trustworthy (fix by re-reading the code / refining
471
- spec+design, then re-run adopt-review or re-adopt).
472
- Blocking gaps: {{blocking_gaps}}
473
- - "## Review items" (close out of band): table | # | kind | where | confirm |.
474
- These are inferred-vs-certain calls, as-built quirks, and missing-invariant
475
- candidates — confirm each against the code/SME, then fold the answer into
476
- spec.md (a resolved [NEEDS CLARIFICATION] / Assumption) or log a deviation.
477
- Review items: {{review_items}}
478
- - "## How to proceed": resolve blocking gaps first; then the slice is a normal
479
- feature — run /aw-spec-orch analyze-design (spec↔design gate) if desired, then
480
- drive every change through the CR delta loop. If a change edits untested legacy
481
- behaviour with blast radius, characterize just that surface first (optional
482
- on-touch fence) — it is not a required phase.
483
- Return the report markdown only.
484
-
485
- - id: fidelity_gate
486
- action: verify_context
487
- require_true: fidelity_ok
488
- on_false: stop
489
- on_false_message: "Fidelity FAILED for {{feature_name}} — the reversed spec/design do not match the code (blocking gaps: {{blocking_gaps}}). See specs/{{feature_name}}/adopt-review-report.md. Fix the unmapped code / remove fabricated items (re-read the source, refine spec.md + design.md + source-map.md), then re-run /aw-spec-orch adopt (after removing the dir) or resolve out of band."
490
-
491
- # ═══════════ OKF CONCEPT — COMPLETE the shallow scan concept (deep reverse) ═══
492
- # onboard wrote this aggregate's OKF concept SHALLOW (a discovery stub — enough to pick the
493
- # feature). Now that the deep reverse produced a TRUSTWORTHY spec.md + design.md +
494
- # source-map.md, COMPLETE the concept: deepen its detail to the reversed reality, LINK the
495
- # authored artifacts, refresh source_files, and mark it ADOPTED. RECONCILE, not rewrite —
496
- # keep OKF format + the bundle links; do NOT touch the Depends-On / Cross-References
497
- # sections (xref_record owns those, next). Runs only after fidelity passes (deepened from
498
- # trustworthy docs). The complement of the governance reconcile below — the DISCOVERY tier
499
- # (OKF) is completed here, the GOVERNANCE tier (constitution + rule pack) just after.
500
- - id: ctx_complete_concept
501
- action: build_context
502
- context:
503
- - { path: "{{concept_path}}" } # the shallow onboard concept to complete
504
- - { path: "{{spec_file}}" } # the deep reversed spec (entities, US, BR/CN/DC/IC)
505
- - { path: "{{design_doc}}" } # the deep reversed design (components, ports, integrations)
506
- - { path: "{{feature_dir}}/source-map.md" } # the source anchor (files, seam, quirks)
507
- - { path: .aw-spec/templates/okf-concept-template.md } # OKF v0.1 format authority
508
- - id: complete_concept
509
- action: agent_generate
510
- tools: "Read,Write,Edit"
511
- permission_mode: acceptEdits
512
- task: |
513
- COMPLETE the OKF aggregate concept for '{{feature_name}}' at {{concept_path}} — onboard
514
- wrote it SHALLOW (a discovery stub from the whole-repo scan). The deep reverse has now
515
- produced a TRUSTWORTHY spec.md + design.md + source-map.md (in context); deepen the
516
- concept to match and LINK those artifacts. Follow the OKF concept template in context.
517
- RECONCILE, do NOT rewrite:
518
- - DEEPEN the responsibilities + the owned entities / value objects / domain events /
519
- commands (user stories) / API endpoints / persistence to match the reversed spec +
520
- design — correct any drift the shallow scan got wrong (the deep docs win).
521
- - LINK the deep artifacts: add bundle links to specs/{{feature_name}}/spec.md, design.md,
522
- and source-map.md so the concept points at the deep truth.
523
- - Refresh `source_files` from the source-map (grouped by the code's OWN folders, per
524
- OKF), and set `timestamp` to the baseline (inventory HEAD) commit time.
525
- - Update frontmatter: keep `origin: reverse-engineered`; mark the concept ADOPTED /
526
- deep-reversed (no longer a shallow scan stub) and stamp `generated_by: aw-spec-adopt`.
527
- - Resolve any `open_questions` the deep reverse answered; keep the rest.
528
- - Do NOT touch the concept's Depends-On / Cross-References sections (xref_record
529
- maintains those next), and do NOT edit any OTHER aggregate concept.
530
- Append a one-line `log.md` entry (bundle root) under today's date noting '{{feature_name}}'
531
- was deep-adopted. Write ONLY {{concept_path}} (+ its dir index.md / bundle log.md if a
532
- link or description changed). Report what you deepened.
533
- outputs:
534
- - { name: concept_completed, from: "$.files" }
535
-
536
- # 3b. OKF cross-references (brownfield seed). The reversed design.md now names this
537
- # slice's cross-aggregate references (§1 References-by-id) + integration contracts
538
- # (its External integrations table, IC-); record them into the shared OKF bundle — a
539
- # Cross-References row in every
540
- # SIBLING aggregate this slice uses (their inventory concepts already exist, so this
541
- # resolves them rather than stubbing), plus this slice's own Depends-On. Same
542
- # reconcile-on-write helper as forward implement, stamped origin reverse-engineered,
543
- # additive to the inventory bundle. Runs only after fidelity passes.
544
- - id: xref_record
545
- action: execute_script
546
- script: { ref: xref }
547
- subcommand: record
548
- args: ["--using", "{{feature_name}}", "--design", "{{design_doc}}", "--bundle", "{{bundle_dir}}", "--origin", "reverse-engineered"]
549
- outputs:
550
- - { name: xref_wrote, from: "$.wrote" }
551
- - { name: xref_edge_count, from: "$.edge_count" }
552
-
553
- # ═══════════ GOVERNANCE RECONCILE — upgrade onboard's PROVISIONAL scaffold ═══
554
- # ⏸ HELD 2026-07-29: every step in this block is gated on `reconcile_governance`
555
- # (default "false"), so adopt currently does NOT touch the constitution halves
556
- # or the docs/domainspecs/<domain>/ rule pack — onboard's provisional scaffold
557
- # is left as-is. Flip the var to "true" (workflow vars) to restore the behaviour.
558
- # Now that this feature is reversed to a TRUSTWORTHY spec (real BR-/CN-/DC-/IC- ids)
559
- # + design (real code coordinates), reconcile that evidence INTO the governance
560
- # onboard established. RECONCILE, NOT re-author: fill provisional entries with this
561
- # feature's real ids; NEVER rewrite the project's principle set or another feature's
562
- # evidence. Runs only after fidelity passes (governance derived from trustworthy docs).
563
- # setup-constitution is idempotent (returns the paths without clobbering onboard's
564
- # content). compose-constitution re-renders the human view.
565
- - id: setup_constitution
566
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
567
- action: execute_script
568
- script: { ref: actions }
569
- subcommand: setup-constitution
570
- outputs:
571
- - { name: constitution_technical_file, from: "$.constitution_technical_file" }
572
- - { name: constitution_domain_file, from: "$.constitution_domain_file" }
573
-
574
- # RECONCILE the domain rule-file pack with THIS feature's real ids.
575
- - id: ctx_reconcile_pack
576
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
577
- action: build_context
578
- context:
579
- - { path: "{{spec_file}}" } # the feature's real BR-/CN-/DC-/IC-
580
- - { path: "{{design_doc}}" }
581
- - { path: "{{feature_dir}}/source-map.md" }
582
- - { path: "docs/domainspecs/{{gov_domain}}/comandrulemap.md", optional: true }
583
- - { path: .aw-spec/RULE-PARTITION.md } # the rule-partition authority (which command reads what)
584
- - id: reconcile_pack
585
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
586
- action: agent_generate
587
- tools: "Read,Write,Edit"
588
- permission_mode: acceptEdits
589
- task: |
590
- RECONCILE the domain rule-file pack docs/domainspecs/{{gov_domain}}/ with the
591
- newly-adopted feature '{{feature_name}}'. onboard authored these rule files from the
592
- whole-repo scan with per-feature specifics marked `PROVISIONAL — reconciled at
593
- adopt`. READ this feature's reversed spec.md + design.md + source-map.md (in
594
- context — the real evidence) and the EXISTING pack files under
595
- docs/domainspecs/{{gov_domain}}/.
596
-
597
- RECONCILE, do NOT re-author:
598
- - UPGRADE the provisional entries this feature now evidences: replace a
599
- `PROVISIONAL` placeholder with the concrete rule, CITING the feature's real spec
600
- ids (BR-/CN-/DC-/IC-/FR-). Leave provisional entries this feature does NOT touch
601
- as they are — a later adopt reconciles them.
602
- - ADD a `<concern>.domain.md` rule file ONLY if this feature evidences a concern the
603
- pack has none for, and wire it into comandrulemap.md under the correct partition
604
- heading. If a rule file already covers the concern, MERGE this feature's evidence
605
- into it — do NOT duplicate.
606
- - Do NOT rewrite the pack, re-scope it to this one aggregate, or remove another
607
- feature's evidence. The pack stays PROJECT-level; this feature is new evidence in it.
608
- - Preserve the RULE PARTITION in comandrulemap.md (constitution / specify / gate get
609
- the domain files; design / implement get None). Keep each file's frontmatter and
610
- note in `generated_by` that adopt reconciled '{{feature_name}}'.
611
- Write ONLY inside docs/domainspecs/{{gov_domain}}/. Report the files changed/added.
612
- outputs:
613
- - { name: pack_reconciled, from: "$.files" }
614
-
615
- # RECONCILE the TECHNICAL constitution: ground provisional principles in this feature's
616
- # real CODE COORDINATES (from the source-map). Domain-free.
617
- - id: ctx_reconcile_technical
618
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
619
- action: build_context
620
- context:
621
- - { path: "{{constitution_technical_file}}" }
622
- - { path: "{{design_doc}}" }
623
- - { path: "{{feature_dir}}/source-map.md" }
624
- - id: reconcile_technical
625
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
626
- action: agent_author
627
- include_standards: false
628
- output_target: { type: file, path: "{{constitution_technical_file}}" }
629
- task: |
630
- RECONCILE the TECHNICAL constitution (target in context) with the adopted feature
631
- '{{feature_name}}'. onboard discovered the technology principle SET from the scan and
632
- marked per-feature code coordinates `PROVISIONAL`. READ this feature's design.md +
633
- source-map.md (in context — the code-coordinate bridge: real file paths / type names).
634
-
635
- RECONCILE, do NOT re-author:
636
- - Where a principle is PROVISIONAL and THIS feature's code now evidences it, replace
637
- the placeholder with the real CODE COORDINATE (file path / type name from the
638
- source-map) — keep the principle's wording; just ground it.
639
- - Do NOT change the principle SET, re-number, or re-scope the constitution to this
640
- aggregate. Add a NEW technology principle ONLY if this feature reveals a project-
641
- level technology trait onboard genuinely missed (cite the code coordinate) — rare.
642
- - Ignore the source-map's domain spec-ids / entity semantics (those belong to the
643
- domain half). Stay domain-agnostic.
644
- - Bump CONSTITUTION_VERSION by semver; prepend a one-line note to the Sync Impact
645
- Report ("reconciled from adopt {{feature_name}}: <principles grounded>"). Preserve
646
- heading hierarchy + every other principle. ISO YYYY-MM-DD dates.
647
- Return the complete updated technical constitution content only.
648
- - id: reconcile_technical_lint
649
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
650
- action: loop
651
- while: "{{technical_ok}} != true"
652
- max_iterations: 3
653
- steps:
654
- - id: rt_lint
655
- action: execute_script
656
- script: { ref: actions }
657
- subcommand: constitution-verify
658
- args: ["--file", "{{constitution_technical_file}}"]
659
- outputs:
660
- - { name: technical_ok, from: "$.ok" }
661
- - { name: technical_issues, from: "$.issues" }
662
- - id: rt_break
663
- action: break
664
- condition: "{{technical_ok}} == true"
665
- - id: rt_patch
666
- action: agent_author
667
- context: ["{{constitution_technical_file}}"]
668
- include_standards: false
669
- output_target: { type: file, path: "{{constitution_technical_file}}" }
670
- task: |
671
- Fix these mechanical defects in the technical constitution (target in context),
672
- changing NOTHING else — preserve every principle, the heading hierarchy, and the
673
- Sync Impact Report. Fill any listed [ALL_CAPS] placeholder (or a justified
674
- TODO(<FIELD>): reason); make the body version AGREE with the Sync Impact Report;
675
- ISO YYYY-MM-DD dates. Defects: {{technical_issues}}
676
- Return the complete updated technical constitution content only.
677
-
678
- # RECONCILE the DOMAIN constitution: ground provisional domain principles in this
679
- # feature's real spec ids; CONTINUE (do not renumber) the technical numbering.
680
- - id: ctx_reconcile_domain
681
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
682
- action: build_context
683
- context:
684
- - { path: "{{constitution_domain_file}}" }
685
- - { path: "{{constitution_technical_file}}" }
686
- - { path: "{{spec_file}}" }
687
- - { path: "docs/domainspecs/{{gov_domain}}/comandrulemap.md", optional: true }
688
- - id: reconcile_domain
689
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
690
- action: agent_author
691
- include_standards: false
692
- output_target: { type: file, path: "{{constitution_domain_file}}" }
693
- task: |
694
- RECONCILE the DOMAIN addenda constitution (target in context) with the adopted
695
- feature '{{feature_name}}'. onboard authored the domain principles from the scan and
696
- marked per-feature specifics `PROVISIONAL`. READ this feature's spec.md (in context
697
- — real BR-/CN-/DC-/IC- + ubiquitous language) + the reconciled pack (comandrulemap).
698
-
699
- RECONCILE, do NOT re-author:
700
- - Where a domain principle is PROVISIONAL and this feature evidences it, ground it in
701
- the feature's real spec ids — keep the principle TITLED by DOMAIN CONCERN (not the
702
- aggregate name), so it still holds when a later feature enters the same context.
703
- - Do NOT re-number or re-scope to this aggregate. Continue the technical half's
704
- numbering (read constitution.technical.md for its last numeral). Add a NEW domain
705
- principle ONLY if this feature reveals a project-level domain concern onboard missed.
706
- - Bump CONSTITUTION_VERSION by semver; prepend a one-line Sync Impact Report note
707
- ("reconciled from adopt {{feature_name}}"). Preserve heading hierarchy + other
708
- principles. NO residual [BRACKET] token may remain. ISO YYYY-MM-DD dates.
709
- Return the complete updated domain addenda content only.
710
- - id: reconcile_domain_lint
711
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
712
- action: loop
713
- while: "{{domain_ok}} != true"
714
- max_iterations: 3
715
- steps:
716
- - id: rd_lint
717
- action: execute_script
718
- script: { ref: actions }
719
- subcommand: constitution-verify
720
- args: ["--file", "{{constitution_domain_file}}"]
721
- outputs:
722
- - { name: domain_ok, from: "$.ok" }
723
- - { name: domain_issues, from: "$.issues" }
724
- - id: rd_break
725
- action: break
726
- condition: "{{domain_ok}} == true"
727
- - id: rd_patch
728
- action: agent_author
729
- context: ["{{constitution_domain_file}}"]
730
- include_standards: false
731
- output_target: { type: file, path: "{{constitution_domain_file}}" }
732
- task: |
733
- Fix these mechanical defects in the domain addenda constitution (target in
734
- context), changing NOTHING else — preserve every principle, the heading
735
- hierarchy, and the Sync Impact Report. Fill any listed [ALL_CAPS] placeholder
736
- (or a justified TODO(<FIELD>): reason); make the body version AGREE with the
737
- Sync Impact Report; ISO YYYY-MM-DD dates. Defects: {{domain_issues}}
738
- Return the complete updated domain addenda content only.
739
-
740
- - id: recompose_constitution
741
- condition: "{{reconcile_governance}} == true" # HELD — governance reconcile paused (see vars)
742
- action: execute_script
743
- script: { ref: actions }
744
- subcommand: compose-constitution
745
- outputs:
746
- - { name: composed_file, from: "$.composed_file" }
747
-
748
- # 4. Post-execution hooks.
749
- - id: resolve_post_hooks
750
- action: execute_script
751
- script: { ref: actions }
752
- subcommand: resolve-hooks
753
- args: ["--phase", "after_adopt"]
754
- outputs:
755
- - { name: after_hooks, from: "$.hooks" }
756
- - id: dispatch_post_hooks
757
- action: dispatch_hooks
758
- hooks_from_variable: after_hooks
759
-
760
- outputs:
761
- feature_dir: "{{feature_dir}}"
762
- spec_file: "{{spec_file}}"
763
- design_doc: "{{design_doc}}"
764
- source_map: "{{feature_dir}}/source-map.md"
765
- aggregate: "{{feature_name}}"
766
- source_count: "{{source_count}}"
767
- review_items: "{{review_items}}"
768
- concept_completed: "{{concept_completed}}"
769
- xref_edge_count: "{{xref_edge_count}}"
770
- gov_domain: "{{gov_domain}}"
771
- pack_reconciled: "{{pack_reconciled}}"
772
- composed_file: "{{composed_file}}"
773
- technical_reconcile_ok: "{{technical_ok}}"
774
- domain_reconcile_ok: "{{domain_ok}}"
775
- next: "Adopted {{feature_name}} (spec.md + design.md + source-map.md, v1.0) and COMPLETED its OKF concept (deepened + linked the deep artifacts; {{xref_edge_count}} cross-slice edge(s) recorded). NOTE — governance reconcile is currently HELD (reconcile_governance=false): this run did NOT modify the constitution halves or the docs/domainspecs/{{gov_domain}}/ rule pack, so they keep onboard's provisional scaffold. Close any items in specs/{{feature_name}}/adopt-review-report.md out of band. The slice is now a NORMAL feature: refine via /aw-spec-orch analyze-design, then drive every change through the CR delta loop (/aw-spec-orch specify → design → analyze-delta-design → implement-delta → build → finalize-delta → analyze-slice → close-delta). If a change edits untested legacy behaviour with blast radius, characterize just that surface first (optional on-touch fence). To restore governance reconcile, set reconcile_governance to \"true\" in the workflow vars."