aw-spec-cli 0.1.33 → 0.1.34

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 (75) hide show
  1. package/README.md +76 -81
  2. package/assets/.appweaver/DESIGN-FORMAT.md +57 -25
  3. package/assets/.appweaver/STACK-PROFILES.md +95 -60
  4. package/assets/.appweaver/orchestrator/LAUNCHER.md +1 -1
  5. package/assets/.appweaver/orchestrator/modules/delta-plan.orch.yaml +173 -32
  6. package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +29 -1
  7. package/assets/.appweaver/orchestrator/modules/foundation-pack.orch.yaml +7 -4
  8. package/assets/.appweaver/orchestrator/modules/foundation-spec.orch.yaml +49 -60
  9. package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +58 -0
  10. package/assets/.appweaver/orchestrator/orchestrator.py +26 -8
  11. package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +20 -20
  12. package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +22 -48
  13. package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +9 -7
  14. package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +5 -5
  15. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +239 -40
  16. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-plan-delta.orch.yaml +254 -43
  17. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-plan.orch.yaml +248 -68
  18. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice-delta.orch.yaml +251 -20
  19. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +316 -10
  20. package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +6 -47
  21. package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +62 -16
  22. package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +132 -9
  23. package/assets/.appweaver/orchestrator/workflows/aw-spec-fix-test-coverage.orch.yaml +965 -0
  24. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +222 -169
  25. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +21 -22
  26. package/assets/.appweaver/orchestrator/workflows/aw-spec-plan.orch.yaml +453 -120
  27. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-lane.orch.yaml +2 -2
  28. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +83 -6
  29. package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +45 -2
  30. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +324 -74
  31. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +275 -44
  32. package/assets/.appweaver/scripts/python/aw-foundation.py +16 -13
  33. package/assets/.appweaver/scripts/python/aw-gaps.py +11 -3
  34. package/assets/.appweaver/scripts/python/aw-model-guard.py +295 -0
  35. package/assets/.appweaver/scripts/python/aw-plan-coverage.py +412 -3
  36. package/assets/.appweaver/scripts/python/aw-plangate.py +23 -16
  37. package/assets/.appweaver/scripts/python/aw-stack.py +1794 -265
  38. package/assets/.appweaver/stack-profiles/dotnet-webapi.json +0 -2
  39. package/assets/.appweaver/stack-profiles/java-spring.json +0 -2
  40. package/assets/.appweaver/templates/api-plan-template.md +107 -0
  41. package/assets/.appweaver/templates/delta-api-plan-template.md +87 -0
  42. package/assets/.appweaver/templates/delta-design-template.md +25 -23
  43. package/assets/.appweaver/templates/delta-spec-template.md +3 -3
  44. package/assets/.appweaver/templates/design-template.md +20 -42
  45. package/assets/.appweaver/templates/domain-model-template.md +3 -0
  46. package/assets/.appweaver/templates/ui-delta-design-template.md +11 -8
  47. package/assets/.appweaver/templates/ui-design-template.md +4 -4
  48. package/assets/foundations/foundation.spec.template.txt +25 -18
  49. package/assets/guardrails/README.md +61 -25
  50. package/assets/guardrails/methodology/ux/accessibility-standards.md +38 -0
  51. package/assets/guardrails/methodology/ux/content-design.md +34 -0
  52. package/assets/guardrails/methodology/ux/interaction-states.md +45 -0
  53. package/assets/guardrails/methodology/ux/journey-mapping.md +41 -0
  54. package/assets/guardrails/project-specific/domain/domain-requirements.md +25 -38
  55. package/assets/guardrails/project-specific/domain-rule-bindings.md +33 -69
  56. package/assets/guardrails/project-specific/frontend/ui-requirements.md +2 -2
  57. package/assets/guardrails/project-specific/service/technical-requirements.md +2 -2
  58. package/assets/guardrails/project-specific/tech-rule-bindings.md +16 -13
  59. package/assets/guardrails/sample-healthcare/domain/domain-requirements.md +58 -0
  60. package/assets/guardrails/sample-healthcare/domain-rule-bindings.md +138 -0
  61. package/assets/guardrails/sample-healthcare/frontend/ui-requirements.md +43 -0
  62. package/assets/guardrails/sample-healthcare/service/technical-requirements.md +40 -0
  63. package/assets/guardrails/sample-healthcare/tech-rule-bindings.md +303 -0
  64. package/dist/commands/init.d.ts.map +1 -1
  65. package/dist/commands/init.js +216 -7
  66. package/dist/commands/init.js.map +1 -1
  67. package/dist/utils/config.js +1 -1
  68. package/dist/utils/config.js.map +1 -1
  69. package/dist/utils/foundation.d.ts +36 -0
  70. package/dist/utils/foundation.d.ts.map +1 -0
  71. package/dist/utils/foundation.js +109 -0
  72. package/dist/utils/foundation.js.map +1 -0
  73. package/dist/utils/paths.js +1 -1
  74. package/dist/utils/paths.js.map +1 -1
  75. package/package.json +1 -1
@@ -1,8 +1,9 @@
1
1
  # Guardrails — Index & Rule-Loading Map
2
2
 
3
3
  Rules live in **shared corpora**, keyed on the one thing that makes them differ: a technical rule
4
- varies by **stack**, a domain rule varies by **industry**. A **project** owns neither corpus. It
5
- owns two maps that say which files it loads, plus the handful of files its own team authors.
4
+ varies by **stack**, a domain rule varies by **industry**, and a methodology rule by neither. A
5
+ **project** owns no corpus. It owns two maps that say which files it loads, plus the handful of
6
+ files its own team authors.
6
7
 
