aw-spec-cli 0.1.4 → 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.
- package/assets/.agents/agent.json +28 -0
- package/assets/.agents/skills/appweaver/SKILL.md +56 -0
- package/assets/.agents/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.claude/agent.json +27 -0
- package/assets/.claude/skills/appweaver/SKILL.md +55 -0
- package/assets/.claude/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.kilocode/agent.json +28 -0
- package/assets/.kilocode/workflows/appweaver-demo.md +59 -0
- package/assets/.kilocode/workflows/appweaver.md +55 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -54
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -34
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -23
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -17
- package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
- package/assets/.aw-spec/scripts/bash/common.sh +0 -582
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
- package/assets/.aw-spec/templates/checklist-template.md +0 -40
- package/assets/.aw-spec/templates/constitution-template.md +0 -57
- package/assets/.aw-spec/templates/plan-template.md +0 -113
- package/assets/.aw-spec/templates/spec-template.md +0 -131
- package/assets/.aw-spec/templates/tasks-template.md +0 -252
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
- package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.kilocode/rules/specify-rules.md +0 -4
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
- package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
- package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
- package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
- package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
- package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
- package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
- package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
- package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
- package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/UI.Visualization/PACKAGING.md +0 -191
- package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +0 -11768
- package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +0 -11214
- package/assets/docs/UI.Visualization/pack-foundation.ps1 +0 -165
- package/assets/docs/UI.Visualization/pack-foundation.sh +0 -206
- package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +0 -159
- package/assets/docs/UI.Visualization/pack-reference-foundation.sh +0 -205
- package/assets/docs/UI.Visualization/unpack-foundation.ps1 +0 -126
- package/assets/docs/UI.Visualization/unpack-foundation.sh +0 -217
- package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +0 -218
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/command.txt +0 -295
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +0 -70
- package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +0 -58
- package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +0 -62
- package/assets/docs/domainspecs/UIVisualization/chart-network.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +0 -75
- package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +0 -66
- package/assets/docs/domainspecs/UIVisualization/chart-survival.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/chart-violin.md +0 -61
- package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +0 -63
- package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +0 -80
- package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +0 -87
- package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +0 -47
- package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +0 -130
- package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +0 -110
- package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +0 -55
- package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/testing.domain.md +0 -52
- package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +0 -39
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -29
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -166
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -26
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -186
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/security/auditing.md +0 -117
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Glossary — Pharmaceutical Terms
|
|
2
|
-
|
|
3
|
-
> Ubiquitous language for the medicinal product registry. Commands: `/aw-spec-specify`, `/aw-spec-clarify`, `/aw-spec-plan`. See [[domain-driven-design.domain]] (modeling), [[terminology]] (coding), [[integration-terms]] (interop).
|
|
4
|
-
|
|
5
|
-
| Term | Definition |
|
|
6
|
-
|---|---|
|
|
7
|
-
| **MedicinalProduct** | The **Aggregate Root** — authoritative record of a registered medicine (ProductRegistry); owns ingredients, packaging, marketing authorization; aligned to IDMP *Medicinal Product* (see [[idmp]], [[domain-driven-design.domain]]). |
|
|
8
|
-
| **NDC** | US FDA product identifier (Labeler + Product + Package); the `NdcCode` VO; unique, format-validated (see [[ndc]]). |
|
|
9
|
-
| **PackageIdentifier** | Package-level NDC on a `PackagingConfiguration` (see [[ndc]]). |
|
|
10
|
-
| **ActiveIngredient** | **Entity**: Name, UNII, Strength, Strength Unit; **>= 1** per product (see [[domain-driven-design.domain]]). |
|
|
11
|
-
| **Substance / ActiveMoiety** | Chemical substance + active moiety; UNII-identified (see [[terminology]]); FHIR `Substance`. |
|
|
12
|
-
| **Strength** | Active-ingredient amount per dose unit — `Strength` VO (numerator/denominator `Quantity`, UCUM) (see [[terminology]]). |
|
|
13
|
-
| **DosageForm** | Physical form (tablet/capsule/solution); coded (SNOMED CT); `DosageForm` VO (see [[terminology]]). |
|
|
14
|
-
| **RouteOfAdministration** | Administration path (oral/IV/topical); coded; `RouteOfAdministration` VO (see [[terminology]]). |
|
|
15
|
-
| **AtcCode** | WHO ATC class code; **multiple per product**; validated against configured sets (see [[atc]]). |
|
|
16
|
-
| **MarketingStatus** | Regulatory marketing state (`MarketingStatus` VO); distinct from lifecycle state (see [[product-lifecycle.domain]]). |
|
|
17
|
-
| **MarketingAuthorization** | **Entity** — authorization granted by a regulator; IDMP-aligned (see [[idmp]]). |
|
|
18
|
-
| **MarketingAuthorizationHolder (MAH)** | Organization holding the authorization; FHIR `Organization`. |
|
|
19
|
-
| **Labeler** | Firm whose Labeler Code forms the first NDC segment (see [[ndc]]). |
|
|
20
|
-
| **PackagingConfiguration** | **Entity**: Package NDC, Description, Quantity, Unit of Measure; **>= 1** per product (see [[domain-driven-design.domain]]). |
|
|
21
|
-
| **ManufacturedItem / PharmaceuticalProduct** | IDMP concepts: manufactured dose-form item + administrable product (see [[idmp]]). |
|
|
22
|
-
| **ProvenanceRecord** | Provenance for externally sourced data (source, method, timestamp, agent) (see [[data-provenance]]). |
|
|
23
|
-
| **AuditRecord** | Append-only audit entry for create/modify/retire/identifier/classification changes (see [[auditing.domain]]). |
|
|
24
|
-
| **ProductVersion** | Queryable historical snapshot of product information (see [[persistence.domain]]). |
|
|
25
|
-
|
|
26
|
-
## Related
|
|
27
|
-
- [[domain-driven-design.domain]] · [[idmp]] · [[ndc]] · [[atc]] · [[terminology]] · [[fhir]] · [[integration-terms]] · [[product-lifecycle.domain]] · [[data-provenance]]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Product Lifecycle — Medicinal Product State Machine
|
|
2
|
-
|
|
3
|
-
> Technology base: [[domain-driven-design]]. NON-NEGOTIABLE. Commands: `/aw-spec-specify`, `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## States
|
|
6
|
-
`Draft` → `Under Review` → `Approved` → `Active` → `Discontinued` / `Withdrawn`
|
|
7
|
-
- Lifecycle state is owned by the aggregate root and is distinct from the `MarketingStatus` value object, though the two MUST stay consistent (see [[domain-driven-design.domain]]).
|
|
8
|
-
|
|
9
|
-
## Valid transitions (guarded; any other rejected as `lifecycle.invalid_transition`)
|
|
10
|
-
| From | Allowed to |
|
|
11
|
-
|---|---|
|
|
12
|
-
| Draft | Under Review |
|
|
13
|
-
| Under Review | Approved, Draft (returned for correction) |
|
|
14
|
-
| Approved | Active |
|
|
15
|
-
| Active | Discontinued, Withdrawn |
|
|
16
|
-
| Discontinued | Withdrawn |
|
|
17
|
-
| Withdrawn | *(terminal)* |
|
|
18
|
-
|
|
19
|
-
The allowed set MAY be configurable policy, but the default above is enforced; no transition bypasses the guard.
|
|
20
|
-
|
|
21
|
-
## Guards
|
|
22
|
-
- Leaving **Draft** requires registration completeness (all required attributes, >= 1 ingredient, >= 1 packaging, valid NDC/dosage form/route/ATC) (see [[domain-driven-design.domain]], [[ndc]], [[terminology]], [[atc]]).
|
|
23
|
-
- Approve/activate/retire are **authorized** actions — only `RegulatoryOfficer` (see [[authorization.domain]]).
|
|
24
|
-
- Retirement is a **logical** state change, never a hard delete (see [[persistence.domain]], [[auditing.domain]]).
|
|
25
|
-
|
|
26
|
-
## Events
|
|
27
|
-
Each transition emits a domain event (`MedicinalProductSubmittedForReview`/`Approved`/`Activated`/`Discontinued`/`Withdrawn`) and is audit-mandatory (see [[eventing.domain]], [[auditing.domain]]).
|
|
28
|
-
|
|
29
|
-
## Related
|
|
30
|
-
- [[domain-driven-design.domain]] · [[authorization.domain]] · [[ndc]] · [[terminology]] · [[atc]] · [[eventing.domain]] · [[auditing.domain]] · [[persistence.domain]]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Regulatory & Compliance Standards — Pharma
|
|
2
|
-
|
|
3
|
-
> NON-NEGOTIABLE. Commands: `/aw-spec-specify`, `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
> Umbrella for the compliance requirements — mechanisms live in the linked files.
|
|
6
|
-
|
|
7
|
-
## Posture
|
|
8
|
-
- Built for **regulatory compliance readiness** — auditability, traceability, data integrity, provenance designed in.
|
|
9
|
-
- GxP-relevant records follow **ALCOA+** (Attributable, Legible, Contemporaneous, Original, Accurate + Complete, Consistent, Enduring, Available).
|
|
10
|
-
|
|
11
|
-
## Requirements
|
|
12
|
-
- **Audit trail** — immutable records for product creation, modification, retirement, identifier changes, classification changes; each carries User, Timestamp, Action, Previous Value, New Value (see [[auditing.domain]]).
|
|
13
|
-
- **Provenance** — capture source/method/agent/timestamp for externally sourced data (see [[data-provenance]]).
|
|
14
|
-
- **Versioning** — full, queryable version history of product information (see [[persistence.domain]]).
|
|
15
|
-
- **Traceability** — every change to identifiers (NDC), classification (ATC), ingredients, packaging, marketing status, lifecycle is traceable command → event → audit record → version snapshot (see [[eventing.domain]], [[auditing.domain]], [[persistence.domain]]).
|
|
16
|
-
- **Authorized actions** — registration, approval, retirement are authorized operations (see [[authorization.domain]], [[product-lifecycle.domain]]).
|
|
17
|
-
|
|
18
|
-
## Related
|
|
19
|
-
- [[auditing.domain]] · [[data-provenance]] · [[persistence.domain]] · [[eventing.domain]] · [[product-lifecycle.domain]] · [[authorization.domain]] · [[domain-driven-design.domain]]
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Terminology Standards — Pharma
|
|
2
|
-
|
|
3
|
-
> NON-NEGOTIABLE. Commands: `/aw-spec-specify`, `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Coded value objects
|
|
6
|
-
- **Coded data MUST use industry terminologies — free-text strings for coded concepts are FORBIDDEN.**
|
|
7
|
-
- Every code-bearing field is a **`Codeable` value object** `{ system, code, version, display }` (mirrors FHIR `CodeableConcept`/`Coding`; see [[fhir]]).
|
|
8
|
-
|
|
9
|
-
## Standard terminologies
|
|
10
|
-
| Concept | Terminology | Conformance |
|
|
11
|
-
|---|---|---|
|
|
12
|
-
| Product / package identity | **NDC** | SHALL (see [[ndc]]) |
|
|
13
|
-
| Substances / active ingredients | **UNII** | SHOULD |
|
|
14
|
-
| Substance / clinical drug | **RxNorm** | SHOULD |
|
|
15
|
-
| Dosage form / route / classification | **SNOMED CT** | SHOULD |
|
|
16
|
-
| Therapeutic classification | **WHO ATC** | SHALL (see [[atc]]) |
|
|
17
|
-
| Units (strength, package qty) | **UCUM** | SHALL |
|
|
18
|
-
|
|
19
|
-
- **UNII** is the substance identity for IDMP `Substance` alignment (see [[idmp]]) and maps to FHIR `Substance.code`.
|
|
20
|
-
|
|
21
|
-
## Validation
|
|
22
|
-
- Hard-coded coded literals FORBIDDEN outside the Terminology module's seed data.
|
|
23
|
-
- Never invent NDC/UNII/RxNorm/SNOMED/ATC/UCUM codes — confirm against value sets (see [[ai-rules.domain]]).
|
|
24
|
-
- Invalid dosage forms/routes rejected at validation time; the bound value set is configuration (see [[domain-driven-design.domain]]).
|
|
25
|
-
|
|
26
|
-
## Terminology module
|
|
27
|
-
- Lookup/validation/expansion **MUST** go through a dedicated **Terminology module** (internal cache or external TS via FHIR `$expand` / `$validate-code`).
|
|
28
|
-
- Aggregates: `CodeSystem`, `ValueSet`, `ConceptMap` (subsets; expansions cached from RxNorm/SNOMED/FDA UNII-NDC/WHO ATC).
|
|
29
|
-
- Code-set versions are pinned + recorded; a terminology release (e.g. WHO ATC annual update) is a tracked, audited change (see [[auditing.domain]]).
|
|
30
|
-
|
|
31
|
-
## Related
|
|
32
|
-
- [[ndc]] · [[atc]] · [[idmp]] · [[fhir]] · [[domain-driven-design.domain]] · [[testing.domain]] · [[ai-rules.domain]]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Testing — Pharma Domain Addenda
|
|
2
|
-
|
|
3
|
-
> Technology base: [[testing]]. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## What MUST be tested
|
|
6
|
-
- **Aggregate invariants** — required attributes; >= 1 ActiveIngredient; >= 1 PackagingConfiguration; NDC uniqueness + format; invalid dosage forms/routes rejected (see [[domain-driven-design.domain]], [[ndc]], [[terminology]]).
|
|
7
|
-
- **Lifecycle state machine** — every allowed transition passes; every disallowed one is rejected (see [[product-lifecycle.domain]]).
|
|
8
|
-
- **NDC validation** — segment configurations, configurable rules, duplicate detection (see [[ndc]]).
|
|
9
|
-
- **Terminology binding** — ATC/UNII/SNOMED/RxNorm/UCUM validated against value sets; invented codes rejected (see [[terminology]], [[atc]]).
|
|
10
|
-
- **FHIR round-trip** — `domain -> FHIR -> domain` for Medication/MedicationKnowledge/Substance/Organization; FHIR validator passes (CI gate; see [[fhir]]).
|
|
11
|
-
- **Audit & versioning** — every audited op writes an immutable record (User/Timestamp/Action/Previous/New); historical versions remain queryable (see [[auditing.domain]], [[persistence.domain]]).
|
|
12
|
-
- **Provenance** — external imports attach a `ProvenanceRecord` (see [[data-provenance]]).
|
|
13
|
-
|
|
14
|
-
## Test data & gates
|
|
15
|
-
- Use **synthetic/clearly-marked test NDCs and codes** — never real identifiers that could collide with the FDA NDC directory (see [[persistence.domain]], [[ndc]]); pin the terminology code-set version under test (see [[terminology]]).
|
|
16
|
-
- CI: FHIR validator passes for every modified resource/profile/example; HL7 outbound conformance checked against the internal corpus (see [[hl7]]).
|
|
17
|
-
|
|
18
|
-
## Related
|
|
19
|
-
- [[testing]] · [[domain-driven-design.domain]] · [[product-lifecycle.domain]] · [[ndc]] · [[terminology]] · [[atc]] · [[fhir]] · [[auditing.domain]] · [[persistence.domain]] · [[data-provenance]] · [[hl7]]
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Vertical Slices — Pharma Domain Addenda
|
|
2
|
-
|
|
3
|
-
> Technology base: [[vertical-slices]]. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Interop adapters in the slice
|
|
6
|
-
`{Module}/Interop/` carries the pharma external-protocol adapters:
|
|
7
|
-
```
|
|
8
|
-
Fhir/ Medication / MedicationKnowledge / Substance / Organization projectors (see [[fhir]])
|
|
9
|
-
Hl7v2/ inbound parsers + outbound emitters (added when a consumer needs them) (see [[hl7]])
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Rules
|
|
13
|
-
- FHIR resources live in a **parallel projection layer** and **MUST NOT** replace internal `Shared` DTOs; projections, never the system of record (see [[fhir]], [[domain-driven-design.domain]]).
|
|
14
|
-
- Domain DTOs (`MedicinalProductDto`, `ActiveIngredientDto`, `PackagingConfigurationDto`) — no setters, required `init`, base64 `RowVersionBase64` (see [[coding-standards.domain]]).
|
|
15
|
-
|
|
16
|
-
## Related
|
|
17
|
-
- [[vertical-slices]] · [[fhir]] · [[hl7]] · [[domain-driven-design.domain]] · [[coding-standards.domain]]
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Zero-Trust — Pharma Domain Addenda
|
|
2
|
-
|
|
3
|
-
> Technology base: [[zero-trust]]. Commands: `/aw-spec-plan`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Rules
|
|
6
|
-
- All registry traffic MUST be TLS-encrypted; commercially-sensitive pre-market data in transit MUST be TLS-protected; at-rest: see [[data-classification.domain]], [[persistence.domain]].
|
|
7
|
-
- FHIR/REST scopes (`system/Medication.read`, `system/*.write` for authorized backends) enforced on every endpoint + propagated through the pipeline. **No patient-context (SMART) launch** — product master data (see [[authorization.domain]], [[fhir]]).
|
|
8
|
-
- Mutating operations **re-check change authority** at the handler edge (only `RegulatoryOfficer` approves/retires; identifier/classification changes are privileged) (see [[authorization.domain]]).
|
|
9
|
-
- Trace context MUST propagate across outbound **FHIR / HL7v2** calls and the CloudEvents stream (see [[eventing.domain]], [[auditing.domain]]).
|
|
10
|
-
|
|
11
|
-
## Related
|
|
12
|
-
- [[zero-trust]] · [[authorization.domain]] · [[data-classification.domain]] · [[persistence.domain]] · [[auditing.domain]] · [[eventing.domain]] · [[fhir]]
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# AI Operational Rules
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic) — domain AI rules in [[ai-rules.domain]]. Applies to all AI agents (Claude Code, Augment, Copilot, etc.). Commands: **ALL**.
|
|
4
|
-
|
|
5
|
-
AI agents MUST treat the constitution as **ground truth**, overriding pre-trained habits and
|
|
6
|
-
any contradictory documentation found inside the repo.
|
|
7
|
-
|
|
8
|
-
## Context loading rules / retrieval expectations
|
|
9
|
-
|
|
10
|
-
- Before generating or editing code, **inspect the relevant vertical slice**
|
|
11
|
-
(`<Module>/Features/<Feature>/`) and the aggregate it mutates (see [[vertical-slices]]).
|
|
12
|
-
- **Confirm symbol signatures via repository search** rather than inferring from generic
|
|
13
|
-
framework knowledge — `IRepository<T>` here is AppWeaver's, not a generic one
|
|
14
|
-
(see [[cqrs]], [[persistence]]).
|
|
15
|
-
|
|
16
|
-
## AI generation rules
|
|
17
|
-
|
|
18
|
-
- New features are generated as **complete vertical slices**: Command/Query + Handler +
|
|
19
|
-
Endpoint + Validator + (when applicable) Specification + DTO + mapping extension + Unit test
|
|
20
|
-
+ Integration test.
|
|
21
|
-
- Do **NOT** introduce new top-level dependencies (see [[dependency-policy]]).
|
|
22
|
-
- Do **NOT** create speculative abstractions (single-implementation interfaces, generic
|
|
23
|
-
wrappers around existing framework types) — YAGNI.
|
|
24
|
-
- Generated tests follow Test-First Engineering and **MUST fail before** the production change
|
|
25
|
-
is in place (see [[testing]]).
|
|
26
|
-
|
|
27
|
-
## Output formatting conventions
|
|
28
|
-
|
|
29
|
-
- Do **NOT** write inline rationale comments explaining why a pattern was chosen — the
|
|
30
|
-
constitution is the rationale (see [[coding-standards]]).
|
|
31
|
-
|
|
32
|
-
## Migration generation policy
|
|
33
|
-
|
|
34
|
-
- AI MAY scaffold EF Core migrations but **MUST NOT run them** against shared environments.
|
|
35
|
-
Production migrations require DBA sign-off and an SRE-executed rollout (see [[persistence]]).
|
|
36
|
-
|
|
37
|
-
## Operating envelope
|
|
38
|
-
|
|
39
|
-
- Edits limited to the scope explicitly requested. Drive-by refactors of unrelated files are
|
|
40
|
-
forbidden.
|
|
41
|
-
- File creation constrained to the Mandatory Folder Structure; new folders require an amendment.
|
|
42
|
-
- All AI-authored commits are self-contained: source change + tests + affected
|
|
43
|
-
DTOs/mappings + migration (when schema changes).
|
|
44
|
-
|
|
45
|
-
## Refusal conditions (generic) — refuse and ask for clarification when a request would:
|
|
46
|
-
|
|
47
|
-
- Violate a NON-NEGOTIABLE principle.
|
|
48
|
-
- Introduce a Forbidden Pattern (see [[coding-standards]]).
|
|
49
|
-
- Require a cross-aggregate transaction (see [[cqrs]], [[domain-driven-design]]).
|
|
50
|
-
- Embed a secret, connection string, or production hostname in code or config.
|
|
51
|
-
- Disable a soft-delete filter, tenancy filter, audit interceptor, scope check, or auth policy
|
|
52
|
-
globally.
|
|
53
|
-
|
|
54
|
-
> Domain-specific generation rules, data masking, terminology codes, and refusal conditions are in [[ai-rules.domain]].
|
|
55
|
-
|
|
56
|
-
## Related
|
|
57
|
-
|
|
58
|
-
- [[coding-standards]] · [[dependency-policy]] · [[testing]] · [[persistence]] ·
|
|
59
|
-
[[vertical-slices]] · [[ai-rules.domain]]
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# API Versioning Policy
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic) — domain (e.g. FHIR) versioning in [[api-versioning.domain]]. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## REST versioning
|
|
6
|
-
|
|
7
|
-
- Internal REST (FastEndpoints) serves first-party apps and operational tooling.
|
|
8
|
-
- List endpoints accept `pageNumber` (1-based) + `pageSize` and return `PagedResult<TDto>`
|
|
9
|
-
(see [[vertical-slices]]).
|
|
10
|
-
- Breaking changes to internal REST require a **versioned route prefix** (`v2/...`).
|
|
11
|
-
- Endpoints MUST NOT swallow exceptions; the central exception handler owns the contract.
|
|
12
|
-
|
|
13
|
-
## ETag / concurrency at the edge
|
|
14
|
-
|
|
15
|
-
- The server sets the ETag header on every create/read/update via `SetETagFromBase64(...)`.
|
|
16
|
-
- Update/Delete extract `If-Match` via `GetIfMatchBase64Token()`; mismatch -> `409
|
|
17
|
-
concurrency.conflict`. ETag tokens are strong; `W/` weak prefixes stripped on read.
|
|
18
|
-
See [[persistence]].
|
|
19
|
-
|
|
20
|
-
## Machine-readable schemas
|
|
21
|
-
|
|
22
|
-
- The service publishes versioned, machine-readable schemas:
|
|
23
|
-
- **OpenAPI** for REST,
|
|
24
|
-
- **AsyncAPI** for events (see [[eventing]]).
|
|
25
|
-
- All schemas regenerate cleanly in CI; diffs are reviewed for breaking changes
|
|
26
|
-
(see [[coding-standards]]).
|
|
27
|
-
- (FHIR CapabilityStatement — see [[api-versioning.domain]].)
|
|
28
|
-
|
|
29
|
-
## Deprecation lifecycle & sunset policy
|
|
30
|
-
|
|
31
|
-
- **Breaking changes are MAJOR version bumps** (per the constitution's governance SemVer).
|
|
32
|
-
- A superseded REST version remains available through a documented deprecation window before
|
|
33
|
-
sunset; the deprecation and sunset are announced via the published schema diffs and the
|
|
34
|
-
governance amendment process.
|
|
35
|
-
|
|
36
|
-
## Canonical example (agent reference — `<SampleProjectName>` sample)
|
|
37
|
-
|
|
38
|
-
ETag round-trip: the endpoint reads `If-Match` on update and sets the `ETag` on success;
|
|
39
|
-
the handler compares the token and translates an EF conflict to `409 concurrency.conflict`:
|
|
40
|
-
|
|
41
|
-
```csharp
|
|
42
|
-
// Endpoint (PUT /projects/{id:guid})
|
|
43
|
-
var id = Route<Guid>("id");
|
|
44
|
-
var token = HttpContext.Request.GetIfMatchBase64Token(); // extract If-Match
|
|
45
|
-
|
|
46
|
-
var result = await _mediator.Send(new UpdateProjectCommand(
|
|
47
|
-
id, req.Name, req.Description, req.StartDate, req.EndDate, req.OwnerId, token), ct);
|
|
48
|
-
|
|
49
|
-
if (result.IsSuccess && !string.IsNullOrWhiteSpace(result.Value?.RowVersionBase64))
|
|
50
|
-
HttpContext.Response.SetETagFromBase64(result.Value!.RowVersionBase64); // set ETag
|
|
51
|
-
return result;
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
```csharp
|
|
55
|
-
// Handler — compare the supplied token, and catch EF's concurrency exception
|
|
56
|
-
var current = entity.RowVersion is { Length: > 0 } rv ? Convert.ToBase64String(rv) : string.Empty;
|
|
57
|
-
if (string.IsNullOrWhiteSpace(request.RowVersionBase64) ||
|
|
58
|
-
!string.Equals(current, request.RowVersionBase64, StringComparison.Ordinal))
|
|
59
|
-
return Result<ProjectDto>.Failure(new Error(
|
|
60
|
-
"concurrency.conflict", "Resource was modified by another process. Reload and retry.",
|
|
61
|
-
409, "projects"));
|
|
62
|
-
|
|
63
|
-
entity.Update(request.Name, request.Description, request.StartDate, request.EndDate, ownerId);
|
|
64
|
-
await _repo.UpdateAsync(entity, ct);
|
|
65
|
-
|
|
66
|
-
try { await _uow.SaveChangesAsync(ct); }
|
|
67
|
-
catch (DbUpdateConcurrencyException)
|
|
68
|
-
{
|
|
69
|
-
return Result<ProjectDto>.Failure(new Error(
|
|
70
|
-
"concurrency.conflict", "Resource was modified by another process. Reload and retry.",
|
|
71
|
-
409, "projects"));
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
ETag token helpers — strong tokens; strip `W/` weak prefix and quotes on read:
|
|
76
|
-
|
|
77
|
-
```csharp
|
|
78
|
-
// <SampleProjectName>.Service/Utilities/HttpRequestETagExtensions.cs
|
|
79
|
-
public static string GetIfMatchBase64Token(this HttpRequest request, string? fallback = null)
|
|
80
|
-
{
|
|
81
|
-
var token = request.Headers.IfMatch.FirstOrDefault();
|
|
82
|
-
return !string.IsNullOrWhiteSpace(token) ? SanitizeETagToken(token) : (fallback ?? string.Empty);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public static string SanitizeETagToken(string? raw)
|
|
86
|
-
{
|
|
87
|
-
if (string.IsNullOrWhiteSpace(raw)) return string.Empty;
|
|
88
|
-
var token = raw.Trim();
|
|
89
|
-
if (token.StartsWith("W/")) token = token[2..].Trim(); // strip weak prefix
|
|
90
|
-
return token.Trim('"'); // strip quotes
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// On success the endpoint sets the strong ETag from the DTO's RowVersionBase64:
|
|
94
|
-
HttpContext.Response.SetETagFromBase64(result.Value!.RowVersionBase64);
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Related
|
|
98
|
-
|
|
99
|
-
- [[vertical-slices]] · [[persistence]] · [[eventing]] · [[coding-standards]] · [[api-versioning.domain]]
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Coding Standards
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic) — domain forbidden patterns & CI gates in [[coding-standards.domain]]. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Naming conventions
|
|
6
|
-
|
|
7
|
-
- Solution and projects: `<SampleProjectName>.<Role>` (e.g. `<SampleProjectName>.Api`,
|
|
8
|
-
`<SampleProjectName>.AppHost`, `<SampleProjectName>.ServiceDefaults`).
|
|
9
|
-
- Namespaces mirror the folder path exactly; **file-scoped namespaces only**.
|
|
10
|
-
- Aggregates: `class <Aggregate> : EntityBase<<Aggregate>Id>, IAggregateRoot,
|
|
11
|
-
IFullAuditedObject, ISoftDeletable, IConcurrencyTracked, IHasDomainEvents,
|
|
12
|
-
INamedEntity<<Aggregate>Id>`.
|
|
13
|
-
- Commands/Queries: `record <Verb><Aggregate>Command(...) : ICommand<Result<TDto>>`.
|
|
14
|
-
- DTOs: `record <Aggregate>Dto { public required Guid Id { get; init; } ... }` — no setters;
|
|
15
|
-
required init for non-nullable members.
|
|
16
|
-
|
|
17
|
-
## Nullable & language rules
|
|
18
|
-
|
|
19
|
-
- C# language version: latest LTS; **nullable reference types ENABLED**; implicit usings
|
|
20
|
-
ENABLED; **`TreatWarningsAsErrors` for Release**.
|
|
21
|
-
|
|
22
|
-
## Async conventions
|
|
23
|
-
|
|
24
|
-
- Every I/O-bound method ends with `Async` and accepts a `CancellationToken` as the **last
|
|
25
|
-
parameter**.
|
|
26
|
-
- `async void` is forbidden outside event handlers.
|
|
27
|
-
- Blocking calls (`.Result`, `.Wait()`, `Task.Run` to fake async) in request-handling paths
|
|
28
|
-
are FORBIDDEN.
|
|
29
|
-
|
|
30
|
-
## Error / exception conventions
|
|
31
|
-
|
|
32
|
-
- Exceptions are thrown by the **Domain only** (`DomainException`,
|
|
33
|
-
`InvariantViolationException`). Application code returns `Result<T>` (see [[cqrs]]).
|
|
34
|
-
- Never catch-all `catch (Exception)` that swallows or rewraps without rethrow, except in the
|
|
35
|
-
central exception handler.
|
|
36
|
-
- Never return HTTP 200 with an error body — use correct status codes (4xx client, 5xx server,
|
|
37
|
-
409 concurrency).
|
|
38
|
-
|
|
39
|
-
## Documentation expectations
|
|
40
|
-
|
|
41
|
-
- XML doc comments on public types and aggregate methods.
|
|
42
|
-
- Inline comments only where intent is non-obvious. Commented-out code MUST be removed before
|
|
43
|
-
merge.
|
|
44
|
-
- Do not write inline rationale comments explaining pattern choices — the constitution is the
|
|
45
|
-
rationale (see [[ai-rules]]).
|
|
46
|
-
|
|
47
|
-
## Forbidden patterns (generic; rejected at review, build-warning where statically detectable)
|
|
48
|
-
|
|
49
|
-
1. MediatR — use `AppWeaver.Mediator` (see [[dependency-policy]]).
|
|
50
|
-
2. AutoMapper / Mapster reflection mapping — hand-written `ToDto()` only.
|
|
51
|
-
3. Anemic domain models (see [[domain-driven-design]]).
|
|
52
|
-
4. Repository as data-access god object (see [[persistence]]).
|
|
53
|
-
5. Cross-aggregate EF navigation properties — strongly-typed ID only.
|
|
54
|
-
6. Hard-coded connection strings, secrets, ports, or issuer URLs in source (see [[zero-trust]]).
|
|
55
|
-
7. Static service locator — use constructor DI.
|
|
56
|
-
8. Direct `DbContext` access from Endpoints or Features outside repo/spec surface.
|
|
57
|
-
9. Blocking calls in request paths.
|
|
58
|
-
10. Catch-all that swallows/rewraps without rethrow (outside central handler).
|
|
59
|
-
11. `AllowAnonymous()` on sensitive-data/mutating endpoints in a CI-protected branch.
|
|
60
|
-
12. Logging/emitting secrets, tokens, keys, or payment-card data (see [[data-classification]]).
|
|
61
|
-
13. Multiple aggregate mutations in one transaction (see [[cqrs]], [[eventing]]).
|
|
62
|
-
14. `DateTime.UtcNow` / `Guid.NewGuid()` in aggregates/handlers/SUT — use `IClock` /
|
|
63
|
-
`IGuidGenerator` (see [[testing]]).
|
|
64
|
-
15. HTTP 200 with an error body.
|
|
65
|
-
16. Analytics/reporting by querying the OLTP DB directly — emit events (see [[eventing]]).
|
|
66
|
-
|
|
67
|
-
> Domain-specific forbidden patterns are in [[coding-standards.domain]].
|
|
68
|
-
|
|
69
|
-
## Quality gates (CI) — generic, must pass before merge
|
|
70
|
-
|
|
71
|
-
1. `dotnet build` succeeds with `TreatWarningsAsErrors=true` for Release.
|
|
72
|
-
2. `dotnet test` passes for UnitTests + IntegrationTests.
|
|
73
|
-
3. Code coverage on changed files meets the Testing Profile threshold (see [[testing]]).
|
|
74
|
-
4. EF Core migrations apply cleanly to a fresh PostgreSQL instance (see [[persistence]]).
|
|
75
|
-
5. OpenAPI document generation succeeds; diff reviewed for breaking changes.
|
|
76
|
-
6. AsyncAPI regenerates cleanly for any domain-event contract change (see [[eventing]]).
|
|
77
|
-
7. Static analysis (Roslyn analyzers, nullable warnings, banned-API analyzer) — zero errors.
|
|
78
|
-
8. Grep checks: no `AllowAnonymous()` on production endpoints, no hard-coded secrets, no
|
|
79
|
-
MediatR/AutoMapper references.
|
|
80
|
-
9. Constitution compliance review checked off in the PR template.
|
|
81
|
-
|
|
82
|
-
> Domain-specific CI gates are in [[coding-standards.domain]].
|
|
83
|
-
|
|
84
|
-
## Related
|
|
85
|
-
|
|
86
|
-
- [[dependency-policy]] · [[api-versioning]] · [[domain-driven-design]] · [[cqrs]] ·
|
|
87
|
-
[[persistence]] · [[testing]] · [[ai-rules]] · [[coding-standards.domain]]
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Dependency Policy
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic) — domain package rules in [[dependency-policy.domain]]. Commands: `/aw-spec-plan`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Package governance
|
|
6
|
-
|
|
7
|
-
- **All package versions are governed by `Directory.Packages.props`** (Central Package
|
|
8
|
-
Management). `PackageReference` entries in `.csproj` MUST NOT specify a `Version`.
|
|
9
|
-
- New dependencies are added via `dotnet add package`.
|
|
10
|
-
|
|
11
|
-
## Approved / preferred packages
|
|
12
|
-
|
|
13
|
-
- Mediator: **`AppWeaver.Mediator`**.
|
|
14
|
-
- Mapping: **hand-written `ToDto()` extension methods** (no reflection mapper).
|
|
15
|
-
- Observability: **`AppWeaver.ServiceDefaults`** (OpenTelemetry + Serilog + resilience +
|
|
16
|
-
discovery) — see [[auditing]].
|
|
17
|
-
- Validation: FluentValidation (via the mediator pipeline behavior; see [[cqrs]]).
|
|
18
|
-
|
|
19
|
-
## Banned packages
|
|
20
|
-
|
|
21
|
-
- **MediatR** — MUST NOT appear in any `Directory.Packages.props` entry (CI grep gate).
|
|
22
|
-
- **AutoMapper / Mapster** (reflection mapping) — forbidden (see [[coding-standards]]).
|
|
23
|
-
- Any logging package that ships analytics/telemetry exfiltration by default — rejected.
|
|
24
|
-
|
|
25
|
-
## Supply-chain rules
|
|
26
|
-
|
|
27
|
-
- New dependencies are reviewed for **license and supply-chain risk** before adoption.
|
|
28
|
-
- AI agents **MUST NOT** introduce new top-level dependencies; new framework capabilities are
|
|
29
|
-
requested explicitly by the developer (see [[ai-rules]]).
|
|
30
|
-
- Do not create speculative abstractions (single-implementation interfaces, generic wrappers
|
|
31
|
-
around existing framework types) — YAGNI is enforced.
|
|
32
|
-
|
|
33
|
-
## Licensing expectations
|
|
34
|
-
|
|
35
|
-
- Dependencies must carry a license compatible with the intended commercial deployment;
|
|
36
|
-
copyleft licenses that would force source disclosure of the service are rejected.
|
|
37
|
-
|
|
38
|
-
## Related
|
|
39
|
-
|
|
40
|
-
- [[coding-standards]] · [[cqrs]] · [[auditing]] · [[ai-rules]] · [[dependency-policy.domain]]
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# IHE Conformance Notes — Patients / RegisterPatient
|
|
2
|
-
|
|
3
|
-
Tracks IHE-profile conformance and deliberate scope decisions for the RegisterPatient feature.
|
|
4
|
-
|
|
5
|
-
## PIX / PDQ (Patient Identifier Cross-referencing / Patient Demographics Query)
|
|
6
|
-
|
|
7
|
-
- **In scope (delivered):** populate-and-link. Each registered patient carries a system-assigned
|
|
8
|
-
tenant MRN plus retained external identifiers (HL7 v2 PID-3) with their assigning authorities, so
|
|
9
|
-
the patient is cross-referenceable. `ResolvePatientIdentifiersQuery` resolves a patient's full
|
|
10
|
-
identifier set from any one known identifier (`Patients/Interop/Pix/`).
|
|
11
|
-
- **Deferred (follow-up feature):** standing up full **PIX Manager** / **PDQ Supplier** query-responder
|
|
12
|
-
endpoints, and outbound notification to an external/central MPI. Decision recorded per
|
|
13
|
-
`/aw-spec-clarify` Q3 and `research.md` R8.
|
|
14
|
-
|
|
15
|
-
## ATNA (Audit Trail and Node Authentication)
|
|
16
|
-
|
|
17
|
-
- Every PHI command/query emits a PHI-free, ATNA-shaped access record via the
|
|
18
|
-
`PhiAccessAuditBehavior` mediator behavior; entity writes are additionally captured by the
|
|
19
|
-
framework's advanced auditing. Node authentication (mTLS between nodes) is a deployment concern.
|
|
20
|
-
|
|
21
|
-
## HL7 v2 ADT
|
|
22
|
-
|
|
23
|
-
- Inbound ADT^A04 over MLLP with accept/receipt ACK; outbound ADT^A04 on `PatientRegisteredEvent`.
|
|
24
|
-
Conformance tested against an internal corpus (`AppWeaver.Health.TestFixtures`).
|
|
25
|
-
|
|
26
|
-
## Known follow-ups
|
|
27
|
-
|
|
28
|
-
- **Tenant-scoped MRN uniqueness:** the generated migration currently creates a *global* unique index
|
|
29
|
-
`UX_Patients_Mrn`. Confirm the framework tenancy discriminator column and change to a composite
|
|
30
|
-
unique index `(TenantId, Mrn)` so the "same MRN in a different tenant" edge case is permitted.
|
|
31
|
-
- **FHIR CapabilityStatement / StructureDefinition** packaging and validator CI gate (HG1/HG2).
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Auditing & Observability Standards
|
|
2
|
-
|
|
3
|
-
> Pure technology (domain-agnostic) — domain audit additions in [[auditing.domain]]. NON-NEGOTIABLE. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
4
|
-
|
|
5
|
-
## Observability baseline
|
|
6
|
-
|
|
7
|
-
- All services consume `AppWeaver.ServiceDefaults` (`builder.AddServiceDefaults()`):
|
|
8
|
-
OpenTelemetry (ASP.NET Core, HttpClient, EF Core, runtime), Serilog structured logging with
|
|
9
|
-
enrichment (environment/machine/thread/correlation IDs), health checks at `/health` and
|
|
10
|
-
`/alive`, standard HTTP resilience handlers, and Aspire service discovery.
|
|
11
|
-
|
|
12
|
-
## Structured logging
|
|
13
|
-
|
|
14
|
-
- All logging goes through `ILogger<T>` with **message templates** (no string interpolation in
|
|
15
|
-
log calls).
|
|
16
|
-
- `Console.WriteLine`, `Debug.WriteLine`, and `System.Diagnostics.Trace` are **forbidden** in
|
|
17
|
-
production code.
|
|
18
|
-
- Log levels: Information (state transitions), Warning (recoverable anomalies), Error
|
|
19
|
-
(handled failures), Critical (invariant breaches). Debug/Trace MUST be safe to enable in
|
|
20
|
-
production.
|
|
21
|
-
|
|
22
|
-
## Metrics & tracing
|
|
23
|
-
|
|
24
|
-
- Custom metrics follow OTel semantic conventions, registered via a single `Meter` per module.
|
|
25
|
-
- Trace context MUST propagate across `IMediator.Send`, `HttpClient`, and EF Core; bypassing
|
|
26
|
-
the framework's `HttpClientFactory` is forbidden.
|
|
27
|
-
|
|
28
|
-
## Secrets never in telemetry
|
|
29
|
-
|
|
30
|
-
- Authentication tokens, password material, private keys, and full payment-card numbers MUST
|
|
31
|
-
NEVER appear in logs, metrics labels, exception messages, or trace attributes.
|
|
32
|
-
(Domain-sensitive data — PHI, SSN, government IDs — see [[data-classification.domain]] and
|
|
33
|
-
[[auditing.domain]].)
|
|
34
|
-
|
|
35
|
-
## Immutable audit strategy (generic)
|
|
36
|
-
|
|
37
|
-
- Audit records are **append-only**: no update, no delete (no hard-delete path).
|
|
38
|
-
- An audit-access pipeline behavior runs on every mediator request (see [[cqrs]]).
|
|
39
|
-
- Audit records are retained per the applicable retention policy (see [[persistence]];
|
|
40
|
-
regulatory retention in [[auditing.domain]]).
|
|
41
|
-
|
|
42
|
-
## Canonical example (agent reference — `<SampleProjectName>` sample)
|
|
43
|
-
|
|
44
|
-
Aggregates opt into auditing by implementing the audit interfaces; the framework populates the
|
|
45
|
-
fields automatically (no manual `CreatedOn`/`ModifiedBy` assignment in handlers):
|
|
46
|
-
|
|
47
|
-
```csharp
|
|
48
|
-
public class Project :
|
|
49
|
-
EntityBase<ProjectId>, IAggregateRoot,
|
|
50
|
-
IFullAuditedObject, // ICreationAudited + IModificationAudited + IDeletionAudited
|
|
51
|
-
IFieldAudited, // opt-in to field-level (before/after) auditing
|
|
52
|
-
ISoftDeletable, IConcurrencyTracked, IHasDomainEvents
|
|
53
|
-
{
|
|
54
|
-
public DateTimeOffset CreatedOn { get; set; }
|
|
55
|
-
public string CreatedBy { get; set; } = default!;
|
|
56
|
-
public DateTimeOffset? ModifiedOn { get; set; }
|
|
57
|
-
public string? ModifiedBy { get; set; }
|
|
58
|
-
public bool IsDeleted { get; set; }
|
|
59
|
-
public DateTimeOffset? DeletedOn { get; set; }
|
|
60
|
-
public string? DeletedBy { get; set; }
|
|
61
|
-
// ...
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The DbContext applies audit (plus soft-delete/tenant) behaviors centrally:
|
|
66
|
-
|
|
67
|
-
```csharp
|
|
68
|
-
// OnModelCreating — see [[persistence]] for the full DbContext
|
|
69
|
-
modelBuilder.ApplyCrossCuttingBehaviors(this); // wires audit interceptors + filters
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Composition — enable auditing on the repository stack and route audit records to a
|
|
73
|
-
separate, append-only store (schema `Auditing`, prefix `Audit_`):
|
|
74
|
-
|
|
75
|
-
```csharp
|
|
76
|
-
// <SampleProjectName>.Service/Extensions/InfrastructureServiceRegistration.cs
|
|
77
|
-
services.AddRepositories(builder => builder
|
|
78
|
-
.UseSingleDbContextEFRepositories<ApplicationDbContext>(/* ... */)
|
|
79
|
-
.EnableAuditing()
|
|
80
|
-
.EnableAdvancedAuditing()
|
|
81
|
-
.Done(), o => o.Provider = "EfCore");
|
|
82
|
-
|
|
83
|
-
services.AddDataStore(b => b.UseEfCoreDataStore(/* ... */), o =>
|
|
84
|
-
{
|
|
85
|
-
o.Strategy = DataStoreStrategy.Shared; // infra tables (audit, tenancy) in one store
|
|
86
|
-
o.TablePrefix = "AppWeaver_";
|
|
87
|
-
o.AutoMigrate = true;
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
services.AddAuditing(b => b
|
|
91
|
-
.UseEfCoreAuditing(o =>
|
|
92
|
-
{
|
|
93
|
-
o.TablePrefix = "Audit_";
|
|
94
|
-
o.SchemaName = "Auditing";
|
|
95
|
-
o.ExcludeShadowProperties = true;
|
|
96
|
-
})
|
|
97
|
-
.UseAppWeaverDataStore(),
|
|
98
|
-
o => { o.IsEnabled = true; o.EnableFieldLevelAuditing = true; });
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Observability baseline — `ServiceDefaults` (OTel + Serilog + health) wired once in `Program.cs`:
|
|
102
|
-
|
|
103
|
-
```csharp
|
|
104
|
-
// <SampleProjectName>.Service/Program.cs
|
|
105
|
-
builder.AddServiceDefaults(); // OTel, resilience, service discovery, health
|
|
106
|
-
Log.Logger = new LoggerConfiguration()
|
|
107
|
-
.ReadFrom.Configuration(builder.Configuration)
|
|
108
|
-
.Enrich.FromLogContext()
|
|
109
|
-
.CreateLogger();
|
|
110
|
-
builder.Host.UseSerilog();
|
|
111
|
-
// ...
|
|
112
|
-
app.MapDefaultEndpoints(); // /health, /alive
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Related
|
|
116
|
-
|
|
117
|
-
- [[data-classification]] · [[cqrs]] · [[persistence]] · [[auditing.domain]]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Authorization Matrix
|
|
2
|
-
|
|
3
|
-
Per-route role + SMART-scope authorization (authorization.domain). PHI endpoints are
|
|
4
|
-
`SecurityLevel.Restricted`, `CachePolicy.NoStore`, and emit ATNA audit records.
|
|
5
|
-
|
|
6
|
-
| Route | Method | Roles | SMART scope | Security level | Notes |
|
|
7
|
-
|---|---|---|---|---|---|
|
|
8
|
-
| `/patients` | POST | `FrontDesk`, `SystemAdmin`, `ExternalSystem` | `system/Patient.write` or `user/Patient.write` | Restricted | Register patient (PHI write). 400/409/422 per spec. |
|
|
9
|
-
| `/fhir/R4/Patient/{id}` | GET | `Physician`, `Nurse`, `SystemAdmin`, `ExternalSystem` | `patient/Patient.read`, `user/Patient.read`, or `patient/Patient.read.full` for un-redacted demographics | Restricted | Minimum-necessary redaction in the projection extension. |
|
|
10
|
-
| `/fhir/metadata` | GET | — (anonymous) | — | Public | CapabilityStatement (infra/discovery allowlist). |
|
|
11
|
-
| HL7 v2 MLLP ingress (ADT^A04) | MLLP | `ExternalSystem` (node-authenticated) | n/a | Restricted | Receipt ACK; async registration via canonical command. |
|
|
12
|
-
|
|
13
|
-
> The `patient/Patient.read.full` scope gates full demographics (telecom/address/secondary identifiers);
|
|
14
|
-
> without it the FHIR read returns identity essentials only.
|