aw-spec-cli 0.1.23 → 0.1.25

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 (38) hide show
  1. package/assets/.appweaver/ORCH-DIALECT.md +3 -3
  2. package/assets/.appweaver/RULE-PARTITION.md +41 -28
  3. package/assets/.appweaver/orchestrator/orchestrator.py +92 -14
  4. package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +3 -3
  5. package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +19 -12
  6. package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +25 -17
  7. package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +2 -2
  8. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +10 -10
  9. package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +28 -17
  10. package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +22 -24
  11. package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +1 -1
  12. package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +29 -19
  13. package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +27 -20
  14. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +184 -37
  15. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-plan-delta.orch.yaml +18 -0
  16. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-plan.orch.yaml +19 -0
  17. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice-delta.orch.yaml +18 -0
  18. package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +55 -29
  19. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +650 -205
  20. package/assets/.appweaver/orchestrator/workflows/aw-spec-plan.orch.yaml +19 -0
  21. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +5 -5
  22. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +2 -2
  23. package/assets/.appweaver/orchestrator/workflows/aw-spec-ui-model.orch.yaml +13 -3
  24. package/assets/.appweaver/orchestrator/workflows/aw-spec-ui-prototype.orch.yaml +40 -1
  25. package/assets/.appweaver/orchestrator/workflows/aw-spec-workflow-model.orch.yaml +2 -1
  26. package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +1 -1
  27. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +69 -7
  28. package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +1 -1
  29. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +58 -2
  30. package/assets/.appweaver/scripts/python/aw-inventory.py +1809 -156
  31. package/assets/.appweaver/scripts/python/aw-rev-constitution.py +106 -145
  32. package/assets/.appweaver/scripts/python/aw-stack.py +45 -1
  33. package/assets/.appweaver/scripts/python/aw-xref.py +73 -2
  34. package/assets/.appweaver/scripts/python/validate_okf.py +10 -5
  35. package/assets/.appweaver/templates/okf-concept-template.md +10 -2
  36. package/assets/.appweaver/templates/proposed-inventory-template.md +100 -48
  37. package/assets/.appweaver/templates/source-map-template.md +14 -6
  38. package/package.json +1 -1
@@ -9,17 +9,23 @@
9
9
  # → onboard <BoundedContext> (once per context)
10
10
  # ← you are here
11
11
  #
12
- # Three passes over the code. The generated document explains each of them to the
13
- # operator reading it; the wording lives in the template
12
+ # It reads back the model the greenfield sequence writes — bounded context →
13
+ # aggregate → feature → operation — from the code: the module folder is the context,
14
+ # a declared aggregate-root type is the aggregate, a UI features/<Feature>/ folder is
15
+ # the capability, and a slice under the module's Features/ is one operation (a user
16
+ # story), never a feature. Three passes; the generated document explains each to the
17
+ # operator reading it, in the wording of the template
14
18
  # .appweaver/templates/proposed-inventory-template.md, overridable per project:
15
- # A aggregate identification — what must stay consistent together. Three
16
- # strategies (structure / reference graph / persistence), each offered only
17
- # where the evidence for it exists, each reporting its own numbers.
18
- # B the seam overlay — what can be cut over together. Always runs, over
19
- # application/API/UI only. Emits signals, never decisions.
20
- # C the proposal — 1:1 aggregate-to-feature by default, splits proposed with
21
- # their evidence and never applied, grouped into bounded contexts and
22
- # ordered into dependency waves.
19
+ # A the aggregates. Four strategies — domain (the roots the code declares),
20
+ # structure, reference graph, persistence — each offered only where its
21
+ # evidence exists, each reporting its own numbers. Declared roots that
22
+ # operations act on are chosen ahead of any measured strategy.
23
+ # B the operations and their seams — each operation's route, the aggregate it
24
+ # acts on, whether it creates one. Emits signals, never decisions.
25
+ # C the features — one per UI feature folder, holding the operations it calls;
26
+ # shared reads join every feature on their aggregate; what no capability
27
+ # claims falls back to one feature per aggregate. Many-to-many within a
28
+ # context, ordered by which feature creates each aggregate.
23
29
  #
24
30
  # The deliverable is `specs/proposed-inventory.md` — an EDITABLE document. The
25
31
  # operator renames, moves, merges, splits and re-orders in that file, then runs
