@tacuchi/agent-workflow-cli 20.26.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/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 +10 -8
- package/skills/w/artifacts/README.md +3 -4
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +2 -2
- package/skills/w/commands/plan-exec.md +11 -5
- package/skills/w/commands/plan-new.md +6 -2
- package/skills/w/commands/plan-refine.md +6 -3
- package/skills/w/commands/quick.md +2 -2
- package/skills/w/commands/spec-new.md +2 -2
- package/skills/w/commands/spec-refine.md +1 -0
- package/skills/w/context/MANIFEST.json +19 -8
- package/skills/w/loops/CHASSIS.md +2 -2
- 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
|
@@ -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.
|
|
@@ -5,8 +5,8 @@ description: >-
|
|
|
5
5
|
spec. Heir of the chassis (loops/CHASSIS.md). Deltas: the plan absorbs the
|
|
6
6
|
TECHNICAL-NOTE level + Tasks phased by verifiable functional state
|
|
7
7
|
(### Fn blocks with live state),
|
|
8
|
-
code/impact-mapping research, planning gap taxonomy, and
|
|
9
|
-
|
|
8
|
+
code/impact-mapping research, planning gap taxonomy, and promotion of the
|
|
9
|
+
design closure to handoff via `design`
|
|
10
10
|
when the plan includes UI. If the spec is not refined it suggests
|
|
11
11
|
spec-refine first. Started by /w:plan-new; resumable. Invoke when a spec
|
|
12
12
|
must become an executable plan.
|
|
@@ -29,7 +29,7 @@ PLAN
|
|
|
29
29
|
`docs/specs/NNN-spec-*.md` (glob — locates the spec by number; or the exact path from the command argument). **Ready vs not** is read from the spec's frontmatter `status`: `ready-for-plan` → proceed (legacy compat: a frontmatter-less spec carrying `## Refinement decisions`, or the older `## Q&A traceability`, counts as ready). Otherwise → **soft-suggest** running `/w:spec-refine` first (planning over a solid spec produces better plans), **never a block**: the user may proceed. Questions the spec left with destination `PLAN` are **input to this loop**, not a reason to send it back.
|
|
30
30
|
|
|
31
31
|
## Writes
|
|
32
|
-
`docs/plans/PPP-plan-<slug>.md` (`generate`; **overwrites with confirmation** if it exists) — or **several sibling plans** when an accepted split applies (§ *Split gate (multi-plan)*).
|
|
32
|
+
`docs/plans/PPP-plan-<slug>.md` (`generate`; **overwrites with confirmation** if it exists) — or **several sibling plans** when an accepted split applies (§ *Split gate (multi-plan)*). With UI, also the design revision it publishes under `docs/designs` (chassis § *docs/ boundary*). It never graduates/exports anything else to `docs/` — that is separate `export-*` work.
|
|
33
33
|
|
|
34
34
|
> **slug**: short kebab-case derived from the spec's Requirement — only `[a-z0-9-]`, ≤ ~5 words / ≤ 40 chars. `aw next-number docs/plans` returns JSON (field `next` = `PPP`); the loop builds the full name. To locate plans, glob `docs/plans/PPP-plan-*.md`.
|
|
35
35
|
|
|
@@ -49,80 +49,72 @@ Full doctrine in the chassis (§ *Internal sessions* + *Numbering*). This loop's
|
|
|
49
49
|
|
|
50
50
|
## Delta 1 — Deliverable: the RICH PLAN (`PPP-plan-<slug>.md`)
|
|
51
51
|
|
|
52
|
-
The plan
|
|
52
|
+
The plan keeps technical detail and roadmap inline:
|
|
53
53
|
|
|
54
54
|
```markdown
|
|
55
55
|
# Plan PPP — <slug>
|
|
56
56
|
|
|
57
57
|
> Derived from docs/specs/NNN-spec-<slug>.md · generated by plan-new-loop
|
|
58
|
-
> Estado: open
|
|
59
|
-
|
|
60
|
-
## Origin source spec
|
|
61
|
-
## Solution the how
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
##
|
|
66
|
-
##
|
|
67
|
-
##
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
The `### Fn` headers are the ONLY source of phases;
|
|
72
|
-
there is no separate Phases table.
|
|
73
|
-
## Validations validations / constraints / business logic (core)
|
|
74
|
-
## Risks / impact technical risks and impacts (opt.)
|
|
75
|
-
## Assumptions assumptions — only the delta over the spec, never re-imported (opt.)
|
|
76
|
-
## Open questions pending — core when any exist; OMIT the section when empty
|
|
58
|
+
> Estado: open
|
|
59
|
+
|
|
60
|
+
## Origin source spec/prompt or adopted source + attribution
|
|
61
|
+
## Solution the how: brief AS-IS → TO-BE + closing "Final behavior" block (core)
|
|
62
|
+
## Impacted FE · BE · DB · APIs · integrations (core)
|
|
63
|
+
## Dependencies docs · sources · DBs · sessions · inter-plan order (opt.)
|
|
64
|
+
## Design references the baselines this plan's roots pin (opt. — only with UI)
|
|
65
|
+
## Tasks `### Fn` blocks: the ONLY source of phases (core)
|
|
66
|
+
## Execution batches complete phase partition; contract in PLAN-EXECUTION-BATCHES (core)
|
|
67
|
+
## Validations cross-cutting validations and constraints (core)
|
|
68
|
+
## Risks / impact technical risks and impacts (opt.)
|
|
69
|
+
## Assumptions delta over the spec only (opt.)
|
|
70
|
+
## Open questions pending; core when any exist; OMIT the section when empty
|
|
77
71
|
```
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
Core sections always appear; optional ones only when warranted. Legacy readers tolerate the old
|
|
74
|
+
separate sections. New plans never write them. The exec session has no `TECHNICAL-NOTE` or own
|
|
75
|
+
`TASKS`: detail and progress live in this plan.
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
Batch syntax, inference and runtime semantics are defined once in
|
|
78
|
+
[`PLAN-EXECUTION-BATCHES`](../../modules/PLAN-EXECUTION-BATCHES.md).
|
|
82
79
|
|
|
83
80
|
## Phase contract (canonical)
|
|
84
81
|
|
|
85
|
-
A `### Fn` block is a **verifiable state of the system**, never a list of layers, files or classes.
|
|
86
|
-
|
|
87
|
-
**Required — every phase, always:**
|
|
82
|
+
A `### Fn` block is a **verifiable state of the system**, never a list of layers, files or classes.
|
|
83
|
+
This is the single contract; the other PLAN loops reference it.
|
|
88
84
|
|
|
89
85
|
```markdown
|
|
90
86
|
### F1 — <result-oriented name>
|
|
91
|
-
|
|
92
87
|
> Estado: pendiente
|
|
93
88
|
|
|
94
89
|
**Resultado:** <the new verifiable state of the system>
|
|
95
|
-
|
|
96
90
|
**Trabajo:**
|
|
97
91
|
- [ ] T1.1 — <coherent unit of work>
|
|
98
|
-
|
|
99
92
|
**Validación de fase:** <the primary proof that the promised state was reached>
|
|
100
|
-
|
|
101
93
|
**Condición de salida:** <falsifiable result · contract preserved>
|
|
102
94
|
```
|
|
103
95
|
|
|
104
|
-
**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
**
|
|
108
|
-
**Recorrido afectado:** <consumer → components → current boundary>
|
|
109
|
-
**Dependencias:** <phase(s) that must land first>
|
|
110
|
-
**Límite de simulación:** antes <where it is> → después <where it lands, or removed>
|
|
111
|
-
**Diferido:** <work consciously reserved for another phase>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
- **Required**: `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida`, plus the `> Estado:` line.
|
|
115
|
-
- **Conditional**: `Estado inicial` (when it is not obvious) · `Recorrido afectado` (distributed change) · `Dependencias` (the phase cannot run in direct sequence) · `Límite de simulación` (**only** when temporary behavior exists) · `Diferido` (only when work was consciously excluded).
|
|
116
|
-
|
|
117
|
-
**A new phase never writes an empty conditional block.** No temporary behavior in the change → no `Límite de simulación` line at all; nothing consciously excluded → no `Diferido`. Writing the label with `no aplica` under it is the failure mode this split exists to prevent: it invites inventing a stub to justify the heading, and turns a contract into a form to fill in. The gates check the same way — an absent conditional block is not a gap (§ *Convergence / exit*).
|
|
96
|
+
**Required**: `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida` · the state
|
|
97
|
+
line. **Conditional**: `Estado inicial` when unclear · `Recorrido afectado` for a distributed
|
|
98
|
+
change · `Dependencias` when direct sequence is insufficient · `Límite de simulación` (**only** when temporary behavior exists) · `Diferido` when work was consciously excluded.
|
|
99
|
+
**A new phase never writes an empty conditional block.**
|
|
118
100
|
|
|
119
|
-
**Phase state = machine state.** One `> Estado: <value>` line
|
|
101
|
+
**Phase state = machine state.** One bare `> Estado: <value>` line uses `pendiente` | `en ejecución`
|
|
102
|
+
| `bloqueada` | `validada`. It is updated in place and counted
|
|
103
|
+
**alongside — not instead of —** checkboxes. `validada` requires completed work, a true exit
|
|
104
|
+
condition, its validation **ran and passed**, and a green review gate. **Never** because all its checkboxes are ticked.
|
|
105
|
+
Legacy blocks have no line; a missing one reads `pendiente`, and nothing is back-filled.
|
|
120
106
|
|
|
121
|
-
**The state line carries its value alone
|
|
107
|
+
**The state line carries its value alone**; an annotated value reads as `pendiente`. A blocker
|
|
108
|
+
uses its own `> Bloqueo: <reason>` line and the session records.
|
|
122
109
|
|
|
123
|
-
**The plan carries its own state, and it is a different axis.**
|
|
110
|
+
**The plan carries its own state, and it is a different axis.** Its title-level value is `open` | `done`;
|
|
111
|
+
only final validation writes `done` plus `> Cierre: YYYY-MM-DD · sesión NNN`.
|
|
112
|
+
Position disambiguates the two marks. `done` with open work is `inconsistent`; all phases green without
|
|
113
|
+
closure is `final_validation_pending`.
|
|
124
114
|
|
|
125
|
-
**Granularity is semantic, not mechanical.** A phase
|
|
115
|
+
**Granularity is semantic, not mechanical.** A phase leaves a demonstrable state. A task is a
|
|
116
|
+
coherent purpose and may touch many files; an edit operation is a **micro step**, never a plan
|
|
117
|
+
entry. `XS–S` informs risk and scope but does not force mechanical splitting.
|
|
126
118
|
|
|
127
119
|
## Delta 2 — Gap taxonomy (of "plan")
|
|
128
120
|
|
|
@@ -140,17 +132,19 @@ Replaces the spec gap taxonomy with a planning-oriented one:
|
|
|
140
132
|
| Structural micro-tasks | the plan enumerates files, classes or methods as entries | the AI groups them by purpose |
|
|
141
133
|
| Simulation without lifecycle | temporary behavior exists with no phase that displaces it and no phase that retires it | the AI derives both / **human** |
|
|
142
134
|
| Phase without evidence | the block declares no `Validación de fase` | the AI derives it from the criteria / **human** |
|
|
135
|
+
| Invalid execution batches | phases are missing/duplicated or cross an ineligible continuous boundary | the AI re-infers the maximal partition |
|
|
143
136
|
| Over-engineered solution | approach heavier than the criteria need — needless abstraction/layer/dependency, or a phase/task not required to meet the spec (chassis § *Minimality*) | AI proposes the lighter path + **human** confirms (**probe** if "lighter works" is a runnable doubt) |
|
|
144
137
|
| Missing deps | order unclear | research / human |
|
|
145
138
|
| Spec criteria uncovered | tasks don't trace to acceptance criteria | the AI derives + human confirms |
|
|
146
139
|
| Unaddressed risks | technical risks unmitigated/undeclared | human / **probe** (Delta 5) |
|
|
147
|
-
| UI without design
|
|
140
|
+
| UI without design *(if it applies)* | the plan includes UI (FE/screens in `Impacted`, `## Design references` in the spec, or UI tasks) and pins no exact root, or its roots are not `handoff` | **`design`** (promote the closure, pin the roots) |
|
|
148
141
|
|
|
149
142
|
> **Author the Solution the laziest-that-works way** (chassis § *Minimality*, generative side): reuse what the codebase/stdlib/platform already provides before proposing new abstractions, layers or dependencies — the coherence gate then only *confirms* minimality, never repairs over-engineering after the fact.
|
|
150
143
|
|
|
151
144
|
## Delta 3 — What research investigates here
|
|
152
145
|
|
|
153
|
-
|
|
146
|
+
Inline research maps affected code, AS-IS wiring and dependencies into `Solution`/`Impacted`.
|
|
147
|
+
The chassis DB rule applies unchanged.
|
|
154
148
|
|
|
155
149
|
## Sequence
|
|
156
150
|
|
|
@@ -159,30 +153,31 @@ plan-new-loop(spec):
|
|
|
159
153
|
input = glob(docs/specs/NNN-spec-*.md) | argument path
|
|
160
154
|
if the spec is not status: ready-for-plan (nor a legacy mark):
|
|
161
155
|
soft-suggest /w:spec-refine # never blocks — the user may proceed anyway
|
|
162
|
-
session = create_or_resume("<slug>-plan-new")
|
|
163
|
-
seed SESSION.Success criteria = coherence-gate checklist
|
|
156
|
+
session = create_or_resume("<slug>-plan-new")
|
|
157
|
+
seed SESSION.Success criteria = coherence-gate checklist
|
|
164
158
|
work = plan skeleton (Delta 1) derived from the spec (+ checkpoint progress if resuming)
|
|
165
|
-
|
|
159
|
+
work.Execution batches = infer maximal phase partition (PLAN-EXECUTION-BATCHES)
|
|
160
|
+
repeat:
|
|
166
161
|
gaps = detect_gaps(work) (Delta 2 taxonomy) minus the exhausted ones
|
|
167
162
|
if gaps == ∅: break
|
|
168
163
|
batch ≤3 → seed CHECKPOINT.Pending/Next → resolve each gap:
|
|
169
|
-
research
|
|
170
|
-
integrate + update CHECKPOINT
|
|
164
|
+
research · human (structured-choice) · probe · design (promote closure + pin roots)
|
|
165
|
+
integrate + update CHECKPOINT
|
|
171
166
|
coherence gate (read-only) = Success criteria green:
|
|
172
|
-
- every spec
|
|
173
|
-
(split: each criterion → exactly one sibling — complete, disjoint partition)
|
|
167
|
+
- every spec criterion traces to a phase/task (split: exactly one sibling)
|
|
174
168
|
- the Final behavior block of ## Solution covers the criteria
|
|
175
169
|
- every ### Fn leaves a verifiable state with its own exit condition — never a list of layers or files
|
|
176
170
|
- the order allows early integration · deps without cycles · Impacted consistent with Solution
|
|
177
|
-
-
|
|
178
|
-
- every phase declares
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
171
|
+
- ONLY when the change carries simulation, its displacement and retirement are owned
|
|
172
|
+
- every phase declares primary evidence; layer tests are justified
|
|
173
|
+
- Execution batches partitions every phase once and crosses only eligible boundaries
|
|
174
|
+
- resumable between units and within one through states/checkboxes
|
|
175
|
+
- minimality: no solution/phase/task heavier than Final behavior requires
|
|
176
|
+
- (UI) every screen/UI task pins an exact root against a declared baseline · that closure is handoff · nothing outside it was promoted
|
|
182
177
|
whatever fails → comes back as a gap
|
|
183
|
-
if split accepted
|
|
178
|
+
if split accepted: work = N sibling plans
|
|
184
179
|
structured_choice(content: [Guardar planes, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
185
|
-
Guardar planes →
|
|
180
|
+
Guardar planes → mint + write each sibling
|
|
186
181
|
else:
|
|
187
182
|
structured_choice(content: [Guardar plan, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
188
183
|
Guardar → write docs/plans/PPP-plan-<slug>.md (confirmation if it exists)
|
|
@@ -192,16 +187,17 @@ finalize: CHECKPOINT persisted (+ BACKLOG only if something is deferred) + close
|
|
|
192
187
|
## Convergence / exit
|
|
193
188
|
|
|
194
189
|
- **No material gaps** → **coherence gate** (the *Sequence* checklist; the PLAN-new instance of the chassis convergence gate). Criterion→task traceability is a **checked invariant**, never a separate section.
|
|
195
|
-
- **The gate judges functional states, not size.**
|
|
190
|
+
- **The gate judges functional states, not size.** Each phase needs an exit condition, evidence and,
|
|
191
|
+
**only when the change carries one**, its simulation lifecycle.
|
|
196
192
|
- Passes → `Guardar plan` (writes with confirmation if it exists) → `finalize`.
|
|
197
|
-
- **Split branch**: `Guardar planes` writes the N siblings
|
|
193
|
+
- **Split branch**: `Guardar planes` writes the N siblings → `finalize`.
|
|
198
194
|
- `Cerrar` at any time → `finalize` (persists `CHECKPOINT`; `BACKLOG` only if something is deferred; closes the session, reports).
|
|
199
195
|
|
|
200
|
-
> **After generating:**
|
|
196
|
+
> **After generating:** run `plan-exec`; use optional `plan-refine` when the structure changes first.
|
|
201
197
|
|
|
202
198
|
## Conditional modules
|
|
203
199
|
|
|
204
200
|
- `split` — the canonical multi-plan gate → `../../modules/PLAN-SPLIT-GATE.md`
|
|
205
201
|
- `split` — the incremental journey shape → `../../modules/INCREMENTAL-STRATEGY.md`
|
|
206
|
-
- `ui` —
|
|
202
|
+
- `ui` — the design closure to promote and the roots to pin → `../../modules/DESIGN-REFERENCES.md`
|
|
207
203
|
- `probe` — probe (PoC) tasks → `../../modules/PLAN-PROBE-TASKS.md`
|