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,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,27 +0,0 @@
1
- MedicinalProduct/
2
-
3
- /aw-spec-orch constitution @docs/pharma-constitution.md
4
-
5
- /aw-spec-orch specify RegisterMedicinalProduct
6
-
7
- Allow an authorized user to register a new medicinal product in the registry.
8
-
9
- On registration the user provides: product name, generic name, NDC, dosage form, strength, route of administration, manufacturer, one or more active ingredients with details, one or more packaging configurations and one or more ATC classification codes.
10
-
11
- The system validates the submission (required attributes, duplicate NDC, valid dosage form and route of administration) and creates the product in the Draft state. A successful registration is auditable and emits a registration event.
12
-
13
- Acceptance:
14
- - A valid submission creates a Draft MedicinalProduct and returns its identifier.
15
- - A malformed or duplicate NDC is rejected with a clear validation error.
16
- - A product missing a required attribute, an active ingredient, or a packaging configuration is rejected.
17
- - The creation is recorded in the audit trail.
18
-
19
- /aw-spec-orch design
20
-
21
- /aw-spec-orch analyze-design
22
-
23
- /aw-spec-orch implement
24
-
25
-
26
-
27
- ==============================================================================================
@@ -1,160 +0,0 @@
1
- # Auditing & Observability Standards
2
-
3
- > Pure technology (domain-agnostic) — domain audit additions in [[auditing.domain]]. NON-NEGOTIABLE. Commands: `/aw-spec-design`.
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
- ## Two auditing levels
43
-
44
- Auditing has exactly **two levels**, chosen **per aggregate** by the marker interfaces the root
45
- implements. The interceptor populates every audit field automatically (no manual
46
- `CreatedOn`/`ModifiedBy` assignment in handlers):
47
-
48
- | Level | Aggregate root implements | Captured | Depth |
49
- |-------|---------------------------|----------|-------|
50
- | **Basic** | `IAuditedObject` (creation+modification) or `IFullAuditedObject` (+soft-delete) | `CreatedBy/On`, `ModifiedBy/On`, `DeletedBy/On`; one `AuditLog` per root per SaveChanges | entity-level (Created/Updated/Deleted) — no before/after |
51
- | **Advanced** | Basic markers **+ `IFieldAudited`** | Basic + field-level before/after (`PropertyChange`: original → new) | entity + property-level previous/new |
52
-
53
- Field-level before/after values exist **only** at the Advanced tier. Children marked
54
- `IAggregateChild` fold into the root's `AuditLog`.
55
-
56
- ## Canonical example (agent reference — `<SampleProjectName>` sample)
57
-
58
- ```csharp
59
- // Basic — lifecycle stamps only
60
- public sealed class Category :
61
- AggregateRootBase<CategoryId>, IAggregateRoot,
62
- IAuditedObject // creation + modification
63
- {
64
- public DateTimeOffset CreatedOn { get; set; }
65
- public string CreatedBy { get; set; } = default!;
66
- public DateTimeOffset? ModifiedOn { get; set; }
67
- public string? ModifiedBy { get; set; }
68
- }
69
-
70
- // Advanced — full lifecycle + field-level (before/after) tracking
71
- public sealed class Project :
72
- AggregateRootBase<ProjectId>, IAggregateRoot,
73
- IFullAuditedObject, // ICreationAudited + IModificationAudited + IDeletionAudited
74
- IFieldAudited, // opt-in to field-level (before/after) auditing
75
- ISoftDeletable, IConcurrencyTracked, IHasDomainEvents
76
- {
77
- public DateTimeOffset CreatedOn { get; set; }
78
- public string CreatedBy { get; set; } = default!;
79
- public DateTimeOffset? ModifiedOn { get; set; }
80
- public string? ModifiedBy { get; set; }
81
- public bool IsDeleted { get; set; }
82
- public DateTimeOffset? DeletedOn { get; set; }
83
- public string? DeletedBy { get; set; }
84
- // ...
85
- }
86
- ```
87
-
88
- The DbContext applies audit (plus soft-delete/tenant) behaviors centrally:
89
-
90
- ```csharp
91
- // OnModelCreating — see [[persistence]] for the full DbContext
92
- modelBuilder.ApplyCrossCuttingBehaviors(this); // wires audit interceptors + filters
93
- ```
94
-
95
- Composition — enable auditing on the repository stack (one `EnableAdvancedAuditing()` registers
96
- the interceptor that serves **both** levels; per-aggregate level is decided by the interfaces
97
- above) and route audit records to a separate, append-only store (schema `Auditing`, prefix
98
- `Audit_`):
99
-
100
- ```csharp
101
- // <SampleProjectName>.Service/Extensions/InfrastructureServiceRegistration.cs
102
- services.AddRepositories(builder => builder
103
- .UseSingleDbContextEFRepositories<ApplicationDbContext>(/* ... */)
104
- .EnableSoftDelete()
105
- .EnableAdvancedAuditing() // AdvancedAuditingSaveChangesInterceptor
106
- .Done(), o => o.Provider = "EfCore");
107
-
108
- services.AddDataStore(b => b.UseEfCoreDataStore(/* ... */), o =>
109
- {
110
- o.Strategy = DataStoreStrategy.Shared; // infra tables (audit, tenancy) in one store
111
- o.TablePrefix = "AppWeaver_";
112
- o.AutoMigrate = true;
113
- });
114
-
115
- services.AddAuditing(b => b
116
- .UseEfCoreAuditing(o =>
117
- {
118
- o.TablePrefix = "Audit_";
119
- o.SchemaName = "Auditing";
120
- o.ExcludeShadowProperties = true;
121
- })
122
- .UseAppWeaverDataStore(),
123
- o => { o.IsEnabled = true; o.EnableFieldLevelAuditing = true; }); // field-level = Advanced
124
- ```
125
-
126
- ## Querying the audit trail (framework-provided)
127
-
128
- The audit store is queryable out of the box via `IAuditEntity` — no bespoke read model required:
129
-
130
- ```csharp
131
- // by resource identity
132
- var logs = await auditEntity.GetAuditLogsAsync(typeof(Project).FullName!, projectId.ToString());
133
- // by user / action / time, with paging
134
- var page = await auditEntity.GetAuditLogsAsync(new AuditLogFilter { UserId = "u1", Action = AuditAction.Updated, Take = 10 });
135
- // by user / tenant
136
- await auditEntity.GetAuditLogsByUserAsync("u1");
137
- await auditEntity.GetAuditLogsByTenantAsync("tenant-alpha");
138
- ```
139
-
140
- Each `AuditLog` carries `{ UserId, UserName, Timestamp, Action, EntityType, EntityId, Metadata
141
- (correlationId, …) }`; its `EntityChanges` hold entity-level `ChangeType`, and — for `IFieldAudited`
142
- roots — nested `PropertyChanges` with `OriginalValue → NewValue`.
143
-
144
- Observability baseline — `ServiceDefaults` (OTel + Serilog + health) wired once in `Program.cs`:
145
-
146
- ```csharp
147
- // <SampleProjectName>.Service/Program.cs
148
- builder.AddServiceDefaults(); // OTel, resilience, service discovery, health
149
- Log.Logger = new LoggerConfiguration()
150
- .ReadFrom.Configuration(builder.Configuration)
151
- .Enrich.FromLogContext()
152
- .CreateLogger();
153
- builder.Host.UseSerilog();
154
- // ...
155
- app.MapDefaultEndpoints(); // /health, /alive
156
- ```
157
-
158
- ## Related
159
-
160
- - [[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.
@@ -1,87 +0,0 @@
1
- # Authorization Standards
2
-
3
- > Pure technology (domain-agnostic) — domain roles & matrix in [[authorization.domain]]. NON-NEGOTIABLE. Commands: `/aw-spec-design`.
4
-
5
- ## Authorization model
6
-
7
- - Authorization is **role-based AND scope-based** — both MUST pass.
8
- - Per-route authorization is declared per endpoint via `Roles(...)` + scope evaluation,
9
- documented in an authorization matrix.
10
- - Identity comes from an external IdP via `.AddAppWeaverSecurity(...)` — local identity stores
11
- forbidden (see [[zero-trust]]).
12
- - (The concrete role set and scope syntax are domain-specific — see [[authorization.domain]].)
13
-
14
- ## Policy evaluation
15
-
16
- - Endpoints inherit `SecureFastEndpoint<TRequest, TResponse>` and MUST override
17
- `GetSecurityCachePolicy()` to declare `SecurityLevel` and `CachePolicy`.
18
- - Mutating endpoints MUST use `CachePolicy.NoStore`.
19
- - Sensitive-data read endpoints MUST use `CachePolicy.NoStore`.
20
- - Field-level redaction (minimum-necessary) lives in **projection extensions**, not
21
- controllers (see [[data-classification]]; domain specifics in [[authorization.domain]]).
22
-
23
- ## Endpoint authorization patterns
24
-
25
- - `AllowAnonymous()` is permitted **only** for infrastructure/discovery endpoints
26
- (`/.well-known`, `/health`, `/alive`, service metadata) and during initial scaffolding
27
- before merge to a protected branch.
28
- - `AllowAnonymous()` on sensitive-data or mutating endpoints in any CI-protected branch is a
29
- Forbidden Pattern (CI grep gate; see [[coding-standards]]).
30
-
31
- ## Canonical example (agent reference — `<SampleProjectName>` sample)
32
-
33
- Secure endpoint — declare auth scheme + roles in `Configure()`, and the security/cache policy
34
- in `GetSecurityCachePolicy()`:
35
-
36
- ```csharp
37
- public override void Configure()
38
- {
39
- Post("/projects");
40
- AuthSchemes("Bearer"); // JWT from the external IdP
41
- Roles("Admin"); // role-based gate (combine with scope checks for FHIR — see .domain)
42
- Summary(s => s.Summary = "Create a new project");
43
- Options(o => o.WithTags("02 - Project - (FastEndpoints)"));
44
- }
45
-
46
- protected override SecurityCachePolicy GetSecurityCachePolicy() => new()
47
- {
48
- SecurityLevel = SecurityLevel.Internal, // Internal | Restricted (admin/sensitive)
49
- CachePolicy = CachePolicy.NoStore // NoStore for mutating/sensitive; PrivateCache for cacheable reads
50
- };
51
- ```
52
-
53
- > Mutating endpoints use `CachePolicy.NoStore`. Admin/audit endpoints (e.g. list-including-deleted)
54
- > use `SecurityLevel.Restricted`. `AllowAnonymous()` is only for infrastructure/discovery routes
55
- > or pre-merge scaffolding (the template ships endpoints scaffolded with `AllowAnonymous()` and
56
- > the `AuthSchemes`/`Roles` lines commented — replace them before merging to a protected branch).
57
-
58
- Composition — external IdP only (no local identity store), role-based authorization:
59
-
60
- ```csharp
61
- // <SampleProjectName>.Service/Program.cs
62
- builder.Services.AddAppWeaverSecurity(security =>
63
- {
64
- security
65
- .AddAuthentication(auth =>
66
- {
67
- if (authProvider == "EntraExternalID")
68
- auth.UseEntraExternalID(o => { o.TenantId = cfg["EntraExternalID:TenantId"]!;
69
- o.ClientId = cfg["EntraExternalID:ClientId"]!; }, cfg);
70
- else
71
- auth.UseAzureAdB2C(o => { o.Domain = cfg["AzureAdB2C:Domain"]!;
72
- o.ClientId = cfg["AzureAdB2C:ClientId"]!;
73
- o.SignUpSignInPolicyId = cfg["AzureAdB2C:SignUpSignInPolicyId"]!; }, cfg);
74
- })
75
- .AddAuthorization(authz => authz.UseRoleBased(o => o.AdminRole = "Admin"));
76
- // NOTE: no .AddIdentity(...) — the IdP is the source of truth (see [[zero-trust]])
77
- }, options => { }, configuration: cfg);
78
-
79
- // ... pipeline order ...
80
- app.UseAuthentication();
81
- app.UseAuthorization();
82
- app.UseFastEndpoints();
83
- ```
84
-
85
- ## Related
86
-
87
- - [[zero-trust]] · [[auditing]] · [[data-classification]] · [[authorization.domain]]
@@ -1,38 +0,0 @@
1
- # Data Classification Standards
2
-
3
- > Pure technology (domain-agnostic) — domain data categories in [[data-classification.domain]]. NON-NEGOTIABLE. Commands: `/aw-spec-design`.
4
-
5
- ## Classification framework
6
-
7
- - Every data element is assigned a **sensitivity class**; controls (encryption, masking,
8
- logging, export) are applied per class.
9
- - The concrete sensitivity taxonomy is project/domain-specific — see
10
- [[data-classification.domain]] for the domain taxonomy.
11
-
12
- ## Masking rules
13
-
14
- - Field-level redaction is applied in **projection extensions**, not controllers
15
- (minimum-necessary by role/scope — see [[authorization]]).
16
-
17
- ## Encryption requirements
18
-
19
- - AES-256 at rest (DB TDE + customer-managed key); TLS 1.2+ in transit (1.3 target);
20
- encrypted backups.
21
- - **Application-level field encryption** for the most sensitive fields (the concrete field
22
- list is domain-specific — see [[data-classification.domain]]).
23
-
24
- ## Logging restrictions
25
-
26
- - **NEVER** log or emit in metrics/traces: authentication tokens, password material, private
27
- keys, or full payment-card data.
28
- (Domain-sensitive elements — PHI, SSN, government IDs — see [[data-classification.domain]].)
29
-
30
- ## Export restrictions
31
-
32
- - Production data MUST NOT be copied to non-production environments without an approved
33
- de-identification / anonymization step.
34
- - (Domain de-identification / anonymization specifics — see [[data-classification.domain]].)
35
-
36
- ## Related
37
-
38
- - [[auditing]] · [[authorization]] · [[zero-trust]] · [[data-classification.domain]]
@@ -1,76 +0,0 @@
1
- # Zero-Trust Standards
2
-
3
- > Pure technology (domain-agnostic) — domain additions in [[zero-trust.domain]]. NON-NEGOTIABLE where marked. Commands: `/aw-spec-design`.
4
-
5
- ## Transport security (mTLS / TLS)
6
-
7
- - HTTPS is enforced; **TLS 1.2 is the floor, TLS 1.3 the target**.
8
- - CORS uses **explicit allow-lists** — no wildcards.
9
-
10
- ## Workload identity
11
-
12
- - Identity is composed via `.AddAppWeaverSecurity(...)` with an **external IdP**.
13
- - **Local identity stores are FORBIDDEN.**
14
-
15
- ## Service authentication
16
-
17
- - Backing services and the IdP are declared as Aspire resources; connection strings,
18
- hostnames, and ports are **discovered through Aspire — never hard-coded**.
19
-
20
- ## Token propagation
21
-
22
- - Tokens / scopes are propagated through the request pipeline and honored on every endpoint
23
- (see [[authorization]]).
24
- - Trace context propagates across `IMediator.Send`, `HttpClient`, and EF Core — bypassing the
25
- framework `HttpClientFactory` is forbidden.
26
-
27
- ## Internal authorization
28
-
29
- - Authorization is **role-based AND scope-based** — both enforced (see [[authorization]]).
30
- - Authentication tokens, password material, and private keys MUST NEVER appear in logs,
31
- metrics, traces, or error messages (see [[data-classification]]).
32
-
33
- ## Secrets
34
-
35
- - Secrets MUST come from **Aspire parameters** or a secrets manager (e.g. Azure Key Vault,
36
- AWS Secrets Manager, HashiCorp Vault) — **NEVER from `appsettings.json`**.
37
- - Hard-coded connection strings, secrets, ports, or issuer URLs in source are a Forbidden
38
- Pattern (see [[coding-standards]]).
39
-
40
- ## Canonical example (agent reference — `<SampleProjectName>` sample)
41
-
42
- Secrets/IdP config read from configuration (Aspire parameters / secrets manager) — never
43
- hard-coded; explicit CORS allow-list; HTTPS enforced outside development:
44
-
45
- ```csharp
46
- // <SampleProjectName>.Service/Program.cs
47
- var cfg = builder.Configuration;
48
-
49
- // IdP settings come from config — no client secrets or issuer URLs in source (see [[authorization]])
50
- builder.Services.AddAppWeaverSecurity(security => security
51
- .AddAuthentication(auth => auth.UseAzureAdB2C(o =>
52
- {
53
- o.Instance = cfg["AzureAdB2C:Instance"]!;
54
- o.Domain = cfg["AzureAdB2C:Domain"]!;
55
- o.ClientId = cfg["AzureAdB2C:ClientId"]!;
56
- }, cfg))
57
- .AddAuthorization(authz => authz.UseRoleBased(o => o.AdminRole = "Admin")),
58
- options => { }, configuration: cfg);
59
-
60
- // Explicit CORS allow-list — no wildcards
61
- builder.Services.AddCors(o => o.AddPolicy("DevelopmentPolicy", p => p
62
- .WithOrigins("http://localhost:7000", "http://localhost:3000")
63
- .AllowAnyMethod().AllowAnyHeader().AllowCredentials()));
64
-
65
- var app = builder.Build();
66
- app.UseCors("DevelopmentPolicy");
67
- app.UseAuthentication();
68
- app.UseAuthorization();
69
-
70
- if (!app.Environment.IsEnvironment("Development"))
71
- app.UseHttpsRedirection(); // enforce HTTPS outside dev
72
- ```
73
-
74
- ## Related
75
-
76
- - [[authorization]] · [[auditing]] · [[data-classification]] · [[zero-trust.domain]]
@@ -1,172 +0,0 @@
1
- # Technology Constitution (domain-agnostic base)
2
-
3
- > **AppWeaver template — reusable engineering constitution.**
4
- > This file holds the technology-only principles. It is **not ratified on its own** — it is
5
- > composed with exactly **one** domain addenda file at ratification time.
6
-
7
- ## How to use (compose-at-ratification)
8
-
9
- This file is **auto-loaded** by `/aw-spec-constitution` (it is in that command's auto-loaded
10
- engineering-standards set). You therefore pass only the **domain addenda**, which composes on
11
- top of this base:
12
-
13
- ```
14
- /aw-spec-constitution @docs/healthcare-constitution.md
15
- /aw-spec-constitution @docs/pharma-constitution.md
16
- ```
17
-
18
- `/aw-spec-constitution` merges the auto-loaded technology base with the supplied domain addenda
19
- into the single ratified `.aw-spec/memory/constitution.md` (auto-loaded by every command
20
- thereafter). Passing `@docs/technology-constitution.md` explicitly is harmless but redundant.
21
-
22
- - Core Principles **I–XV** below are domain-agnostic and reused verbatim across every project.
23
- - **PROJECT IDENTITY**, **REGULATORY REGIME**, domain principles (**XVI+**), folder additions,
24
- and governance-override values are **supplied by the domain addenda file** — do not fill them
25
- here.
26
- - Paths below use this repo's `docs/...` root. In a generated solution where the
27
- engineering-standards docs live under `code/docs/...`, adjust the prefix accordingly.
28
-
29
- Treat this content as the canonical, supreme engineering authority that supersedes README,
30
- CLAUDE.md, AGENTS.md, and any other guidance. The detailed rules for each principle live in the
31
- engineering-standards docs under `docs/` (see the Context-Loading Map at the end); this
32
- file stays slim and authoritative.
33
-
34
- ## Project Identity
35
-
36
- *Supplied by the domain addenda file.* Project name, mission, bounded contexts, regulatory
37
- regime, data residency, and architecture posture are provided by the composed domain addenda
38
- file (`docs/<domain>-constitution.md`). The technology base stays domain-agnostic.
39
-
40
- ## Runtime Style
41
-
42
- A Modular Monolith built to evolve into independent services. It combines Clean Architecture,
43
- Domain-Driven Design, CQRS + Mediator, Vertical Slice feature organization, and
44
- Specification-Driven Development. Cross-cutting concerns are delegated to the AppWeaver
45
- framework family; business logic lives inside aggregates inside their owning module.
46
-
47
- ## Core Principles (domain-agnostic)
48
-
49
- > Essence only — full rules in `docs/`, see the map below.
50
-
51
- ### I — Modular Monolith with Vertical Slices (NON-NEGOTIABLE)
52
- Single deployable service partitioned into modules; each module = Domain/Features/Persistence/Shared; each feature is a self-contained vertical slice; no cross-module Domain coupling; no horizontal service layers.
53
- → `docs/architecture/modular-monolith.md`, `vertical-slices.md`
54
-
55
- ### II — Clean Architecture Dependency Rule (NON-NEGOTIABLE)
56
- Dependencies flow inward: API → Application → Domain ← Infrastructure. Domain is framework-agnostic; endpoints call `IMediator`, never repositories/DbContext.
57
- → `docs/architecture/clean-architecture.md`
58
-
59
- ### III — Domain-Driven Design with Rich Aggregates (NON-NEGOTIABLE)
60
- Access entities through aggregate roots; strongly-typed Vogen IDs; sealed validating value objects; immutable domain events; invariants enforced in the aggregate; transaction boundary = aggregate boundary.
61
- → `docs/domain/domain-driven-design.md`
62
-
63
- ### IV — CQRS via Mediator with Result Pattern (NON-NEGOTIABLE)
64
- All logic dispatched via AppWeaver.Mediator; commands/queries return `Result<T>`; errors are `Result.Failure` (not exceptions); writes run in a transaction and publish domain events.
65
- → `docs/architecture/cqrs.md`
66
-
67
- ### V — Specification-Driven Persistence (NON-NEGOTIABLE)
68
- Query composition lives in Domain Specifications; no ad-hoc LINQ in handlers; no cross-aggregate EF navigation joins; reference parents by strongly-typed ID.
69
- → `docs/architecture/persistence.md`
70
-
71
- ### VI — Immutable Contracts at the Edge
72
- Shared DTOs mapped with hand-written `ToDto()`; no reflection mappers; `RowVersionBase64` on concurrency-tracked DTOs; standard `PagedResult<T>`; external projections stay parallel.
73
- → `docs/architecture/vertical-slices.md`
74
-
75
- ### VII — Optimistic Concurrency via ETag / If-Match (NON-NEGOTIABLE)
76
- Mutable aggregates implement `IConcurrencyTracked`; ETag set on every create/read/update; `If-Match` required on update/delete; mismatch → 409 `concurrency.conflict`.
77
- → `docs/architecture/persistence.md`, `docs/governance/api-versioning.md`
78
-
79
- ### VIII — Multi-Provider, Multi-Tenant Persistence
80
- Provider-aware `ContextAwareDbContext`; PostgreSQL production / SQLite dev (non-sensitive); client-managed concurrency tokens; cross-cutting soft-delete/tenant/audit behaviors; hard delete forbidden for retention-protected data.
81
- → `docs/architecture/persistence.md`
82
-
83
- ### IX — Security by Default (NON-NEGOTIABLE)
84
- `SecureFastEndpoint` + declared cache policy; external IdP only (no local identity); role-based **and** scope-based auth; secrets from a manager not appsettings; TLS 1.2+; explicit CORS; sensitive data encrypted in transit and at rest (CMK).
85
- → `docs/security/zero-trust.md`, `authorization.md`, `data-classification.md`
86
-
87
- ### X — Observability is a First-Class Citizen (NON-NEGOTIABLE)
88
- AppWeaver.ServiceDefaults (OTel + Serilog + health + resilience + discovery); `ILogger` message templates only; never log secrets/regulated data; every sensitive read/mutation emits an audit record; trace context propagates everywhere.
89
- → `docs/security/auditing.md`, `data-classification.md`
90
-
91
- ### XI — Cloud-Native Orchestration via .NET Aspire
92
- AppHost is the composition root; backing services are Aspire resources referenced via `.WithReference(...)`; no hard-coded connection strings/ports; Helm stays in sync with the AppHost projection.
93
- → `docs/security/zero-trust.md`, `architecture/eventing.md`
94
-
95
- ### XII — REST API Standards
96
- Internal REST (FastEndpoints, one endpoint/file, kebab routes); standard paging; versioned breaking changes; machine-readable contracts (OpenAPI). Domain interoperability surfaces (e.g. FHIR) are added by the domain addenda.
97
- → `docs/governance/api-versioning.md`, `architecture/vertical-slices.md`
98
-
99
- ### XIII — Test-First Engineering
100
- Tests for every aggregate behavior/value object/specification/handler/endpoint; deterministic (`IClock`/`IGuidGenerator`); contract changes ship with test updates in the same commit.
101
- → `docs/architecture/testing.md`
102
-
103
- ### XIV — Data Integration Layer / Single Source of Truth (NON-NEGOTIABLE)
104
- Authoritative system of record; consumers use the REST API / published projections / CloudEvents only; no direct DB access; inbound feeds flow through Interop adapters; versioned machine-readable schemas.
105
- → `docs/architecture/eventing.md`, `docs/governance/api-versioning.md`
106
-
107
- ### XV — Evolutionary Path to Microservices
108
- Modules own their aggregates/persistence/DTOs/projectors/events; cross-module access via Shared DTOs or `IMediator`; per-module schemas recommended; extraction approved by amendment.
109
- → `docs/architecture/modular-monolith.md`
110
-
111
- > **Domain principles (XVI and beyond) are supplied by the domain addenda file.**
112
-
113
- ## Mandatory Folder Structure
114
-
115
- Governed by the engineering-standards docs; this file does not duplicate the tree.
116
-
117
- - Technology layout (src/tests/helm/docs, module = Domain/Features/Persistence/Shared): `docs/architecture/folder-structure.md`
118
- - Domain-specific additions (Interop adapters, domain test fixtures, regulatory controls): supplied by the domain addenda + `docs/domainspecs/<domain>/folder-structure.domain.md`
119
-
120
- Project names use the `<SampleProjectName>` placeholder. Cross-cutting files (`Program.cs`, `GlobalUsings.cs`, `Directory.Build.props`, `Directory.Packages.props`, `global.json`) MUST stay at the same level they occupy in the AppWeaver template.
121
-
122
- ## Conventions, Forbidden Patterns, AI Rules, Quality Gates
123
-
124
- These are governed in full by the engineering-standards docs; this file does not duplicate them.
125
-
126
- - Naming & coding conventions, the Forbidden Patterns, and the CI Quality Gates: `docs/governance/coding-standards.md`
127
- - Package governance (approved/banned packages, supply-chain, licensing): `docs/governance/dependency-policy.md`
128
- - AI operational rules (generation, context loading, refusal conditions): `docs/glossary/ai-rules.md` (the domain addenda extends this with domain-specific masking / code / refusal rules)
129
-
130
- ## Governance
131
-
132
- - This constitution supersedes all other engineering documentation in the repository (README.md, CLAUDE.md, AGENTS.md, wiki pages). Where they disagree, this document wins. The `docs/` engineering standards are the authorized expansion of these principles; if a doc contradicts a principle here, this file wins and the doc is corrected.
133
- - Amendments are proposed via pull request that modifies `.aw-spec/memory/constitution.md` (and the affected `docs/` files), includes a migration plan for non-compliant code, bumps the version per the policy below, and is approved per the roles named in the domain addenda's Governance Overrides (at minimum one Principal Engineer + the domain's mandatory approver).
134
- - Versioning follows SemVer applied to governance:
135
- - **MAJOR** — removal or weakening of a NON-NEGOTIABLE principle, or a backward-incompatible change to the Mandatory Folder Structure or a domain's canonical interoperability surface.
136
- - **MINOR** — addition of a new principle, new mandatory section, or new bounded context.
137
- - **PATCH** — clarifications, wording fixes, non-semantic edits.
138
- - Compliance review happens on every PR. Reviewers MUST cite the principle number when requesting changes.
139
- - A quarterly architecture and security review MUST audit a random sample of modules against this constitution and file remediation tickets for any deviation.
140
- - Runtime guidance (CLAUDE.md / AGENTS.md) MUST contain a single pointer to this constitution and MUST NOT duplicate or paraphrase its rules.
141
- - Domain-specific governance overrides (approver roles, regulatory review triggers, control mappings) are supplied by the domain addenda file.
142
-
143
- ## Context-Loading Map
144
-
145
- > Include only the relevant docs per AW-Spec command. Full index: `docs/README.md`.
146
-
147
- **Doc naming convention (technology vs. domain):**
148
-
149
- - `docs/<area>/<name>.md` = **pure technology** rule, domain-agnostic — reusable across any project. **Loaded automatically** by each AW-Spec command (see the command's SKILL.md); you do not pass them by hand.
150
- - `docs/domainspecs/<domain>/<name>.md` and `<name>.domain.md` = **domain-specific** rules under one folder. The `.domain.md` files extend the matching technology file; the plain `.md` files are inherently domain.
151
-
152
- **Per-command file map** (technical default that auto-loads vs. domain files to add):
153
-
154
- - Technical defaults: the *Auto-Loaded Engineering Standards* section in each `.claude/skills/aw-spec-<command>/SKILL.md` (authoritative).
155
- - Domain files: the active domain's `docs/domainspecs/<domain>/comandrulemap.md`.
156
-
157
- Rule of thumb: technology standards auto-load; add only the domain files listed in the active domain's `comandrulemap.md` for the slice you are building.
158
-
159
- ## Domain Requirements
160
-
161
- Project-specific and maintained separately so it can be updated independently per project:
162
- → `docs/domainspecs/<domain>/domain-requirements.md` (named by the domain addenda file)
163
-
164
- This holds `[DOMAIN: Bounded Contexts / Modules]`, the per-subsection pointers into `docs/`, `[DOMAIN: Platform Topology]`, and `[DOMAIN: Governance Overrides]`. The technology base above stays domain-agnostic.
165
-
166
- ## Ratification Metadata
167
-
168
- > Finalized by the composed domain addenda.
169
-
170
- - **Version:** 1.0.0
171
- - **Ratified:** `<YYYY-MM-DD>`
172
- - **Last Amended:** `<YYYY-MM-DD>`