@@ -29,7 +35,7 @@
29
35
  # It does NOT author specs, plans or governance (that is onboard, per context)
30
36
  # and never modifies source.
31
37
  #
32
- # Launch: /appweaver inventory [structure|reference|persistence] [focus hints]
38
+ # Launch: /appweaver inventory [domain|structure|reference|persistence] [focus hints]
33
39
  # /appweaver inventory apply
34
40
  # =============================================================================
35
41
 
@@ -44,9 +50,11 @@ inputs:
44
50
  description: >-
45
51
  Either the literal word `apply` — validate the edited specs/proposed-inventory.md
46
52
  and regenerate the machine map — or an optional Pass A strategy name
47
- (structure | reference | persistence) to force, plus free-text focus hints.
48
- With no argument, the highest-coverage available strategy is proposed and the
49
- operator confirms it from a menu carrying each strategy's measured numbers.
53
+ (domain | structure | reference | persistence) to force, plus free-text focus
54
+ hints. With no argument, `domain` is proposed where the code declares aggregate
55
+ roots that operations act on, and otherwise the highest-coverage available
56
+ strategy; the operator confirms it from a menu carrying each strategy's
57
+ measured numbers.
50
58
  required: false
51
59
  bind: USER_INPUT
52
60
 
@@ -96,10 +104,16 @@ workflow:
96
104
  - { name: wave_count, from: "$.wave_count" }
97
105
  - { name: cycle_count, from: "$.cycle_count" }
98
106
  - { name: contexts_ordered, from: "$.contexts_ordered" }
107
+ - { name: aggregate_count, from: "$.aggregate_count" }
108
+ - { name: operation_count, from: "$.operation_count" }
109
+ - { name: orphaned_count, from: "$.orphaned_count" }
99
110
  - { name: apply_problems, from: "$.problems" }
111
+ - { name: apply_error, from: "$.error" }
100
112
 
101
113
  # A rejected edit names the row it could not resolve. Stopping here is the
102
114
  # point: a map built from a half-understood file would be onboarded silently.
115
+ # apply exits non-zero on a rejection; `on_error: continue` still binds the JSON
116
+ # it printed, which is where the rejected rows (or the missing file) are named.
103
117
  - id: apply_gate
104
118
  action: verify_context
105
119
  condition: "{{mode}} == apply"
@@ -107,7 +121,7 @@ workflow:
107
121
  equals: "true"
108
122
  on_mismatch: stop
109
123
  on_mismatch_message: >
110
- specs/proposed-inventory.md could not be applied: {{apply_problems}}
124
+ specs/proposed-inventory.md could not be applied: {{apply_problems}}{{apply_error}}
111
125
  Fix those rows and re-run /appweaver inventory apply. The Aggregate column
112
126
  must name an aggregate the scan found; every Depends On value must name a
113
127
  Feature that exists in the same table.
@@ -176,19 +190,23 @@ workflow:
176
190
  - { name: split_candidates, from: "$.split_candidates" }
177
191
  - { name: contexts_ordered, from: "$.contexts_ordered" }
178
192
  - { name: strategy_options, from: "$.strategy_options" }
193
+ - { name: proposal_error, from: "$.error" }
179
194
 
180
- # 2b. Substance gate. Zero features is the one outcome that leaves onboard with
181
- # nothing to do, and it is reported as what it is rather than as a crash.
182
- - id: require_features
195
+ # 2b. Substance gate. A scan with nothing to propose is the one outcome that
196
+ # leaves onboard with nothing to do. propose reports it as ok=false with the
197
+ # reason and writes neither file, so this stop leaves no empty map behind for
198
+ # onboard to read, and a map from an earlier run stays as it was.
199
+ - id: require_proposal
183
200
  action: verify_context
184
201
  condition: "{{mode}} == propose"
185
- require_true: feature_count
186
- on_false: stop
187
- on_false_message: >
188
- No candidate features were found in {{root}}. Every Pass A strategy either
189
- returned nothing or was unavailable for want of evidence. Point
190
- /appweaver inventory at a subtree that holds application source, or check
191
- that the lane declaration names the right path.
202
+ require_value: proposal_ok
203
+ equals: "true"
204
+ on_mismatch: stop
205
+ on_mismatch_message: >
206
+ /appweaver inventory found nothing to propose. {{proposal_error}}
207
+ Check that the service lane in .appweaver/stacks.json names the directory
208
+ that holds the application source (/appweaver select-stack re-declares it),
209
+ then re-run /appweaver inventory.
192
210
 