7
8
  ```
8
9
  guardrails/
@@ -13,30 +14,40 @@ guardrails/
13
14
  ├── domain/<industry>/ domain rules — vary by industry, never by stack
14
15
  │ ├── healthcare/
15
16
  │ └── pharma/
16
- ├── project-specific/ the project's own rules — what it SELECTS from the corpora
17
- │ ├── tech-rule-bindings.md → technology/{{backend_stack}}/ + technology/{{frontend_stack}}/
18
- │ ├── domain-rule-bindings.md → domain/healthcare/
17
+ ├── methodology/<topic>/ methodology rules — vary by neither stack nor industry
18
+ │ └── ux/ how specify states the experience
19
+ ├── project-specific/ the ACTIVE project as shipped — maps no industry corpus
20
+ │ ├── tech-rule-bindings.md → technology/{{backend_stack}}/ + technology/{{frontend_stack}}/ + methodology/ux/
21
+ │ ├── domain-rule-bindings.md → its own domain/domain-requirements.md only
19
22
  │ ├── service/technical-requirements.md PROJECT-SUPPLIED
20
23
  │ ├── frontend/ui-requirements.md PROJECT-SUPPLIED
21
- │ └── domain/domain-requirements.md PROJECT-SUPPLIED
24
+ │ └── domain/domain-requirements.md PROJECT-SUPPLIED (a blank template)
25
+ ├── sample-healthcare/ a worked project on the healthcare corpus — same shape, filled in
26
+ │ ├── tech-rule-bindings.md → as project-specific, with domain/healthcare/ux/ + ihe-conformance.md
27
+ │ └── domain-rule-bindings.md → domain/healthcare/
22
28
  └── brf-<name>/ a project `onboard` reverse-engineers from existing code
23
29
  ```
24
30
 
25
31
  **The active project is the folder `.appweaver/domain.json` names** — `project-specific` as shipped,
26
32
  and `brf-<name>` once `onboard` has run, because onboard creates that folder and writes its name
27
- there. No sequence selects a project. To use another one, copy `project-specific/` to a new folder
28
- here, change the `guardrails/project-specific/` paths inside its two maps to the new folder, and run
29
- the optional `/appweaver select-domain <name>` — it lists the folders here that hold a map and
30
- writes the one picked into `domain.json` (editing `"domain"` by hand does the same). It never
31
- creates a folder. Re-run `/appweaver constitution` after switching so the constitution follows.
33
+ there. No sequence selects a project. As shipped, `project-specific` maps no industry corpus: a
34
+ team fills in its three files and adds the corpora it uses to its two maps. `sample-healthcare` is
35
+ the same shape filled in for the healthcare corpus — `/appweaver select-domain sample-healthcare`
36
+ switches to it whole, and its maps show which files of an industry corpus go under which heading.
37
+ To start a project of your own from either, copy the folder to a new one here, change the
38
+ `guardrails/<folder>/` paths inside its two maps to the new folder, and run the optional
39
+ `/appweaver select-domain <name>` — it lists the folders here that hold a map and writes the one
40
+ picked into `domain.json` (editing `"domain"` by hand does the same). It never creates a folder.
41
+ Re-run `/appweaver constitution` after switching so the constitution follows.
32
42
  `resolve-tech` and `resolve-domain` read the active project's two maps. **To change what a command
33
- loads, edit the map — never a workflow.** The folder names `technology/` and `domain/` are the only
34
- vocabulary here: a project's maps may point anywhere, in any combination.
43
+ loads, edit the map — never a workflow.** The folder names `technology/`, `domain/` and
44
+ `methodology/` are the only vocabulary here: a project's maps may point anywhere, in any combination.
35
45
 
36
46
  **A directory under `guardrails/` is a project only if it carries a rule map.** Both shells'
37
47
  `list-domains` enforces that, exactly as `foundations/` requires a `*.pack.txt` or `*.spec.txt` — the
38
- corpora `technology/` and `domain/` carry no map, so they are never taken for a project. Either map
39
- qualifies, because `onboard` writes the domain map several steps before the technical one.
48
+ corpora `technology/`, `domain/` and `methodology/` carry no map, so they are never taken for a
49
+ project. Either map qualifies, because `onboard` writes the domain map several steps before the
50
+ technical one.
40
51
 
41
52
  **The technical map names no stack.** Every path in `project-specific/tech-rule-bindings.md` writes
42
53
  its stack directory as `{{backend_stack}}` or `{{frontend_stack}}`, resolved from the lanes in
@@ -92,19 +103,25 @@ pointer per principle, so sample code is weight without a reader.
92
103
 
93
104
  **A file's tier is set by the map that lists it, not by the folder it lives in.**
94
105
  `domain/healthcare/ihe-conformance.md` is the live proof: it sits in the domain corpus because IHE
95
- is a healthcare standard, and it is on the **technical** tier because `tech-rule-bindings.md`
96
- is what lists it. Infer the tier from the folder and the fold breaks.
106
+ is a healthcare standard, and it is on the **technical** tier because
107
+ `sample-healthcare/tech-rule-bindings.md` is what lists it. The `methodology/ux/` rules are the
108
+ same: technical tier, because a technical map lists them. Infer the tier from the folder and the
109
+ fold breaks.
97
110
 
98
111
  ## Adding to the tree
99
112
 
100
113
  - **A stack** — create `technology/<stack-id>/`, author the rules domain-free, map them from a
101
114
  project. See [technology/java-spring/README.md](technology/java-spring/README.md), which is that
102
115
  procedure written out. Use the stack id from `.appweaver/stack-profiles/`, so a lane in
103
- `stacks.json` and a rule folder are the same word.
116
+ `stacks.json` and a rule folder are the same word. Give the files the names the project's
117
+ map lists under `technology/{{backend_stack}}/` or `technology/{{frontend_stack}}/`:
118
+ `/appweaver select-stack` counts how many of those exist for each stack and reports the
119
+ stack as complete, partial or without a rule set (`stack-rules`).
104
120
  - **An industry** — create `domain/<industry>/`, author the overlays, point a project's
