@tacuchi/agent-workflow-cli 20.25.0 → 21.0.0
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 +1 -1
- package/dist/adapters/node-file-system.js +3 -0
- package/dist/adapters/node-file-system.js.map +1 -1
- package/dist/application/design/design-gate-service.js +246 -0
- package/dist/application/design/design-gate-service.js.map +1 -0
- package/dist/application/design/design-graph-service.js +85 -0
- package/dist/application/design/design-graph-service.js.map +1 -0
- package/dist/application/design/design-index-service.js +132 -0
- package/dist/application/design/design-index-service.js.map +1 -0
- package/dist/application/design/design-publish-service.js +488 -0
- package/dist/application/design/design-publish-service.js.map +1 -0
- package/dist/application/design/design-resolver-service.js +165 -0
- package/dist/application/design/design-resolver-service.js.map +1 -0
- package/dist/application/resume-service.js +23 -4
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/self/install-skill.js +25 -8
- package/dist/application/self/install-skill.js.map +1 -1
- package/dist/application/semantic-operation/protocol.js +18 -12
- package/dist/application/semantic-operation/protocol.js.map +1 -1
- package/dist/application/semantic-operation/publish.js +56 -9
- package/dist/application/semantic-operation/publish.js.map +1 -1
- package/dist/application/skills-resolver-service.js +19 -4
- package/dist/application/skills-resolver-service.js.map +1 -1
- package/dist/application/status-service.js +1 -0
- package/dist/application/status-service.js.map +1 -1
- package/dist/application/workline-index-service.js +6 -0
- package/dist/application/workline-index-service.js.map +1 -1
- package/dist/application/workspace-init-service.js +9 -1
- package/dist/application/workspace-init-service.js.map +1 -1
- package/dist/cli/commands/designs.js +110 -0
- package/dist/cli/commands/designs.js.map +1 -0
- package/dist/cli/commands/index.js +2 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/resume.js +8 -0
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/status.js +45 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/help-groups.js +3 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/parser.js +1 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/domain/design/artifact-body.js +223 -0
- package/dist/domain/design/artifact-body.js.map +1 -0
- package/dist/domain/design/artifact.js +606 -0
- package/dist/domain/design/artifact.js.map +1 -0
- package/dist/domain/design/baseline.js +359 -0
- package/dist/domain/design/baseline.js.map +1 -0
- package/dist/domain/design/capability.js +51 -0
- package/dist/domain/design/capability.js.map +1 -0
- package/dist/domain/design/closure.js +161 -0
- package/dist/domain/design/closure.js.map +1 -0
- package/dist/domain/design/governance.js +298 -0
- package/dist/domain/design/governance.js.map +1 -0
- package/dist/domain/design/identity.js +145 -0
- package/dist/domain/design/identity.js.map +1 -0
- package/dist/domain/design/manifest.js +552 -0
- package/dist/domain/design/manifest.js.map +1 -0
- package/dist/domain/design/maturity.js +234 -0
- package/dist/domain/design/maturity.js.map +1 -0
- package/dist/domain/design/naming.js +117 -0
- package/dist/domain/design/naming.js.map +1 -0
- package/dist/domain/design/projections.js +165 -0
- package/dist/domain/design/projections.js.map +1 -0
- package/dist/domain/design/reference.js +234 -0
- package/dist/domain/design/reference.js.map +1 -0
- package/dist/domain/design/retired.js +61 -0
- package/dist/domain/design/retired.js.map +1 -0
- package/dist/domain/design/revision.js +219 -0
- package/dist/domain/design/revision.js.map +1 -0
- package/dist/domain/design/secrets.js +86 -0
- package/dist/domain/design/secrets.js.map +1 -0
- package/dist/domain/design/validation.js +75 -0
- package/dist/domain/design/validation.js.map +1 -0
- package/dist/domain/design/yaml-subset.js +390 -0
- package/dist/domain/design/yaml-subset.js.map +1 -0
- package/dist/domain/safe-path.js +23 -0
- package/dist/domain/safe-path.js.map +1 -0
- package/dist/domain/skills.js +27 -3
- package/dist/domain/skills.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +13 -11
- package/skills/w/artifacts/README.md +3 -4
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +2 -2
- package/skills/w/commands/README.md +2 -0
- package/skills/w/commands/export-diagrams.md +1 -1
- package/skills/w/commands/export-manuals.md +1 -1
- package/skills/w/commands/export-reports.md +1 -1
- package/skills/w/commands/export-scripts.md +1 -1
- package/skills/w/commands/fix-git.md +1 -1
- package/skills/w/commands/generate-launch.md +2 -2
- package/skills/w/commands/persist.md +2 -2
- package/skills/w/commands/plan-exec.md +13 -7
- package/skills/w/commands/plan-new.md +8 -4
- package/skills/w/commands/plan-refine.md +8 -5
- package/skills/w/commands/quick.md +4 -4
- package/skills/w/commands/resume.md +2 -2
- package/skills/w/commands/spec-new.md +4 -4
- package/skills/w/commands/spec-refine.md +3 -2
- package/skills/w/commands/status.md +1 -1
- package/skills/w/commands/workspace-init.md +1 -1
- package/skills/w/context/MANIFEST.json +19 -8
- package/skills/w/harness/HARNESS.md +14 -10
- package/skills/w/loops/CHASSIS.md +9 -8
- package/skills/w/loops/CODE-POLICIES.md +22 -7
- package/skills/w/loops/README.md +1 -1
- package/skills/w/loops/plan-exec-loop/LOOP.md +127 -61
- package/skills/w/loops/plan-new-loop/LOOP.md +66 -70
- package/skills/w/loops/plan-refine-loop/LOOP.md +15 -7
- package/skills/w/loops/spec-refine-loop/LOOP.md +14 -12
- package/skills/w/modules/DESIGN-REFERENCES.md +109 -0
- package/skills/w/modules/PERSIST-ROUTING.md +1 -0
- package/skills/w/modules/PLAN-EXECUTION-BATCHES.md +84 -0
- package/skills/w/roles/README.md +7 -5
- package/skills/w/roles/design/ROLE.md +217 -0
- package/skills/w/schemas/design/design-baseline.v1.schema.json +71 -0
- package/skills/w/schemas/design/design-manifest.v1.schema.json +322 -0
- package/skills/w/schemas/design/design-review.v1.schema.json +72 -0
- package/skills/w/schemas/design/design-revocation.v1.schema.json +54 -0
- package/skills/w/schemas/design/ui-flow.v1.schema.json +211 -0
- package/skills/w/schemas/design/ui-screen.v1.schema.json +214 -0
- package/skills/w/artifacts/artifacts-design/SPEC.md +0 -42
- package/skills/w/modules/PLAN-DESIGN-SPECS.md +0 -12
- package/skills/w/modules/PLAN-REFINE-DESIGN-SPECS.md +0 -7
- package/skills/w/roles/ui-spec/ROLE.md +0 -147
|
@@ -34,7 +34,7 @@ The capabilities the harness layer depends on, with their universal fallback (wh
|
|
|
34
34
|
|---|---|---|
|
|
35
35
|
| **command-invocation** | the user triggers a flow by name (`spec-new`, `plan-exec`, …) | the user writes "run the `<cmd>` procedure" and the AI reads its doc |
|
|
36
36
|
| **procedure-loading** | load a loop's/command's doctrine | the AI **reads the `.md`** of the loop and follows it (read-and-follow) |
|
|
37
|
-
| **structured-choice** | ask the human ≤3 content questions **+ always** a `flow` control (`Compactar`/`Cerrar`)
|
|
37
|
+
| **structured-choice** | ask the human ≤3 content questions **+ always** a `flow` control (`Compactar`/`Cerrar`); every option has a semantic label + one-sentence functional explanation/example | **labeled markdown** in chat; answer by label or ratify all first options with `Aceptar recomendaciones` |
|
|
38
38
|
| **compaction** | shrink the context without losing the thread (+ a context-pressure **signal** for the chassis' self-regulation) | write `CHECKPOINT` and ask the user to restart the context and resume (resume keys off `CHECKPOINT`) |
|
|
39
39
|
| **subagent-dispatch** | *(optional)* parallelize research breadth | **inline sequential** research in the same session (the default anyway) |
|
|
40
40
|
| **persistent-context** | the `WORKSPACE` block + conventions always present | the repo's context file (standard **`AGENTS.md`**; `CLAUDE.md` on Claude Code) |
|
|
@@ -47,13 +47,13 @@ The capabilities the harness layer depends on, with their universal fallback (wh
|
|
|
47
47
|
|
|
48
48
|
## Harness binding matrix
|
|
49
49
|
|
|
50
|
-
Concrete mechanism per harness (**Jul-2026
|
|
50
|
+
Concrete mechanism per harness (matrix base verified **Jul-2026**; the `structured-choice` row was refreshed **Aug-2026** against current official docs/source and local host probes; `~` partial). Antigravity CLI reuses Gemini's surfaces (`~/.gemini/`); Oz reuses Warp's (they share the **Warp / Oz** column, with MCP via flag — see the note under the matrix).
|
|
51
51
|
|
|
52
52
|
| Capability | Claude Code | Codex | Kimi Code | Gemini / Antigravity | OpenCode | Crush | Warp / Oz | Generic |
|
|
53
53
|
|---|---|---|---|---|---|---|---|---|
|
|
54
54
|
| command-invocation | `.claude/commands/` (slash) | skills only (`$` mention; no commands dir, prompts removed) | skills only, as `/skill:<name>` (no commands dir) | skills only in agy (system slash commands; `.gemini/commands/*.toml` = legacy Gemini CLI) | `.opencode/command/` | `.crush/commands` (palette) + user-invocable skills | skills as `/name` | text |
|
|
55
55
|
| procedure-loading (skills) | `SKILL.md` `.claude/skills` | `SKILL.md` `.agents/skills` | `SKILL.md` `.kimi-code/skills`+`.agents/skills` (user and project tiers) | `SKILL.md` (agentskills) | `SKILL.md` `.opencode`+`.claude`+`.agents` | `SKILL.md` `~/.config/crush`+`.agents`+`.claude` (`.crush/skills` is project-only) | `SKILL.md` `.agents`+`.warp`+`.claude` | read-and-follow `.md` |
|
|
56
|
-
| structured-choice | `AskUserQuestion` (**main-agent only
|
|
56
|
+
| structured-choice | `AskUserQuestion` (**main-agent only**; 1–4 questions, 2–4 options; label + description) | `request_user_input` when exposed (~; 1–3 questions, 2–3 options; label + description) | `AskUserQuestion` (1–4 questions, 2–4 options; label + description; failure → text) | `ask_user` (Gemini: 1–4 questions, 2–4 choice options; label + description) · `AskQuestion` (Antigravity: option text + write-in; public limits undocumented) | `question` (label + description; custom answer; public limits undocumented) | `question` (≤5 questions, ≤5 choices; descriptions + fill-in) | no documented structured-choice surface → labeled markdown | labeled markdown (label + sentence) |
|
|
57
57
|
| compaction | `/compact` | Pre/PostCompact hooks | `/compact` + Pre/PostCompact hooks | ~ | `session.compacted` | ~ | ~ | CHECKPOINT + resume |
|
|
58
58
|
| subagent-dispatch | `Task` (parallel) | `SubagentStart` / agents | sub-agents (`SubagentStart`/`SubagentStop`) | agents (`.gemini/agents`) | `.opencode/agent/*.md` | ~ | ~ (cloud agents) | inline |
|
|
59
59
|
| persistent-context | `CLAUDE.md` (does **not** read AGENTS.md → symlink) | `AGENTS.md` | `AGENTS.md` (hierarchical) | `GEMINI.md` + `AGENTS.md` | `AGENTS.md` | `CRUSH.md` + `AGENTS.md` | `AGENTS.md` (auto) | `AGENTS.md` |
|
|
@@ -65,9 +65,13 @@ Concrete mechanism per harness (**Jul-2026**, verified against official docs; `~
|
|
|
65
65
|
|
|
66
66
|
> **Kimi Code caveats** (verified 2026-07-29 vs the shipped v0.29.2 binary + live probes): it exports **no env markers** to its subprocesses, so `aw harness` legitimately answers `unknown` inside it and detection goes through binary + config dir. Its hooks live **only** in the user-global `config.toml` — there is no project-level config — and their schema is `event`/`matcher`/`command`/`timeout`, so the bundled JSON template is *transformed*, not copied: `type: "prompt"` hooks cannot be expressed and are reported as skipped, and matchers are carried only for the tool-name events.
|
|
67
67
|
|
|
68
|
-
> **Notes (field research
|
|
68
|
+
> **Notes (field research Aug-2026):** **`SKILL.md` skills** are the **universal** portable unit — **every harness in the matrix** supports them (Codex added them Dec-2025; **`.agents/skills` is the cross-host anchor**, read by Codex/OpenCode/Crush/Warp/Oz/**Kimi Code** — every host except Claude Code, which reads only `.claude/skills`). The **enforcement layer** is **not Claude-exclusive**: Codex + Gemini use a near-identical protocol (`permissionDecision:deny` / exit 2) and OpenCode blocks via `throw` in a JS plugin; Crush/Warp only offer **coarse** allow/deny (no custom per-command logic) → there, conventions stay **advisory** + allow/deny lists. Enforced **plan mode** is never trusted for safety; git-safe (invariant #5) is our own — though a host-planner's *output* (the plan it built) is adoptable input (`../commands/plan-new.md` § *Input resolution*, mode 4). **MCP** is universal (each host its file/key). The **guaranteed floor** (last column) runs the full model.
|
|
69
69
|
|
|
70
|
-
> **
|
|
70
|
+
> **structured-choice routing.** A native binding qualifies only when the current client exposes it and can display the option's functional sentence without loss. When it has separate fields, map the semantic label and sentence to them; when it exposes one visible option string, render `Label — functional sentence`. Otherwise use labeled markdown. Respect the per-call ceilings in the row and reserve one question slot for `flow`; carry overflow into a later call. If the native tool already injects a custom/free-text option, do not add a duplicate `Other` option.
|
|
71
|
+
|
|
72
|
+
> **structured-choice evidence (checked 2026-08-02):** [Claude Code](https://code.claude.com/docs/en/agent-sdk/user-input) · [Codex App Server](https://learn.chatgpt.com/docs/app-server.md) · [Kimi Code](https://moonshotai.github.io/kimi-code/en/reference/tools.html) · [Gemini CLI](https://geminicli.com/docs/tools/ask-user/) · [Antigravity changelog](https://github.com/google-antigravity/antigravity-cli/blob/main/CHANGELOG.md) · [OpenCode](https://dev.opencode.ai/docs/tools/) · [Crush source](https://github.com/charmbracelet/crush) · [Warp agents](https://docs.warp.dev/agent-platform/getting-started/agents-in-warp) / [Oz CLI](https://docs.warp.dev/reference/cli). Public docs do not expose Antigravity's full question schema or a dedicated Warp/Oz structured-choice schema; the row says so instead of inferring one.
|
|
73
|
+
|
|
74
|
+
> **Oz (Warp's cloud sibling).** `oz agent run` is a cloud agent orchestrator that **reuses Warp's surfaces**: same skills (`.agents/skills`, top-level dirs like Warp) and `AGENTS.md`. No dedicated structured-choice schema is documented for Oz itself, so a direct Oz run uses labeled markdown; if Oz delegates to another harness and exposes that harness's native question surface, follow that harness's own binding. Oz differs from Warp in three points: **detection** via `OZ_RUN_ID` (takes priority over Warp when both markers coexist); **MCP without a config file** — the JSON is passed via the `--mcp` flag of `oz agent run` (or the `OZ_MCP_CONFIG` env), it never writes `.warp/.mcp.json`; and **no plugin or hooks** (advisory enforcement, like Warp). Hence it shares the **Warp / Oz** column with those caveats.
|
|
71
75
|
|
|
72
76
|
> **compaction (signal & self-regulation).** The chassis' *Self-regulation (proactive compaction)* doctrine (`../modules/COMPACTION.md`, loaded under the `compaction` signal) needs two per-host facts: the **context-pressure signal** (does the host surface one the agent can read?) and **`auto`-mode viability** (can compaction fire **without user interaction**?). Claude Code: the signal is the harness' own context warnings; `/compact` is user-invoked — the agent cannot run it itself, so `auto` **degrades to `confirm`** there (the native auto-compact is already cushioned by the PreCompact/PostCompact hooks: checkpoint-write + resume-summary). Hosts with compaction hooks/events (Codex Pre/PostCompact, OpenCode `session.compacted`) cushion resume the same way; hosts with neither signal nor mechanism run the universal fallback (CHECKPOINT + restart + resume) and `auto` likewise degrades. Mode semantics (`[compaction]` config, default, consent): the chassis' subsection — single source.
|
|
73
77
|
|
|
@@ -85,8 +89,8 @@ Concrete mechanism per harness (**Jul-2026**, verified against official docs; `~
|
|
|
85
89
|
## Convention for the rest of the corpus
|
|
86
90
|
|
|
87
91
|
- Loops/commands reference the **capability** by name (e.g. "*structured-choice* (see `harness/HARNESS.md`)"), **never** the concrete tool.
|
|
88
|
-
-
|
|
89
|
-
- The `flow` lifecycle control (`Compactar`/`Cerrar`) belongs to the `structured-choice` capability, not to a tool:
|
|
92
|
+
- Concrete tool names survive **only** as per-host bindings in this document, never as doctrine vocabulary.
|
|
93
|
+
- The `flow` lifecycle control (`Compactar`/`Cerrar`) belongs to the `structured-choice` capability, not to a tool: a required native field adds neutral `Continuar`; the text fallback leaves flow optional.
|
|
90
94
|
|
|
91
95
|
## Distribution (install-time)
|
|
92
96
|
|
|
@@ -94,7 +98,7 @@ Proven pattern (Spec Kit, 30+ agents): **one canonical source** + generate/symli
|
|
|
94
98
|
|
|
95
99
|
## Command packaging (harness-specific)
|
|
96
100
|
|
|
97
|
-
Each command's **contract** (Flow, Trigger, Input, Mode, …) is agnostic. The **file** the harness executes wraps that contract in its native format — the installer (`aw self install-skill`) emits the right wrapper per host:
|
|
101
|
+
Each command's **contract** (Flow, Trigger, Input, Mode, …) is agnostic. The **file** the harness executes wraps that contract in its native format — the installer (`aw self install-skill`) emits the right wrapper per host, retargets bundle-relative links to that host's installed `skills/w` directory and materializes the authored `${CLAUDE_PLUGIN_ROOT}/skills/w` token to the same absolute bundle for `aw context-plan --root`. Claude's plugin surface expands that token natively; installed wrappers never rely on the CLI's potentially different packaged copy:
|
|
98
102
|
|
|
99
103
|
| Host | Wrapper installed | Invoked as |
|
|
100
104
|
|---|---|---|
|
|
@@ -110,8 +114,8 @@ Each command's **contract** (Flow, Trigger, Input, Mode, …) is agnostic. The *
|
|
|
110
114
|
|
|
111
115
|
## Status
|
|
112
116
|
|
|
113
|
-
Capability model + binding matrix **defined** and **validated** with field research (**Jul-2026
|
|
117
|
+
Capability model + binding matrix **defined** and **validated** with field research (base **Jul-2026**; `structured-choice` refreshed **Aug-2026** against the linked official docs/source and current local probes).
|
|
114
118
|
|
|
115
|
-
The catalog counts **8 hosts** — `claude-code`, `codex`, `oz`, `warp`, `gemini`, `opencode`, `crush`, `kimi` — each with its own entry in `domain/harnesses.ts`. The columns above group two pairs that share a config surface (Warp/Oz, Gemini/Antigravity), which is a presentation choice, not a second taxonomy: the host set is whatever `HARNESSES` says.
|
|
119
|
+
The catalog counts **8 hosts** — `claude-code`, `codex`, `oz`, `warp`, `gemini`, `opencode`, `crush`, `kimi` — each with its own entry in `domain/harnesses.ts`. The columns above group two pairs that share a config surface (Warp/Oz, Gemini/Antigravity), which is a presentation choice, not a second taxonomy: the host set is whatever `HARNESSES` says. Anti-drift guards cover the CODE projections (TUI, install targets, doctor, detection); `chassis-consistency.test.ts` additionally parses the `structured-choice` row and asserts every host binding or explicit limitation. Support levels: **official** — Claude Code, Codex, Warp, Gemini/Antigravity, Kimi Code; **best-effort** — Oz, OpenCode, Crush. `agents` (`~/.agents/skills`) is a **shared destination**, never a host.
|
|
116
120
|
|
|
117
121
|
All support `SKILL.md` (anchor `.agents/skills`) + MCP + `AGENTS.md`; deterministic enforcement on Claude/Codex/Kimi/Gemini/OpenCode, advisory + coarse allow/deny on Crush/Warp/Oz. The CLI (`aw`) implements the registry (`domain/harnesses.ts`), the per-host MCP writers, `detect-hosts` and `install-skill --target <host>`. The universal floor (`AGENTS.md` + text + files + skills) runs the full model today.
|
|
@@ -72,7 +72,7 @@ The common cycle — each heir instantiates it in its `## Sequence` with its own
|
|
|
72
72
|
1. `detect_gaps(work)`, minus the *exhausted* gaps (see *Research*).
|
|
73
73
|
2. If `∅` → **convergence gate** (see *Convergence / exit*).
|
|
74
74
|
3. If there are gaps: take a batch (≤3) and **seed** `CHECKPOINT.Pending/Next` (*artifact-first*).
|
|
75
|
-
4. Resolve each gap with its **resolver** per the *ask-vs-research rule*: human (structured-choice) · inline research · a probe (PoC) · a composed capability (e.g. `
|
|
75
|
+
4. Resolve each gap with its **resolver** per the *ask-vs-research rule*: human (structured-choice) · inline research · a probe (PoC) · a composed capability (e.g. `design`).
|
|
76
76
|
5. **Integrate**, update `CHECKPOINT` → repeat.
|
|
77
77
|
|
|
78
78
|
## Internal sessions (managed) — one session per run
|
|
@@ -105,14 +105,15 @@ Investigation is **inline**: an activity **inside the run's current session**, n
|
|
|
105
105
|
|
|
106
106
|
## Structured-choice (design & batching)
|
|
107
107
|
|
|
108
|
-
**Canonical rule
|
|
108
|
+
**Canonical rule:** *structured-choice* = **≤3 content questions + 1 `flow` control**, always. Each option is a **short semantic label + one functional sentence** (outcome/trade-off or simple example), never a positional code. Use the richest current binding in [`HARNESS.md`](../harness/HARNESS.md); otherwise use labeled markdown.
|
|
109
109
|
|
|
110
|
-
-
|
|
111
|
-
- **Content
|
|
112
|
-
- **
|
|
113
|
-
- **
|
|
110
|
+
- **Flow:** `Compactar` | `Cerrar`; an unanswered control means continue (`Continuar` when the UI requires it). Under context pressure the loop **raises the choice itself**, recommending `Compactar`.
|
|
111
|
+
- **Content/batching:** human gaps, pre-query MCP choice and the convergence action | `Preguntar algo más`; at most 3 per call. Honor a smaller native ceiling by reserving one question slot for `flow`; carry overflow, prioritizing blockers.
|
|
112
|
+
- **Options/encoding:** prefer 2–3 alternatives. Map label/sentence to separate fields or `Label — functional sentence`. If it cannot fit, use labeled markdown; never truncate or merge candidates or duplicate a host-provided free-text option.
|
|
113
|
+
- **Recommendation:** the first option is marked *recommended* and comes from research; the human ratifies or corrects it, never starts cold.
|
|
114
|
+
- **Text fallback:** answer by label; `Aceptar recomendaciones` accepts all first options. Never require composite coordinates such as `1A, 2A, 3A`.
|
|
114
115
|
|
|
115
|
-
>
|
|
116
|
+
> Canonical labels (`Continuar`, `Compactar`, `Cerrar`, `Aceptar recomendaciones`, `Guardar plan`, …) stay verbatim; other user-facing text follows [`SKILL.md`](../SKILL.md) § *Language policy*.
|
|
116
117
|
|
|
117
118
|
## Compact / resume
|
|
118
119
|
|
|
@@ -133,7 +134,7 @@ Resume **keys off the `CHECKPOINT`** of the run's session, not the existence of
|
|
|
133
134
|
|
|
134
135
|
## docs/ boundary — no auto-export (hard rule)
|
|
135
136
|
|
|
136
|
-
A loop writes into `docs/` **only** its own flow's doc (spec-refine: `docs/specs` · the three plan flows: `docs/plans` · quick: **none** — it never touches `docs/`). No loop **graduates/promotes artifacts** into `docs/`: migrations → `docs/scripts`, manuals → `docs/manuals`, diagrams → `docs/diagrams` are done by the separate **`export-*`** skills, as an explicit later step; artifacts stay in their sessions until then. A task that creates a tool/utility has it documented in `docs/tools` by the ambient `creating-tools` skill (auto-discovered; Workline does not bind it).
|
|
137
|
+
A loop writes into `docs/` **only** its own flow's doc (spec-refine: `docs/specs` · the three plan flows: `docs/plans` · quick: **none** — it never touches `docs/`) plus, when it composes a capability whose own deliverable is a `docs/` category, that category — today only the **UI Design Package** under `docs/designs` (`design`). **Published, never graduated**: the test is the origin, not the folder. No loop **graduates/promotes artifacts** into `docs/`: migrations → `docs/scripts`, manuals → `docs/manuals`, diagrams → `docs/diagrams` are done by the separate **`export-*`** skills, as an explicit later step; artifacts stay in their sessions until then. A task that creates a tool/utility has it documented in `docs/tools` by the ambient `creating-tools` skill (auto-discovered; Workline does not bind it).
|
|
137
138
|
|
|
138
139
|
## Conditional modules
|
|
139
140
|
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
# CODE-POLICIES — policies for code-editing loops
|
|
2
2
|
|
|
3
|
-
They apply to **`plan-exec-loop`** (per
|
|
3
|
+
They apply to **`plan-exec-loop`** (per effective batch) and **`quick-loop`** (the single task;
|
|
4
|
+
**proportional** gate): each reads this doc with the chassis. Document loops do not edit code and
|
|
5
|
+
do not load it. These policies own the DB scripts-only, safe Git and closing-review invariants;
|
|
6
|
+
code loops keep only a short inline floor for advisory hosts.
|
|
4
7
|
|
|
5
8
|
## Safe git — verified branch + proposed commits
|
|
6
9
|
|
|
7
|
-
- **Before editing**
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
|
|
10
|
+
- **Before editing** an execution unit's sources, verify every current branch (`aw check-branch
|
|
11
|
+
--source <alias>`). On mismatch, pause; never destructively clean or switch without confirmation.
|
|
12
|
+
- **Proposed commits:** only after the closing review gate. In plan-exec create exactly one commit
|
|
13
|
+
per affected source at effective-batch close; in quick, one at task close. Never
|
|
14
|
+
`push`/`--amend`/`--no-verify`.
|
|
15
|
+
- **Authorization:** default to one consolidated approval for a green batch's source commits. An
|
|
16
|
+
explicit user pre-authorization conditional on all checks passing is recorded before editing and
|
|
17
|
+
removes that final question. A failed or unrun check never authorizes a commit.
|
|
18
|
+
- **Rejected commit:** changes stay. Record the execution unit as uncommitted in `CHECKPOINT` and
|
|
19
|
+
`BACKLOG`.
|
|
20
|
+
- **Between-unit precondition:** each working tree is clean or explicitly acknowledged. A
|
|
21
|
+
`continuous` batch is the narrow exception that intentionally co-mingles its internal phases in
|
|
22
|
+
one reviewed commit; no batch may co-mingle with another.
|
|
11
23
|
|
|
12
24
|
## Closing review gate (conventions, pre-commit)
|
|
13
25
|
|
|
14
|
-
After validation
|
|
26
|
+
After validation and before commits, the whole execution-unit diff passes a **closing review
|
|
27
|
+
gate**: an effective batch in plan-exec, or the proportional task in quick. Early `Cerrar` uses the
|
|
28
|
+
same gate before any pending commit.
|
|
15
29
|
|
|
16
30
|
- **Independent re-read** of the diff (subagent or clean re-read — the engine's *independent verification*: it does not assume the implementation is correct; *only command output counts*).
|
|
17
31
|
- **Apply the installed ambient conventions** relevant to the touched stack (code/stack standards, security, diff review, the workspace's own families) — the host **auto-discovers them by `description`**. Workline **names and binds no** concrete conventions skill: **it creates the moment; the installed skills fill it** (that is why review is **not a role** — see [`../roles/README.md`](../roles/README.md)). With no convention skills installed → minimal generic checklist: SOLID/early-return, clear names, DRY, no silenced errors, no secrets/PII, parametrized SQL, no dead code, + the plan's `Validations` (if any).
|
|
@@ -20,7 +34,8 @@ After validation (of the phase in plan-exec; of the task in quick, proportional)
|
|
|
20
34
|
- **Temporary simulation check** (only when the change carries one): stubs, fakes and in-memory adapters are **explicit and named as such** (`Stub…` / `Fake…`), they sit at the boundary the plan declares, and no configuration can select them in a production runtime. A simulation still active on the main path with no declared removal is a finding, not a detail.
|
|
21
35
|
- **Tooling check** (`docs/tools`): did the run create **reusable auxiliary tooling** (support scripts/CLIs/generators/reusable configs — not product code, not session probes)? → the host applies the **ambient `creating-tools` skill** (auto-discovered by its `description`; Workline does not bind it) so the tool gets its home under `docs/tools/<slug>/` (README + run/output structure per that skill's contract + its index row). Host without such a skill → the loop still **never writes `docs/tools` itself**: **declare the gap** — the homeless tool goes to the plan's `Open questions` + `BACKLOG` (in quick, `BACKLOG`) — never silent.
|
|
22
36
|
- **Findings**: **fix** them in the working tree and **re-run validation** (the gate does not replace the tests: it re-verifies after fixing), or **defer them justified** (→ the plan's `Open questions` + `BACKLOG`; in quick, `BACKLOG`); the non-obvious → `DECISION`. Gate integrity (see [`CHASSIS.md`](CHASSIS.md) § *Verification-first*): never weaken a check or lower a convention to pass.
|
|
23
|
-
- **Artifact-first + verification-first**: `CHECKPOINT.Next = "review <
|
|
37
|
+
- **Artifact-first + verification-first**: seed `CHECKPOINT.Next = "review <batch/task>"`; Success
|
|
38
|
+
criteria require the whole diff to pass before commits.
|
|
24
39
|
|
|
25
40
|
Only with the gate green are the commits proposed.
|
|
26
41
|
|
package/skills/w/loops/README.md
CHANGED
|
@@ -47,7 +47,7 @@ The **5 loops** are heirs: they use `## Inherits` (a one-line reference to [`CHA
|
|
|
47
47
|
|
|
48
48
|
## Chassis / heirs
|
|
49
49
|
|
|
50
|
-
The **engine lives in [`CHASSIS.md`](CHASSIS.md)** (a referenced doc, not a skill); the 5 loops — including `spec-refine-loop` — are **heirs** of that engine. The canonical heirs list and their deltas live in the chassis itself (§ *Heirs*). The chassis is **not a bindable capability**: it is the loop engine; what is pluggable are the **capabilities** a loop composes (e.g. `
|
|
50
|
+
The **engine lives in [`CHASSIS.md`](CHASSIS.md)** (a referenced doc, not a skill); the 5 loops — including `spec-refine-loop` — are **heirs** of that engine. The canonical heirs list and their deltas live in the chassis itself (§ *Heirs*). The chassis is **not a bindable capability**: it is the loop engine; what is pluggable are the **capabilities** a loop composes (e.g. `design`, `sql`, `git`), resolved via `.workflow/skills.toml`.
|
|
51
51
|
|
|
52
52
|
## Composed capabilities (roles)
|
|
53
53
|
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
name: plan-exec-loop
|
|
3
3
|
description: >-
|
|
4
4
|
Executes an implementation plan (docs/plans/PPP-plan-<slug>.md) as a living
|
|
5
|
-
doc:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
session, safe git, DB scripts-only, phase proof plus progressive tests,
|
|
10
|
-
pre-commit closing review gate, no auto-export. Composes git and sql.
|
|
5
|
+
doc: re-infers isolated or continuous phase batches, edits real code, then
|
|
6
|
+
validates/reviews/commits each effective batch. Heir of CHASSIS.md and
|
|
7
|
+
CODE-POLICIES.md. Keeps the executability and deviation gates, one resumable
|
|
8
|
+
session, safe git, DB scripts-only and no auto-export. Composes git and sql.
|
|
11
9
|
Started by /w:plan-exec. Invoke to implement an already generated plan.
|
|
12
10
|
---
|
|
13
11
|
|
|
@@ -25,7 +23,7 @@ PLAN
|
|
|
25
23
|
`/w:plan-exec` — **resumable** (same chassis mechanism; here resume keys off the plan-doc phase states + checkboxes + CHECKPOINT, see Delta 1).
|
|
26
24
|
|
|
27
25
|
## Reads
|
|
28
|
-
`docs/plans/PPP-plan-<slug>.md` (locate via the `docs/plans/PPP-plan-*.md` glob or the exact path from the command argument) **and its source spec** (resolved through the plan's `## Origin`) — the entry gate reads both. It runs **any** plan, whether or not it passed through [`plan-refine-loop`](../plan-refine-loop/LOOP.md) — plan-refine is auxiliary, not mandatory; no gate requires it. What it does require is an **executable shape** (§ *Entry gate — executability*). If the plan
|
|
26
|
+
`docs/plans/PPP-plan-<slug>.md` (locate via the `docs/plans/PPP-plan-*.md` glob or the exact path from the command argument) **and its source spec** (resolved through the plan's `## Origin`) — the entry gate reads both. It runs **any** plan, whether or not it passed through [`plan-refine-loop`](../plan-refine-loop/LOOP.md) — plan-refine is auxiliary, not mandatory; no gate requires it. What it does require is an **executable shape** (§ *Entry gate — executability*). If the plan pins design, it also reads the **UI Design Package** revisions its `## Design references` and its tasks name — **read-only**, at the exact revision each one fixed (§ *Design precondition gate*).
|
|
29
27
|
|
|
30
28
|
## Writes
|
|
31
29
|
- `docs/plans/PPP-plan-<slug>.md` (**read/update**, living doc: phase/task state, `Open questions`).
|
|
@@ -40,6 +38,10 @@ Full rule in the chassis (§ *docs/ boundary — no auto-export*). Here: the onl
|
|
|
40
38
|
|
|
41
39
|
Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **and** **[`../CODE-POLICIES.md`](../CODE-POLICIES.md)** — the *code-editing loop policies* — **always before** these deltas. *(If `../` does not resolve: same names next to this file — global layout rule, chassis § Reference resolution.)*
|
|
42
40
|
|
|
41
|
+
Read the shared execution-unit contract in
|
|
42
|
+
[`PLAN-EXECUTION-BATCHES`](../../modules/PLAN-EXECUTION-BATCHES.md); it owns batch syntax,
|
|
43
|
+
inference, the deferred-validation cycle and conditional Git authorization.
|
|
44
|
+
|
|
43
45
|
## Composes
|
|
44
46
|
|
|
45
47
|
`git` (safe branch + proposed commits) · `sql` (DB rule). Both resolved via `.workflow/skills.toml`; `off` → the loop continues without the capability and, if it was needed, says so or asks.
|
|
@@ -72,20 +74,64 @@ Execution **no longer accepts in silence** a plan that would force it to invent
|
|
|
72
74
|
|
|
73
75
|
> The gate reads the **canonical phase contract** from [`plan-new-loop`](../plan-new-loop/LOOP.md) § *Phase contract (canonical)* — required sections, the `> Estado:` vocabulary, semantic granularity. Execution references it; it never redefines it. The marker is a **line of its own** inside the `### Fn` block (`> Estado: <value>`); written any other way it reads as `pendiente`.
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
After this gate and before editing, infer the effective batches over pending phases. The live
|
|
78
|
+
checkout may merge or split the plan's declaration without consent; record the result and drift in
|
|
79
|
+
`CHECKPOINT`. A missing `## Execution batches` is legacy compatibility, not an entry gap.
|
|
80
|
+
|
|
81
|
+
## Design precondition gate (fail-closed, per task)
|
|
82
|
+
|
|
83
|
+
Applies **only** to a task that pins design (`DES-001@r4 / SCR-002@r2#empty`). Run
|
|
84
|
+
`aw designs --plan <plan-doc>` before implementing the batch; it answers per task
|
|
85
|
+
and the verdict is the command's, not the implementer's.
|
|
86
|
+
|
|
87
|
+
**Four causes block, and each names the artifact and the corrective action:** the
|
|
88
|
+
reference does not resolve · its digest no longer matches the bytes · the revision
|
|
89
|
+
is **revoked** · the applicable **closure** does not reach `handoff`. A blocked
|
|
90
|
+
task is not implemented, its phase stays `en ejecución` or `bloqueada`, and the
|
|
91
|
+
correction goes to `/w:plan-refine` — or to `/w:spec-refine` when it changes
|
|
92
|
+
behavior or acceptance.
|
|
93
|
+
|
|
94
|
+
**One cause only warns:** a revision **superseded** by a newer one but intact
|
|
95
|
+
stays executable. Publishing `@r5` never invalidates the `@r4` a task pinned on
|
|
96
|
+
purpose; only an explicit, audited revocation does. A **stale path hint** warns
|
|
97
|
+
the same way — identity resolved, the recorded path moved.
|
|
98
|
+
|
|
99
|
+
> **`plan-exec` never redesigns.** Completing an `outline` artifact, inventing a
|
|
100
|
+
> missing state or promoting a revision to `handoff` are design decisions and
|
|
101
|
+
> belong to the refine that owns them. Full contract in
|
|
102
|
+
> [`DESIGN-REFERENCES.md`](../../modules/DESIGN-REFERENCES.md) (signal `ui`).
|
|
103
|
+
|
|
104
|
+
**Publishing a document together with a package revision is one transition.** A
|
|
105
|
+
spec or plan whose reference moves is written in the **same** all-or-nothing batch
|
|
106
|
+
as the revision it points at, so no reader ever sees a document citing a baseline
|
|
107
|
+
that is not there, or a revision no document reached. An effect the batch cannot
|
|
108
|
+
cover — anything outside the workspace files — is recorded as **pending
|
|
109
|
+
reconciliation** in `CHECKPOINT`, never reported as published.
|
|
110
|
+
|
|
111
|
+
## Delta 1 — One session per run; execution-unit cycle in the plan-doc
|
|
112
|
+
|
|
113
|
+
- Walk the plan's `### Fn` blocks under `## Tasks` in dependency order inside one session. Infer
|
|
114
|
+
effective `continuous`/`isolated` batches first; legacy `## Phases` tables degrade the same way.
|
|
115
|
+
- **Execution-unit cycle:** seed one batch intent; implement all its phases in order; validate and
|
|
116
|
+
review at unit close; then update states/`CHECKPOINT` and enter Git. An isolated unit contains
|
|
117
|
+
one phase. A continuous unit follows `PLAN-EXECUTION-BATCHES`: no proof, runner, build, lint,
|
|
118
|
+
review or commit between its phases.
|
|
79
119
|
- Executes the phase's tasks; **skips** the ones already `- [x]` in the plan (the plan-doc is the per-task source of truth). **Micro steps stay internal** (canonical contract): they reach `CHECKPOINT` only when a resume needs them, never the plan.
|
|
80
|
-
- **Marking order (hard rule):** a task
|
|
120
|
+
- **Marking order (hard rule):** mark a task when its local work finishes and each reached phase
|
|
121
|
+
`en ejecución`. After the whole unit is green, flip all its phases to `validada`. Each still
|
|
122
|
+
requires its proof, focused checks, exit condition and the combined review;
|
|
123
|
+
a blocker is never deferred into `validada`. **Never** because all its checkboxes are ticked.
|
|
81
124
|
- **Intermediate states:** `bloqueada` = the phase is stopped on a live blocker — recorded in `CHECKPOINT` + the plan's `## Open questions`, back to `en ejecución` when it clears; it counts as **not validated**. A phase whose work is complete but whose operative check the AI **cannot run** (an unapplied migration — Delta 3) **stays `bloqueada`**: its finished tasks keep their boxes ticked, and the reason goes on its own `> Bloqueo:` line, dropped when the blocker clears. It counts as **not validated** until the check runs and passes. Never a silent `validada`.
|
|
82
125
|
- **A blocker without a reason is not a blocker (hard rule).** Writing `> Estado: bloqueada` **always** writes its `> Bloqueo:` line in the same edit: a state that says "stopped" without saying on what is a dead end for whoever reads `aw status` next. The runtime tolerates a legacy block that states none (`blocker: null`) — this loop never produces one. `CHECKPOINT.Next` names **the action that unblocks it** ("apply migration 014, then re-run the persistence proof"), never the state it is in.
|
|
83
126
|
- **Plan-doc residue (hard rule):** execution writes into the plan-doc **only** five things — checkbox flips (`- [ ]` → `- [x]`), the phase's own `> Estado:` line, its `> Bloqueo:` line while blocked, deferrals appended to its `## Open questions`, and the plan's own status mark (its `> Estado:` line and, on close, its `> Cierre:` line — Delta 6). The declared-gap hatch is Deltas 4, 5 and 7. Per-phase results, review-gate findings and metrics go to the session's `DECISION`/`CHECKPOINT` — **never** into the plan-doc. Phase blocks are updated **in place — NEVER append a duplicate `### Fn` block** (same contract as CHECKPOINT sections). The entry gate's consented normalization is the single exception, and it lands before execution starts.
|
|
84
|
-
- **CHECKPOINT per
|
|
127
|
+
- **CHECKPOINT per execution unit:** record its effective grouping, functional states, simulation
|
|
128
|
+
boundary when applicable, checks/results, decisions, deferrals and next intent. The task boxes
|
|
129
|
+
and `en ejecución` marks preserve an intra-batch resume.
|
|
85
130
|
- Records in `DECISION` only the **non-obvious**, **as it is decided** (per-phase decisions accumulate in the SINGLE `DECISION`, tagged by phase/task — e.g. `Origin: T2 (F1)`). A structural deviation is **not** settled with an entry there (§ *Deviation gate*).
|
|
86
131
|
- The chassis **gap-driven** engine applies here **inside a task**: facing a non-obvious decision/doubt → inline research, a probe (Delta 7) OR structured-choice.
|
|
87
132
|
|
|
88
|
-
> **Legacy plans degrade safely
|
|
133
|
+
> **Legacy plans degrade safely:** a missing line reads `pendiente`; missing execution batches are
|
|
134
|
+
> inferred into `CHECKPOINT`; neither is back-filled. Checked boxes alone prove nothing.
|
|
89
135
|
|
|
90
136
|
## Deviation gate
|
|
91
137
|
|
|
@@ -108,7 +154,10 @@ On either return path: `CHECKPOINT` records the state reached and the trigger, t
|
|
|
108
154
|
|
|
109
155
|
## Delta 2 — Git policy: **safe branch + proposed commits**
|
|
110
156
|
|
|
111
|
-
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md)
|
|
157
|
+
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md). Inline: branch-check every source
|
|
158
|
+
before the unit; after its green review, produce exactly one proposed commit per affected source.
|
|
159
|
+
Use one consolidated approval, or the explicit conditional pre-authorization already recorded in
|
|
160
|
+
`CHECKPOINT`. Never `push`/`--amend`/`--no-verify`.
|
|
112
161
|
|
|
113
162
|
## Delta 4 — Validation: phase proof + progressive tests
|
|
114
163
|
|
|
@@ -117,7 +166,12 @@ Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Safe git*: bran
|
|
|
117
166
|
2. **focused tests** — added when the layer carries its own rules, a relevant transformation, error handling, persistence, transactions, temporal logic or external integration;
|
|
118
167
|
3. **risk tests** — security, concurrency, idempotency, retries, known regressions.
|
|
119
168
|
- **One vertical proof per operation while wiring** (request → controller → use case → repository → fake or stub → expected response): it demonstrates the path once instead of re-asserting the same happy path at every layer. Trivial mappers, plain DTOs and framework behavior get no dedicated test.
|
|
120
|
-
-
|
|
169
|
+
- `isolated` remains compatible with literal TDD. A continuous batch may author evidence before
|
|
170
|
+
code, but first runs it at batch close. No phase becomes `validada` before its exit is demonstrated.
|
|
171
|
+
- **Continuous means all checks at batch close.** Do not run its phase proofs, focused/risk tests,
|
|
172
|
+
build, typecheck, lint or review while implementing internal phases. At close run proofs in phase
|
|
173
|
+
order, then the justified checks and cross-cutting validations. `isolated` runs the same stack for
|
|
174
|
+
its single phase.
|
|
121
175
|
- Each added test is re-weighed at the closing review gate ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate* → *Test-value lens*, tag `overtest`): over-testing is a **finding to fix or justify**, never an automatic rejection.
|
|
122
176
|
- Also run the plan's `## Validations` (cross-cutting rules and constraints) + the Final behavior block of `## Solution` (legacy plans: the `## Final behavior` section) + the spec's acceptance/success criteria (its `## Scenarios`, if present, are ready-made test cases: GIVEN=arrange · WHEN=act · THEN=assert).
|
|
123
177
|
- A validation that **runs and fails** → back into the phase (gap): no advancing, no `validada`.
|
|
@@ -127,13 +181,21 @@ Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Safe git*: bran
|
|
|
127
181
|
|
|
128
182
|
## Delta 5 — Closing review gate (conventions, pre-commit)
|
|
129
183
|
|
|
130
|
-
Full gate in [`../CODE-POLICIES.md`](../CODE-POLICIES.md)
|
|
184
|
+
Full gate in [`../CODE-POLICIES.md`](../CODE-POLICIES.md): independent re-read, ambient
|
|
185
|
+
conventions and the floor lenses. It covers the execution unit's **whole** diff after every phase
|
|
186
|
+
proof/check and before states or Git advance. Findings are fixed and the affected checks rerun, or
|
|
187
|
+
deferred with justification when they are not blockers.
|
|
131
188
|
|
|
132
189
|
## Delta 6 — Completion / close
|
|
133
190
|
|
|
134
|
-
- A phase closes when its `> Estado:` reads `validada`: work done,
|
|
191
|
+
- A phase closes when its `> Estado:` reads `validada`: work done, exit condition true and proof
|
|
192
|
+
passed. In a continuous batch every phase waits for the batch review; an operative handoff leaves
|
|
193
|
+
the affected phase `bloqueada` and the unit uncommitted.
|
|
135
194
|
- **The plan's own state is the third axis, and it stays `open` during the whole run.** Every phase `validada` is **not** the plan closed: the final validation still has to run. Keep `> Estado: open` under the title while executing — stamping it on the first write if the plan carries none — and never write `done` from the counters — a legacy plan with every box ticked is not closed by that fact (§ *Legacy plans degrade safely*).
|
|
136
|
-
- **Every phase `validada` +
|
|
195
|
+
- **Every phase `validada` + final validation passed** unlocks completion.
|
|
196
|
+
`Marcar plan done` is offered under no other condition. On the last batch, its one consolidated Git approval also authorizes
|
|
197
|
+
this mark before committing, so the status write lands in the same source commit. Explicit
|
|
198
|
+
green-commit pre-authorization applies it without another question.
|
|
137
199
|
- **Marking done = ONE status line in the plan-doc**, under the title's blockquote: `> Estado: done`, updated in place on a re-run. The machine value **stands alone** — the date and session go on their own `> Cierre: YYYY-MM-DD · sesión NNN` line right under it, for the same reason a blocker never rides on a phase's state line. It never replaces the per-phase lines inside the `### Fn` blocks — position tells the two apart. No per-phase result tables, no ✅ suffixes — that record lives in the session (`DECISION`/`CHECKPOINT`).
|
|
138
200
|
- **Legacy status line, migrated on write.** A plan carrying the old single-line form (`> Estado: done — YYYY-MM-DD · sesión NNN`) is still **read** as closed; the first time this loop legitimately writes that document, it is rewritten to the two-line form. Compatibility is for reading old plans — every new write uses the normalized contract.
|
|
139
201
|
- **No automatic export**: the artifacts (`SCRIPTS.sql`, `DECISION`, …) stay in the session. Promoting them to `docs/` (scripts, manuals, …) is a separate step via `export-*`.
|
|
@@ -147,54 +209,58 @@ plan-exec-loop(PPP-plan-<slug>.md):
|
|
|
147
209
|
entry gate (executability): result · exit condition · phase proof · simulation boundary if any · no structural contradiction
|
|
148
210
|
minor gap → structured-choice [Normalizar y ejecutar | Ir a plan-refine] → normalize in place + DECISION
|
|
149
211
|
structural gap → CHECKPOINT(blocker) → hand off to /w:plan-refine → stop
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
212
|
+
batches = infer_effective_batches(pending phases, plan + live checkout)
|
|
213
|
+
may merge/split declared rows without asking; legacy absence is allowed
|
|
214
|
+
record batches + declaration drift in CHECKPOINT
|
|
215
|
+
commit_authorization = explicit conditional pre-authorization from the user, if any
|
|
216
|
+
record it before editing; otherwise approval is deferred to each green batch close
|
|
217
|
+
for each Batch in batches:
|
|
218
|
+
verify every affected source's branch; mismatch → stop + human
|
|
219
|
+
seed CHECKPOINT.Next = Batch Bn (mode + phases + tasks)
|
|
220
|
+
for each Phase in Batch:
|
|
221
|
+
if Estado == validada: skip
|
|
222
|
+
read Resultado + Condición de salida; set > Estado: en ejecución
|
|
223
|
+
for each pending Task:
|
|
224
|
+
execute minimal work; keep DB/tool policies; apply deviation gate
|
|
225
|
+
local decision → resolve; DECISION only if non-obvious
|
|
226
|
+
structural/functional deviation → CHECKPOINT + stop → refine destination
|
|
227
|
+
probe whose verdict shapes later work → batch was ineligible; stop/re-infer
|
|
228
|
+
mark Task - [x] after its local work
|
|
229
|
+
# continuous: advance directly to the next phase; run NO validation/review/commit here
|
|
230
|
+
at Batch close, in phase order:
|
|
231
|
+
run every Validación de fase, then justified focused/risk checks
|
|
232
|
+
run applicable plan Validations; last Batch also runs final validation before Git
|
|
233
|
+
failures → fix + rerun affected checks
|
|
234
|
+
unrun operative check → phase bloqueada + > Bloqueo: + CHECKPOINT + Open questions
|
|
235
|
+
closing review gate over the WHOLE BATCH diff
|
|
236
|
+
findings → fix + rerun affected checks OR defer justified if non-blocking
|
|
237
|
+
if any proof/check/review/exit condition is not green:
|
|
238
|
+
preserve actual states + combined uncommitted diff; record unblocking action; stop
|
|
239
|
+
set every Batch phase > Estado: validada; update CHECKPOINT
|
|
240
|
+
prepare exactly one commit per affected source
|
|
241
|
+
if last Batch + final validation green:
|
|
242
|
+
pre-authorized → mark plan done, then commit once per affected source without asking
|
|
243
|
+
otherwise → structured_choice(content: [Marcar plan done, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
244
|
+
Marcar plan done → approve; mark done; commit all source changes once
|
|
245
|
+
else if pre-authorized → commit without another question
|
|
246
|
+
else → one consolidated approval for all source commits
|
|
247
|
+
rejected → changes stay; record "batch uncommitted"
|
|
248
|
+
next-batch precondition: working trees clean or acknowledged
|
|
249
|
+
if no Batch ran and phases are already validada:
|
|
250
|
+
run final validation now
|
|
251
|
+
if green:
|
|
252
|
+
use the same pre-authorized/final structured-choice completion branch
|
|
253
|
+
when authorized → mark plan done with > Estado: done + > Cierre: YYYY-MM-DD · sesión NNN under the title (Delta 6), then commit that source once
|
|
254
|
+
if plan is not done:
|
|
255
|
+
the plan-level > Estado: stays open → CHECKPOINT.Next = the action that unblocks the phase(s)
|
|
191
256
|
# NO export: artifacts stay in the session; a separate export-* promotes them
|
|
192
257
|
finalize: CHECKPOINT (+ BACKLOG if something is deferred) + close session + report
|
|
193
258
|
```
|
|
194
259
|
|
|
195
260
|
## Convergence / exit
|
|
196
261
|
|
|
197
|
-
- **Every phase `validada`** + final validation
|
|
262
|
+
- **Every phase `validada`** + final validation passed + every effective batch reviewed before its
|
|
263
|
+
commits → `Marcar plan done`. Any pending/running/blocked phase keeps the plan open.
|
|
198
264
|
- A **structural deviation** or a **functional change** exits this loop without converging (§ *Deviation gate*): `CHECKPOINT` + `finalize`, and the work continues in `plan-refine` / `spec-refine`. Same exit when the entry gate finds a structural gap.
|
|
199
265
|
- `Cerrar` (`flow` control, at any time) → `finalize` persists `CHECKPOINT` (and `BACKLOG` only if something remained unexecuted / uncommitted / unapplied), closes the session, reports.
|
|
200
266
|
- Promoting artifacts to `docs/` (via `export-*`) is **always** a later, explicit step outside this loop.
|