193
211
  # 3. THE STRATEGY PICK. Offered from the probe, each option carrying its own
194
212
  # measured numbers — features found, share of source covered, how many
@@ -199,9 +217,11 @@ workflow:
199
217
  action: user_select
200
218
  condition: "{{mode}} == propose"
201
219
  prompt: >
202
- Pass A found these candidate boundaries. Which evidence should the feature
203
- map be built from? (`{{chosen_strategy}}` is proposed: highest coverage,
204
- ties broken by fewest single-file candidates.)
220
+ Pass A found these candidate aggregates. Which evidence should the map be
221
+ built from? (`{{chosen_strategy}}` is proposed: the roots the code declares
222
+ where operations act on them, otherwise the highest coverage, ties broken by
223
+ fewest single-file candidates. Coverage is how much code a strategy placed,
224
+ not whether it placed it right — compare the aggregate counts too.)
205
225
  options_from_variable: strategy_options
206
226
  preselect_from: chosen_strategy
207
227
  single_option_confirm: true
@@ -227,6 +247,9 @@ workflow:
227
247
  - { name: coverage_pct, from: "$.coverage_pct" }
228
248
  - { name: split_candidates, from: "$.split_candidates" }
229
249
  - { name: contexts_ordered, from: "$.contexts_ordered" }
250
+ - { name: aggregate_count, from: "$.aggregate_count" }
251
+ - { name: operation_count, from: "$.operation_count" }
252
+ - { name: orphaned_count, from: "$.orphaned_count" }
230
253
 
231
254
  # 5. Hooks, after the map exists and before the operator is handed it.
232
255
  - id: resolve_pre_hooks
@@ -264,7 +287,10 @@ outputs:
264
287
  coverage_pct: "{{coverage_pct}}"
265
288
  split_candidates: "{{split_candidates}}"
266
289
  contexts_ordered: "{{contexts_ordered}}"
290
+ aggregates: "{{aggregate_count}}"
291
+ operations: "{{operation_count}}"
292
+ orphaned_operations: "{{orphaned_count}}"
267
293
  # Sits INSIDE outputs: — the engine resolves and returns wf["outputs"] only, so a
268
294
  # next: at the document's top level is parsed and then dropped, and the workflow
269
295
  # ends with no suggested successor at all.
270
- next: "{{feature_count}} feature(s) across {{context_count}} bounded context(s) were proposed from `{{chosen_strategy}}` evidence ({{coverage_pct}}% of source covered), ordered into {{wave_count}} dependency wave(s). READ AND EDIT specs/proposed-inventory.md — it is the boundary map, and it is yours. Rename features and contexts, move a feature to another context, merge two by giving them one name, split one by adding a row with the same Aggregate, and set Depends On to change the order. {{split_candidates}} split(s) were PROPOSED with their evidence and none were applied. Then run /appweaver inventory apply to validate those edits and regenerate the machine map. Next: /appweaver onboard <Context> — once per bounded context, one at a time, in the order inventory apply reports: {{contexts_ordered}}. Then /appweaver adopt <Feature> per feature you are about to change."
296
+ next: "{{context_count}} bounded context(s), {{aggregate_count}} aggregate(s), {{feature_count}} feature(s) and {{operation_count}} operation(s) were proposed from `{{chosen_strategy}}` evidence ({{coverage_pct}}% of source covered), ordered into {{wave_count}} dependency wave(s). {{orphaned_count}} operation(s) fell to a per-aggregate default beside real capabilities — the proposal's Needs a decision section lists them. READ AND EDIT specs/proposed-inventory.md — it is the boundary map, and it is yours. Rename features and contexts, move a feature to another context, make a feature act on another aggregate by adding a row, move an operation by editing the Operations cells, merge two by giving them one name, split one by adding a row with the same Aggregate, and set Depends On to change the order. {{split_candidates}} split(s) were PROPOSED with their evidence and none were applied. Then run /appweaver inventory apply to validate those edits and regenerate the machine map. Next: /appweaver onboard <Context> — once per bounded context, one at a time, in the order inventory apply reports: {{contexts_ordered}}. Then /appweaver adopt <Feature> per feature you are about to change."