105
121
  `domain-rule-bindings.md` at it. The technical map needs no edit.
106
- - **A project** — fill in `project-specific/`: repoint the bullets and replace the three
107
- project-supplied files. Nothing outside that folder changes.
122
+ - **A project** — fill in `project-specific/`: add the corpora it uses as bullets in its two maps
123
+ and replace the three project-supplied files. `sample-healthcare/` is that done for one
124
+ industry. Nothing outside the project's folder changes.
108
125
 
109
126
  ## Files — technical (`technology/dotnet-webapi/`)
110
127
 
@@ -147,8 +164,25 @@ same name.
147
164
  Mapping `## /aw-spec-ui-*` in a project's `tech-rule-bindings.md` is what declares that the project
148
165
  *has* a frontend lane. With no such heading, `constitution` skips the UI half and creates no file.
149
166
 
167
+ ## Files — methodology (`methodology/ux/`)
168
+
169
+ **Experience** — mapped under `## /aw-spec-specify` on the **technical** tier by the shipped
170
+ `project-specific/` map: they govern how `specify` states the experience, and the spec's Experience
171
+ Scope + Experience Standards (`UX-`) are what `prototype`, `ui-design` and `ui-implement` author
172
+ and verify against. Each carries a "What must NOT appear" section — that is what keeps screens,
173
+ pages and components out of the spec. They hold for every stack and every industry; an industry
174
+ corpus may carry its own variant, as `domain/healthcare/ux/` does.
175
+ - [journey-mapping.md](methodology/ux/journey-mapping.md) — a journey is a `US-n`; outcome not click-path; interruption and hand-off
176
+ - [interaction-states.md](methodology/ux/interaction-states.md) — which states must be handled; the `UX-` standard vs the EARS `FR-` behaviour
177
+ - [accessibility-standards.md](methodology/ux/accessibility-standards.md) — conformance target, AT floor, keyboard-completable `US-n`, waiver discipline
178
+ - [content-design.md](methodology/ux/content-design.md) — ubiquitous language, actionable errors, verbatim regulated wording, units and provenance
179
+
150
180
  ## Files — healthcare domain (`domain/healthcare/`)
151
181
 
182
+ Mapped by [sample-healthcare/](sample-healthcare/), not by the shipped `project-specific/`.
183
+ [sample-healthcare/domain/domain-requirements.md](sample-healthcare/domain/domain-requirements.md)
184
+ is the hospital enumeration (Patients, EMR, Radiology…) a healthcare project starts from.
185
+
152
186
  **Constitution**
153
187
  - [domain-constitution.md](domain/healthcare/domain-constitution.md) — the ratified industry base, principles XVI+
154
188
 
@@ -181,11 +215,11 @@ Mapping `## /aw-spec-ui-*` in a project's `tech-rule-bindings.md` is what declar
181
215
  - [dependency-policy.domain.md](domain/healthcare/dependency-policy.domain.md) — HIPAA suitability, healthcare libs
182
216
  - [api-versioning.domain.md](domain/healthcare/api-versioning.domain.md) — FHIR versioning, CapabilityStatement
183
217
 
184
- **Experience (`ux/`)** — mapped under `## /aw-spec-specify` on the **technical** tier, like
185
- `ihe-conformance.md`: they govern how `specify` states the experience, and the spec's Experience
186
- Scope + Experience Standards (`UX-`) are what `prototype`, `ui-design` and `ui-implement` author
187
- and verify against. Each carries a "What must NOT appear" section — that is what keeps screens,
188
- pages and components out of the spec.
218
+ **Experience (`ux/`)** — the healthcare variant of [methodology/ux/](methodology/ux/): the same
219
+ rules, with the clinical cases (interrupted clinical work, staleness as a clinical fact, units on
220
+ clinical values, clinical-safety accessibility) stated outright. `sample-healthcare/` maps them under
221
+ `## /aw-spec-specify` in place of the industry-free set, on the **technical** tier like
222
+ `ihe-conformance.md`.
189
223
  - [ux/journey-mapping.md](domain/healthcare/ux/journey-mapping.md) — a journey is a `US-n`; outcome not click-path; interruption and hand-off
190
224
  - [ux/interaction-states.md](domain/healthcare/ux/interaction-states.md) — which states must be handled; the `UX-` standard vs the EARS `FR-` behaviour
191
225
  - [ux/accessibility-standards.md](domain/healthcare/ux/accessibility-standards.md) — conformance target, AT floor, keyboard-completable `US-n`, waiver discipline
@@ -213,6 +247,8 @@ Medicinal-Product-Registration enumeration a pharma project would copy into its
213
247
  - **`domain/<industry>/<name>.domain.md`** — a domain overlay extending the `technology/` file of
214
248
  the same name.
215
249
  - **`domain/<industry>/<name>.md`** — inherently domain (FHIR, HIPAA, NDC, terminology…).
250
+ - **`methodology/<topic>/<name>.md`** — a way of working that holds for every stack and every
251
+ industry (the `ux/` rules `specify` states the experience by); its tier is the map that lists it.
216
252
 
217
253
  ## What is not here
218
254
 
