@wairon/cli 5.1.1-dev.11 → 5.1.1-dev.110

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 (37) hide show
  1. package/CONTRIBUTING.md +193 -0
  2. package/README.md +154 -41
  3. package/dist/cli/index.js +66474 -29775
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/index.d.ts +43671 -0
  6. package/dist/index.js +53581 -21797
  7. package/dist/index.js.map +1 -1
  8. package/dist/templates/architect.yaml +15 -13
  9. package/dist/templates/domain-owner.yaml +5 -4
  10. package/dist/templates/skills/sdd-architect.md +44 -26
  11. package/dist/templates/skills/sdd-auditor.md +5 -4
  12. package/dist/templates/skills/sdd-delegate.md +43 -4
  13. package/dist/templates/skills/sdd-implement.md +83 -13
  14. package/dist/templates/skills/sdd-narrative.md +7 -4
  15. package/dist/templates/variants/logic-shapes.yaml +59 -0
  16. package/dist/templates/variants/portal-shapes.yaml +13 -0
  17. package/dist/webapp.html +771 -0
  18. package/docs/architecture.md +83 -0
  19. package/docs/cli.md +1208 -0
  20. package/docs/design/approval-baseline.md +257 -0
  21. package/docs/design/connecting-agent-entrypoint.md +167 -0
  22. package/docs/design/execution-budgets.md +199 -0
  23. package/docs/design/pack-scoping.md +581 -0
  24. package/docs/design/supervisor-doctrine.md +110 -0
  25. package/docs/design-export.md +313 -0
  26. package/docs/extending-wairon.md +616 -0
  27. package/docs/network.md +109 -0
  28. package/docs/requirements.md +65 -0
  29. package/docs/roadmap.md +133 -0
  30. package/docs/standards/INDEX.md +23 -0
  31. package/docs/standards/architecture.md +1042 -0
  32. package/docs/standards/language-bindings.md +120 -0
  33. package/docs/templates.md +61 -0
  34. package/docs/vision.md +59 -0
  35. package/docs/wairon-feature-requests-hosted-mcp.md +74 -0
  36. package/package.json +18 -5
  37. package/schemas/design-export-2.json +1186 -0
