aw-spec-cli 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +291 -0
- package/assets/.agents/agent.json +28 -0
- package/assets/.agents/skills/aw-spec-orch/SKILL.md +56 -0
- package/assets/.agents/skills/aw-spec-orch-demo/SKILL.md +59 -0
- package/assets/.aw-spec/DESIGN-FORMAT.md +151 -0
- package/assets/.aw-spec/ORCH-DIALECT.md +156 -0
- package/assets/.aw-spec/RULE-PARTITION.md +126 -0
- package/assets/.aw-spec/extensions/agent-context/extension.yml +12 -9
- package/assets/.aw-spec/extensions.yml +12 -19
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +1 -9
- package/assets/.aw-spec/interpreter/run-skill.py +1158 -0
- package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +94 -0
- package/assets/.aw-spec/orchestrator/README.md +300 -0
- package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +74 -0
- package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +74 -0
- package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +105 -0
- package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +79 -0
- package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +81 -0
- package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +75 -0
- package/assets/.aw-spec/orchestrator/orchestrator.py +1721 -0
- package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +40 -0
- package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +59 -0
- package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +97 -0
- package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +61 -0
- package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
- package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
- package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
- package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
- package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +160 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +244 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +775 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +248 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +261 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +425 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +188 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +474 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +284 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +103 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +382 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +246 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +231 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +258 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +236 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +949 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +177 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +79 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +412 -0
- package/assets/.aw-spec/scripts/bash/aw-inventory.sh +14 -0
- package/assets/.aw-spec/scripts/bash/aw-parity.sh +13 -0
- package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +13 -0
- package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +1899 -0
- package/assets/.aw-spec/scripts/bash/aw-xref.sh +15 -0
- package/assets/.aw-spec/scripts/bash/common.sh +11 -60
- package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +14 -0
- package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +13 -0
- package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +13 -0
- package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +1563 -0
- package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +15 -0
- package/assets/.aw-spec/scripts/python/aw-inventory.py +683 -0
- package/assets/.aw-spec/scripts/python/aw-parity.py +380 -0
- package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +312 -0
- package/assets/.aw-spec/scripts/python/aw-xref.py +1330 -0
- package/assets/.aw-spec/scripts/python/validate_okf.py +349 -0
- package/assets/.aw-spec/templates/constitution-domain-template.md +75 -0
- package/assets/.aw-spec/templates/constitution-technical-template.md +70 -0
- package/assets/.aw-spec/templates/delta-design-template.md +69 -0
- package/assets/.aw-spec/templates/delta-spec-template.md +60 -0
- package/assets/.aw-spec/templates/design-template.md +383 -0
- package/assets/.aw-spec/templates/okf-concept-template.md +103 -0
- package/assets/.aw-spec/templates/parity-manifest-template.json +49 -0
- package/assets/.aw-spec/templates/source-map-template.md +85 -0
- package/assets/.aw-spec/templates/spec-template.md +192 -71
- package/assets/.claude/agent.json +27 -0
- package/assets/.claude/skills/aw-spec-orch/SKILL.md +55 -0
- package/assets/.claude/skills/aw-spec-orch-demo/SKILL.md +59 -0
- package/assets/.kilocode/agent.json +28 -0
- package/assets/.kilocode/workflows/aw-spec-orch-demo.md +59 -0
- package/assets/.kilocode/workflows/aw-spec-orch.md +55 -0
- package/assets/docs/architecture/clean-architecture.md +1 -1
- package/assets/docs/architecture/cqrs.md +1 -1
- package/assets/docs/architecture/eventing.md +1 -1
- package/assets/docs/architecture/folder-structure.md +1 -1
- package/assets/docs/architecture/modular-monolith.md +1 -1
- package/assets/docs/architecture/persistence.md +1 -1
- package/assets/docs/architecture/testing.md +1 -1
- package/assets/docs/architecture/vertical-slices.md +1 -1
- package/assets/docs/components/Email/README.md +1 -1
- package/assets/docs/components/Jobs/README.md +1 -1
- package/assets/docs/components/QrGenerator/README.md +1 -1
- package/assets/docs/components/README.md +1 -1
- package/assets/docs/domain/domain-driven-design.md +1 -1
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +86 -18
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +1 -1
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +58 -124
- package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +119 -0
- package/assets/docs/domainspecs/healthcare/consent.md +1 -1
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/dicom.md +1 -1
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/fhir.md +1 -1
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/hipaa.md +1 -1
- package/assets/docs/domainspecs/healthcare/hl7.md +1 -1
- package/assets/docs/domainspecs/healthcare/integration-terms.md +1 -1
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/terminology.md +1 -1
- package/assets/docs/domainspecs/healthcare/testing.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +1 -1
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/atc.md +1 -1
- package/assets/docs/domainspecs/pharma/auditing.domain.md +80 -16
- package/assets/docs/domainspecs/pharma/authorization.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/comandrulemap.md +64 -142
- package/assets/docs/domainspecs/pharma/commandtechrulemap.md +119 -0
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/data-provenance.md +1 -1
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/eventing.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/fhir.md +1 -1
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/hl7.md +1 -1
- package/assets/docs/domainspecs/pharma/idmp.md +1 -1
- package/assets/docs/domainspecs/pharma/integration-terms.md +1 -1
- package/assets/docs/domainspecs/pharma/ndc.md +1 -1
- package/assets/docs/domainspecs/pharma/persistence.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/pharma-terms.md +1 -1
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +1 -1
- package/assets/docs/domainspecs/pharma/terminology.md +1 -1
- package/assets/docs/domainspecs/pharma/testing.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +1 -1
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +1 -1
- package/assets/docs/governance/api-versioning.md +1 -1
- package/assets/docs/governance/coding-standards.md +1 -1
- package/assets/docs/governance/dependency-policy.md +1 -1
- package/assets/docs/requirement-spec.txt +13 -1
- package/assets/docs/security/auditing.md +54 -11
- package/assets/docs/security/authorization.md +1 -1
- package/assets/docs/security/data-classification.md +1 -1
- package/assets/docs/security/zero-trust.md +1 -1
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +142 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/utils/manifest.d.ts +31 -0
- package/dist/utils/manifest.d.ts.map +1 -0
- package/dist/utils/manifest.js +91 -0
- package/dist/utils/manifest.js.map +1 -0
- package/dist/utils/paths.js +2 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/update-engine.d.ts +52 -0
- package/dist/utils/update-engine.d.ts.map +1 -0
- package/dist/utils/update-engine.js +203 -0
- package/dist/utils/update-engine.js.map +1 -0
- package/package.json +1 -1
- package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
- package/assets/.aw-spec/templates/checklist-template.md +0 -40
- package/assets/.aw-spec/templates/constitution-template.md +0 -57
- package/assets/.aw-spec/templates/plan-template.md +0 -113
- package/assets/.aw-spec/templates/tasks-template.md +0 -252
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
- package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.kilocode/rules/specify-rules.md +0 -4
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
- package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
- package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
- package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
- package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
- package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
- package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
- package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
- package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
- package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
- package/assets/docs/command.txt +0 -295
- package/assets/docs/pharma-constitution.my-ref.md +0 -86
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# aw-spec-parity (orchestrator) — the CUTOVER GATE of the Brownfield Pipeline
|
|
3
|
+
#
|
|
4
|
+
# The migration-grade oracle. Once a slice has a new (candidate) implementation
|
|
5
|
+
# (forward pipeline) and a green characterization fence, PARITY runs every case
|
|
6
|
+
# in a manifest against BOTH the running LEGACY system and the new CANDIDATE and
|
|
7
|
+
# diffs observable output (response status + body, and optional resulting-state
|
|
8
|
+
# probes). The seam cuts over to the candidate ONLY when parity HOLDS — the
|
|
9
|
+
# running legacy system is the oracle, not a written spec.
|
|
10
|
+
#
|
|
11
|
+
# inventory → adopt → characterize → [ forward pipeline ] → PARITY → cutover ← you are here
|
|
12
|
+
#
|
|
13
|
+
# Parity is what analyze-slice/characterize can't be: it compares against a LIVE oracle,
|
|
14
|
+
# so it catches behaviour no static test captured. Approved intended differences
|
|
15
|
+
# are whitelisted in the manifest's `expected_deviations` — and each MUST be
|
|
16
|
+
# recorded as a MODIFIED spec item via the CR loop, so behaviour never drifts
|
|
17
|
+
# silently.
|
|
18
|
+
#
|
|
19
|
+
# Two things the operator supplies (the pipeline cannot guess them): WHERE the
|
|
20
|
+
# legacy and candidate systems are running (the two `sides` in the manifest).
|
|
21
|
+
# parity AUTHORS the input corpus from the spec + source-map, then STOPS for you
|
|
22
|
+
# to fill the endpoints, then diffs on re-run.
|
|
23
|
+
#
|
|
24
|
+
# On a mismatch: triage — a REGRESSION is fixed in the CANDIDATE code (to match
|
|
25
|
+
# legacy); an INTENDED difference is added to expected_deviations (+ recorded as a
|
|
26
|
+
# MODIFIED spec item via /aw-spec-orch specify). parity never changes the spec here and
|
|
27
|
+
# never forces a match by breaking the candidate.
|
|
28
|
+
#
|
|
29
|
+
# Launch: /aw-spec-orch parity [strategy] [focus/guidance]
|
|
30
|
+
# Prereq: /aw-spec-orch adopt (spec.md + design.md + source-map.md) + a running
|
|
31
|
+
# candidate, and the legacy system reachable.
|
|
32
|
+
# =============================================================================
|
|
33
|
+
|
|
34
|
+
name: aw-spec-parity
|
|
35
|
+
description: Run a parity manifest's cases against the running legacy system and the new candidate, diff observable output, and gate cutover on parity holding. Authors the corpus from the spec + source-map; the operator supplies the two endpoints. Mismatches are triaged (fix the candidate, or whitelist an intended deviation that must become a MODIFIED spec item). The live legacy system is the oracle.
|
|
36
|
+
version: 1.0.0
|
|
37
|
+
agent_agnostic: true
|
|
38
|
+
dialect: aw-spec.orchestrator/v1
|
|
39
|
+
|
|
40
|
+
inputs:
|
|
41
|
+
user_input:
|
|
42
|
+
description: Optional focus / guidance (an area or extra input cases to cover).
|
|
43
|
+
required: false
|
|
44
|
+
bind: USER_INPUT
|
|
45
|
+
|
|
46
|
+
scripts:
|
|
47
|
+
parity:
|
|
48
|
+
sh: .aw-spec/scripts/bash/aw-parity.sh
|
|
49
|
+
ps1: .aw-spec/scripts/powershell/aw-parity.ps1
|
|
50
|
+
actions:
|
|
51
|
+
sh: .aw-spec/scripts/bash/aw-spec-actions.sh
|
|
52
|
+
ps1: .aw-spec/scripts/powershell/aw-spec-actions.ps1
|
|
53
|
+
|
|
54
|
+
# Sticky standards seed = the UNIVERSAL always-on rule only (ai-rules). The code-generation
|
|
55
|
+
# set (triage may fix the CANDIDATE code to match legacy) is no longer hardcoded here — it is
|
|
56
|
+
# now CONFIGURATION, loaded per-command from docs/domainspecs/<domain>/commandtechrulemap.md
|
|
57
|
+
# under "## /aw-spec-parity" by the tech-select module (see the tech_select step below). No
|
|
58
|
+
# domain files: the target behaviour is defined by the running legacy system, not domain rules —
|
|
59
|
+
# the tech map lists only technical files. (parity does not reference constitution.technical.md.)
|
|
60
|
+
standards:
|
|
61
|
+
- { path: docs/glossary/ai-rules.md, optional: true }
|
|
62
|
+
|
|
63
|
+
vars:
|
|
64
|
+
parity_ok: "false"
|
|
65
|
+
case_count: "0"
|
|
66
|
+
sides_configured: "false"
|
|
67
|
+
|
|
68
|
+
workflow:
|
|
69
|
+
|
|
70
|
+
# 0. TECHNICAL rule files → sticky standards (configuration, not hardcoded). tech-select
|
|
71
|
+
# reads docs/domainspecs/<domain>/commandtechrulemap.md under "## /aw-spec-parity" and
|
|
72
|
+
# loads that code-generation set into the sticky standards the agent_generate triage step
|
|
73
|
+
# ALWAYS prepends. No domain rule file is loaded here — the tech map lists only technical
|
|
74
|
+
# files. No blocking gate: an unconfigured project soft-continues (the target behaviour is
|
|
75
|
+
# the running legacy system, not any rule file).
|
|
76
|
+
- id: tech_select
|
|
77
|
+
action: include
|
|
78
|
+
module: .aw-spec/orchestrator/modules/tech-select.orch.yaml
|
|
79
|
+
with: { command: aw-spec-parity }
|
|
80
|
+
|
|
81
|
+
# 1. Resolve the feature + require the adopted artifacts (spec/design/source-map).
|
|
82
|
+
- id: feature_paths
|
|
83
|
+
action: execute_script
|
|
84
|
+
on_error: continue # never crash raw on 'no feature set' — the gate below explains it
|
|
85
|
+
script: { ref: actions }
|
|
86
|
+
subcommand: feature-paths
|
|
87
|
+
outputs:
|
|
88
|
+
- { name: feature_dir, from: "$.feature_dir" }
|
|
89
|
+
- { name: spec_file, from: "$.spec_file" }
|
|
90
|
+
- { name: design_file, from: "$.design_file" }
|
|
91
|
+
- { name: spec_exists, from: "$.spec_exists" }
|
|
92
|
+
- { name: design_exists, from: "$.design_exists" }
|
|
93
|
+
|
|
94
|
+
- id: require_feature
|
|
95
|
+
action: verify_context
|
|
96
|
+
require_non_empty: feature_dir
|
|
97
|
+
on_empty: stop
|
|
98
|
+
on_empty_message: "No active feature. Run /aw-spec-orch select-feature first (pick or create the aggregate, e.g. Order), then re-run parity."
|
|
99
|
+
|
|
100
|
+
- id: verify_spec
|
|
101
|
+
action: verify_context
|
|
102
|
+
require_true: spec_exists
|
|
103
|
+
on_false: stop
|
|
104
|
+
on_false_message: "No spec.md for the current feature. Adopt the slice first: /aw-spec-orch adopt <Aggregate>."
|
|
105
|
+
|
|
106
|
+
- id: verify_design
|
|
107
|
+
action: verify_context
|
|
108
|
+
require_true: design_exists
|
|
109
|
+
on_false: stop
|
|
110
|
+
on_false_message: "No design.md for the current feature. Run /aw-spec-orch adopt <Aggregate> (or /aw-spec-orch design) first."
|
|
111
|
+
|
|
112
|
+
- id: set_source_map
|
|
113
|
+
action: set
|
|
114
|
+
vars:
|
|
115
|
+
source_map: "{{feature_dir}}/source-map.md"
|
|
116
|
+
# required_files raises a fixed Stop naming the missing file → run adopt first.
|
|
117
|
+
- id: require_source_map
|
|
118
|
+
action: verify_context
|
|
119
|
+
required_files: ["{{source_map}}"]
|
|
120
|
+
|
|
121
|
+
# 2. Scaffold the parity manifest (idempotent — keeps an existing one, incl. the
|
|
122
|
+
# operator's endpoints and any cases already authored).
|
|
123
|
+
- id: scaffold_parity
|
|
124
|
+
action: execute_script
|
|
125
|
+
script: { ref: parity }
|
|
126
|
+
subcommand: scaffold
|
|
127
|
+
args: ["--feature-dir", "{{feature_dir}}"]
|
|
128
|
+
outputs:
|
|
129
|
+
- { name: manifest_path, from: "$.manifest_path" }
|
|
130
|
+
|
|
131
|
+
# 3. Read current manifest readiness BEFORE authoring, so cases are only authored
|
|
132
|
+
# once (a re-run after the operator fills endpoints skips authoring).
|
|
133
|
+
- id: check_initial
|
|
134
|
+
action: execute_script
|
|
135
|
+
script: { ref: parity }
|
|
136
|
+
subcommand: check
|
|
137
|
+
args: ["--manifest", "{{manifest_path}}"]
|
|
138
|
+
outputs:
|
|
139
|
+
- { name: case_count, from: "$.case_count" }
|
|
140
|
+
- { name: sides_configured, from: "$.sides_configured" }
|
|
141
|
+
|
|
142
|
+
# 4. Pre-execution hooks.
|
|
143
|
+
- id: resolve_pre_hooks
|
|
144
|
+
action: execute_script
|
|
145
|
+
script: { ref: actions }
|
|
146
|
+
subcommand: resolve-hooks
|
|
147
|
+
args: ["--phase", "before_parity"]
|
|
148
|
+
outputs:
|
|
149
|
+
- { name: before_hooks, from: "$.hooks" }
|
|
150
|
+
- id: dispatch_pre_hooks
|
|
151
|
+
action: dispatch_hooks
|
|
152
|
+
hooks_from_variable: before_hooks
|
|
153
|
+
|
|
154
|
+
# 5. AUTHOR the parity corpus (only when no real cases exist yet). Derive cases
|
|
155
|
+
# from the spec's US/FR and the source-map's as-built quirks. Edits ONLY the
|
|
156
|
+
# `cases` array — the operator owns `sides`.
|
|
157
|
+
- id: ctx_author_cases
|
|
158
|
+
condition: "{{case_count}} == 0"
|
|
159
|
+
action: build_context
|
|
160
|
+
context:
|
|
161
|
+
- { path: "{{manifest_path}}" } # the manifest to edit (cases only)
|
|
162
|
+
- { path: "{{spec_file}}" } # US / FR / SC — the observable surface
|
|
163
|
+
- { path: "{{source_map}}" } # as-built quirks (each MUST get a case)
|
|
164
|
+
- { path: "{{design_file}}" } # endpoints / handlers / events
|
|
165
|
+
- id: author_cases
|
|
166
|
+
condition: "{{case_count}} == 0"
|
|
167
|
+
action: agent_generate
|
|
168
|
+
tools: "Read,Write,Edit"
|
|
169
|
+
permission_mode: acceptEdits
|
|
170
|
+
task: |
|
|
171
|
+
Author the PARITY CORPUS by editing the `cases` array of the parity manifest
|
|
172
|
+
(in context) — the inputs whose outputs must match between the running legacy
|
|
173
|
+
system and the new candidate. Guidance: {{USER_INPUT}}
|
|
174
|
+
Rules:
|
|
175
|
+
- Derive cases from the spec's User Stories / FR / Success Criteria (in context)
|
|
176
|
+
and the design's endpoints/handlers: one case per observable behaviour, with
|
|
177
|
+
representative inputs — the happy path, boundaries, and error paths.
|
|
178
|
+
- Every AS-BUILT QUIRK recorded in source-map.md (in context) MUST get a case
|
|
179
|
+
that will confirm the candidate REPRODUCES it (parity fails if the new code
|
|
180
|
+
"fixes" a quirk that was not turned into an intended deviation).
|
|
181
|
+
- Each case: a stable `id` (PC-002, PC-003, …), a `description`, `spec_ids`, a
|
|
182
|
+
`request` (method/path/headers/body — compared on status + body), and — where
|
|
183
|
+
resulting STATE matters — an optional `state_probe` request (a follow-up
|
|
184
|
+
read compared on body). Use the routes/fields the design + code actually use.
|
|
185
|
+
- Edit ONLY the `cases` array. Preserve `sides`, `compare`, `expected_deviations`
|
|
186
|
+
and every other key BYTE-FOR-BYTE (the operator owns the two `sides`
|
|
187
|
+
endpoints). Remove the PC-001-EXAMPLE placeholder. Emit VALID JSON.
|
|
188
|
+
outputs:
|
|
189
|
+
- { name: authored, from: "$.files" }
|
|
190
|
+
|
|
191
|
+
# 6. Re-read readiness after authoring.
|
|
192
|
+
- id: check_ready
|
|
193
|
+
action: execute_script
|
|
194
|
+
script: { ref: parity }
|
|
195
|
+
subcommand: check
|
|
196
|
+
args: ["--manifest", "{{manifest_path}}"]
|
|
197
|
+
outputs:
|
|
198
|
+
- { name: case_count, from: "$.case_count" }
|
|
199
|
+
- { name: sides_configured, from: "$.sides_configured" }
|
|
200
|
+
- { name: check_error, from: "$.error" }
|
|
201
|
+
|
|
202
|
+
- id: cases_gate
|
|
203
|
+
action: verify_context
|
|
204
|
+
require_true: case_count
|
|
205
|
+
on_false: stop
|
|
206
|
+
on_false_message: "No parity cases in {{manifest_path}} (check error: {{check_error}}). Authoring produced none or the JSON is invalid — add cases by hand (derived from the spec + source-map) and re-run."
|
|
207
|
+
|
|
208
|
+
# 7. OPERATOR HANDOFF: the two `sides` endpoints cannot be guessed. Stop here until
|
|
209
|
+
# they are filled (where the legacy + candidate systems are running).
|
|
210
|
+
- id: sides_gate
|
|
211
|
+
action: verify_context
|
|
212
|
+
require_true: sides_configured
|
|
213
|
+
on_false: stop
|
|
214
|
+
on_false_message: "Parity corpus is ready ({{case_count}} case(s)), but the endpoints are not set. Edit {{manifest_path}} → set sides.legacy and sides.candidate to where your LEGACY and NEW systems are running (kind:http base_url, or kind:shell command), then re-run /aw-spec-orch parity."
|
|
215
|
+
|
|
216
|
+
# 8. PARITY + TRIAGE loop: run both sides + diff; on mismatch, fix the CANDIDATE
|
|
217
|
+
# (regression) or whitelist an INTENDED deviation, then re-run. Bounded (3×).
|
|
218
|
+
- id: parity_loop
|
|
219
|
+
action: loop
|
|
220
|
+
while: "{{parity_ok}} != true"
|
|
221
|
+
max_iterations: 3
|
|
222
|
+
steps:
|
|
223
|
+
- id: run_parity
|
|
224
|
+
action: execute_script
|
|
225
|
+
on_error: continue
|
|
226
|
+
script: { ref: parity }
|
|
227
|
+
subcommand: run
|
|
228
|
+
args: ["--manifest", "{{manifest_path}}"]
|
|
229
|
+
outputs:
|
|
230
|
+
- { name: parity_ok, from: "$.ok" }
|
|
231
|
+
- { name: mismatched, from: "$.mismatched" }
|
|
232
|
+
- { name: matched, from: "$.matched" }
|
|
233
|
+
- { name: par_errors, from: "$.errors" }
|
|
234
|
+
- { name: report_path, from: "$.report_path" }
|
|
235
|
+
- id: hold_break
|
|
236
|
+
action: break
|
|
237
|
+
condition: "{{parity_ok}} == true"
|
|
238
|
+
- id: ctx_triage
|
|
239
|
+
action: build_context
|
|
240
|
+
context:
|
|
241
|
+
- { path: "{{report_path}}" } # the unaccepted diffs + accepted deviations
|
|
242
|
+
- { path: "{{manifest_path}}" } # to add expected_deviations
|
|
243
|
+
- { path: "{{spec_file}}" }
|
|
244
|
+
- { path: "{{source_map}}" }
|
|
245
|
+
- id: triage
|
|
246
|
+
action: agent_generate
|
|
247
|
+
tools: "Read,Write,Edit,Bash"
|
|
248
|
+
permission_mode: acceptEdits
|
|
249
|
+
task: |
|
|
250
|
+
Parity did not hold. Triage EACH unaccepted diff in the report (in context)
|
|
251
|
+
— the LEGACY output is the oracle:
|
|
252
|
+
- REGRESSION (the candidate is wrong): fix the CANDIDATE (new) code so its
|
|
253
|
+
observable output matches legacy. Read the candidate code, correct it, and
|
|
254
|
+
keep behaviour aligned with the legacy value shown in the report. Never
|
|
255
|
+
change the legacy side, and never edit a test just to hide the diff.
|
|
256
|
+
- INTENDED difference (a deliberate modernization): add an entry to the
|
|
257
|
+
manifest's `expected_deviations` ({case, path, reason}) so parity accepts
|
|
258
|
+
it — AND state in the reason that it must be recorded as a MODIFIED spec
|
|
259
|
+
item via /aw-spec-orch specify (do NOT edit spec.md here, and do NOT change code
|
|
260
|
+
to force a match). An as-built quirk the candidate dropped is a REGRESSION
|
|
261
|
+
unless it is a reviewed intended change.
|
|
262
|
+
- INVOKE ERROR (a side unreachable / bad request): report it — the operator
|
|
263
|
+
must make both systems reachable / fix the case; do not fake a pass.
|
|
264
|
+
Change ONLY candidate code and/or the manifest's expected_deviations.
|
|
265
|
+
Report:
|
|
266
|
+
{{report_path}}
|
|
267
|
+
outputs:
|
|
268
|
+
- { name: triaged_files, from: "$.files" }
|
|
269
|
+
|
|
270
|
+
- id: parity_gate
|
|
271
|
+
action: verify_context
|
|
272
|
+
require_true: parity_ok
|
|
273
|
+
on_false: stop
|
|
274
|
+
on_false_message: "Parity does NOT hold after 3 attempts ({{mismatched}} mismatch(es), {{par_errors}} error(s)). See {{report_path}}. Resolve each unaccepted diff — fix the candidate to match legacy, or whitelist an intended deviation (and record it as a MODIFIED spec item via /aw-spec-orch specify) — then re-run. Do NOT cut over until parity holds."
|
|
275
|
+
|
|
276
|
+
# 9. Post-execution hooks.
|
|
277
|
+
- id: resolve_post_hooks
|
|
278
|
+
action: execute_script
|
|
279
|
+
script: { ref: actions }
|
|
280
|
+
subcommand: resolve-hooks
|
|
281
|
+
args: ["--phase", "after_parity"]
|
|
282
|
+
outputs:
|
|
283
|
+
- { name: after_hooks, from: "$.hooks" }
|
|
284
|
+
- id: dispatch_post_hooks
|
|
285
|
+
action: dispatch_hooks
|
|
286
|
+
hooks_from_variable: after_hooks
|
|
287
|
+
|
|
288
|
+
outputs:
|
|
289
|
+
feature_dir: "{{feature_dir}}"
|
|
290
|
+
manifest_path: "{{manifest_path}}"
|
|
291
|
+
report_path: "{{report_path}}"
|
|
292
|
+
matched: "{{matched}}"
|
|
293
|
+
next: "PARITY HOLDS — the slice is cutover-ready. Route the seam to the candidate (Run/Deploy); the legacy path goes dark and roll back = re-route. Fold every accepted deviation into spec.md as a MODIFIED item via /aw-spec-orch specify. Repeat inventory→adopt→characterize→parity for the next slice."
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# aw-spec-run (orchestrator) — migrate + prepare to run
|
|
3
|
+
#
|
|
4
|
+
# Apply database migrations; on failure fix (up to 3×) and record the touched files
|
|
5
|
+
# in the slice's OKF concept; then surface the launch command. A live server is not
|
|
6
|
+
# held by the batch engine — the launch hint is reported for the user/agent to start.
|
|
7
|
+
# Run after /aw-spec-orch analyze-slice.
|
|
8
|
+
#
|
|
9
|
+
# 1.1.0 — the fix loop's file list now comes from the OKF concept's `source_files`
|
|
10
|
+
# (`aw-xref concept-paths`) instead of the retired `design-paths` scan for
|
|
11
|
+
# ```lang path=… fences, and the tail step records fix-loop files in that concept
|
|
12
|
+
# instead of copying file bodies back into design fences (`design-reconcile`).
|
|
13
|
+
#
|
|
14
|
+
# Launch: /aw-spec-orch run [strategy]
|
|
15
|
+
# =============================================================================
|
|
16
|
+
|
|
17
|
+
name: aw-spec-run
|
|
18
|
+
description: Apply migrations, fix migration/runtime errors, record the touched files in the slice's knowledge concept, and report the launch command.
|
|
19
|
+
version: 1.1.0
|
|
20
|
+
agent_agnostic: true
|
|
21
|
+
dialect: aw-spec.orchestrator/v1
|
|
22
|
+
|
|
23
|
+
scripts:
|
|
24
|
+
actions:
|
|
25
|
+
sh: .aw-spec/scripts/bash/aw-spec-actions.sh
|
|
26
|
+
ps1: .aw-spec/scripts/powershell/aw-spec-actions.ps1
|
|
27
|
+
xref:
|
|
28
|
+
sh: .aw-spec/scripts/bash/aw-xref.sh
|
|
29
|
+
ps1: .aw-spec/scripts/powershell/aw-xref.ps1
|
|
30
|
+
|
|
31
|
+
# No hardcoded technical standards seed (run never had ai-rules). The technical rule file
|
|
32
|
+
# the migration step works against (persistence) is now CONFIGURATION, loaded per-command from
|
|
33
|
+
# docs/domainspecs/<domain>/commandtechrulemap.md under "## /aw-spec-run" by the tech-select
|
|
34
|
+
# module (see the tech_select step below). No domain files; run does not reference
|
|
35
|
+
# constitution.technical.md. (missing files skipped at assembly time)
|
|
36
|
+
standards: []
|
|
37
|
+
|
|
38
|
+
vars:
|
|
39
|
+
migrate_ok: "false"
|
|
40
|
+
|
|
41
|
+
workflow:
|
|
42
|
+
|
|
43
|
+
# 0. TECHNICAL rule files → sticky standards (configuration, not hardcoded). tech-select
|
|
44
|
+
# reads docs/domainspecs/<domain>/commandtechrulemap.md under "## /aw-spec-run" and loads
|
|
45
|
+
# that set (persistence) into the sticky standards the agent_generate migration step ALWAYS
|
|
46
|
+
# prepends. No domain rule file here. No blocking gate: an unconfigured project soft-continues.
|
|
47
|
+
- id: tech_select
|
|
48
|
+
action: include
|
|
49
|
+
module: .aw-spec/orchestrator/modules/tech-select.orch.yaml
|
|
50
|
+
with: { command: aw-spec-run }
|
|
51
|
+
|
|
52
|
+
- id: feature_paths
|
|
53
|
+
action: execute_script
|
|
54
|
+
on_error: continue # never crash raw on 'no feature set' — the gate below explains it
|
|
55
|
+
script: { ref: actions }
|
|
56
|
+
subcommand: feature-paths
|
|
57
|
+
outputs:
|
|
58
|
+
- { name: feature_dir, from: "$.feature_dir" }
|
|
59
|
+
|
|
60
|
+
- id: require_feature
|
|
61
|
+
action: verify_context
|
|
62
|
+
require_non_empty: feature_dir
|
|
63
|
+
on_empty: stop
|
|
64
|
+
on_empty_message: "No active feature. Run /aw-spec-orch select-feature first (pick or create the aggregate, e.g. Order), then re-run run."
|
|
65
|
+
|
|
66
|
+
# The slice's source files, from its OKF concept — what the migration fix loop below is
|
|
67
|
+
# handed. Replaces the retired `design-paths` fence scan (the tech-agnostic design.md
|
|
68
|
+
# carries no ```lang path=… code blocks, so it returned nothing and the fixer got an
|
|
69
|
+
# EMPTY context). Read-only, exits 0 with paths=[] when there is no concept yet, and
|
|
70
|
+
# on_error: continue so a missing bundle can never block a migration.
|
|
71
|
+
- id: concept_paths
|
|
72
|
+
action: execute_script
|
|
73
|
+
on_error: continue
|
|
74
|
+
script: { ref: xref }
|
|
75
|
+
subcommand: concept-paths
|
|
76
|
+
args: ["--feature-dir", "{{feature_dir}}"]
|
|
77
|
+
outputs:
|
|
78
|
+
- { name: all_paths, from: "$.paths" }
|
|
79
|
+
- { name: paths_missing, from: "$.missing" }
|
|
80
|
+
|
|
81
|
+
- id: resolve_pre_hooks
|
|
82
|
+
action: execute_script
|
|
83
|
+
script: { ref: actions }
|
|
84
|
+
subcommand: resolve-hooks
|
|
85
|
+
args: ["--phase", "before_run"]
|
|
86
|
+
outputs:
|
|
87
|
+
- { name: before_hooks, from: "$.hooks" }
|
|
88
|
+
- id: dispatch_pre_hooks
|
|
89
|
+
action: dispatch_hooks
|
|
90
|
+
hooks_from_variable: before_hooks
|
|
91
|
+
|
|
92
|
+
# Migrate → (if red) fix → re-migrate, up to 3×.
|
|
93
|
+
- id: migrate_loop
|
|
94
|
+
action: loop
|
|
95
|
+
while: "{{migrate_ok}} != true"
|
|
96
|
+
max_iterations: 3
|
|
97
|
+
steps:
|
|
98
|
+
- id: migrate
|
|
99
|
+
action: execute_script
|
|
100
|
+
on_error: continue
|
|
101
|
+
script: { ref: actions }
|
|
102
|
+
subcommand: run-migrate
|
|
103
|
+
args: ["--feature-dir", "{{feature_dir}}"]
|
|
104
|
+
outputs:
|
|
105
|
+
- { name: migrate_ok, from: "$.ok" }
|
|
106
|
+
- { name: migrate_tool, from: "$.tool" }
|
|
107
|
+
- { name: migrate_log, from: "$.log_tail" }
|
|
108
|
+
- id: green_break
|
|
109
|
+
action: break
|
|
110
|
+
condition: "{{migrate_ok}} == true"
|
|
111
|
+
- id: ctx_fix
|
|
112
|
+
action: build_context
|
|
113
|
+
vars:
|
|
114
|
+
migrate_log: "{{migrate_log}}"
|
|
115
|
+
context_from: all_paths
|
|
116
|
+
- id: fix
|
|
117
|
+
action: agent_generate
|
|
118
|
+
tools: "Read,Write,Edit,Bash"
|
|
119
|
+
permission_mode: acceptEdits
|
|
120
|
+
task: |
|
|
121
|
+
A migration/runtime step failed. Fix the migration or configuration in
|
|
122
|
+
the files in context (usually the Infra layer), preserving intent. Log:
|
|
123
|
+
{{migrate_log}}
|
|
124
|
+
outputs:
|
|
125
|
+
- { name: fixed_files, from: "$.files" }
|
|
126
|
+
|
|
127
|
+
- id: run_gate
|
|
128
|
+
action: verify_context
|
|
129
|
+
require_true: migrate_ok
|
|
130
|
+
on_false: stop
|
|
131
|
+
on_false_message: "Migration still failing after 3 fix attempts. Last log: {{migrate_log}}"
|
|
132
|
+
|
|
133
|
+
# Record what the migration fix loop touched in the slice's OKF concept. Replaces the
|
|
134
|
+
# retired `design-reconcile` (which copied file bodies back into design fences — a
|
|
135
|
+
# silent no-op since design.md stopped carrying code). The fix loop can CREATE files
|
|
136
|
+
# (a new migration, a config) that implement never recorded. UNION (--merge), never
|
|
137
|
+
# replace. Advisory: conditioned + on_error: continue, never gated.
|
|
138
|
+
- id: okf_merge_run_fixes
|
|
139
|
+
action: execute_script
|
|
140
|
+
condition: "{{fixed_files}}"
|
|
141
|
+
on_error: continue
|
|
142
|
+
script: { ref: xref }
|
|
143
|
+
subcommand: concept-upsert
|
|
144
|
+
args: ["--feature-dir", "{{feature_dir}}", "--source-files", "{{fixed_files}}", "--merge"]
|
|
145
|
+
outputs:
|
|
146
|
+
- { name: okf_concept, from: "$.concept" }
|
|
147
|
+
|
|
148
|
+
# Surface the launch command (does not start a long-lived server).
|
|
149
|
+
- id: locate_host
|
|
150
|
+
action: execute_script
|
|
151
|
+
on_error: continue
|
|
152
|
+
script: { ref: actions }
|
|
153
|
+
subcommand: find-host-project
|
|
154
|
+
outputs:
|
|
155
|
+
- { name: host_found, from: "$.found" }
|
|
156
|
+
- { name: host_project, from: "$.project_dir" }
|
|
157
|
+
|
|
158
|
+
- id: resolve_post_hooks
|
|
159
|
+
action: execute_script
|
|
160
|
+
script: { ref: actions }
|
|
161
|
+
subcommand: resolve-hooks
|
|
162
|
+
args: ["--phase", "after_run"]
|
|
163
|
+
outputs:
|
|
164
|
+
- { name: after_hooks, from: "$.hooks" }
|
|
165
|
+
- id: dispatch_post_hooks
|
|
166
|
+
action: dispatch_hooks
|
|
167
|
+
hooks_from_variable: after_hooks
|
|
168
|
+
|
|
169
|
+
outputs:
|
|
170
|
+
feature_dir: "{{feature_dir}}"
|
|
171
|
+
migrate_tool: "{{migrate_tool}}"
|
|
172
|
+
okf_concept: "{{okf_concept}}"
|
|
173
|
+
# Declared in the concept but absent on disk — advisory index drift, never gated.
|
|
174
|
+
stale_source_files: "{{paths_missing}}"
|
|
175
|
+
host_project: "{{host_project}}"
|
|
176
|
+
launch_hint: "dotnet run --project {{host_project}} (if .NET)"
|
|
177
|
+
next: "/aw-spec-orch deploy"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# aw-spec-select-domain (orchestrator) — select the active domain-specs folder
|
|
3
|
+
#
|
|
4
|
+
# Pure orchestration/governance, NO generation: scripts + one gate + one HITL select.
|
|
5
|
+
# Exercises the D1 interaction channel: under ANY strategy the `user_select`
|
|
6
|
+
# step suspends via --checkpoint (kind 'select') so the LAUNCHING agent asks
|
|
7
|
+
# the user; headless runs prefill with --input, --select select_domain=<name>,
|
|
8
|
+
# or --non-interactive.
|
|
9
|
+
#
|
|
10
|
+
# Run (interactive via launcher):
|
|
11
|
+
# python3 .aw-spec/orchestrator/orchestrator.py \
|
|
12
|
+
# .aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml \
|
|
13
|
+
# --checkpoint .aw-spec/orchestrator/.state/select-domain.state.json --json
|
|
14
|
+
# =============================================================================
|
|
15
|
+
|
|
16
|
+
name: aw-spec-select-domain
|
|
17
|
+
description: Select the active domain-specs folder and store it in .aw-spec/domain.json so all AW-Spec commands load the right domain rule files.
|
|
18
|
+
version: 1.0.0
|
|
19
|
+
agent_agnostic: true
|
|
20
|
+
dialect: aw-spec.orchestrator/v1
|
|
21
|
+
|
|
22
|
+
inputs:
|
|
23
|
+
user_input:
|
|
24
|
+
description: Optional domain folder name to set directly (e.g. healthcare).
|
|
25
|
+
required: false
|
|
26
|
+
bind: USER_INPUT
|
|
27
|
+
|
|
28
|
+
scripts:
|
|
29
|
+
actions:
|
|
30
|
+
sh: .aw-spec/scripts/bash/aw-spec-actions.sh
|
|
31
|
+
ps1: .aw-spec/scripts/powershell/aw-spec-actions.ps1
|
|
32
|
+
|
|
33
|
+
workflow:
|
|
34
|
+
|
|
35
|
+
# 1. Discover candidate domains = immediate subdirs of docs/domainspecs.
|
|
36
|
+
- id: list_domains
|
|
37
|
+
action: execute_script
|
|
38
|
+
script: { ref: actions }
|
|
39
|
+
subcommand: list-domains
|
|
40
|
+
outputs:
|
|
41
|
+
- { name: domains, from: "$.domains" }
|
|
42
|
+
|
|
43
|
+
# 2. Stop early if there are no domains to choose from.
|
|
44
|
+
- id: guard_no_domains
|
|
45
|
+
action: verify_context
|
|
46
|
+
require_non_empty: domains
|
|
47
|
+
on_empty_message: >
|
|
48
|
+
No domains found. Create docs/domainspecs/<name>/comandrulemap.md
|
|
49
|
+
(laid out like the healthcare one), then re-run.
|
|
50
|
+
on_empty: stop
|
|
51
|
+
|
|
52
|
+
# 3. Choose the domain. If USER_INPUT names a valid domain it is used directly;
|
|
53
|
+
# otherwise the launcher relays the choice to the user. One option => confirm.
|
|
54
|
+
- id: select_domain
|
|
55
|
+
action: user_select
|
|
56
|
+
prompt: "Select the active domain:"
|
|
57
|
+
options_from_variable: domains
|
|
58
|
+
preselect_from: USER_INPUT # direct-argument fast path
|
|
59
|
+
single_option_confirm: true
|
|
60
|
+
outputs:
|
|
61
|
+
- { name: chosen, from: selection }
|
|
62
|
+
|
|
63
|
+
# 4. Persist the choice to .aw-spec/domain.json and report map status.
|
|
64
|
+
- id: set_domain
|
|
65
|
+
action: execute_script
|
|
66
|
+
script: { ref: actions }
|
|
67
|
+
subcommand: set-domain
|
|
68
|
+
args: ["--domain", "{{chosen}}"]
|
|
69
|
+
outputs:
|
|
70
|
+
- { name: domain, from: "$.domain" }
|
|
71
|
+
- { name: map_path, from: "$.map_path" }
|
|
72
|
+
- { name: map_exists, from: "$.map_exists" }
|
|
73
|
+
|
|
74
|
+
outputs:
|
|
75
|
+
domain: "{{domain}}"
|
|
76
|
+
comandrulemap: "{{map_path}}"
|
|
77
|
+
comandrulemap_exists: "{{map_exists}}"
|
|
78
|
+
note: "Active domain '{{domain}}' persisted to .aw-spec/domain.json. It selects TWO rule maps under docs/domainspecs/{{domain}}/ — comandrulemap.md (DOMAIN rules; read by constitution + specify only, because the spec is the pivot) and commandtechrulemap.md (TECHNICAL rules; read by 10 workflows incl. design, implement, build and run). comandrulemap_exists reports the domain half only. A map that is absent, or a command with no heading in one, loads nothing for that class and SOFT-CONTINUES — an absent heading is a valid state, never a failure."
|
|
79
|
+
next: "/aw-spec-orch select-feature (then specify — the per-feature path). Re-run /aw-spec-orch select-domain any time to switch domains; it rebinds both maps at once."
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# aw-spec-select-feature (orchestrator) — pick or create the active FEATURE
|
|
3
|
+
#
|
|
4
|
+
# feature = AGGREGATE (e.g. Order). This is the FIRST step of the spec-anchored
|
|
5
|
+
# pipeline: it fixes the aggregate boundary BEFORE any spec/design exists, so the
|
|
6
|
+
# feature's single spec.md + design.md and every command (CreateOrder/UpdateOrder =
|
|
7
|
+
# user stories) hang off one directory. It replaces guessing the aggregate out of prose in
|
|
8
|
+
# `specify` — that is why finding #1 (feature=aggregate) is enforced here, not hoped for.
|
|
9
|
+
#
|
|
10
|
+
# The pickable list is TWO merged sources (deduped by name): specs/ sub-folders
|
|
11
|
+
# (features already scaffolded/adopted) AND the OKF bundle's Aggregate concepts —
|
|
12
|
+
# the brownfield feature map `/aw-spec-orch onboard` reverse-engineers. So in a
|
|
13
|
+
# brownfield repo you pick a real discovered code feature BEFORE anything is under
|
|
14
|
+
# specs/; on greenfield (no bundle) the list is specs-only, exactly as before.
|
|
15
|
+
#
|
|
16
|
+
# ZERO LLM: only scripts + one select + (conditionally) one ask. No generation,
|
|
17
|
+
# no standards, no domain-select. Pure, deterministic orchestration/governance.
|
|
18
|
+
#
|
|
19
|
+
# list-features (specs/ ∪ OKF aggregates) → user_select (existing | "+ create new") → [ask name] → set-feature
|
|
20
|
+
#
|
|
21
|
+
# Persists .aw-spec/feature.json {"feature_directory":"specs/<Feature>"} so every
|
|
22
|
+
# later command operates on it: the forward loop (specify/design/analyze-design/implement/
|
|
23
|
+
# build/analyze-slice/run/deploy) and the CR loop (analyze-delta-design/implement-delta/
|
|
24
|
+
# finalize-delta/close-delta — the standalone `cr` is retired; specify and design author
|
|
25
|
+
# the delta docs themselves).
|
|
26
|
+
#
|
|
27
|
+
# Launch:
|
|
28
|
+
# /aw-spec-orch select-feature # interactive: list + add-new
|
|
29
|
+
# /aw-spec-orch select-feature Order # direct: create-or-select Order
|
|
30
|
+
# =============================================================================
|
|
31
|
+
|
|
32
|
+
name: aw-spec-select-feature
|
|
33
|
+
description: Pick an existing feature (aggregate) or create a new one, and store it in .aw-spec/feature.json so every AW-Spec command operates on it. Zero LLM — scripts + one selection only.
|
|
34
|
+
version: 1.0.0
|
|
35
|
+
agent_agnostic: true
|
|
36
|
+
dialect: aw-spec.orchestrator/v1
|
|
37
|
+
|
|
38
|
+
inputs:
|
|
39
|
+
user_input:
|
|
40
|
+
description: Optional feature (aggregate) name to create or select directly, e.g. Order.
|
|
41
|
+
required: false
|
|
42
|
+
bind: USER_INPUT
|
|
43
|
+
|
|
44
|
+
scripts:
|
|
45
|
+
actions:
|
|
46
|
+
sh: .aw-spec/scripts/bash/aw-spec-actions.sh
|
|
47
|
+
ps1: .aw-spec/scripts/powershell/aw-spec-actions.ps1
|
|
48
|
+
|
|
49
|
+
vars:
|
|
50
|
+
new_sentinel: "+ Create a new feature" # source of truth is list-features $.sentinel; overwritten below
|
|
51
|
+
typed_name: ""
|
|
52
|
+
target_name: ""
|
|
53
|
+
bundle_dir: "knowledge" # where /aw-spec-orch onboard writes the OKF feature map (repo-root default)
|
|
54
|
+
|
|
55
|
+
workflow:
|
|
56
|
+
|
|
57
|
+
# 1. Enumerate selectable aggregates from TWO merged sources (deduped by name):
|
|
58
|
+
# specs/ sub-folders (already scaffolded/adopted) AND the OKF bundle's
|
|
59
|
+
# Aggregate concepts — the brownfield feature map onboard reverse-engineers,
|
|
60
|
+
# so a not-yet-adopted code feature is pickable before its specs/ dir exists.
|
|
61
|
+
# On greenfield (no bundle) the OKF source is empty → specs-only, as before.
|
|
62
|
+
# `select_options` carries the "+ create new" sentinel and (when USER_INPUT
|
|
63
|
+
# names a not-yet feature) that name injected — a direct arg is one-list select.
|
|
64
|
+
- id: list_features
|
|
65
|
+
action: execute_script
|
|
66
|
+
script: { ref: actions }
|
|
67
|
+
subcommand: list-features
|
|
68
|
+
args: ["--preselect", "{{USER_INPUT}}", "--bundle", "{{bundle_dir}}"]
|
|
69
|
+
outputs:
|
|
70
|
+
- { name: features, from: "$.features" }
|
|
71
|
+
- { name: feature_names, from: "$.names" }
|
|
72
|
+
- { name: feature_count, from: "$.count" }
|
|
73
|
+
- { name: select_options, from: "$.select_options" }
|
|
74
|
+
- { name: new_sentinel, from: "$.sentinel" }
|
|
75
|
+
|
|
76
|
+
# 2. Choose. A matching USER_INPUT auto-selects (existing OR injected-new) with
|
|
77
|
+
# no prompt; the lone sentinel at bootstrap (no features yet) auto-confirms.
|
|
78
|
+
- id: pick
|
|
79
|
+
action: user_select
|
|
80
|
+
prompt: "Select a feature (the aggregate, e.g. Order) — or create a new one:"
|
|
81
|
+
options_from_variable: select_options
|
|
82
|
+
preselect_from: USER_INPUT
|
|
83
|
+
single_option_confirm: true
|
|
84
|
+
outputs:
|
|
85
|
+
- { name: chosen, from: selection }
|
|
86
|
+
|
|
87
|
+
# 3. Only when the user chose "+ create new" (or bootstrapped) do we ask a name.
|
|
88
|
+
- id: ask_new_name
|
|
89
|
+
action: ask
|
|
90
|
+
condition: "{{chosen}} == {{new_sentinel}}"
|
|
91
|
+
prompt: >
|
|
92
|
+
Name the new feature — this is the AGGREGATE root (e.g. Order, Invoice,
|
|
93
|
+
Customer), NOT a single command. Operations like CreateOrder / UpdateOrder
|
|
94
|
+
become user stories inside it:
|
|
95
|
+
answer_var: typed_name
|
|
96
|
+
|
|
97
|
+
# 4. Coalesce the target name. The engine has no compound conditions, so this
|
|
98
|
+
# is two ordered sets: default to the pick, then override with the typed
|
|
99
|
+
# name only on the "create new" branch.
|
|
100
|
+
- id: name_from_pick
|
|
101
|
+
action: set
|
|
102
|
+
vars: { target_name: "{{chosen}}" }
|
|
103
|
+
- id: name_from_new
|
|
104
|
+
action: set
|
|
105
|
+
condition: "{{chosen}} == {{new_sentinel}}"
|
|
106
|
+
vars: { target_name: "{{typed_name}}" }
|
|
107
|
+
|
|
108
|
+
# 5. Create-or-select the aggregate dir + persist it as the active feature.
|
|
109
|
+
- id: set_feature
|
|
110
|
+
action: execute_script
|
|
111
|
+
script: { ref: actions }
|
|
112
|
+
subcommand: set-feature
|
|
113
|
+
args: ["--feature", "{{target_name}}"]
|
|
114
|
+
outputs:
|
|
115
|
+
- { name: feature, from: "$.feature" }
|
|
116
|
+
- { name: feature_dir, from: "$.feature_dir" }
|
|
117
|
+
- { name: spec_file, from: "$.spec_file" }
|
|
118
|
+
- { name: existed, from: "$.existed" }
|
|
119
|
+
- { name: created, from: "$.created" }
|
|
120
|
+
- { name: spec_exists, from: "$.spec_exists" }
|
|
121
|
+
|
|
122
|
+
outputs:
|
|
123
|
+
feature: "{{feature}}"
|
|
124
|
+
feature_dir: "{{feature_dir}}"
|
|
125
|
+
created: "{{created}}"
|
|
126
|
+
spec_exists: "{{spec_exists}}"
|
|
127
|
+
note: "Active feature set in .aw-spec/feature.json — the aggregate boundary for its single spec.md + design.md."
|
|
128
|
+
next: "/aw-spec-orch specify <what this feature does> (authors {{feature_dir}}/spec.md; each operation = a user story)"
|