@@ -0,0 +1,38 @@
1
+ # UX Rule — Accessibility Standards
2
+
3
+ > Loaded under `## /aw-spec-specify` in a project's `tech-rule-bindings.md`. A methodology
4
+ > rule: it governs how the conformance obligation is stated in the spec so that `ui-design`
5
+ > and the UI code gate can verify it. It holds for every stack and every industry; an industry
6
+ > corpus may carry its own variant (`guardrails/domain/healthcare/ux/` is one).
7
+
8
+ ## Why this is a spec concern at all
9
+
10
+ `ui-design` and `ui-implement` author from the **spec**, never from the rule corpus. An
11
+ accessibility obligation that lives only here reaches no UI phase and is gated by nothing. The
12
+ lift into a `UX-n` is what makes it binding.
13
+
14
+ ## Rules
15
+
16
+ 1. **Name the target, the level, and the surface it covers.** "Meets WCAG 2.2 Level AA on
17
+ every user-facing surface" is checkable. "Is accessible" is not, and fails the gate as an
18
+ unverifiable standard.
19
+ 2. **State the assistive-technology floor in Experience Scope**, not in the standard. The
20
+ standard says conformance; the scope says which readers and input modes define it. The two
21
+ are separated so a floor change does not rewrite the standard.
22
+ 3. **Keyboard operability is stated against the User Stories.** The obligation is that every
23
+ task the spec lists as a `US-n` is completable keyboard-only. That binds the standard to
24
+ this aggregate's actual work rather than to a generic surface.
25
+ 4. **A status the user acts on is not decoration.** Colour is never the sole carrier of a
26
+ status that affects a decision the user makes, alerts are announced to assistive
27
+ technology, and a dismissible warning is re-reachable. State these as `UX-n` standards.
28
+ 5. **A waiver is an id, a reason and an expiry.** An accessibility exception is recorded against
29
+ the `UX-n` id it relaxes, time-boxed, and expires. An unrecorded exception is a defect.
30
+ 6. **Regulatory accessibility obligations lift as themselves.** Where a jurisdiction imposes a
31
+ conformance regime on the software or on the users it serves, that obligation is a `UX-n`
32
+ citing the regime. Where the same regime also imposes a records or retention duty, that half
33
+ stays a `CN-n`.
34
+
35
+ ## What must NOT appear
36
+
37
+ ARIA attributes, roles, landmark structure, tab order, contrast values for a specific palette,
38
+ component libraries, or linter configuration. Those are how the standard is met.
@@ -0,0 +1,34 @@
1
+ # UX Rule — Content Design
2
+
3
+ > Loaded under `## /aw-spec-specify` in a project's `tech-rule-bindings.md`. A methodology
4
+ > rule: it governs the language obligations the spec carries into the UI lane. It holds for
5
+ > every stack and every industry; an industry corpus may carry its own variant
6
+ > (`guardrails/domain/healthcare/ux/` is one).
7
+
8
+ ## Rules
9
+
10
+ 1. **The UI speaks the ubiquitous language.** User-facing terms are the terms in Key Entities.
11
+ Where the interface must show a term the domain does not use, the spec says which term and
12
+ why; an unmapped synonym invented in a component is a defect against the domain model.
13
+ 2. **Every error names what happened and what to do next.** State this once as a `UX-n`. A
14
+ message that reports a failure without an action is not a message, it is a dead end — see
15
+ `interaction-states.md`.
16
+ 3. **Regulated wording is reproduced verbatim.** Consent text, legal notices, safety warnings,
17
+ and any wording a regulator or another authority fixes are quoted exactly and never
18
+ paraphrased, truncated or localised without the approved translation. Lift the obligation as
19
+ a `UX-n` and the retention or audit duty attached to it as a `CN-n`.
20
+ 4. **Measured values carry their units and their provenance.** A displayed quantity without its
21
+ unit is ambiguous; a value drawn from an external feed is attributable. State the obligation
22
+ here, state the classification of the field itself in `DC-n`.
23
+ 5. **Identity display is a classification decision, not a wording one.** What may appear on a
24
+ surface — and what must not appear in logs, metrics or traces — is `DC-n`. This section
25
+ governs only how the permitted content reads.
26
+ 6. **Localisation is structural where it applies.** Where the product ships more than one
27
+ locale, state as a `UX-n` that user-visible strings come from a catalogue and that dates,
28
+ numbers and units format locale-aware at the boundary. Where it ships one, say so in
29
+ Experience Scope and omit the standard.
30
+
31
+ ## What must NOT appear
32
+
33
+ Final copy, message strings, tone-of-voice guides, or per-screen wording. The spec states the
34
+ obligation the wording must satisfy; the prototype and the design system settle the words.
@@ -0,0 +1,45 @@
1
+ # UX Rule — Interaction States
2
+
3
+ > Loaded under `## /aw-spec-specify` in a project's `tech-rule-bindings.md`. A methodology
4
+ > rule: it governs how the spec expresses what the user meets while the system works, never
5
+ > how any of it is rendered. It holds for every stack and every industry; an industry corpus
6
+ > may carry its own variant (`guardrails/domain/healthcare/ux/` is one).
7
+
8
+ ## The split this rule exists to hold
9
+
10
+ Two things look alike and belong in different sections:
11
+
12
+ | Statement | Home | Why |
13
+ |---|---|---|
14
+ | "Every asynchronous operation presents its loading, empty, partial-failure, recovery and success states" | **`UX-n`** | project-wide standard, true of every surface |
15
+ | "IF the order history cannot be retrieved THEN THE SYSTEM SHALL present the last known list marked stale and offer retry" | **`FR-n`** | this aggregate's behaviour, in EARS |
16
+
17
+ The standard is lifted once. The behaviour is specified per aggregate, in EARS, using the
18
+ unwanted-behaviour patterns the spec template already defines.
19
+
20
+ ## Rules
21
+
22
+ 1. **Enumerate the states, do not draw them.** The states are loading, empty, partial,
23
+ failure, recovery, success and — where the domain requires it — stale and degraded. The
24
+ spec says which must be handled; the prototype says what they look like.
25
+ 2. **No dead end.** A `UX-n` states that no reachable state leaves the user without a next
26
+ action. A state the UI can reach and the spec does not describe is a spec defect routed
27
+ back to `specify`, never invented in a component.
28
+ 3. **Partial failure is stated, not implied.** Where a surface composes several sources, the
29
+ spec states whether a partial result is presentable and how it is marked. Where a partial
30
+ result could mislead the user, it is presentable ONLY when its incompleteness is explicit;
31
+ silence here is a defect, not a default.
32
+ 4. **Staleness is stated where it matters.** Where cached or last-known data may be shown, say
33
+ so as an `FR-n` and carry the project-wide marking obligation as a `UX-n`. Data whose
34
+ currency affects a decision the user makes is never presented as current when it is not.
35
+ 5. **Destructive and irreversible actions state their confirmation obligation** as a `UX-n`,
36
+ and their specific consequence as an `FR-n` or `BR-n`.
37
+ 6. **Responsiveness is a bound, not a behaviour.** Acknowledgement and progress thresholds are
38
+ `UX-n` limits. Where the bound depends on a server-side budget, that budget stays a `CN-n`
39
+ and the two cross-reference — the service-side gates read `CN-` and never read the
40
+ Experience Standards.
41
+
42
+ ## What must NOT appear
43
+
44
+ Spinners, skeletons, toasts, banners, placement, animation, timing curves, or any component
45
+ name. Those realise the state; they are not the state.
@@ -0,0 +1,41 @@
1
+ # UX Rule — Journey Mapping
2
+
3
+ > Loaded under `## /aw-spec-specify` in a project's `tech-rule-bindings.md`. It is a
4
+ > **methodology** rule: it governs how `specify` expresses the experience in the spec, not
5
+ > what any screen looks like. It holds for every stack and every industry; an industry corpus
6
+ > may carry its own variant (`guardrails/domain/healthcare/ux/` is one). Tier is set by the map
7
+ > that lists it, not by the folder it sits in — it is loaded as a technical input.
8
+
9
+ ## What this rule governs
10
+
11
+ The spec states the user's **path through a task** as a `US-n` user story and the standards
12
+ that path must hold to as `UX-n` entries. It never states the route the user takes through a
13
+ UI. One story may become one screen or five; that is the prototype's and `design.ui.md`'s
14
+ decision, and a spec that pre-empts it has specified the solution.
15
+
16
+ ## Rules
17
+
18
+ 1. **A journey is a `US-n`, not a new id class.** A user story is already defined as a
19
+ prioritized, independently testable journey. An experience journey uses that definition
20
+ unchanged — the actor, the goal, the acceptance criteria in Given/When/Then.
21
+ 2. **State the outcome, never the mechanism.** "A buyer can compare two saved quotes and
22
+ accept one in a single sitting" is a journey. "A buyer opens the Quotes tab, ticks two rows,
23
+ clicks Compare, then Accept" is a click-path and belongs in the prototype.
24
+ 3. **Every journey names the actor from Experience Scope.** A story whose actor is not listed
25
+ there is either an unlisted actor or a story that does not belong to this aggregate.
26
+ 4. **Interruption is a first-class case.** Real work is interrupted; a long or shared task
27
+ whose journey cannot survive being abandoned mid-task and resumed is under-specified. Where
28
+ resumability is required, state it as an acceptance criterion on the `US-n`, and state the
29
+ project-wide expectation once as a `UX-n`.
30
+ 5. **Journey integrity is a `UX-n` standard.** Completability without leaving the aggregate's
31
+ surface, confirmation and reversibility of destructive actions, and preservation of entered
32
+ work across a failure are standards that hold for every journey — lift them once, do not
33
+ repeat them per story.
34
+ 6. **Hand-offs between actors are journeys too.** Where a task passes from one role to another
35
+ (request → approval → fulfilment), the hand-off is part of the journey and its state at the
36
+ boundary is stated in the acceptance criteria.
37
+
38
+ ## What must NOT appear
39
+
40
+ Screens, pages, tabs, wizards, step counts, navigation structure, button labels, modal-vs-inline
41
+ choices, or any statement whose only realisation is one layout.
@@ -1,58 +1,45 @@
1
1
  # DOMAIN REQUIREMENTS (project-specific)
