aw-spec-cli 0.1.5 → 0.1.7

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 +1 -1
  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,22 +0,0 @@
1
- # ATC — WHO Anatomical Therapeutic Chemical Classification
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## Value Object
6
- - ATC is the **`AtcCode` value object** — immutable, equality by value (see [[domain-driven-design.domain]]); carries code, ATC system URI, **ATC edition/version** (WHO updates annually), display.
7
- - Free-text storage of a therapeutic class is a Forbidden Pattern.
8
-
9
- ## Multiplicity
10
- - **Multiple ATC codes MAY attach to one `MedicinalProduct`** (a collection of `AtcCode` VOs).
11
- - The 7-character hierarchy (anatomical → therapeutic → pharmacological → chemical subgroup → substance) SHALL be representable; level is derivable from code length.
12
-
13
- ## Validation
14
- - **ATC codes SHALL be validated against configured code sets** — the bound edition is value-set data via the Terminology module (see [[terminology]]).
15
- - An ATC code absent from the configured set is rejected; the Domain MUST NOT persist an unvalidated ATC code; never invent ATC codes (see [[ai-rules.domain]]).
16
- - Changing a product's ATC is a **classification change** — audit-mandatory (see [[auditing.domain]]).
17
-
18
- ## FHIR mapping
19
- - ATC → FHIR `Medication.code` / `MedicationKnowledge` classification codings (`CodeableConcept`, ATC system URI) (see [[fhir]]).
20
-
21
- ## Related
22
- - [[terminology]] · [[domain-driven-design.domain]] · [[fhir]] · [[auditing.domain]] · [[ai-rules.domain]]
@@ -1,90 +0,0 @@
1
- # Auditing — Pharma Domain Addenda
2
-
3
- > Technology base: [[auditing]]. NON-NEGOTIABLE. Consumed by `/aw-spec-specify` (LIFTS the
4
- > auditing requirement into the spec) and `/aw-spec-gate` (VALIDATES the spec/design realise it).
5
- > `/aw-spec-design` and `/aw-spec-implement` never load this file — auditing reaches them through
6
- > the spec's **declared audit level per aggregate**, and the enablement mechanics live in the
7
- > technical base [[auditing]]. Keep this file technology-agnostic (levels + rules, **no code**).
8
-
9
- ## Two auditing levels (framework-supported)
10
-
11
- AppWeaver auditing has exactly **two levels**; the framework's audit interceptor populates every
12
- audit field automatically (handlers NEVER assign audit fields):
13
-
14
- | Level | Captures | Depth |
15
- |---|---|---|
16
- | **Basic** | who/when lifecycle — created / modified / (soft-)deleted, by whom and when; one audit entry per aggregate root per save (who · action · resource type · resource id · timestamp · correlation) | entity-level (Created/Updated/Deleted) — **no** before/after values |
17
- | **Advanced** | everything Basic captures **plus field-level before/after** — each changed property's previous → new value | entity-level **+ property-level previous/new value** |
18
-
19
- - **Advanced is REQUIRED whenever the spec asks for "previous value / new value"** — before/after
20
- values exist ONLY at the Advanced tier.
21
- - Child entities fold their changes into the owning aggregate root's audit entry.
22
-
23
- > Code realisation — marker interfaces (Basic = `IAuditedObject` / `IFullAuditedObject`; Advanced =
24
- > `+ IFieldAudited`), the one-time composition, and the audit query API — lives in the technical
25
- > base. See [[auditing]]; `/aw-spec-design` and `/aw-spec-implement` get the HOW from there.
26
-
27
- ## Aggregate assignment rule (how specify decides the level)
28
-
29
- `/aw-spec-specify` MUST assign an audit level to every aggregate it models and LIFT it into the
30
- spec as an explicit, developer-editable declaration:
31
-
32
- - The **main aggregate** of the requirement (the aggregate root the story is about) → **Advanced**.
33
- - **Supporting aggregates** (collaborating/referenced roots) → **Basic** by default.
34
- - A developer MAY raise or lower a level afterwards by editing the spec declaration — the level is
35
- a **spec** decision, never a design or implementation one. `/aw-spec-design` then follows the
36
- declared level.
37
-
38
- Lift it as one line the gate can check, e.g. under Constraints:
39
-
40
- > **CN-0xx**: Auditing level — `<MainAggregate>` uses **Advanced** (field-level before/after)
41
- > auditing; `<SupportingAggregate…>` use **Basic** (lifecycle) auditing; creation is
42
- > audit-mandatory and append-only. — lifted from auditing.domain.
43
-
44
- Declare the **level** — do NOT enumerate the audit record's field shape in the spec (next section).
45
-
46
- ## Spec-required vs framework-emitted (what the gate checks)
47
-
48
- The audit record's field shape is **framework-emitted** — the interceptor populates it; it is NOT
49
- spec-authored content. Fields the platform always supplies:
50
-
51
- - `resourceType`, `resourceId`, `correlationId`, `tenantId`, and the physical record layout.
52
-
53
- Split for the gate:
54
-
55
- - **Spec-required** (specify lifts it; the gate checks the spec + design carry it): the **audit
56
- level per aggregate**; that creation is **audit-mandatory** and **append-only**; and the
57
- business-meaningful capture — **User, Timestamp, Action, Previous Value, New Value** (the last
58
- two imply Advanced).
59
- - **Framework-emitted** (NEVER a spec/design gap — always populated by the platform): the fields
60
- listed above. The gate MUST NOT raise a LIFT-FAILURE for them; they are guaranteed by the
61
- framework, not authored in the spec.
62
-
63
- ## Queryable audit (framework-provided)
64
-
65
- The audit store is queryable out of the box (by resource identity, by user, by tenant, and by
66
- action/time with paging — see [[auditing]]). A spec "queryable creation audit record for
67
- compliance" success criterion is therefore satisfied by the framework's audit query API; design
68
- references it and does **NOT** need a bespoke audit read port/model.
69
-
70
- ## Setup (pharma)
71
-
72
- - Auditing is **MANDATORY** for `MedicinalProduct` (**Advanced**) and its child entities
73
- (`ActiveIngredient`, `PackagingConfiguration`, `MarketingAuthorization` — folded into the
74
- product's audit entry).
75
- - Audit-mandatory operations: product **creation**, **modification**, **retirement**
76
- (Discontinued/Withdrawn), **identifier changes** (NDC / Package NDC), **classification changes**
77
- (ATC) — plus every lifecycle transition and authorized admin action (see
78
- [[product-lifecycle.domain]], [[ndc]], [[atc]]).
79
-
80
- ## Immutability & retention
81
-
82
- - Audit records (log · entity change · property change) are **append-only** — no update, no delete
83
- (see [[domain-driven-design.domain]], [[persistence.domain]]).
84
- - Retained per regulatory policy, queryable for the full window; exportable, MAY project to FHIR
85
- `AuditEvent` / `Provenance` (see [[fhir]], [[data-provenance]]).
86
- - Audit + domain events + version snapshots give end-to-end traceability (see
87
- [[regulatory-compliance]], [[eventing.domain]]).
88
-
89
- ## Related
90
- - [[auditing]] · [[regulatory-compliance]] · [[data-provenance]] · [[persistence.domain]] · [[product-lifecycle.domain]] · [[ndc]] · [[atc]] · [[cqrs.domain]] · [[eventing.domain]] · [[fhir]] · [[domain-driven-design.domain]]
@@ -1,25 +0,0 @@
1
- # Authorization — Pharma Domain Addenda
2
-
3
- > Technology base: [[authorization]]. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Roles
6
- `SystemAdmin`, `RegulatoryOfficer`, `ProductSteward`, `TerminologyManager`, `DataManager`, `ReadOnlyConsumer`, `ExternalSystem`. Per-route matrix: `docs/security/authorization-matrix.md`.
7
-
8
- ## Change authority
9
- - **Only `RegulatoryOfficer`** performs guarded lifecycle transitions — approve / activate / discontinue / withdraw (see [[product-lifecycle.domain]]).
10
- - `ProductSteward` creates/edits a `Draft` and submits for review; MUST NOT approve/activate/retire.
11
- - **NDC and ATC changes require `RegulatoryOfficer`** authority (or `ProductSteward` + documented `RegulatoryOfficer` sign-off) (see [[ndc]], [[atc]], [[auditing.domain]]).
12
- - `TerminologyManager` owns `CodeSystem`/`ValueSet`/`ConceptMap` + version changes (see [[terminology]]).
13
- - `DataManager` runs external imports; each attaches a `ProvenanceRecord` (see [[data-provenance]]).
14
-
15
- ## Scope enforcement
16
- - FHIR endpoints scope-enforced (`system/Medication.read`, `system/Substance.read`, `system/*.write` for authorized backends). **No patient-context (SMART) scope** — product master data, not patient data (see [[fhir]], [[zero-trust.domain]]).
17
-
18
- ## Audit-mandatory
19
- Every product create/modify/retire, identifier change, classification change, lifecycle transition, terminology change, external import, privileged admin/role change (see [[auditing.domain]]).
20
-
21
- ## Anonymous allowlist
22
- - `/fhir/metadata` (CapabilityStatement) and `/health`; no write or product-data endpoint is anonymous (see [[fhir]]).
23
-
24
- ## Related
25
- - [[authorization]] · [[product-lifecycle.domain]] · [[ndc]] · [[atc]] · [[terminology]] · [[data-provenance]] · [[auditing.domain]] · [[data-classification.domain]] · [[fhir]] · [[zero-trust.domain]]
@@ -1,28 +0,0 @@
1
- # Coding Standards — Pharma Domain Addenda
2
-
3
- > Technology base: [[coding-standards]]. Commands: `/aw-spec-gate`.
4
-
5
- ## Coded value objects
6
- - Follow the FHIR pattern: `Codeable`, `Coding`, `Quantity`, `Ratio`, `Identifier` (see [[terminology]], [[fhir]]).
7
- - Spec-mandated names: `NdcCode`, `ProductName`, `GenericName`, `Strength`, `DosageForm`, `RouteOfAdministration`, `AtcCode`, `MarketingStatus`, `PackageIdentifier` (see [[domain-driven-design.domain]]).
8
- - Domain may throw `InvalidNdcException`, `InvalidLifecycleTransitionException`, `UnvalidatedCodeException` (see [[ndc]], [[product-lifecycle.domain]], [[terminology]]).
9
-
10
- ## Forbidden patterns — extend [[coding-standards]]
11
- - **P1.** Hard delete of a `MedicinalProduct`, version history, or `AuditRecord` — use lifecycle retirement / logical delete (see [[persistence.domain]], [[product-lifecycle.domain]]).
12
- - **P2.** Hard-coded NDC/Labeler/ATC/UNII/RxNorm/SNOMED literals outside the Terminology seed (see [[terminology]], [[ndc]], [[atc]]).
13
- - **P3.** Storing NDC, dosage form, route, ATC, or strength as **free text** when a value object/code applies (see [[terminology]]).
14
- - **P4.** A second FHIR write path bypassing the aggregate (see [[fhir]]).
15
- - **P5.** Persisting a product with an invalid NDC, dosage form, route, or unvalidated ATC code (see [[ndc]], [[atc]], [[terminology]]).
16
- - **P6.** Mutating a contained entity (`ActiveIngredient`/`PackagingConfiguration`/`MarketingAuthorization`) outside the aggregate root (see [[domain-driven-design.domain]]).
17
- - **P7.** Allowing an invalid lifecycle transition or removing a transition guard (see [[product-lifecycle.domain]]).
18
- - **P8.** Exposing `Draft`/pre-market product data on the public surface (see [[data-classification.domain]]).
19
-
20
- ## Quality gates — extend [[coding-standards]]
21
- - **PG1.** FHIR CapabilityStatement regenerates cleanly; FHIR validator passes for every modified Medication/MedicationKnowledge/Substance/Organization resource (see [[fhir]]).
22
- - **PG2.** No invented NDC/ATC/UNII/RxNorm/SNOMED codes — codes resolve against value sets (grep + tests; see [[terminology]]).
23
- - **PG3.** NDC uniqueness + format + duplicate-detection tests pass (see [[ndc]]).
24
- - **PG4.** Lifecycle state-machine tests pass — every allowed + every rejected transition (see [[product-lifecycle.domain]], [[testing.domain]]).
25
- - **PG5.** Audit-emission tests cover create/modify/retire/identifier/classification with required fields (see [[auditing.domain]]).
26
-
27
- ## Related
28
- - [[coding-standards]] · [[terminology]] · [[ndc]] · [[atc]] · [[fhir]] · [[domain-driven-design.domain]] · [[product-lifecycle.domain]] · [[persistence.domain]] · [[data-classification.domain]] · [[auditing.domain]] · [[testing.domain]]
@@ -1,108 +0,0 @@
1
- # Pharma Domain — Command → Rule-File Map
2
-
3
- Per-command list of the **pharma domain** rule files loaded (via `resolve-domain` +
4
- the `domain-select` module, into the sticky standards set) for the spec-anchored
5
- orchestrator pipeline.
6
-
7
- **The model (see `.aw-spec/RULE-PARTITION.md`):** domain files feed
8
- only three consumers — **specify** (authors them into the spec as FR/BR/CN-/DC-/IC-),
9
- **constitution** (the domain principles), and the **gates** (conformance checklist).
10
- **design** and **implement** load **NO** domain file — the domain reaches them solely
11
- through the spec/design (as CN-/DC-/IC- ids). This is what keeps design authoring from
12
- the spec + technical standards and the tech base swappable.
13
-
14
- - All paths are workspace-relative and live in `docs/domainspecs/pharma/`.
15
- - `resolve-domain --command <name>` collects the `- ` bullets under `## /<name>`.
16
- - This file is the **canonical source** for the pharma domain mapping; `/aw-spec-orch
17
- select-domain` selects this folder as active.
18
-
19
- ---
20
-
21
- ## /aw-spec-constitution
22
- <!-- Domain identity/regulatory/interop sources that become domain principles XVI+ in
23
- constitution.domain.md (authored from docs/pharma-constitution.my-ref.md + these). -->
24
- - docs/domainspecs/pharma/domain-requirements.md
25
- - docs/domainspecs/pharma/ndc.md
26
- - docs/domainspecs/pharma/idmp.md
27
- - docs/domainspecs/pharma/atc.md
28
- - docs/domainspecs/pharma/terminology.md
29
- - docs/domainspecs/pharma/pharma-terms.md
30
- - docs/domainspecs/pharma/product-lifecycle.domain.md
31
- - docs/domainspecs/pharma/regulatory-compliance.md
32
- - docs/domainspecs/pharma/data-provenance.md
33
- - docs/domainspecs/pharma/fhir.md
34
- - docs/domainspecs/pharma/hl7.md
35
- - docs/domainspecs/pharma/data-classification.domain.md
36
- - docs/domainspecs/pharma/auditing.domain.md
37
- - docs/domainspecs/pharma/authorization.domain.md
38
- - docs/domainspecs/pharma/zero-trust.domain.md
39
- - docs/domainspecs/pharma/ai-rules.domain.md
40
-
41
- ## /aw-spec-specify
42
- <!-- The FULL domain set. Specify models the domain COMPLETELY and LIFTS the constraint
43
- overlays into the spec's CN-/DC-/IC- sections (design/implement never see these files). -->
44
- - docs/domainspecs/pharma/domain-requirements.md
45
- - docs/domainspecs/pharma/domain-driven-design.domain.md
46
- - docs/domainspecs/pharma/product-lifecycle.domain.md
47
- - docs/domainspecs/pharma/ndc.md
48
- - docs/domainspecs/pharma/idmp.md
49
- - docs/domainspecs/pharma/atc.md
50
- - docs/domainspecs/pharma/pharma-terms.md
51
- - docs/domainspecs/pharma/terminology.md
52
- - docs/domainspecs/pharma/integration-terms.md
53
- - docs/domainspecs/pharma/regulatory-compliance.md
54
- - docs/domainspecs/pharma/data-provenance.md
55
- - docs/domainspecs/pharma/fhir.md
56
- - docs/domainspecs/pharma/hl7.md
57
- - docs/domainspecs/pharma/data-classification.domain.md
58
- - docs/domainspecs/pharma/persistence.domain.md
59
- - docs/domainspecs/pharma/cqrs.domain.md
60
- - docs/domainspecs/pharma/eventing.domain.md
61
- - docs/domainspecs/pharma/auditing.domain.md
62
- - docs/domainspecs/pharma/authorization.domain.md
63
- - docs/domainspecs/pharma/zero-trust.domain.md
64
- - docs/domainspecs/pharma/api-versioning.domain.md
65
- - docs/domainspecs/pharma/vertical-slices.domain.md
66
-
67
- ## /aw-spec-design
68
- _None — design loads no domain file. Domain reaches design only through the spec (BR-/CN-/DC-/IC-)._
69
-
70
- ## /aw-spec-implement
71
- _None — implement loads no domain file. Domain reaches implement only through design.md. Framework
72
- components are added separately via `/aw-spec-orch add-component`._
73
-
74
- ## /aw-spec-gate
75
- <!-- Conformance checklist for the gates (analyze-design · analyze-slice): the domain-derived
76
- constraints design/implement were NOT given as authoring input, VALIDATED against the
77
- output. Domain re-enters here as a check, never as authoring input. -->
78
- - docs/domainspecs/pharma/persistence.domain.md
79
- - docs/domainspecs/pharma/cqrs.domain.md
80
- - docs/domainspecs/pharma/eventing.domain.md
81
- - docs/domainspecs/pharma/auditing.domain.md
82
- - docs/domainspecs/pharma/authorization.domain.md
83
- - docs/domainspecs/pharma/zero-trust.domain.md
84
- - docs/domainspecs/pharma/data-classification.domain.md
85
- - docs/domainspecs/pharma/api-versioning.domain.md
86
- - docs/domainspecs/pharma/vertical-slices.domain.md
87
- - docs/domainspecs/pharma/folder-structure.domain.md
88
- - docs/domainspecs/pharma/coding-standards.domain.md
89
- - docs/domainspecs/pharma/dependency-policy.domain.md
90
- - docs/domainspecs/pharma/testing.domain.md
91
- - docs/domainspecs/pharma/ai-rules.domain.md
92
-
93
- ---
94
-
95
- ## Quick reference (command → domain file count)
96
-
97
- | Command | Domain rule files | Role |
98
- |---|---|---|
99
- | /aw-spec-constitution | 16 | domain principles (XVI+) |
100
- | /aw-spec-specify | 22 | author into spec (lift → CN-/DC-/IC-) |
101
- | /aw-spec-design | 0 | none — spec is the only domain input |
102
- | /aw-spec-implement | 0 | none — design is the only domain input |
103
- | /aw-spec-gate | 14 | conformance checklist (validate, don't author) |
104
-
105
- > Retired in the orchestrator pipeline: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-taskplan`,
106
- > `/aw-spec-clarify`, `/aw-spec-analyze` (clarify folds into specify; plan/tasks into design). The
107
- > collapsed tiers `/aw-spec-fast-implement` and `/aw-spec-minimal-implementation` are pending a ruling
108
- > (they fold design+implement into one pass, which needs internal context staging to keep the partition).
@@ -1,119 +0,0 @@
1
- # Pharma Domain — Command → Technical-Rule-File Map
2
-
3
- Per-command list of the **technical** rule files loaded (via `resolve-tech` + the
4
- `tech-select` module, into the sticky standards set) for the spec-anchored
5
- orchestrator pipeline. This is the technical counterpart of `comandrulemap.md`
6
- (which maps the DOMAIN rule files).
7
-
8
- **The model:** the technical rule files (the `docs/architecture` · `docs/security` ·
9
- `docs/interop` · `docs/governance` set that used to be HARDCODED in each workflow's
10
- `standards:` block) are now CONFIGURATION — tune this map, not the workflows. The
11
- technology base itself (`constitution.technical.md`) is NOT listed here — every
12
- consumer still refers to it directly, as-is.
13
-
14
- - All paths are workspace-relative technical rule files (domain-agnostic docs/…).
15
- - `resolve-tech --command <name>` collects the `- ` bullets under `## /<name>`.
16
- - This file is the **canonical technical mapping** for the pharma domain; it is
17
- selected whenever pharma is the active domain (`.aw-spec/domain.json`).
18
- - A command with no heading here loads no mapped technical file (only the workflow's
19
- universal `ai-rules.md` seed + `constitution.technical.md`, referred to directly).
20
- - `## /aw-spec-specify` is the one **modelling-methodology** slot (see the rule partition):
21
- a domain-agnostic way of *modelling*, never a technology choice. Everything below it is a
22
- HOW-phase technical set.
23
-
24
- ---
25
-
26
- ## /aw-spec-specify
27
- <!-- MODELLING METHODOLOGY ONLY. Specify is the domain phase: the single technical input it
28
- may take is a domain-agnostic way of MODELLING (DDD tactical patterns), never a
29
- technology choice. Do NOT add an architecture / persistence / codegen file here — that
30
- would break specify's domain purity (design/implement own those). The domain's own DDD
31
- overlay (domain-driven-design.domain.md) arrives separately via comandrulemap. -->
32
- - docs/domain/domain-driven-design.md
33
-
34
- ## /aw-spec-design
35
- <!-- The technical/architecture rule files the design author works from (alongside the
36
- spec and constitution.technical.md). NO domain file here — domain reaches design
37
- only as spec ids (BR-/CN-/DC-/IC-). -->
38
- - docs/architecture/clean-architecture.md
39
- - docs/architecture/cqrs.md
40
- - docs/architecture/eventing.md
41
- - docs/architecture/modular-monolith.md
42
- - docs/architecture/vertical-slices.md
43
- - docs/architecture/persistence.md
44
- - docs/architecture/folder-structure.md
45
- - docs/architecture/testing.md
46
- - docs/governance/api-versioning.md
47
- - docs/security/zero-trust.md
48
- - docs/security/authorization.md
49
- - docs/security/authorization-matrix.md
50
- - docs/security/auditing.md
51
- - docs/security/data-classification.md
52
- - docs/interop/ihe-conformance.md
53
-
54
- ## /aw-spec-implement
55
- <!-- The FRAMEWORK / code-generation rule files the code generator builds against
56
- (alongside design.md and constitution.technical.md). NO domain file — domain
57
- reaches implement only through design.md. clean-architecture/cqrs are design
58
- concerns; component wiring is a separate /aw-spec-orch add-component step. -->
59
- - docs/governance/coding-standards.md
60
- - docs/governance/dependency-policy.md
61
- - docs/architecture/folder-structure.md
62
- - docs/architecture/testing.md
63
- - docs/VerticalSlice/PACKAGING.md
64
-
65
- ## /aw-spec-implement-delta
66
- <!-- The CR analog of implement — same FRAMEWORK / code-generation set (HOW to build).
67
- The delta's code is generated against the master design.md + delta-design.md; no
68
- domain file (domain reached the delta via delta-spec → delta-design). -->
69
- - docs/governance/coding-standards.md
70
- - docs/governance/dependency-policy.md
71
- - docs/architecture/folder-structure.md
72
- - docs/architecture/testing.md
73
- - docs/VerticalSlice/PACKAGING.md
74
-
75
- ## /aw-spec-build
76
- <!-- The compile/fix reference set: the layering + coding rules the fixer respects when
77
- repairing compile errors against the design intent. NO domain file (build loads
78
- domain rules separately via domain-select) and no constitution.technical here. -->
79
- - docs/architecture/clean-architecture.md
80
- - docs/governance/coding-standards.md
81
-
82
- ## /aw-spec-analyze-slice
83
- <!-- The design↔code conformance gate's TECHNICAL checklist: the code + tests are
84
- validated against these (alongside the DOMAIN gate overlays, loaded separately via
85
- resolve-domain `## /aw-spec-gate`). Validation input only — never authoring. -->
86
- - docs/architecture/testing.md
87
- - docs/governance/coding-standards.md
88
-
89
- ## /aw-spec-constitution
90
- <!-- The technology-constitution base the TECHNICAL half of the split constitution
91
- ratifies into constitution.technical.md. Loaded BEFORE the technical half and before
92
- domain-select, so the technical author stays domain-free (the seam). NO domain file
93
- here — the domain half's sources are the domain map's ## /aw-spec-constitution. -->
94
- - docs/technology-constitution.md
95
-
96
- ## /aw-spec-run
97
- <!-- Execution / data migration: the persistence rules the migration step generates against.
98
- NO domain file; run does not reference constitution.technical.md. -->
99
- - docs/architecture/persistence.md
100
-
101
- ---
102
-
103
- ## Quick reference (command → technical file count)
104
-
105
- | Command | Technical rule files | Role |
106
- |---|---|---|
107
- | /aw-spec-specify | 1 | the modelling methodology (DDD) the domain model is expressed in — no technology |
108
- | /aw-spec-design | 15 | architecture/security/interop the design author mediates the spec against |
109
- | /aw-spec-implement | 5 | governance/architecture the code generator builds against (from design.md) |
110
- | /aw-spec-implement-delta | 5 | same code-generation set, scoped to the open change's delta-design |
111
- | /aw-spec-build | 2 | layering + coding rules the compile-fixer respects |
112
- | /aw-spec-analyze-slice | 2 | testing + coding rules the design↔code gate validates against |
113
- | /aw-spec-constitution | 1 | the technology-constitution base the technical half ratifies |
114
- | /aw-spec-run | 1 | persistence rules the execution / data-migration step generates against |
115
-
116
- > All migrated workflows are on this map. The conformance-gate workflows **analyze-design**
117
- > and **analyze-delta-design** are intentionally NOT here — they validate design/delta
118
- > against the spec + DOMAIN gate overlays only (comandrulemap `## /aw-spec-gate`), with no
119
- > technical gate checklist.
@@ -1,16 +0,0 @@
1
- # CQRS — Pharma Domain Addenda
2
-
3
- > Technology base: [[cqrs]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Pipeline
6
- - Append a **product-audit behavior** to the mediator pipeline: every create/modify/retire/re-identify/reclassify command on `MedicinalProduct` MUST emit an immutable audit record (User, Timestamp, Action, Previous Value, New Value). See [[auditing.domain]], [[regulatory-compliance]].
7
-
8
- ## Commands & queries
9
- - Registration, lifecycle transitions, ingredient/packaging edits, identifier & classification changes = **commands**; each publishes its domain event (see [[eventing.domain]], [[product-lifecycle.domain]]).
10
- - Product lookup, version history, FHIR projections = **queries** via `IReadRepository<MedicinalProduct>` + a `Specification` (see [[persistence.domain]]).
11
-
12
- ## Error codes
13
- `medicinal-product.not_found` · `ndc.duplicate` · `ndc.invalid_format` · `dosage-form.invalid` · `route.invalid` · `atc.invalid_code` · `lifecycle.invalid_transition` · `concurrency.conflict`.
14
-
15
- ## Related
16
- - [[cqrs]] · [[auditing.domain]] · [[eventing.domain]] · [[product-lifecycle.domain]] · [[persistence.domain]] · [[domain-driven-design.domain]] · [[regulatory-compliance]]
@@ -1,24 +0,0 @@
1
- # Data Classification — Pharma Domain Addenda
2
-
3
- > Technology base: [[data-classification]]. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- > No PHI — the model is commercial confidentiality, regulatory integrity, and source trust.
6
-
7
- ## Categories
8
- | Class | Extra rules |
9
- |---|---|
10
- | **Public / Published** (NDC-directory disclosure level) | Projectable via the public FHIR surface once `MarketingStatus` is active |
11
- | **Commercially-Sensitive** (pre-market formulations, proprietary strengths, unpublished products) | Access-restricted; **MUST NOT** be on the public FHIR surface until marketing status permits |
12
- | **Regulatory-Submission** (MA dossier refs, regulator keys) | Restricted; audited access (see [[auditing.domain]]) |
13
- | **Externally-Sourced** (FDA NDC / RxNorm / WHO ATC / partner feeds) | Carries a `ProvenanceRecord`; still validated (see [[data-provenance]]) |
14
-
15
- ## Data integrity (GxP / ALCOA+)
16
- - GxP records satisfy **ALCOA+** (Attributable, Legible, Contemporaneous, Original, Accurate + Complete, Consistent, Enduring, Available), enforced via immutable audit, provenance, version history (see [[auditing.domain]], [[data-provenance]], [[persistence.domain]], [[regulatory-compliance]]).
17
-
18
- ## Exposure & logging
19
- - `Draft`/`Under Review` or non-public `MarketingStatus` products MUST NOT be published on the public FHIR/REST surface (see [[product-lifecycle.domain]], [[fhir]]).
20
- - Externally-sourced values are never published without passing validation (see [[ndc]], [[atc]], [[terminology]]).
21
- - Commercially-sensitive pre-market details MUST NOT appear in logs/metrics/traces — log the product ID only (see [[coding-standards.domain]]).
22
-
23
- ## Related
24
- - [[data-classification]] · [[data-provenance]] · [[auditing.domain]] · [[persistence.domain]] · [[regulatory-compliance]] · [[product-lifecycle.domain]] · [[authorization.domain]] · [[coding-standards.domain]] · [[ndc]] · [[atc]] · [[fhir]]
@@ -1,21 +0,0 @@
1
- # Data Provenance Standards — Pharma
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## First-class concern
6
- - Any product attribute imported from an external source (FDA NDC directory, RxNorm, WHO ATC, an MAH submission, a partner feed) SHALL carry a **`ProvenanceRecord`** (Provenance module).
7
- - Provenance is captured at ingestion through the Interop adapters — never back-filled by guessing (see [[hl7]], [[fhir]], [[ai-rules.domain]]).
8
-
9
- ## Record (minimum)
10
- ```
11
- { source, sourceSystem, sourceVersion, method, agent, timestamp, importedFields[], correlationId }
12
- ```
13
- - **sourceVersion** = originating authority's release/version (e.g. terminology edition; see [[terminology]], [[atc]]); **method** = automated import / manual entry / API sync; **agent** = responsible principal.
14
-
15
- ## Integrity
16
- - Complements audit (who/when/what; see [[auditing.domain]]) and version history (see [[persistence.domain]]).
17
- - Provenance does **not** exempt an NDC/ATC/UNII value from validation (see [[ndc]], [[atc]], [[terminology]]).
18
- - MAY project to the FHIR `Provenance` resource (see [[fhir]]).
19
-
20
- ## Related
21
- - [[auditing.domain]] · [[persistence.domain]] · [[terminology]] · [[ndc]] · [[atc]] · [[fhir]] · [[regulatory-compliance]] · [[ai-rules.domain]]
@@ -1,11 +0,0 @@
1
- # Dependency Policy — Pharma Domain Addenda
2
-
3
- > Technology base: [[dependency-policy]]. Commands: `/aw-spec-gate`.
4
-
5
- ## Reviews & libraries
6
- - Every new dependency gets a **regulatory-suitability** review beyond the generic license/supply-chain check — reject packages that phone home or ship analytics by default (leak risk for commercially-sensitive pre-market data) (see [[data-classification.domain]]).
7
- - FHIR: the **official FHIR .NET SDK**, version-matched to the endpoint (R4/R5; see [[fhir]]).
8
- - Terminology integrations (RxNorm/SNOMED/UNII/ATC/NDC) go through the Terminology module; client libraries added **only** on explicit developer request — no AI-introduced terminology/interop dependencies (see [[terminology]], [[hl7]], [[ai-rules.domain]]).
9
-
10
- ## Related
11
- - [[dependency-policy]] · [[fhir]] · [[hl7]] · [[terminology]] · [[data-classification.domain]] · [[ai-rules.domain]]
@@ -1,36 +0,0 @@
1
- # Domain-Driven Design — Medicinal Product Domain Model
2
-
3
- > Technology base: [[domain-driven-design]]. NON-NEGOTIABLE. Commands: `/aw-spec-specify`.
4
-
5
- ## Modeling
6
- - Use the pharma/regulatory ubiquitous language (see [[pharma-terms]]), aligned to ISO IDMP concepts (see [[idmp]]).
7
- - FHIR- and IDMP-aligned, but **FHIR resources are projections, not the system of record** (see [[fhir]]); the aggregate is authoritative.
8
- - Coded concepts use industry terminologies, never free text (see [[terminology]]); coded VOs follow the FHIR pattern (`Codeable`, `Coding`, `Quantity`, `Ratio`, `Identifier`).
9
-
10
- ## Aggregate Root
11
- - **`MedicinalProduct` is the Aggregate Root.** All product data (ingredients, packaging, marketing authorization, identifiers, classification, lifecycle state) is reached/modified **through** it; no external code mutates a contained entity directly. Invariants are enforced atomically; state changes raise domain events (see [[eventing.domain]]).
12
-
13
- ## Value Objects (immutable, equality by value)
14
- `NdcCode` · `ProductName` · `GenericName` · `Strength` · `DosageForm` · `RouteOfAdministration` · `AtcCode` · `MarketingStatus` · `PackageIdentifier`
15
- - `NdcCode`/`PackageIdentifier` — segmented, format-validated, unique (see [[ndc]]).
16
- - `Strength` — numerator/denominator `Quantity` with UCUM units; `DosageForm`/`RouteOfAdministration`/`AtcCode` — coded against configured value sets (see [[terminology]], [[atc]]).
17
-
18
- ## Entities (identity within the aggregate)
19
- - **`ActiveIngredient`** — Name, UNII, Strength, Strength Unit. **>= 1 required.**
20
- - **`PackagingConfiguration`** — Package NDC, Description, Quantity, Unit of Measure. **>= 1 required.**
21
- - **`MarketingAuthorization`** — authorization granted to the MAH by a regulator (see [[idmp]]).
22
-
23
- ## Invariants
24
- - **MedicinalProduct** — NDC unique + format-valid (invalid blocks persistence); >= 1 ActiveIngredient + >= 1 PackagingConfiguration; all required attributes enforced at registration; dosage form/route must be valid coded values; lifecycle transitions must be valid (see [[product-lifecycle.domain]]); identifier/classification changes are audit-mandatory + emit events (see [[auditing.domain]], [[eventing.domain]]).
25
- - **PackagingConfiguration** — Package NDC unique within and across products (see [[ndc]]).
26
- - **ActiveIngredient** — Strength + Strength Unit required; UNII validated where supplied (see [[terminology]]).
27
- - **AuditRecord** — append-only; no update/delete (see [[auditing.domain]]).
28
-
29
- ## Validation summary
30
- NDC format; required attributes; duplicate identifiers; invalid dosage forms; invalid routes; invalid lifecycle transitions (see [[ndc]], [[terminology]], [[product-lifecycle.domain]]).
31
-
32
- ## AI guidance
33
- See [[ai-rules.domain]] — confirm signatures, use the official FHIR SDK, never invent NDC/UNII/RxNorm/SNOMED/ATC codes, keep FHIR as projections.
34
-
35
- ## Related
36
- - [[domain-driven-design]] · [[product-lifecycle.domain]] · [[ndc]] · [[idmp]] · [[atc]] · [[terminology]] · [[fhir]] · [[eventing.domain]] · [[auditing.domain]] · [[persistence.domain]] · [[pharma-terms]] · [[ai-rules.domain]]
@@ -1,99 +0,0 @@
1
- # DOMAIN REQUIREMENTS (project-specific)
2
-
3
- > Project-specific input, **updated independently per project**. The engineering constitution
4
- > stays domain-agnostic and supreme; this file holds the per-project enumeration and headline
5
- > profiles for the **Medicinal Product Registration** domain. Detailed domain *rules* are
6
- > expanded in the sibling files in this folder.
7
- >
8
- > Replace `<SampleProjectName>` and the bounded-context list below for a new project.
9
-
10
- =====================================================================
11
- [DOMAIN: Bounded Contexts / Modules]
12
- =====================================================================
13
- - ProductRegistry — aggregate root: **MedicinalProduct**; owns ActiveIngredient,
14
- PackagingConfiguration, MarketingAuthorization entities and the product value objects
15
- (NdcCode, ProductName, GenericName, Strength, DosageForm, RouteOfAdministration, AtcCode,
16
- MarketingStatus, PackageIdentifier). See [[domain-driven-design.domain]].
17
- - Substances — aggregates: Substance, ActiveMoiety; UNII-keyed ingredient identity
18
- (see [[terminology]]).
19
- - Organizations — aggregates: Organization, MarketingAuthorizationHolder, Manufacturer,
20
- Labeler. Maps to FHIR `Organization` (see [[fhir]]).
21
- - Classification — aggregates: AtcClassification, ProductClassification; ATC code sets and
22
- SNOMED CT classification references (see [[atc]], [[terminology]]).
23
- - Terminology — aggregates: CodeSystem, ValueSet, ConceptMap (project-managed subsets;
24
- expansions cached from external terminology services). Backs NDC/ATC/UNII/SNOMED/RxNorm
25
- validation (see [[terminology]]).
26
- - Lifecycle — the MedicinalProduct state machine (Draft → Under Review → Approved → Active →
27
- Discontinued → Withdrawn) and its transition guards (see [[product-lifecycle.domain]]).
28
- - Interoperability — aggregates: FhirProjection, IntegrationEndpoint; FHIR Medication /
29
- MedicationKnowledge / Substance / Organization projections and HL7 readiness
30
- (see [[fhir]], [[hl7]]).
31
- - Provenance — aggregate: ProvenanceRecord for externally sourced product data
32
- (see [[data-provenance]]).
33
- - Auditing — aggregate: AuditRecord (append-only). Captures creation, modification,
34
- retirement, identifier and classification changes (see [[auditing.domain]]).
35
-
36
- =====================================================================
37
- [DOMAIN: subsection pointers]
38
- =====================================================================
39
- [DOMAIN: Standards — NDC] -> docs/domainspecs/pharma/ndc.md
40
- [DOMAIN: Standards — ISO IDMP] -> docs/domainspecs/pharma/idmp.md
41
- [DOMAIN: Standards — ATC] -> docs/domainspecs/pharma/atc.md
42
- [DOMAIN: Standards — Terminology] -> docs/domainspecs/pharma/terminology.md
43
- [DOMAIN: Interop — FHIR] -> docs/domainspecs/pharma/fhir.md
44
- [DOMAIN: Interop — HL7] -> docs/domainspecs/pharma/hl7.md
45
- [DOMAIN: Aggregates and Business Invariants] -> docs/domainspecs/pharma/domain-driven-design.domain.md
46
- [DOMAIN: Product Lifecycle] -> docs/domainspecs/pharma/product-lifecycle.domain.md
47
- [DOMAIN: Regulatory / Compliance] -> docs/domainspecs/pharma/regulatory-compliance.md
48
- [DOMAIN: Data Provenance] -> docs/domainspecs/pharma/data-provenance.md
49
- [DOMAIN: Audit Profile] -> docs/domainspecs/pharma/auditing.domain.md
50
- [DOMAIN: Persistence / Versioning Profile] -> docs/domainspecs/pharma/persistence.domain.md
51
- [DOMAIN: Eventing Profile] -> docs/domainspecs/pharma/eventing.domain.md
52
- [DOMAIN: Testing Profile] -> docs/domainspecs/pharma/testing.domain.md
53
- [DOMAIN: Security Profile] -> docs/domainspecs/pharma/authorization.domain.md, docs/domainspecs/pharma/data-classification.domain.md, docs/domainspecs/pharma/zero-trust.domain.md
54
- [DOMAIN: Coding Standards Profile] -> docs/domainspecs/pharma/coding-standards.domain.md
55
- [DOMAIN: CQRS / Vertical Slices Profile] -> docs/domainspecs/pharma/cqrs.domain.md, docs/domainspecs/pharma/vertical-slices.domain.md
56
- [DOMAIN: Folder Structure Profile] -> docs/domainspecs/pharma/folder-structure.domain.md
57
- [DOMAIN: API Versioning Profile] -> docs/domainspecs/pharma/api-versioning.domain.md
58
- [DOMAIN: Dependency Policy Profile] -> docs/domainspecs/pharma/dependency-policy.domain.md
59
- [DOMAIN: Integration Terms] -> docs/domainspecs/pharma/integration-terms.md
60
- [DOMAIN: AI Policy Addenda] -> docs/domainspecs/pharma/ai-rules.domain.md
61
- [DOMAIN: Ubiquitous Language] -> docs/domainspecs/pharma/pharma-terms.md
62
- [DOMAIN: Platform Topology] -> below
63
-
64
- =====================================================================
65
- [DOMAIN: Platform Topology]
66
- =====================================================================
67
- - Target runtime: Kubernetes (AKS, EKS, or on-prem). Single-region by default; multi-region
68
- active/passive for DR.
69
- - External dependencies (Aspire resources): PostgreSQL (primary product registry), Redis
70
- (cache for terminology expansions + read models), a message broker (Azure Service Bus,
71
- AWS SQS/SNS, or RabbitMQ) for CloudEvents, an OTel collector, the configured IdP, an external
72
- Terminology Service (NDC/RxNorm/SNOMED/UNII/ATC value-set expansion, optional), a FHIR
73
- validator container, and an object store (S3/Blob) for imported source documents / labels.
74
- - Scale targets: P95 read latency < 200 ms at 200 RPS per module; FHIR search P95 < 500 ms.
75
- - Disaster recovery: RPO <= 15 minutes, RTO <= 4 hours; daily encrypted backups with 35-day
76
- retention plus monthly archive. Product registry and audit history are retention-protected
77
- (see [[persistence.domain]], [[auditing.domain]]).
78
-
79
- =====================================================================
80
- [DOMAIN: Governance Overrides]
81
- =====================================================================
82
- - Principal Engineers (approvers): TBD — fill at ratification.
83
- - Regulatory / Compliance Officer (mandatory approver for any identifier, classification, or
84
- lifecycle-rule change): TBD.
85
- - Domain Owners (per module): TBD — assign one regulatory and one technical owner per bounded
86
- context.
87
- - Quarterly review cadence: first business week of each quarter; an additional review after
88
- every relevant regulatory or terminology-release update (e.g. WHO ATC annual update, FDA NDC
89
- directory changes).
90
- - Exception process: a time-boxed waiver via a Waiver Request issue, approved by a Principal
91
- Engineer + the Compliance Officer, with a mandatory expiry <= 90 days and a remediation plan
92
- recorded in the issue.
93
-
94
- ## Related
95
-
96
- - [[domain-driven-design.domain]] · [[product-lifecycle.domain]] · [[ndc]] · [[idmp]] ·
97
- [[atc]] · [[terminology]] · [[fhir]] · [[hl7]] · [[regulatory-compliance]] ·
98
- [[data-provenance]] · [[auditing.domain]] · [[persistence.domain]] · [[ai-rules.domain]] ·
99
- [[pharma-terms]]
@@ -1,18 +0,0 @@
1
- # Eventing — Pharma Domain Addenda
2
-
3
- > Technology base: [[eventing]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Domain events
6
- - `MedicinalProduct` raises domain events on every significant state change — the integration seam to downstream consumers (prescribing, dispensing, manufacturing, pharmacovigilance, clinical).
7
- - Events publish from the aggregate boundary, never by an external feed writing aggregates directly (see [[hl7]], [[domain-driven-design.domain]]).
8
-
9
- ## Canonical events
10
- `MedicinalProductRegistered` (Draft) · `…SubmittedForReview`/`Approved`/`Activated`/`Discontinued`/`Withdrawn` (lifecycle, see [[product-lifecycle.domain]]) · `ProductIdentifierChanged` (NDC, see [[ndc]]) · `ProductClassificationChanged` (ATC, see [[atc]]) · `ActiveIngredientChanged`/`PackagingConfigurationChanged` · `MarketingStatusChanged`. Each = an audit-mandatory operation (see [[auditing.domain]]).
11
-
12
- ## Delivery
13
- - Outbox pattern: events persisted transactionally with the aggregate change, published to CloudEvents. Consumers integrate via FHIR / REST / event stream — **direct DB access FORBIDDEN** (see [[fhir]]).
14
- - Payloads carry coded values via standard terminologies, never free text (see [[terminology]], [[ndc]], [[atc]]).
15
- - Each event carries a `correlationId` tying command → audit record → version snapshot (see [[auditing.domain]], [[persistence.domain]], [[regulatory-compliance]]).
16
-
17
- ## Related
18
- - [[eventing]] · [[domain-driven-design.domain]] · [[product-lifecycle.domain]] · [[auditing.domain]] · [[persistence.domain]] · [[fhir]] · [[hl7]] · [[ndc]] · [[atc]] · [[terminology]]