@@ -0,0 +1,83 @@
1
+ # wairon — Architecture
2
+
3
+ > Last updated: 2026-10-05 (for v6.0.0). wairon's own design is specified in its
4
+ > spec tree under `.wai/specs/`; this page is the orientation map, and the tree
5
+ > is authoritative where they differ.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ wairon is a TypeScript CLI. Its data flow is a single pipeline from the spec tree
12
+ to the artifacts the host AI tool consumes:
13
+
14
+ ```
15
+ .wai/specs/ ──┬─ validate ─▶ conformance result (gate)
16
+ ├─ lock ─────▶ .wai/lock.json (approval) ──▶ lock-check (CI gate)
17
+ ├─ export ───▶ design JSON (wairon-design)
18
+ └─ resolve ──▶ agent topology ──┬─▶ live briefs (sdd_get_agent_brief)
19
+ ├─▶ skills installed
20
+ ├─▶ MCP server (sdd_*)
21
+ └─▶ agent files (opt-in)
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Layers (`src/`)
27
+
28
+ | Directory | Responsibility |
29
+ |-----------|----------------|
30
+ | `cli/` | Commander entrypoint; wires commands |
31
+ | `commands/` | Command implementations, some thin ones in `cli/runner.ts` (init, validate, status, generate, lock, lock-check, doctor, diagram, export, rules, pack, member, project, subsystem, externals, surface, remote, produce, agent, list, show, domains, skills, mcp, execution, update, aliases, `dev`, and the hosting commands `serve` / `host`); `commands/adapters/` holds the forwards into core |
32
+ | `core/` | The engine: `specs` (load/scan the tree), `validation` and `family-validation` (the owner's gate and the family run), `rules/` (the rule registry), `authoring` (the gated spec writes), `agent_resolver` (spec → agents and briefs), `domains`, `skills`, `statehash` (deterministic StateId), `lockfile` and `approval` (the lock record), `externals` / `project-family` (members and pins), `design-export`, `extensions` / `packstore` (packs), `source-analysis` (code↔spec conformance), `diagram` / `canvas`, `provision`, `context`, `templates` |
33
+ | `migrations/` | Family migrations and the upgrade migrations: plan on a private copy, then apply all or nothing through a journaled transaction |
34
+ | `git/` | Git-backed hosted projects (commits only `.wai/`) |
35
+ | `producers/` | Projecting a spec tree to Notion / Miro |
36
+ | `config/` | `loader` (paths, request-scoped project root, project config, topology config, derived registry), defaults |
37
+ | `models/` | Zod schemas: `specs`, `agent`, `domain`/topology, `project`, `template`, `registry` |
38
+ | `exporters/` | Render an agent into a tool-specific file (Claude, Gemini, custom) |
39
+ | `mcp/` | The stdio MCP server (topology + `sdd_*` tools + the `wairon-agent://` brief resource) |
40
+ | `server/` | The hosting server (`sdd_host`): HTTP data plane (`/mcp`), admin control plane, web UI, per-request project scoping, auth, units and permissions, and the credential/project registries |
41
+ | `templates/` | Built-in agent templates + the SDD skill files |
42
+ | `utils/` | Logger, fs, yaml, errors, the AI guide |
43
+
44
+ ---
45
+
46
+ ## Key design points
47
+
48
+ - **Specs are the single source of truth.** `loadRegistry()` always derives the
49
+ agent set from the spec tree via `resolveAgentTopology()`. There is no
50
+ hand-maintained `agents.json`.
51
+ - **Domains are a superset of subsystems.** `resolveDomains()` returns
52
+ subsystem-derived domains (`boundTo` set) plus free-standing domains from
53
+ `.wai/topology.yaml`. A subsystem is a software unit; a domain is an ownership
54
+ scope.
55
+ - **Agents are briefs first.** Each agent's brief is composed live from the
56
+ current tree; writing it as a native subagent file into each target's output
57
+ directory is opt-in (`rules.materializeAgentFiles`). wairon does not do
58
+ per-directory or session-based rendering.
59
+ - **Approval is a file, not a status.** `lock` writes the gate identity and one
60
+ digest per spec to `.wai/lock.json` and never rewrites a spec; `lock-check`
61
+ and `status` compare against it.
62
+ - **Conformance is centralized** in `core/validation.ts`: `validateProject` (the
63
+ owner's gate, one project from its own files) and `validateFamily` (the
64
+ family run in `core/family-validation.ts`: each member's own gate verbatim,
65
+ plus composition and the family checks), reused by both the `validate`
66
+ command and the `sdd_validate_tree` MCP tool.
67
+ `validateAsComplete` runs the same gate at full strictness for `lock`.
68
+ - **Optionally hosted.** `wairon serve` (the `sdd_host` subsystem, in `server/`)
69
+ serves the `sdd_*` tools over streamable HTTP for many fully-isolated projects,
70
+ binding each request to its authenticated project via `AsyncLocalStorage`
71
+ (`runWithProjectRoot`) — reusing the core, validation, and MCP layers unchanged.
72
+ - **Everything is file-based** under `.wai/` — no database, and no daemon for the
73
+ core workflow. `wairon serve` is an **opt-in** hosting daemon (see the
74
+ [hosted server guide](https://github.com/SYW-Apps/Waffle-AIron/blob/main/docs/design/hosted-mcp-server.md)) that serves the same
75
+ file-based tools over HTTP.
76
+
77
+ ---
78
+
79
+ ## Stack
80
+
81
+ TypeScript + Node 18+, Commander, Inquirer, Zod, js-yaml, the MCP SDK, Vitest,
82
+ and tsup for bundling. See [docs/standards/](standards/INDEX.md) for the
83
+ architecture standards the SDD component model is built on.