2
2
 
3
3
  > Project-specific input, **authored by the project owner** and updated independently per
4
- > project. It is the last file in the set mapped under `## /aw-spec-constitution` in
5
- > `domain-rule-bindings.md`, and the only one there expected to differ between two projects on this
6
- > corpus; the standard industry rules beside it are shared. Its mapping is optional — a project
7
- > that has not authored it yet ratifies the standard set alone.
4
+ > project. It is mapped under `## /aw-spec-constitution` and `## /aw-spec-specify` in
5
+ > `domain-rule-bindings.md`, so `constitution` ratifies it into `constitution.domain.md` and
6
+ > `specify` lifts its constraints into the spec. Where the project maps an industry corpus, it
7
+ > is the last file in that set and the only one expected to differ between two projects on the
8
+ > same corpus. Its mapping is optional — a project that has not authored it yet still runs.
8
9
  >
9
- > This file holds the per-project enumeration and headline profiles. Detailed domain *rules*
10
- > are expanded in the sibling files in this folder.
11
- >
12
- > Replace `<SampleProjectName>` and the bounded-context list below for a new project.
10
+ > This file holds the per-project enumeration and headline profiles. Replace every comment
11
+ > below with this project's content; a section that does not apply says so in one line rather
12
+ > than being deleted. `guardrails/sample-healthcare/domain/domain-requirements.md` is a filled
13
+ > example.
13
14
 
14
15
  =====================================================================
15
16
  [DOMAIN: Bounded Contexts / Modules]
16
17
  =====================================================================
17
- - Patients — aggregates: Patient (master patient index), Consent, RelatedPerson; cross-references via PIX/PDQ.
18
- - Appointments — aggregates: Appointment, Slot, Schedule, Waitlist.
19
- - Encounters — aggregates: Encounter (inpatient, outpatient, emergency), Admission, Transfer, Discharge.
20
- - EMR — aggregates: ClinicalNote, ProblemList, AllergyIntolerance, MedicationStatement, Observation (vitals, social history), Immunization, CarePlan, ServiceRequest, Procedure.
21
- - Radiology — aggregates: ImagingOrder, ImagingStudy (DICOM metadata), DiagnosticReport (radiology); pixel data lives in PACS/VNA.
22
- - Lab — aggregates: LabOrder, Specimen, Observation (lab result), DiagnosticReport (lab).
23
- - Pharmacy — aggregates: MedicationRequest, MedicationDispense, MedicationAdministration, Formulary, ControlledSubstanceLedger.
24
- - Billing — aggregates: ChargeItem, Invoice, Claim, ClaimResponse, PaymentReconciliation, Account, AdjustmentEntry.
25
- - Insurance — aggregates: Coverage, Payer, Plan, EligibilityRequest, EligibilityResponse, PriorAuth.
26
- - Inventory — aggregates: InventoryItem, Lot, StockMovement, Reservation, ExpiryAlert.
27
- - Interoperability — aggregates: IntegrationEndpoint, MessageEnvelope (HL7v2), FhirSubscription, BulkExportJob.
28
- - PatientPortal — aggregates: PortalAccount (identity-bound), MessageThread, AppointmentRequest, RecordAccessRequest.
29
- - Identity — aggregates: Practitioner, PractitionerRole, Organization, Location, HealthcareService.
30
- - Auditing — aggregates: AuditRecord (append-only, ATNA + FHIR AuditEvent shape).
31
- - Terminology — aggregates: CodeSystem, ValueSet, ConceptMap (project-managed subsets; expansions cached from external TS).
18
+ <!-- One bullet per bounded context: its name, then the aggregates it owns, e.g.
19
+ - Ordering — aggregates: Order, Cart, Quote.
20
+ Name the aggregates in the business's own language; specify and the domain model reuse
21
+ these names. -->
32
22
 
33
23
  =====================================================================
34
24
  [DOMAIN: subsection pointers]
35
25
  =====================================================================
36
- [DOMAIN: Aggregates and Business Invariants] -> guardrails/domain/healthcare/domain-driven-design.domain.md
37
- [DOMAIN: Persistence Profile] -> guardrails/domain/healthcare/persistence.domain.md
38
- [DOMAIN: Security Profile] -> guardrails/domain/healthcare/authorization.domain.md, guardrails/domain/healthcare/data-classification.domain.md
39
- [DOMAIN: Testing Profile] -> guardrails/domain/healthcare/testing.domain.md
40
- [DOMAIN: AI Policy Addenda] -> guardrails/domain/healthcare/ai-rules.domain.md
41
- [DOMAIN: Platform Topology] -> below
26
+ <!-- Where the detailed rules for each profile live — a file in this folder, a file of an
27
+ industry corpus this project maps, or "below". One line per profile, e.g.
28
+ [DOMAIN: Aggregates and Business Invariants] -> below
29
+ [DOMAIN: Persistence Profile] -> below
30
+ [DOMAIN: Security Profile] -> below
31
+ [DOMAIN: Testing Profile] -> below
32
+ [DOMAIN: Platform Topology] -> below -->
42
33
 
43
34
  =====================================================================
44
35
  [DOMAIN: Platform Topology]
45
36
  =====================================================================
46
- - Target runtime: Kubernetes (AKS, EKS, or on-prem). Single-region by default; multi-region active/passive for DR.
47
- - External dependencies (Aspire resources): PostgreSQL (primary), Redis (cache + portal session), a message broker (Azure Service Bus, AWS SQS/SNS, or RabbitMQ) for CloudEvents, an OTel collector, the configured IdP, an external Terminology Service (optional), a FHIR validator container, a PACS/VNA endpoint (DICOMweb), an HL7v2 broker (MLLP), an SMTP/SMS gateway, an object store (S3/Blob) for binaries.
48
- - Scale targets: P95 read latency < 200 ms at 200 RPS per module; FHIR search P95 < 500 ms; HL7v2 ingest sustains 50 messages/sec per channel.
49
- - Disaster recovery: RPO <= 15 minutes, RTO <= 4 hours; daily encrypted backups with 35-day retention plus monthly archive >= 7 years.
37
+ <!-- Target runtime and regions, the external systems the product depends on, scale targets,
38
+ and recovery objectives (RPO / RTO, backup retention). State targets as numbers. -->
50
39
 
51
40
  =====================================================================
52
41
  [DOMAIN: Governance Overrides]
53
42
  =====================================================================
54
- - Principal Engineers (approvers): TBD — fill at ratification.
55
- - Security/Compliance Officer (mandatory approver for any PHI/security change): TBD.
56
- - Domain Owners (per module): TBD — assign one clinical and one technical owner per bounded context.
57
- - Quarterly review cadence: first business week of each quarter; security review additionally after every significant regulatory update.
58
- - Exception process: a time-boxed waiver via a Waiver Request issue, approved by a Principal Engineer + the Compliance Officer, with a mandatory expiry <= 90 days and a remediation plan recorded in the issue.
43
+ <!-- The approvers (principal engineers, the security or compliance owner, a domain owner per
44
+ bounded context), the review cadence, and the exception process: who approves a waiver,
45
+ its maximum duration, and where it is recorded. -->
@@ -2,7 +2,8 @@
2
2
 
3
3
  Per-command list of the **domain** rule files this project loads (via `resolve-domain`
4
4
  + the `domain-select` module, into the sticky standards set) for the spec-anchored
5
- orchestrator pipeline. This project draws its domain from the **healthcare** corpus.
5
+ orchestrator pipeline. As shipped it maps **no industry corpus**: the only domain file it
6
+ loads is the one the project team authors, `domain/domain-requirements.md`, beside this map.
6
7
 
7
8
  **The model:** domain files feed
8
9
  only three consumers — **specify** (authors them into the spec as FR/BR/CN-/DC-/IC-),
@@ -10,69 +11,43 @@ only three consumers — **specify** (authors them into the spec as FR/BR/CN-/DC
10
11
  **design** and **implement** load **NO** domain file — the domain reaches them solely
11
12
  through the spec/design (as CN-/DC-/IC- ids).
12
13
 
13
- - All paths are workspace-relative. The **standard industry rules** live in
14
- `guardrails/domain/healthcare/` — shared, reusable by every project that maps them. The
15
- one file this project authors, `domain/domain-requirements.md`, lives beside this map.
14
+ - All paths are workspace-relative. **Standard industry rules** live in shared corpora under
15
+ `guardrails/domain/<industry>/` — `healthcare/` and `pharma/` ship — reusable by every
16
+ project that maps them. To govern this project by one, add its files as `- ` bullets under
17
+ the headings below. Nothing else changes: the technical map, the workflows and the engine
18
+ are untouched.
19
+ - `guardrails/sample-healthcare/` is a complete project on the healthcare corpus: its
20
+ `domain-rule-bindings.md` shows which files of an industry corpus go under which heading.
21
+ `/appweaver select-domain sample-healthcare` switches to it whole.
22
+ - A heading with no bullets loads nothing. With this map as shipped, `specify` lifts only the
23
+ constraints `domain-requirements.md` states, and the gates check the plans and the code
24
+ against the spec and the bounded context's domain model, with no industry checklist. Keep
25
+ every heading, even with nothing under it: a command whose heading is absent or misspelled
26
+ loads the same nothing, and its run ends with a warning saying so.
16
27
  - A mapped file that does not exist is skipped rather than failing the run, so a project
17
- that has not authored its `domain-requirements.md` yet still gets the standard set.
28
+ that has not authored its `domain-requirements.md` yet still runs; the run ends with a
29
+ warning naming the file.
18
30
  - `resolve-domain --command <name>` collects the `- ` bullets under `## /<name>`.
19
- - To govern a different industry, repoint these bullets at another
20
- `guardrails/domain/<industry>/` corpus — `guardrails/domain/pharma/` also ships. Nothing
21
- else changes: the technical map, the workflows and the engine are untouched.
22
31
  - This file is the **canonical domain mapping** for this project; it is used whenever
23
32
  `.appweaver/domain.json` names `project-specific`, which it does by default.
24
33
 
25
34
  ---
26
35
 
27
36
  ## /aw-spec-constitution
28
- <!-- What the DOMAIN half ratifies into constitution.domain.md as domain principles XVI+.
29
- The industry constitution first, then the STANDARD industry rules — the modelling
30
- overlay the Adopted Modelling Standard section cites, identity, regulatory, interop,
31
- security overlays, and the folder overlay the Domain Folder Additions section cites —
32
- which every project on this corpus shares, and LAST the PROJECT-SUPPLIED
33
- domain-requirements.md the project team authors. Only that last file is expected to
34
- differ between two projects on the same corpus, and its mapping is OPTIONAL: the project
35
- owner supplies the file, and where it is absent the set loads without it rather than
36
- failing. -->
37
- - guardrails/domain/healthcare/domain-constitution.md
38
- - guardrails/domain/healthcare/domain-driven-design.domain.md
39
- - guardrails/domain/healthcare/clinical-terms.md
40
- - guardrails/domain/healthcare/terminology.md
41
- - guardrails/domain/healthcare/consent.md
42
- - guardrails/domain/healthcare/hipaa.md
43
- - guardrails/domain/healthcare/fhir.md
44
- - guardrails/domain/healthcare/hl7.md
45
- - guardrails/domain/healthcare/dicom.md
46
- - guardrails/domain/healthcare/data-classification.domain.md
47
- - guardrails/domain/healthcare/auditing.domain.md
48
- - guardrails/domain/healthcare/authorization.domain.md
49
- - guardrails/domain/healthcare/zero-trust.domain.md
50
- - guardrails/domain/healthcare/ai-rules.domain.md
51
- - guardrails/domain/healthcare/folder-structure.domain.md
37
+ <!-- What the DOMAIN half ratifies into constitution.domain.md as domain principles. With an
38
+ industry corpus mapped, its constitution comes first, then its STANDARD rules — the
39
+ modelling overlay the Adopted Modelling Standard section cites, identity, regulatory,
40
+ interop, security overlays, and the folder overlay the Domain Folder Additions section
41
+ cites — and LAST the PROJECT-SUPPLIED domain-requirements.md the project team authors.
42
+ As shipped only that last file is mapped. Its mapping is OPTIONAL: the project owner
43
+ supplies the file, and where it is absent the set loads without it rather than failing. -->
52
44
  - guardrails/project-specific/domain/domain-requirements.md
53
45
 
54
46
  ## /aw-spec-specify
55
47
  <!-- The FULL domain set. Specify models the domain COMPLETELY and LIFTS the constraint
56
- overlays into the spec's CN-/DC-/IC- sections (design/implement never see these files). -->
48
+ overlays into the spec's CN-/DC-/IC- sections (design/implement never see these files).
49
+ An industry corpus adds its terminology, its standards and its *.domain.md overlays here. -->
57
50
  - guardrails/project-specific/domain/domain-requirements.md
58
- - guardrails/domain/healthcare/domain-driven-design.domain.md
59
- - guardrails/domain/healthcare/clinical-terms.md
60
- - guardrails/domain/healthcare/terminology.md
61
- - guardrails/domain/healthcare/integration-terms.md
62
- - guardrails/domain/healthcare/consent.md
63
- - guardrails/domain/healthcare/hipaa.md
64
- - guardrails/domain/healthcare/fhir.md
65
- - guardrails/domain/healthcare/hl7.md
66
- - guardrails/domain/healthcare/dicom.md
67
- - guardrails/domain/healthcare/data-classification.domain.md
68
- - guardrails/domain/healthcare/persistence.domain.md
69
- - guardrails/domain/healthcare/cqrs.domain.md
70
- - guardrails/domain/healthcare/eventing.domain.md
71
- - guardrails/domain/healthcare/auditing.domain.md
72
- - guardrails/domain/healthcare/authorization.domain.md
73
- - guardrails/domain/healthcare/zero-trust.domain.md
74
- - guardrails/domain/healthcare/api-versioning.domain.md
75
- - guardrails/domain/healthcare/vertical-slices.domain.md
76
51
 
77
52
  ## /aw-spec-plan-backend
78
53
  _None — the service lane of plan loads no domain file. Domain reaches it only through the spec
@@ -94,21 +69,10 @@ frontend-plan.md and the context's domain-model.md._
94
69
  ## /aw-spec-gate
95
70
  <!-- Conformance checklist for the gates (analyze-plan · analyze-slice): the domain-derived
96
71
  constraints design/implement were NOT given as authoring input, VALIDATED against the
97
- output. Domain re-enters here as a check, never as authoring input. -->
98
- - guardrails/domain/healthcare/persistence.domain.md
99
- - guardrails/domain/healthcare/cqrs.domain.md
100
- - guardrails/domain/healthcare/eventing.domain.md
101
- - guardrails/domain/healthcare/auditing.domain.md
102
- - guardrails/domain/healthcare/authorization.domain.md
103
- - guardrails/domain/healthcare/zero-trust.domain.md
104
- - guardrails/domain/healthcare/data-classification.domain.md
105
- - guardrails/domain/healthcare/api-versioning.domain.md
106
- - guardrails/domain/healthcare/vertical-slices.domain.md
107
- - guardrails/domain/healthcare/folder-structure.domain.md
108
- - guardrails/domain/healthcare/coding-standards.domain.md
109
- - guardrails/domain/healthcare/dependency-policy.domain.md
110
- - guardrails/domain/healthcare/testing.domain.md
111
- - guardrails/domain/healthcare/ai-rules.domain.md
72
+ output. Domain re-enters here as a check, never as authoring input. An industry corpus
73
+ maps its *.domain.md overlays here. -->
74
+ _None — this project maps no industry corpus, so the gates have no domain checklist. They still
75
+ check the plans and the code against the spec and the bounded context's domain-model.md._
112
76
 
113
77
  ---
114
78
 
@@ -116,13 +80,13 @@ frontend-plan.md and the context's domain-model.md._
116
80
 
117
81
  | Command | Domain rule files | Role |
118
82
  |---|---|---|
119
- | /aw-spec-constitution | 16 | domain principles (XVI+) — the industry constitution + standard industry rules + the project's own requirements |
120
- | /aw-spec-specify | 19 | author into spec (lift → CN-/DC-/IC-) |
83
+ | /aw-spec-constitution | 1 | domain principles — the project's own requirements; an industry corpus adds its constitution and standard rules |
84
+ | /aw-spec-specify | 1 | author into spec (lift → CN-/DC-/IC-) |
121
85
  | /aw-spec-plan-backend | 0 | none — the spec and the domain model carry the domain |
122
86
  | /aw-spec-plan-frontend | 0 | none — the spec and the domain model carry the domain |
123
87
  | /aw-spec-implement-backend | 0 | none — backend-plan.md and the domain model carry the domain |
124
88
  | /aw-spec-implement-frontend | 0 | none — frontend-plan.md and the domain model carry the domain |
125
- | /aw-spec-gate | 14 | conformance checklist (validate, don't author) |
89
+ | /aw-spec-gate | 0 | conformance checklist (validate, don't author) — an industry corpus's overlays |
126
90
 
127
91
  > Retired in the orchestrator pipeline: the prose `/aw-spec-plan` phase, `/aw-spec-tasks`,
128
92
  > `/aw-spec-taskplan`, `/aw-spec-clarify`, `/aw-spec-analyze` (clarify folded into specify; the
@@ -1,8 +1,8 @@
1
1
  # UI Requirements — project-supplied
2
2
 
3
3
  > **This file is authored by the project team, not by the corpus.**
4
- > `guardrails/technology/nextjs/ui-constitution.md` is the standard frontend rule set for that
5
- > stack, reusable by every project that maps it. This file is where one project's own experience
4
+ > `ui-constitution.md` in the frontend stack's folder under `guardrails/technology/` is the
5
+ > standard frontend rule set for that stack, reusable by every project that maps it. This file is where one project's own experience
6
6
  > decisions go.
7
7
 
8
8
  It is mapped under `## /aw-spec-ui-constitution` in `tech-rule-bindings.md`, so its
@@ -1,8 +1,8 @@
1
1
  # Technical Requirements — project-supplied
2
2
 
3
3
  > **This file is authored by the project team, not by the corpus.** The rules this project's
4
- > technical map lists live in `guardrails/technology/dotnet-webapi/` — the standard set for that
5
- > stack, reusable by every project that maps it. This file is where one project's own technology
4
+ > technical map lists live in the backend stack's folder under `guardrails/technology/` — the
5
+ > standard set for that stack, reusable by every project that maps it. This file is where one project's own technology
6
6
  > decisions go, and it is the only technical file a second project on the same stack replaces.
7
7
 
8
8
  It is mapped under `## /aw-spec-constitution` in `tech-rule-bindings.md`, so its content