@tacuchi/agent-workflow-cli 20.21.0 → 20.22.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 +17 -6
- package/dist/application/markdown.js +61 -16
- package/dist/application/markdown.js.map +1 -1
- package/dist/application/parsers/phases.js +38 -45
- package/dist/application/parsers/phases.js.map +1 -1
- package/dist/application/parsers/plan-status.js +75 -0
- package/dist/application/parsers/plan-status.js.map +1 -0
- package/dist/application/status-service.js +36 -0
- package/dist/application/status-service.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +3 -1
- package/skills/w/commands/plan-new.md +1 -1
- package/skills/w/commands/resume.md +7 -2
- package/skills/w/commands/spec-refine.md +12 -0
- package/skills/w/commands/status.md +14 -6
- package/skills/w/loops/README.md +5 -3
- package/skills/w/loops/plan-exec-loop/LOOP.md +10 -5
- package/skills/w/loops/plan-new-loop/LOOP.md +17 -8
- package/skills/w/loops/plan-refine-loop/LOOP.md +3 -1
- package/skills/w/loops/spec-refine-loop/LOOP.md +20 -7
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@ Workline has three layers plus a permanent `docs/` zone:
|
|
|
16
16
|
|
|
17
17
|
- **Layer 1 · Commands** (`/w:*`) — the only thing the user invokes:
|
|
18
18
|
- **SPEC** — `/w:spec-new` (single-pass draft after a bounded reconnaissance of the sources; may split into sibling specs) → `/w:spec-refine` (gap-driven loop; converges at `status: ready-for-plan` — the blocking functional decisions closed, the technical ones declared for PLAN) → `docs/specs/`.
|
|
19
|
-
- **PLAN** — `/w:plan-new` → (`/w:plan-refine` — aux, optional) → `/w:plan-exec` → `docs/plans/` (the plan loops may split into sibling plans). A plan is a sequence of **functional states**: every phase names a verifiable state, carries its own primary proof, and declares where a
|
|
19
|
+
- **PLAN** — `/w:plan-new` → (`/w:plan-refine` — aux, optional) → `/w:plan-exec` → `docs/plans/` (the plan loops may split into sibling plans). A plan is a sequence of **functional states**: every phase names a verifiable state, carries its own primary proof, and — **only when the change carries temporary behavior** — declares where a simulation lives and when it retires. Ticking every checkbox is not validation, and validating every phase is not closing the plan.
|
|
20
20
|
- **QUICK** — `/w:quick` — lightweight shortcut; escalates live to SPEC when the goal outgrows a quick.
|
|
21
21
|
- **EXPORTS** — `/w:export-scripts` · `export-manuals` · `export-diagrams` · `export-reports` (the only path that promotes artifacts to `docs/`).
|
|
22
22
|
- **Bootstrap** — `/w:workspace-init` turns any folder into a workspace (1+ sources; no project/hub distinction).
|
|
23
|
-
- **Transversal** — `/w:status` · `/w:fix-git` · `/w:generate-launch` · `/w:persist` (persists in-conversation work into `docs/` — classify → `docs/research` · spec draft · plan adoption; the host→`docs/` counterpart of `export-*`).
|
|
23
|
+
- **Transversal** — `/w:status` · `/w:resume` (read-only: composes `/w:status` and proposes how to continue, routed to the target command) · `/w:fix-git` · `/w:generate-launch` · `/w:persist` (persists in-conversation work into `docs/` — classify → `docs/research` · spec draft · plan adoption; the host→`docs/` counterpart of `export-*`).
|
|
24
24
|
- **Layer 2 · Loops** — the AI runs them whole: `spec-refine-loop` · `plan-new-loop` · `plan-refine-loop` · `plan-exec-loop` · `quick-loop` — all heirs of the shared engine `skills/w/loops/CHASSIS.md` (+ `CODE-POLICIES.md` for the code-editing loops). Each loop is a **persistent goal** that runs until its success criteria are green (verification-first); gap-driven, with **structured-choice** lifecycle control (compact/close — `AskUserQuestion` on Claude Code, numbered markdown elsewhere) and resumable `CHECKPOINT`.
|
|
25
25
|
- **Layer 3 · Sessions + artifacts** — internal, ephemeral process state under `.workflow/sessions/` (`SESSION` · `CHECKPOINT` · `BACKLOG` · `SCRIPTS.sql` · `ANALYSIS-FILE` · `CONCLUSIONS` · `DECISION` · …). Sessions are slug-named folders, created by loops, never by the user.
|
|
26
26
|
|
|
@@ -32,9 +32,10 @@ Workline has three layers plus a permanent `docs/` zone:
|
|
|
32
32
|
|
|
33
33
|
A `### Fn` phase is a **verifiable state of the system**, not a batch of technical tasks. It answers one question: *what can the system do or demonstrate at the end that it could not at the start?* The contract is defined **once** in `skills/w/loops/plan-new-loop/LOOP.md` (§ *Phase contract*); the other two plan loops reference it and never redefine it.
|
|
34
34
|
|
|
35
|
-
- **Phase shape** — always `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida
|
|
36
|
-
- **Phase state** — one `> Estado:` line per phase (`pendiente` | `en ejecución` | `bloqueada` | `validada`), machine state that `aw status` parses. A phase reaches `validada` only with its proof green, its exit condition true and the closing review gate passed — **never** because its checkboxes are ticked.
|
|
37
|
-
- **
|
|
35
|
+
- **Phase shape** — required always: `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida`. Conditional, each only when its condition holds: `Estado inicial`, `Recorrido afectado`, `Dependencias`, `Límite de simulación` and `Diferido`. A conditional block is **never written empty** — no `no aplica` placeholders. Granularity is semantic: a task is a unit of purpose that may touch several files, never an edit operation ("create class X").
|
|
36
|
+
- **Phase state** — one `> Estado:` line per phase (`pendiente` | `en ejecución` | `bloqueada` | `validada`), machine state that `aw status` parses. A phase reaches `validada` only with its proof green, its exit condition true and the closing review gate passed — **never** because its checkboxes are ticked. A `bloqueada` phase states what it waits on in its own `> Bloqueo:` line.
|
|
37
|
+
- **Plan state** — one `> Estado:` line under the title (`open` | `done`), plus a `> Cierre: YYYY-MM-DD · sesión NNN` line on close. It is the third axis, not a summary of the other two: every phase validated with no closure is a plan still `open`, awaiting its **final validation**.
|
|
38
|
+
- **Temporary simulation** — **only when the change carries one**, and then planned with a lifecycle: where it is born, how it moves (`antes → después`), which phase retires it, and what prevents it from being selected in a production runtime. A change with no temporary behavior declares no boundary and no gate asks for one. A stub still live on the main path with no declared removal is a review finding.
|
|
38
39
|
- **Evidence** — one primary proof per phase; focused tests only where a layer owns rules, transformation, persistence or integration; risk tests on top of those. Tests that only mirror structure are flagged `overtest` at the closing review gate.
|
|
39
40
|
|
|
40
41
|
The authoring side and the execution side share one gate, seen from both ends:
|
|
@@ -47,7 +48,17 @@ The authoring side and the execution side share one gate, seen from both ends:
|
|
|
47
48
|
└─ functional change ────▶ spec-refine
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
`plan-refine` converges when the plan is executable; `plan-exec` re-checks that same shape on entry, normalizes only minor gaps with consent, and returns the work instead of redesigning it silently.
|
|
51
|
+
`plan-refine` converges when the plan is executable; `plan-exec` re-checks that same shape on entry, normalizes only minor gaps with consent, and returns the work instead of redesigning it silently.
|
|
52
|
+
|
|
53
|
+
Progress is reported on **three** independent axes, and none stands in for another:
|
|
54
|
+
|
|
55
|
+
| Axis | Question | Field |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| task completed | what work was done | `progress_pct` (checkbox-derived, unchanged) |
|
|
58
|
+
| phase validated | what functional state was demonstrated | `phases_validated` / `phases_total` |
|
|
59
|
+
| plan closed | whether the whole solution was validated | `plan_state` |
|
|
60
|
+
|
|
61
|
+
A plan at 100% of checkboxes with zero validated phases is work implemented, not validated. A plan with every phase validated and no closure is `open` with `final_validation_pending: true` — the **final validation** never ran. A plan declaring `done` over open tasks or unvalidated phases is `inconsistent`, reported as a contradiction rather than a closure. Both `/w:status` and `/w:resume` say so, and a `bloqueada` phase is shown with the `> Bloqueo:` reason that says what unblocks it.
|
|
51
62
|
|
|
52
63
|
## Bundled SKILL
|
|
53
64
|
|
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
const HEADING_LINE_RE = /^(#{1,6})\s+(\S.*)$/;
|
|
2
|
+
const FENCE_OPEN_RE = /^(`{3,}|~{3,})/;
|
|
3
|
+
/**
|
|
4
|
+
* Single-pass semantic scan of a Markdown document: which lines are quoted
|
|
5
|
+
* inside a fenced code block, and which headings are real structure.
|
|
6
|
+
*
|
|
7
|
+
* One implementation governs what is semantically visible, because the project
|
|
8
|
+
* writes its own contracts as Markdown examples: a `## Refinement decisions`,
|
|
9
|
+
* a `### F9` or a `> Estado: validada` shown inside a fence is documentation
|
|
10
|
+
* ABOUT the contract, never an instance of it. A parser that misses the
|
|
11
|
+
* distinction promotes specs nobody refined and counts phases nobody planned.
|
|
12
|
+
*
|
|
13
|
+
* Fences follow CommonMark's closing rule (see {@link closesFence}) — the
|
|
14
|
+
* alternating-marker shortcut leaked a nested example back into visibility.
|
|
15
|
+
* Beyond that, this is deliberately NOT a CommonMark implementation: indented
|
|
16
|
+
* code blocks, HTML blocks and setext headings are out of the contracts'
|
|
17
|
+
* vocabulary and stay unhandled.
|
|
18
|
+
*/
|
|
19
|
+
export function scanMarkdown(text) {
|
|
20
|
+
const lines = text.split("\n");
|
|
21
|
+
const fenced = new Array(lines.length).fill(false);
|
|
22
|
+
const headings = [];
|
|
23
|
+
let fence = null;
|
|
24
|
+
for (let i = 0; i < lines.length; i++) {
|
|
25
|
+
const line = (lines[i] ?? "").trim();
|
|
26
|
+
const marker = FENCE_OPEN_RE.exec(line)?.[1] ?? null;
|
|
27
|
+
if (fence === null) {
|
|
28
|
+
if (marker) {
|
|
29
|
+
fence = marker;
|
|
30
|
+
fenced[i] = true;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const match = HEADING_LINE_RE.exec(line);
|
|
34
|
+
if (match?.[1] && match[2]) {
|
|
35
|
+
headings.push({ level: match[1].length, title: match[2].trim(), line: i });
|
|
36
|
+
}
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
fenced[i] = true;
|
|
40
|
+
if (marker && closesFence(fence, marker, line))
|
|
41
|
+
fence = null;
|
|
42
|
+
}
|
|
43
|
+
return { lines, fenced, headings };
|
|
44
|
+
}
|
|
45
|
+
/** CommonMark closing fence: same character, at least as long, the bare marker alone. */
|
|
46
|
+
function closesFence(open, marker, line) {
|
|
47
|
+
return marker[0] === open[0] && marker.length >= open.length && line === marker;
|
|
48
|
+
}
|
|
1
49
|
export function parseMdValue(text, key) {
|
|
2
50
|
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3
51
|
const re = new RegExp(`^\\s*[-*]?\\s*\\*{0,2}${escaped}\\*{0,2}\\s*[:=]\\s*(.+)$`, "im");
|
|
@@ -8,29 +56,26 @@ export function parseMdValue(text, key) {
|
|
|
8
56
|
const value = match[1].trim();
|
|
9
57
|
return value.length > 0 ? value : undefined;
|
|
10
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Body of the section opened by `heading`, up to the next heading of the same
|
|
61
|
+
* or a higher level. Section boundaries come from {@link scanMarkdown}, so a
|
|
62
|
+
* heading quoted inside a fence neither opens nor closes a section; the body
|
|
63
|
+
* returned is the raw slice, fenced examples included.
|
|
64
|
+
*/
|
|
11
65
|
export function parseMdSection(text, heading, normalizeName = (s) => s.trim().toLowerCase()) {
|
|
12
66
|
const target = normalizeName(heading);
|
|
13
|
-
const lines = text
|
|
14
|
-
const headingRe = /^(#{1,6})\s+(.+?)\s*$/;
|
|
67
|
+
const { lines, headings } = scanMarkdown(text);
|
|
15
68
|
let captureFrom = null;
|
|
16
69
|
let captureLevel = 0;
|
|
17
|
-
for (
|
|
18
|
-
const line = lines[i];
|
|
19
|
-
if (line === undefined)
|
|
20
|
-
continue;
|
|
21
|
-
const match = line.match(headingRe);
|
|
22
|
-
if (!match || !match[1] || !match[2])
|
|
23
|
-
continue;
|
|
24
|
-
const level = match[1].length;
|
|
25
|
-
const name = normalizeName(match[2]);
|
|
70
|
+
for (const h of headings) {
|
|
26
71
|
if (captureFrom === null) {
|
|
27
|
-
if (
|
|
28
|
-
captureFrom =
|
|
29
|
-
captureLevel = level;
|
|
72
|
+
if (normalizeName(h.title) === target) {
|
|
73
|
+
captureFrom = h.line + 1;
|
|
74
|
+
captureLevel = h.level;
|
|
30
75
|
}
|
|
31
76
|
}
|
|
32
|
-
else if (level <= captureLevel) {
|
|
33
|
-
return joinTrim(lines.slice(captureFrom,
|
|
77
|
+
else if (h.level <= captureLevel) {
|
|
78
|
+
return joinTrim(lines.slice(captureFrom, h.line));
|
|
34
79
|
}
|
|
35
80
|
}
|
|
36
81
|
if (captureFrom !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/application/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/application/markdown.ts"],"names":[],"mappings":"AAkBA,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAC9C,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAc,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAsB,EAAE,CAAC;IAEvC,IAAI,KAAK,GAAkB,IAAI,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACrD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,IAAI,MAAM,EAAE,CAAC;gBACX,KAAK,GAAG,MAAM,CAAC;gBACf,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;gBACjB,SAAS;YACX,CAAC;YACD,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MA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scanMarkdown } from "../markdown.js";
|
|
1
2
|
export const PHASE_STATES = ["pendiente", "en ejecución", "bloqueada", "validada"];
|
|
2
|
-
const HEADING_RE = /^(#{1,6})\s+(\S.*)$/;
|
|
3
3
|
const PHASE_NAME_RE = /^F(\d+)\s*(?:[—–-]\s*)?(.*)$/;
|
|
4
4
|
const STATE_RE = /^>\s*Estado\s*:\s*(.+)$/i;
|
|
5
|
-
const
|
|
5
|
+
const BLOCKER_RE = /^>\s*Bloqueo\s*:\s*(.+)$/i;
|
|
6
6
|
const TASKS_SECTION = "tasks";
|
|
7
7
|
/**
|
|
8
8
|
* Phase progress of a plan-doc: the `### Fn` blocks of its `## Tasks` section
|
|
@@ -24,55 +24,33 @@ const TASKS_SECTION = "tasks";
|
|
|
24
24
|
* spacing are folded. An absent, annotated (`validada — SQL pendiente de
|
|
25
25
|
* aplicar`) or unknown value degrades to `pendiente`: a phase is never counted
|
|
26
26
|
* as validated by deference. The reason for a stop lives in its own
|
|
27
|
-
* `> Bloqueo:` line,
|
|
27
|
+
* `> Bloqueo:` line, read here as opaque text so a blocked phase can say what
|
|
28
|
+
* it waits on without that reason ever qualifying the machine state.
|
|
28
29
|
*/
|
|
29
30
|
export function parsePhases(text) {
|
|
30
31
|
const scan = { items: [], current: null, stated: false, inTasks: false, anyStated: false };
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const { lines, fenced, headings } = scanMarkdown(text);
|
|
33
|
+
const headingByLine = new Map(headings.map((h) => [h.line, h]));
|
|
34
|
+
for (let i = 0; i < lines.length; i++) {
|
|
35
|
+
if (fenced[i])
|
|
36
|
+
continue;
|
|
37
|
+
const heading = headingByLine.get(i);
|
|
33
38
|
if (heading) {
|
|
34
39
|
applyHeading(scan, heading);
|
|
35
40
|
continue;
|
|
36
41
|
}
|
|
37
42
|
if (scan.inTasks)
|
|
38
|
-
|
|
43
|
+
applyBlockLine(scan, (lines[i] ?? "").trim());
|
|
39
44
|
}
|
|
40
45
|
if (!scan.anyStated)
|
|
41
|
-
return { total: 0, validated: 0, items: [] };
|
|
46
|
+
return { total: 0, validated: 0, blocked: 0, items: [] };
|
|
42
47
|
return {
|
|
43
48
|
total: scan.items.length,
|
|
44
49
|
validated: scan.items.filter((p) => p.state === "validada").length,
|
|
50
|
+
blocked: scan.items.filter((p) => p.state === "bloqueada").length,
|
|
45
51
|
items: scan.items,
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
|
-
/** Trimmed lines outside fenced blocks — a quoted example is never document content. */
|
|
49
|
-
function* visibleLines(text) {
|
|
50
|
-
let fence = null;
|
|
51
|
-
for (const raw of text.split("\n")) {
|
|
52
|
-
const line = raw.trim();
|
|
53
|
-
const marker = FENCE_RE.exec(line)?.[1] ?? null;
|
|
54
|
-
if (fence === null) {
|
|
55
|
-
if (marker) {
|
|
56
|
-
fence = marker;
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
yield line;
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
if (marker && closesFence(fence, marker, line))
|
|
63
|
-
fence = null;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/** CommonMark closing fence: same character, at least as long, the bare marker alone. */
|
|
67
|
-
function closesFence(open, marker, line) {
|
|
68
|
-
return marker[0] === open[0] && marker.length >= open.length && line === marker;
|
|
69
|
-
}
|
|
70
|
-
function readHeading(line) {
|
|
71
|
-
const match = HEADING_RE.exec(line);
|
|
72
|
-
if (!match?.[1] || !match[2])
|
|
73
|
-
return null;
|
|
74
|
-
return { level: match[1].length, name: match[2].trim() };
|
|
75
|
-
}
|
|
76
54
|
/**
|
|
77
55
|
* Section and block boundaries. A level-2 heading enters or leaves `## Tasks`;
|
|
78
56
|
* a level-3 one opens a phase or closes the previous block; a deeper one is a
|
|
@@ -83,12 +61,12 @@ function applyHeading(scan, heading) {
|
|
|
83
61
|
return;
|
|
84
62
|
scan.current = null;
|
|
85
63
|
if (heading.level <= 2) {
|
|
86
|
-
scan.inTasks = heading.level === 2 && isTasksHeading(heading.
|
|
64
|
+
scan.inTasks = heading.level === 2 && isTasksHeading(heading.title);
|
|
87
65
|
return;
|
|
88
66
|
}
|
|
89
67
|
if (!scan.inTasks)
|
|
90
68
|
return;
|
|
91
|
-
const phase = readPhaseHeading(heading.
|
|
69
|
+
const phase = readPhaseHeading(heading.title);
|
|
92
70
|
if (!phase)
|
|
93
71
|
return;
|
|
94
72
|
scan.items.push(phase);
|
|
@@ -104,19 +82,34 @@ function readPhaseHeading(name) {
|
|
|
104
82
|
const match = PHASE_NAME_RE.exec(name);
|
|
105
83
|
if (!match?.[1])
|
|
106
84
|
return null;
|
|
107
|
-
return { n: Number(match[1]), name: (match[2] ?? "").trim(), state: "pendiente" };
|
|
85
|
+
return { n: Number(match[1]), name: (match[2] ?? "").trim(), state: "pendiente", blocker: null };
|
|
108
86
|
}
|
|
109
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The two machine lines of a phase block: its state (first one wins, the rest
|
|
89
|
+
* is prose) and its blocker reason (likewise). A block with no `> Bloqueo:`
|
|
90
|
+
* keeps `blocker: null` — legacy plans stopped before the line existed, and a
|
|
91
|
+
* missing reason is never invented.
|
|
92
|
+
*/
|
|
93
|
+
function applyBlockLine(scan, line) {
|
|
110
94
|
const current = scan.current;
|
|
111
|
-
if (!current
|
|
95
|
+
if (!current)
|
|
112
96
|
return;
|
|
113
97
|
// `**` tolerated: authors bold the label (`> **Estado:** validada`).
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
98
|
+
const bare = line.replace(/\*/g, "");
|
|
99
|
+
if (!scan.stated) {
|
|
100
|
+
const state = STATE_RE.exec(bare);
|
|
101
|
+
if (state?.[1]) {
|
|
102
|
+
current.state = normalizeState(state[1]);
|
|
103
|
+
scan.stated = true;
|
|
104
|
+
scan.anyStated = true;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (current.blocker !== null)
|
|
116
109
|
return;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
const blocker = BLOCKER_RE.exec(bare)?.[1]?.trim();
|
|
111
|
+
if (blocker)
|
|
112
|
+
current.blocker = blocker;
|
|
120
113
|
}
|
|
121
114
|
/** Case- and accent-insensitive: `en ejecucion` is the same mark as `en ejecución`. */
|
|
122
115
|
function fold(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phases.js","sourceRoot":"","sources":["../../../src/application/parsers/phases.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"phases.js","sourceRoot":"","sources":["../../../src/application/parsers/phases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AAoB5F,MAAM,aAAa,GAAG,8BAA8B,CAAC;AACrD,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAC5C,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,aAAa,GAAG,OAAO,CAAC;AAc9B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,IAAI,GAAS,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACjG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,C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@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { scanMarkdown } from "../markdown.js";
|
|
2
|
+
export const PLAN_DECLARED_STATES = ["open", "done"];
|
|
3
|
+
const STATE_RE = /^>\s*Estado\s*:\s*(.+)$/i;
|
|
4
|
+
const CLOSURE_RE = /^>\s*Cierre\s*:\s*(.+)$/i;
|
|
5
|
+
/** `done — 2026-07-27 · sesion 123` → value `done`, tail the rest. */
|
|
6
|
+
const ANNOTATED_RE = /^(.*?)\s+[—–-]\s+(.+)$/;
|
|
7
|
+
/**
|
|
8
|
+
* The plan-level status line: the first `> Estado:` of the document PREAMBLE —
|
|
9
|
+
* everything before the first level-2 heading, i.e. the blockquote under the
|
|
10
|
+
* `# Plan PPP — <slug>` title.
|
|
11
|
+
*
|
|
12
|
+
* Position is what tells the two marks apart: this one governs the whole plan,
|
|
13
|
+
* while the `> Estado:` lines inside the `### Fn` blocks of `## Tasks` govern
|
|
14
|
+
* one phase each ({@link import("./phases.js").parsePhases}). Reading them with
|
|
15
|
+
* one rule would let a validated first phase close the plan.
|
|
16
|
+
*
|
|
17
|
+
* The machine value stands alone (`open` | `done`); the date and session live
|
|
18
|
+
* on the `> Cierre:` line. The legacy `done — YYYY-MM-DD · sesion NNN` shape is
|
|
19
|
+
* still read — those plans exist — and reports `legacy: true` so the loop that
|
|
20
|
+
* next edits the document migrates it instead of copying the old form forward.
|
|
21
|
+
* Anything else reads `unknown`: an unreadable declaration is a contradiction
|
|
22
|
+
* to surface, never a silent `open`.
|
|
23
|
+
*/
|
|
24
|
+
export function parsePlanStatus(text) {
|
|
25
|
+
const { lines, fenced, headings } = scanMarkdown(text);
|
|
26
|
+
// The preamble is the blockquote under the `# Plan PPP — <slug>` title: skip
|
|
27
|
+
// the title itself, stop at the first section heading that follows it.
|
|
28
|
+
const [title, ...rest] = headings;
|
|
29
|
+
const boundary = title?.level === 1 ? rest[0] : title;
|
|
30
|
+
const end = boundary ? boundary.line : lines.length;
|
|
31
|
+
let declared = "absent";
|
|
32
|
+
let closure = null;
|
|
33
|
+
let legacy = false;
|
|
34
|
+
for (let i = 0; i < end; i++) {
|
|
35
|
+
if (fenced[i])
|
|
36
|
+
continue;
|
|
37
|
+
// `**` tolerated: authors bold the label (`> **Estado:** done`).
|
|
38
|
+
const line = (lines[i] ?? "").trim().replace(/\*/g, "");
|
|
39
|
+
if (declared === "absent") {
|
|
40
|
+
const raw = STATE_RE.exec(line)?.[1];
|
|
41
|
+
if (raw) {
|
|
42
|
+
const read = readDeclaration(raw);
|
|
43
|
+
declared = read.declared;
|
|
44
|
+
legacy = read.legacy;
|
|
45
|
+
if (read.closure)
|
|
46
|
+
closure = read.closure;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (closure === null) {
|
|
51
|
+
const cierre = CLOSURE_RE.exec(line)?.[1]?.trim();
|
|
52
|
+
if (cierre)
|
|
53
|
+
closure = cierre;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { declared, closure, legacy };
|
|
57
|
+
}
|
|
58
|
+
function readDeclaration(raw) {
|
|
59
|
+
const exact = normalizeDeclared(raw);
|
|
60
|
+
if (exact)
|
|
61
|
+
return { declared: exact, closure: null, legacy: false };
|
|
62
|
+
const annotated = ANNOTATED_RE.exec(raw.trim());
|
|
63
|
+
const head = annotated?.[1] ? normalizeDeclared(annotated[1]) : null;
|
|
64
|
+
if (head && annotated?.[2]) {
|
|
65
|
+
return { declared: head, closure: annotated[2].trim(), legacy: true };
|
|
66
|
+
}
|
|
67
|
+
return { declared: "unknown", closure: null, legacy: false };
|
|
68
|
+
}
|
|
69
|
+
function normalizeDeclared(raw) {
|
|
70
|
+
const folded = raw.trim().toLowerCase();
|
|
71
|
+
return PLAN_DECLARED_STATES.includes(folded)
|
|
72
|
+
? folded
|
|
73
|
+
: null;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=plan-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-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,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxC,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjE,CAAC,CAAE,MAA4B;QAC/B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { localDateIso } from "./dates.js";
|
|
|
3
3
|
import { humanizeRelativeEs } from "./humanize-es.js";
|
|
4
4
|
import { firstNonEmptyLine, parseMdSection } from "./markdown.js";
|
|
5
5
|
import { parsePhases } from "./parsers/phases.js";
|
|
6
|
+
import { parsePlanStatus } from "./parsers/plan-status.js";
|
|
6
7
|
import { parseProjectBlock } from "./parsers/project-block.js";
|
|
7
8
|
import { parseTasks } from "./parsers/tasks.js";
|
|
8
9
|
import { findArtifact } from "./session-artifacts.js";
|
|
@@ -155,6 +156,8 @@ async function readPlans(fs, cwd, now) {
|
|
|
155
156
|
const text = await fs.readText(f.path);
|
|
156
157
|
const t = parseTasks(text);
|
|
157
158
|
const p = parsePhases(text);
|
|
159
|
+
const declared = parsePlanStatus(text).declared;
|
|
160
|
+
const planState = derivePlanState(declared, t, p);
|
|
158
161
|
const ts = await resolveTimestamp(fs, f.path, undefined, now);
|
|
159
162
|
out.push({
|
|
160
163
|
file: relFromCwd(f.path, cwd),
|
|
@@ -165,6 +168,12 @@ async function readPlans(fs, cwd, now) {
|
|
|
165
168
|
progress_pct: t.progress_pct,
|
|
166
169
|
phases_total: p.total,
|
|
167
170
|
phases_validated: p.validated,
|
|
171
|
+
plan_state: planState,
|
|
172
|
+
phases_blocked: p.blocked,
|
|
173
|
+
blocked_phases: p.items
|
|
174
|
+
.filter((phase) => phase.state === "bloqueada")
|
|
175
|
+
.map((phase) => ({ number: phase.n, name: phase.name, blocker: phase.blocker })),
|
|
176
|
+
final_validation_pending: planState === "open" && p.total > 0 && p.validated === p.total && t.closed === t.total,
|
|
168
177
|
date: ts.date,
|
|
169
178
|
relative: ts.relative,
|
|
170
179
|
});
|
|
@@ -175,6 +184,33 @@ async function readPlans(fs, cwd, now) {
|
|
|
175
184
|
}
|
|
176
185
|
return sortByNumber(out);
|
|
177
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* The three axes reconciled into one closure state. The rules, in order:
|
|
189
|
+
*
|
|
190
|
+
* - a plan that declares nothing, or declares `open`, IS open — including the
|
|
191
|
+
* case where every box is ticked and every phase is validated: that plan is
|
|
192
|
+
* waiting on its final validation, not finished (`final_validation_pending`);
|
|
193
|
+
* - a plan that declares `done` is `done` only when the counters agree — every
|
|
194
|
+
* task closed and, under the phase contract, every phase validated;
|
|
195
|
+
* - any other combination is `inconsistent`: the document says one thing and
|
|
196
|
+
* shows another, and nothing but a human repairs that.
|
|
197
|
+
*
|
|
198
|
+
* A plan with no phase marks predates the contract (`phases_total: 0`) and is
|
|
199
|
+
* judged by its checkboxes alone — it never acquires fictitious phases, and
|
|
200
|
+
* `done` on such a plan stays legitimate when its boxes are all ticked.
|
|
201
|
+
*/
|
|
202
|
+
function derivePlanState(declared, tasks, phases) {
|
|
203
|
+
if (declared === "unknown")
|
|
204
|
+
return "inconsistent";
|
|
205
|
+
if (declared !== "done")
|
|
206
|
+
return "open";
|
|
207
|
+
if (tasks.closed !== tasks.total)
|
|
208
|
+
return "inconsistent";
|
|
209
|
+
// Legacy contract (`legacy-tasks`): no phase marks, so the checkboxes decide.
|
|
210
|
+
if (phases.total === 0)
|
|
211
|
+
return "done";
|
|
212
|
+
return phases.validated === phases.total ? "done" : "inconsistent";
|
|
213
|
+
}
|
|
178
214
|
async function readSessions(fs, env, paths, now) {
|
|
179
215
|
const active = [];
|
|
180
216
|
const closed = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-service.js","sourceRoot":"","sources":["../../src/application/status-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AASxD,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAU,CAAC;AA6EvE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,EAAkB,EAClB,GAAY,EACZ,KAAmB,EACnB,QAAqB,EAAE;IAEvB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IAEjC,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAA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AC,MAAM,CAAC;IAC9E,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tacuchi/agent-workflow-cli",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.22.0",
|
|
4
4
|
"description": "Runtime CLI for Workline — the stages + loops + artifacts system for agent work. Bundles the universal `w` skill set under `skills/w/` (slash commands `/w:*`: spec-new/spec-refine, plan-new/plan-exec, quick, persist, workspace-init, export-*); `self install --target <host>` copies SKILL + commands + hooks into the host. Pluggable capability skills via `.workflow/skills.toml`. Multi-empresa parametrization via `profile.json` cascade. Namespace auto-detected from any `.<ns>/sessions/` dir in CWD; default `workflow`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/skills/w/SKILL.md
CHANGED
|
@@ -67,7 +67,9 @@ USER invokes
|
|
|
67
67
|
|
|
68
68
|
Typical chain: prompt → `spec-new` generates `docs/specs/NNN-spec-<slug>.md` → `spec-refine` runs the loop and refines **that same spec in place** until PLAN can design without inventing behavior, stamping `status: ready-for-plan` → `plan-new` → `docs/plans/PPP-plan-<slug>.md` → *(optional)* `plan-refine` adjusts **that same plan in place** if changes arise before executing → `plan-exec` executes and updates the plan (living doc) + artifacts in sessions. Promoting anything else to `docs/` is **always** a separate step via `export-*`.
|
|
69
69
|
|
|
70
|
-
> **A plan is a sequence of functional states.** Every `### Fn` phase names a verifiable state of the system, carries its own primary proof, and — **only when the change carries one** — declares where a temporary simulation lives and when it retires. Its `> Estado:` line (`pendiente` | `en ejecución` | `bloqueada` | `validada`) is machine state that `aw status` counts **alongside** the checkbox progress: ticking every checkbox is **not** validation, and neither is a proof nobody ran — a phase whose check could not be executed stays `bloqueada` until it runs and passes. Execution runs those states without redesigning them — a structural deviation returns to `plan-refine`, a functional one to `spec-refine`.
|
|
70
|
+
> **A plan is a sequence of functional states.** Every `### Fn` phase names a verifiable state of the system, carries its own primary proof, and — **only when the change carries one** — declares where a temporary simulation lives and when it retires. Its `> Estado:` line (`pendiente` | `en ejecución` | `bloqueada` | `validada`) is machine state that `aw status` counts **alongside** the checkbox progress: ticking every checkbox is **not** validation, and neither is a proof nobody ran — a phase whose check could not be executed stays `bloqueada` until it runs and passes, stating on its `> Bloqueo:` line what it waits on. Execution runs those states without redesigning them — a structural deviation returns to `plan-refine`, a functional one to `spec-refine`.
|
|
71
|
+
|
|
72
|
+
> **Three axes, and none stands in for another.** A **task completed** is work done (checkboxes); a **phase validated** is a functional state demonstrated (`> Estado: validada`); a **plan closed** is the whole solution validated — the plan's own `> Estado:` line under the title (`open` | `done`, with the date and session on its `> Cierre:` line). 100% of tasks does not imply validated phases, every phase validated does not imply the **final validation** ran, and a `done` declared over open work is a contradiction `aw status` reports as `inconsistent` rather than a closure. The runtime derives that third axis (`plan_state`) from the declaration **and** the counters; it never infers it from either alone.
|
|
71
73
|
|
|
72
74
|
QUICK can **escalate live to SPEC** when the objective exceeds a quick (entry size gate) or the task grows mid-loop: with consent via structured-choice, the work line moves to the SPEC flow (draft via the `spec-new` procedure + `spec-refine-loop` directly); escalation to PLAN stays **deferred** (seed + pointer). See `loops/quick-loop/LOOP.md` § *QUICK delta*.
|
|
73
75
|
|
|
@@ -45,7 +45,7 @@ The skill evaluates `$ARGUMENTS` (specs live in place — `docs/specs/NNN-spec-<
|
|
|
45
45
|
|
|
46
46
|
## Phases are functional states
|
|
47
47
|
|
|
48
|
-
The plan is born with `### Fn` phases that each leave a **verifiable state of the system** — each with its `> Estado:` line, its primary evidence and its exit condition — never a list of files, classes or layers. Contract: `../loops/plan-new-loop/LOOP.md` § *Phase contract (canonical)*.
|
|
48
|
+
The plan is born with `### Fn` phases that each leave a **verifiable state of the system** — each with its `> Estado:` line, its primary evidence and its exit condition — never a list of files, classes or layers. The blocks beyond those are **conditional**: a phase with no temporary behavior gets no `Límite de simulación`, and one with nothing excluded gets no `Diferido` — a heading is never written empty to satisfy a template. The plan itself is born `> Estado: open` under the title; only `plan-exec` closes it. Contract: `../loops/plan-new-loop/LOOP.md` § *Phase contract (canonical)*.
|
|
49
49
|
|
|
50
50
|
## Numbering notes
|
|
51
51
|
|
|
@@ -35,7 +35,7 @@ Same hard floor: this mode **proposes** the route — it never starts the target
|
|
|
35
35
|
## Run
|
|
36
36
|
|
|
37
37
|
1. **Workline level — compose `/w:status`.** Read-and-follow [`status.md`](status.md) to produce the prioritized summary (it already renders `aw status` and, when available, the host-context section). Do **not** re-implement the summary. For deeper session detail, `aw resume-summary [--include-recent-closed]` gives the primary session's CHECKPOINT state, and `aw session-resume --code <NNN>` the full checkpoint of any other active or closed session.
|
|
38
|
-
2. **Interpret the stage marks.** Map each signal to its stage: the spec's `status` (`draft`/`refining` = SPEC work still open · `ready-for-plan` = it can go to PLAN) + `open_questions`; plan progress on **
|
|
38
|
+
2. **Interpret the stage marks.** Map each signal to its stage: the spec's `status` (`draft`/`refining` = SPEC work still open · `ready-for-plan` = it can go to PLAN) + `open_questions`; plan progress on **all three axes** — checkboxes (`tasks_done` / `tasks_total`), validated phases (`phases_validated` / `phases_total`) and closure (`plan_state`, with `final_validation_pending` and `blocked_phases[]`); session `checkpoint_present`. A `status` that is absent, empty or unknown reads `draft`: that work stays in SPEC and never routes to PLAN on an unreadable mark. Associate a session to its plan or spec by **slug** — there is no linkage field in the `aw status` output, so infer it from `folder` / `slug`; when precision matters, confirm by the session's `## Origin` (§ *Directed resume*).
|
|
39
39
|
3. **Build the prioritized pending list** — fixed order: **session with CHECKPOINT > plan half-done > spec not ready > host context**.
|
|
40
40
|
4. **Host level (second source).** If the workline level does not explain the pending work (or no Workline flow was used), rely on the host-context already surfaced by `/w:status`; escalate it to a proposal and, only if needed, use the host-memory *deep* tier or ask the user (universal fallback: git / `docs/` signals + a question). See [`../harness/HARNESS.md`](../harness/HARNESS.md) § *host-memory*.
|
|
41
41
|
5. **Propose (only when ≥1 pending).** One structured-choice with the top ≤3 options by the priority order; each option **routes** to its command (table below). Every proposal carries `Retomar` (recommended) and `Descartar` / `Cerrar` (secondary).
|
|
@@ -47,11 +47,16 @@ Priority: **session+CHECKPOINT > plan half-done > spec not ready > host context*
|
|
|
47
47
|
|
|
48
48
|
> **Every box ticked is not a finished plan.** A plan with `phases_validated` below `phases_total` still has functional state to reach — work implemented, not validated — so it counts as half-done and routes to `/w:plan-exec`, which re-enters at the first phase that is not `validada`. A phase left `bloqueada` routes the same way: `/w:plan-exec` re-enters **through it** to run the validation still pending, and the plan stays open until that phase reads `validada`. A plan with `phases_total: 0` is a legacy plan (no phase marks) and is judged by its checkboxes alone.
|
|
49
49
|
|
|
50
|
+
> **`plan_state` decides whether a plan is resumable at all.** Only `done` is finished; everything else routes back to `/w:plan-exec` with a different re-entry point. `final_validation_pending: true` means the phases are green but the final validation never ran — the plan re-enters **at that validation**, not at a phase. `inconsistent` means the document contradicts itself (`done` declared over open work, or an unreadable value): the re-entry is **repairing the state first**, and the proposal says so instead of pretending there is work to implement.
|
|
51
|
+
|
|
50
52
|
| Pending detected | `Retomar` (recommended) | Secondary |
|
|
51
53
|
|---|---|---|
|
|
52
54
|
| spec not ready (`draft` / `refining`, or a `status` absent or unreadable) | `/w:spec-refine` | `Descartar` |
|
|
53
55
|
| spec `ready-for-plan`, no plan | `/w:plan-new` | `Descartar` |
|
|
54
|
-
| plan
|
|
56
|
+
| plan `open` — open checkboxes **or** phases not `validada` | `/w:plan-exec` | `Cerrar` |
|
|
57
|
+
| plan `open` with `final_validation_pending` — everything validated, no closure | `/w:plan-exec`, from the final validation | `Cerrar` |
|
|
58
|
+
| plan `inconsistent` — `done` over open work, or an unreadable value | `/w:plan-exec`, repairing the state first | `Cerrar` |
|
|
59
|
+
| plan `done` | — not resumed automatically | — |
|
|
55
60
|
| active session with CHECKPOINT | continue / reopen (`aw session-resume --reopen`) | `Cerrar` |
|
|
56
61
|
| host context only (no workline) | best next step for what was found | `Descartar` |
|
|
57
62
|
|
|
@@ -21,6 +21,18 @@ This command does not refine the spec itself: it delegates to `spec-refine-loop`
|
|
|
21
21
|
> 3. **Write boundary** — this flow edits only `docs/specs/…` (in place, with confirmation), stamping the spec's frontmatter `status: ready-for-plan` on save; nothing else lands in `docs/`.
|
|
22
22
|
> 4. **Language** — everything user-facing (questions, option labels, the doc's content) goes in the **user's language**.
|
|
23
23
|
> 5. **Converge, do not close everything** — the target is `ready-for-plan`, not a spec without unknowns: close what can change **what** gets built; hand architecture and implementation questions to `PLAN`, recorded in `## Open questions` with their destination.
|
|
24
|
+
> 6. **Shape before gaps** — if the investigation shows the spec must be **split** or **replaced**, ask and resolve that **before** the gap questions, in its own question, and record the answer in `CHECKPOINT`. Never mix it into the gap batch.
|
|
25
|
+
|
|
26
|
+
## The two shape branches are not the same question
|
|
27
|
+
|
|
28
|
+
The loop's *change-shape gate* can find that one spec is the wrong container. `split` and `replace` are different findings, so they ask different things and do different things — reusing one for the other asks about cardinality when what changed was purpose:
|
|
29
|
+
|
|
30
|
+
| Finding | What it asks | What it writes |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| **`split`** — independent functional outcomes discovered | `Dividir en varias specs` \| `Una sola spec` | the original, rewritten reduced, **plus** one new file per extracted outcome |
|
|
33
|
+
| **`replace`** — the purpose itself changed | `Crear una nueva spec` \| `Reformular esta spec` | `Crear` → one **new** file, this spec untouched · `Reformular` → **no new file**: this same file, same number, same path |
|
|
34
|
+
|
|
35
|
+
Both branches keep the `Cerrar` control, which closes the run **without applying the change**. No file — new or overwritten — is written without confirmation.
|
|
24
36
|
|
|
25
37
|
## Run the loop
|
|
26
38
|
|
|
@@ -17,14 +17,19 @@ Shows, simple and direct, the workspace state grouped as **Done / Missing / Disc
|
|
|
17
17
|
1. Run `aw status` (returns JSON; backed by `status-service`).
|
|
18
18
|
2. Render a readable summary from the JSON — do **not** show the raw JSON. Use the `relative` field verbatim (it comes pre-humanized in the user's language — Spanish). Head it with `workspace.name`.
|
|
19
19
|
3. Group into three blocks (the dashboard is user-facing → render it in the user's language; the canonical Spanish labels below):
|
|
20
|
-
- `▸ HECHO` — specs whose `status` is `ready-for-plan` (the JSON keeps `refined: true` as its boolean mirror); plans with their progress (`tasks_done`/`tasks_total`, `progress_pct`) **and** their validated phases (`phases_validated`/`phases_total`); `closed` sessions.
|
|
21
|
-
- `▸ FALTA` — `active` sessions; plans
|
|
20
|
+
- `▸ HECHO` — specs whose `status` is `ready-for-plan` (the JSON keeps `refined: true` as its boolean mirror); plans whose `plan_state` is `done`, with their progress (`tasks_done`/`tasks_total`, `progress_pct`) **and** their validated phases (`phases_validated`/`phases_total`); `closed` sessions.
|
|
21
|
+
- `▸ FALTA` — `active` sessions; plans whose `plan_state` is `open` (pending tasks `tasks_total − tasks_done`, phases still to validate `phases_total − phases_validated`, or a final validation that never ran); plans whose `plan_state` is `inconsistent`, **naming the contradiction**; specs whose `status` is `draft` or `refining`; specs with `open_questions > 0`.
|
|
22
22
|
- `▸ DESCARTÓ` — every item in `discarded[]` (`kind: deferred` = deferred in BACKLOG; `kind: excluded` = excluded in CHECKPOINT), with its `text`.
|
|
23
23
|
4. Every line ends with its relative date after ` · ` (e.g. `· ayer en la mañana`). An empty section shows `— (nada)`. Never invent data not present in the JSON.
|
|
24
|
-
5.
|
|
25
|
-
6.
|
|
24
|
+
5. **Say what blocks a phase.** Every entry of `blocked_phases[]` is rendered with its `number`, its `name` and its `blocker` — `• F3 — Persistencia real — bloqueada: falta aplicar la migración`. A `blocker: null` is a legacy block that stated no reason: render it as `bloqueada` with `motivo no declarado`, never a guess.
|
|
25
|
+
6. If `workspace.initialized` is `false` and everything is empty → say the folder is not an agent-workflow workspace (no `.workflow/`) and suggest `/w:workspace-init`.
|
|
26
|
+
7. **Host context (opportunistic, read-only).** After the dashboard, if the host exposes *cheap* host-memory (see [`../harness/HARNESS.md`](../harness/HARNESS.md) § *host-memory* — e.g. the auto-memory `MEMORY.md` on Claude Code), append a `▸ CONTEXTO DEL HOST` section with a few signals of recent focus relevant to this workspace. If there is no cheap host memory, **omit the section silently**. Never run an expensive transcript scan here and **never ask** — this is a read-only dashboard; the enrichment is additive and must not slow the default output.
|
|
26
27
|
|
|
27
|
-
> **
|
|
28
|
+
> **Three axes, none of them a substitute for another.** A task completed answers *what work was done* (`tasks_done`/`tasks_total`); a phase validated answers *what functional state was demonstrated* (`phases_validated`/`phases_total`); a plan closed answers *whether the whole solution was validated* (`plan_state`). `progress_pct` stays checkbox-derived — it never reads the phase marks. A plan at 100% with `phases_validated: 0` is **work implemented, not validated**: report it in both blocks and say so. `phases_total: 0` means a legacy plan with no phase marks — show only its checkbox progress, never a `0/0`.
|
|
29
|
+
|
|
30
|
+
> **`plan_state` is derived, never declared alone.** `open` (or nothing declared) keeps the plan in `▸ FALTA`, **including** a plan whose every box is ticked and every phase validated: that one carries `final_validation_pending: true` and is reported as `validación final pendiente` — the work is complete, the final validation never ran. `done` reaches `▸ HECHO` only when the counters back the declaration. `inconsistent` means the document declares `done` while tasks or phases stay open, or declares a value nobody can read: it belongs in `▸ FALTA` **with the contradiction named** (`declara done con 2 tareas abiertas`), because only a human repairs it.
|
|
31
|
+
|
|
32
|
+
> **A blocked phase says what it waits on.** A `bloqueada` phase is the implemented-not-validated gap made explicit — every box ticked, its verification still pending — and belongs in both blocks: the work under `▸ HECHO`, the phase under `▸ FALTA` with its `> Bloqueo:` reason, so the reader knows the next action instead of only the state.
|
|
28
33
|
|
|
29
34
|
> **The frontmatter governs spec maturity.** The spec's `status` (`draft` | `refining` | `ready-for-plan`) is the primary source, and readiness is never inferred from a section the spec happens to carry. A `status` that is absent, empty or unknown reads `draft` and the spec is reported as pending; only a spec with **no frontmatter at all** falls back to the two legacy marks (`## Refinement decisions`, `## Q&A traceability`).
|
|
30
35
|
|
|
@@ -34,13 +39,16 @@ Suggested format (plain text; user-facing labels in Spanish):
|
|
|
34
39
|
Workspace: <name>
|
|
35
40
|
|
|
36
41
|
▸ HECHO
|
|
37
|
-
• plan <slug> — <done>/<total> tareas (<pct>%) · <validadas>/<fases> fases validadas · <relative>
|
|
42
|
+
• plan <slug> — cerrado · <done>/<total> tareas (<pct>%) · <validadas>/<fases> fases validadas · <relative>
|
|
38
43
|
• spec <slug> — lista para plan · <relative>
|
|
39
44
|
• <folder> (<type>) — cerrada · <relative>
|
|
40
45
|
|
|
41
46
|
▸ FALTA
|
|
42
47
|
• <folder> (<type>) — activa · <relative>
|
|
43
48
|
• plan <slug> — <pendientes> tareas pendientes · <sin validar> fases sin validar
|
|
49
|
+
• plan <slug> — validación final pendiente (todo validado, sin cierre)
|
|
50
|
+
• plan <slug> — inconsistente: declara done con <n> tareas abiertas
|
|
51
|
+
• F3 — Persistencia real — bloqueada: falta aplicar la migración
|
|
44
52
|
• spec <slug> — borrador · <relative>
|
|
45
53
|
• spec <slug> — <n> preguntas abiertas
|
|
46
54
|
|
package/skills/w/loops/README.md
CHANGED
|
@@ -16,14 +16,16 @@ The 5 loops run the same **common engine**, whose canon lives in [`CHASSIS.md`](
|
|
|
16
16
|
|
|
17
17
|
| Loop (`name:`) | Flow | Started by | Reads | Writes |
|
|
18
18
|
|---|---|---|---|---|
|
|
19
|
-
| [`spec-refine-loop`](spec-refine-loop/LOOP.md) | SPEC | `/w:spec-refine` | `docs/specs/NNN-spec*.md` (the spec itself) | `docs/specs/NNN-spec-<slug>.md` (in place) |
|
|
20
|
-
| [`plan-new-loop`](plan-new-loop/LOOP.md) | PLAN | `/w:plan-new` | `docs/specs/NNN-spec-*.md` | `docs/plans/PPP-plan-<slug>.md
|
|
21
|
-
| [`plan-refine-loop`](plan-refine-loop/LOOP.md) | PLAN | `/w:plan-refine` *(aux, optional)* | `docs/plans/PPP-plan-*.md` (the plan itself) | `docs/plans/PPP-plan-<slug>.md` (in place) |
|
|
19
|
+
| [`spec-refine-loop`](spec-refine-loop/LOOP.md) | SPEC | `/w:spec-refine` | `docs/specs/NNN-spec*.md` (the spec itself) | `docs/specs/NNN-spec-<slug>.md` (in place) **and, with confirmation, sibling specs** (accepted split) **or one replacement spec** (`Crear una nueva spec`) |
|
|
20
|
+
| [`plan-new-loop`](plan-new-loop/LOOP.md) | PLAN | `/w:plan-new` | `docs/specs/NNN-spec-*.md` | `docs/plans/PPP-plan-<slug>.md`, **or N sibling plans** (accepted split) |
|
|
21
|
+
| [`plan-refine-loop`](plan-refine-loop/LOOP.md) | PLAN | `/w:plan-refine` *(aux, optional)* | `docs/plans/PPP-plan-*.md` (the plan itself) | `docs/plans/PPP-plan-<slug>.md` (in place) **plus the extracted sibling plans** (accepted split) |
|
|
22
22
|
| [`plan-exec-loop`](plan-exec-loop/LOOP.md) | PLAN | `/w:plan-exec` | `docs/plans/PPP-plan-*.md` | `docs/plans/PPP-plan-<slug>.md` (update); the rest via `export-*` |
|
|
23
23
|
| [`quick-loop`](quick-loop/LOOP.md) | QUICK | `/w:quick` | — (prompt) | edits code + light session; **no** `docs/` |
|
|
24
24
|
|
|
25
25
|
> `/w:spec-new` has no loop (single-pass). Hence **6 commands / 5 loops**.
|
|
26
26
|
|
|
27
|
+
> **A single run may write several documents.** Splitting, and replacing by a new spec, produce more than one file — always **inside the same flow's folder**, always **after confirmation**, never in another `docs/` zone: the `docs/` boundary below bounds *where* a loop writes, not *how many* files it writes there. `Reformular esta spec` is the counter-case: a replacement that creates nothing and edits the same file in place.
|
|
28
|
+
|
|
27
29
|
### `docs/` boundary (hard rule)
|
|
28
30
|
|
|
29
31
|
Every loop writes **only** its own flow's doc (SPEC→`docs/specs` · PLAN→`docs/plans` · QUICK→none) and **never** graduates other artifacts to `docs/` — that promotion belongs to the separate, explicit `export-*` skills. Canon: [`CHASSIS.md`](CHASSIS.md) § *docs/ boundary*.
|
|
@@ -66,7 +66,9 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
|
|
|
66
66
|
Execution **no longer accepts in silence** a plan that would force it to invent its own structure. Two outcomes:
|
|
67
67
|
|
|
68
68
|
- **Minor gap** — the plan is all but executable: an exit condition derivable from what is already written, the obvious evidence unnamed, micro-tasks to group. `plan-exec` may **normalize it with consent** — one structured-choice content question, labels `Normalizar y ejecutar` (recommended) | `Ir a plan-refine`. Normalizing edits the `### Fn` blocks in place, **adds no scope and moves no boundary**, and is recorded in `DECISION` + `CHECKPOINT`.
|
|
69
|
-
- **Structural gap** — phases, contracts
|
|
69
|
+
- **Structural gap** — phases, contracts or journey are missing, or a change that **does** carry temporary behavior leaves its boundary undeclared. It does **not** improvise: record the finding in `CHECKPOINT`, hand off to [`plan-refine-loop`](../plan-refine-loop/LOOP.md) (`/w:plan-refine`) and resume execution over the refined plan.
|
|
70
|
+
|
|
71
|
+
> **A missing `Límite de simulación` is a gap only when there is something to simulate.** No task and no phase introduces temporary behavior → the block is legitimately absent and the gate passes; demanding it anyway pushes execution to invent a stub so the plan matches a template. The same holds for `Diferido` and every other conditional block.
|
|
70
72
|
|
|
71
73
|
> 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`.
|
|
72
74
|
|
|
@@ -77,7 +79,8 @@ Execution **no longer accepts in silence** a plan that would force it to invent
|
|
|
77
79
|
- 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.
|
|
78
80
|
- **Marking order (hard rule):** a task is marked `- [x]` when its local work is finished. A phase reaches `validada` **only** when its primary proof **ran and passed**, the needed focused checks passed, its `Condición de salida` is true, the review gate is green and every remaining review finding is explicitly deferred — a blocker is never deferred into `validada`. **Never** because all its checkboxes are ticked.
|
|
79
81
|
- **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`.
|
|
80
|
-
- **
|
|
82
|
+
- **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
|
+
- **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.
|
|
81
84
|
- **CHECKPOINT per phase:** on closing a phase record the **functional state reached**, the simulation boundary in force **only when the change carries one**, the tests run and their result, the non-obvious decisions, the deferrals and the next state being pursued. Enumerating every file touched is not required unless it helps a resume.
|
|
82
85
|
- 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*).
|
|
83
86
|
- 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.
|
|
@@ -133,8 +136,10 @@ Full gate in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Closing review ga
|
|
|
133
136
|
## Delta 6 — Completion / close
|
|
134
137
|
|
|
135
138
|
- A phase closes when its `> Estado:` reads `validada`: work done, `Condición de salida` true, proof **run and passed**. A proof still waiting on an operative handoff leaves it `bloqueada`.
|
|
139
|
+
- **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
140
|
- **Every phase `validada` + the final validation passed** → final *structured-choice* (content: `Marcar plan done` / `Preguntar algo más`; flow: `Compactar`/`Cerrar`). `Marcar plan done` is offered under no other condition: one `bloqueada` phase keeps the plan open, however many of its tasks are ticked.
|
|
137
|
-
- **Marking done = ONE line in the plan-doc**, under the title's blockquote: `> Estado: done — YYYY-MM-DD · sesión NNN
|
|
141
|
+
- **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`).
|
|
142
|
+
- **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.
|
|
138
143
|
- **No automatic export**: the artifacts (`SCRIPTS.sql`, `DECISION`, …) stay in the session. Promoting them to `docs/` (scripts, manuals, …) is a separate step via `export-*`.
|
|
139
144
|
|
|
140
145
|
## Delta 7 — Probe (PoC) tasks
|
|
@@ -193,8 +198,8 @@ plan-exec-loop(PPP-plan-<slug>.md):
|
|
|
193
198
|
final validation (whatever can run; a deferred check keeps its phase bloqueada)
|
|
194
199
|
if every phase validada AND the final validation passed:
|
|
195
200
|
structured_choice(content: [Marcar plan done, Preguntar algo más], flow: [Compactar, Cerrar])
|
|
196
|
-
mark plan done →
|
|
197
|
-
else: the plan stays open → CHECKPOINT.Next =
|
|
201
|
+
mark plan done → > Estado: done + > Cierre: YYYY-MM-DD · sesión NNN under the title (Delta 6), in place
|
|
202
|
+
else: the plan-level > Estado: stays open → CHECKPOINT.Next = the action that unblocks the phase(s)
|
|
198
203
|
# NO export: artifacts stay in the session; a separate export-* promotes them
|
|
199
204
|
finalize: CHECKPOINT (+ BACKLOG if something is deferred) + close session + report
|
|
200
205
|
```
|
|
@@ -55,6 +55,7 @@ The plan absorbs the `TECHNICAL-NOTE` level **inline** (user decision) + the roa
|
|
|
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 ← plan-level machine state (open | done); plan-exec closes it
|
|
58
59
|
|
|
59
60
|
## Origin source spec · prompt (bootstrapped via spec-new) · "adopted from <source>" + attribution (external plan — /w:plan-new mode 4 / /w:persist)
|
|
60
61
|
## Solution the how (core): 1–2 summary sentences + the AS-IS → TO-BE
|
|
@@ -83,6 +84,8 @@ The plan absorbs the `TECHNICAL-NOTE` level **inline** (user decision) + the roa
|
|
|
83
84
|
|
|
84
85
|
A `### Fn` block is a **verifiable state of the system**, never a list of layers, files or classes. It answers one question: *what can the system do or demonstrate at the end that it could not at the start?* The contract is defined **once** here — [`plan-refine-loop`](../plan-refine-loop/LOOP.md) and [`plan-exec-loop`](../plan-exec-loop/LOOP.md) reference it and never redefine it.
|
|
85
86
|
|
|
87
|
+
**Required — every phase, always:**
|
|
88
|
+
|
|
86
89
|
```markdown
|
|
87
90
|
### F1 — <result-oriented name>
|
|
88
91
|
|
|
@@ -90,28 +93,34 @@ A `### Fn` block is a **verifiable state of the system**, never a list of layers
|
|
|
90
93
|
|
|
91
94
|
**Resultado:** <the new verifiable state of the system>
|
|
92
95
|
|
|
93
|
-
**Recorrido afectado:** <consumer → components → current boundary>
|
|
94
|
-
|
|
95
96
|
**Trabajo:**
|
|
96
97
|
- [ ] T1.1 — <coherent unit of work>
|
|
97
98
|
|
|
98
|
-
**Límite de simulación:** antes <where it is> → después <where it lands, or removed>
|
|
99
|
-
|
|
100
99
|
**Validación de fase:** <the primary proof that the promised state was reached>
|
|
101
100
|
|
|
102
|
-
**Condición de salida:** <falsifiable result · contract preserved
|
|
101
|
+
**Condición de salida:** <falsifiable result · contract preserved>
|
|
102
|
+
```
|
|
103
103
|
|
|
104
|
+
**Conditional — added to that block only when its own condition holds:**
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
**Estado inicial:** <where the phase starts>
|
|
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>
|
|
104
111
|
**Diferido:** <work consciously reserved for another phase>
|
|
105
112
|
```
|
|
106
113
|
|
|
107
|
-
- **
|
|
108
|
-
- **Conditional**: `Estado inicial` (when it is not obvious) · `Recorrido afectado` (distributed change) · `Límite de simulación` (temporary behavior exists) · `Diferido`
|
|
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*).
|
|
109
118
|
|
|
110
119
|
**Phase state = machine state.** One `> Estado: <value>` line directly under the `### Fn` heading; vocabulary `pendiente` | `en ejecución` | `bloqueada` | `validada`, updated **in place**, never duplicated. It is what `aw status` counts (`phases_validated` / `phases_total`), **alongside — not instead of —** the checkbox progress. A phase reaches `validada` only when its work is done, its `Condición de salida` holds, its validation **ran and passed**, and the closing review gate passed. **Never** because all its checkboxes are ticked. *(Legacy plans carry no line at all: `aw status` reports them as zero phases — checkbox progress only. A missing line among stated blocks reads `pendiente`, and nothing is back-filled.)*
|
|
111
120
|
|
|
112
121
|
**The state line carries its value alone** — no comment, no suffix, no annotation; an annotated value reads as `pendiente`. A blocker's reason lives on its own `> Bloqueo: <reason>` line inside the block, and in `CHECKPOINT`, `## Open questions` and `BACKLOG`.
|
|
113
122
|
|
|
114
|
-
|
|
123
|
+
**The plan carries its own state, and it is a different axis.** One `> Estado:` line under the title, vocabulary `open` | `done`, born `open` with the plan; `plan-exec` writes `done` only after the final validation, adding a `> Cierre: YYYY-MM-DD · sesión NNN` line for the date and session (§ *Delta 6* there). `aw status` derives `plan_state` from that declaration **and** both counters: a `done` over open tasks or unvalidated phases reads `inconsistent`, and every phase `validada` with no closure reads `final_validation_pending` — still open. Position disambiguates the two marks: the plan-level one lives under the title, the phase-level one inside its `### Fn` block. *(Legacy: `> Estado: done — YYYY-MM-DD · sesión NNN` is still read; the next legitimate write normalizes it.)*
|
|
115
124
|
|
|
116
125
|
**Granularity is semantic, not mechanical.** A phase earns its place when it leaves a demonstrable state, can be reviewed as a unit, and — when the change carries temporary behavior — moves or retires a simulation. A task is a **coherent unit of purpose** and may touch several files. Naming an edit operation — "create class X", "add method Y", "update the import" — describes a **micro step**: internal to execution, recorded in `CHECKPOINT` when a resume needs it, never a plan entry. `XS–S` stays an orientation of risk and scope; it never mandates splitting a semantic task into mechanical operations.
|
|
117
126
|
|
|
@@ -71,7 +71,9 @@ question that changed nothing, is NOT transcribed.
|
|
|
71
71
|
|
|
72
72
|
> **No gating contract** (unlike spec↔plan): the presence of `## Refinement decisions` in the plan is **audit trace only** — `plan-exec` neither requires nor checks it (it runs any plan). It serves to (a) distinguish a re-refined plan from a freshly generated one on resume, and (b) record what changed and why. *(Legacy plans may also carry `## Q&A traceability`; new runs never write it.)*
|
|
73
73
|
|
|
74
|
-
> **Execution updates progress; refinement changes structure.** `plan-exec` updates the plan's operational state in place — task checkboxes, the phase `> Estado:` line with its `> Bloqueo:` line while blocked, declared deferrals and the
|
|
74
|
+
> **Execution updates progress; refinement changes structure.** `plan-exec` updates the plan's operational state in place — task checkboxes, the phase `> Estado:` line with its `> Bloqueo:` line while blocked, declared deferrals and the plan's own status mark. It does **not** redesign contracts, phase shape or order, participating components, evidence or simulation boundaries: those structural changes are this loop's, and a change of functional behavior belongs to `spec-refine`.
|
|
75
|
+
|
|
76
|
+
> **Normalize on write, never invent.** A save through this loop leaves the document on the current contract. The plan-level `> Estado:` line sits under the title — `open`, unless execution already closed it, and then with the date and session on their own `> Cierre:` line. Each `### Fn` carries its required blocks, and **no conditional block is written empty**: a phase with no temporary behavior gets no `Límite de simulación`, one with nothing excluded gets no `Diferido`. Normalizing is a rewrite of form — it never changes a phase's state, never ticks a box, and never closes a plan.
|
|
75
77
|
|
|
76
78
|
## Delta 2 — Gap taxonomy (of "plan")
|
|
77
79
|
|
|
@@ -46,7 +46,9 @@ Closing *every* gap turns the spec into a premature plan. Close what changes **w
|
|
|
46
46
|
**Adopt, do not repeat.** `spec-new`'s **facts** are reused; its **assumptions** are re-validated **only when one blocks a gap**; its `Open questions` are re-classified by destination; its one-vs-many hypothesis is re-judged at the *Change-shape gate*. The shallow sweep is never re-run wholesale. Keep the labels distinct — a spec that blurs them cannot be gated: **fact** (backed by repo, data or docs) · **inference** (unproven) · **user decision** · **deferred decision** (owner declared) · **open question** (can still move the contract).
|
|
47
47
|
|
|
48
48
|
## Writes
|
|
49
|
-
Updates `docs/specs/NNN-spec-<slug>.md` **in place** (when the user picks `Guardar especificación refinada`): completes sections, **adds** `## Decisions`, closes `Open questions` as they get resolved, and stamps the frontmatter `status: ready-for-plan`. Since it overwrites an existing doc, it asks the user's **confirmation**.
|
|
49
|
+
Updates `docs/specs/NNN-spec-<slug>.md` **in place** (when the user picks `Guardar especificación refinada`): completes sections, **adds** `## Decisions`, closes `Open questions` as they get resolved, and stamps the frontmatter `status: ready-for-plan`. Since it overwrites an existing doc, it asks the user's **confirmation**.
|
|
50
|
+
|
|
51
|
+
> **Not every shape decision creates a file** (§ *Change-shape gate*). An accepted **split** writes the reduced original **and** the extracted sibling specs; a replacement by **`Crear una nueva spec`** writes one new file and leaves this one untouched; **`Reformular esta spec`** creates nothing — it edits this same file, same number, same path. Every write, new or overwriting, is confirmed first.
|
|
50
52
|
|
|
51
53
|
> **Boundary invariant:** this loop writes **only** into `docs/specs`. It never graduates/exports other artifacts to `docs/` — that is separate `export-*` work (chassis § *docs/ boundary*).
|
|
52
54
|
|
|
@@ -82,6 +84,8 @@ When the project already exists, establish the current behavior the change rests
|
|
|
82
84
|
|
|
83
85
|
Runs once the baseline exists and **before** closing details: the investigation can reveal the draft's shape was wrong. Does the spec still carry **one** functional outcome, did its purpose survive, can the delivery be accepted as a unit? The verdict is **one of three shapes** — `same` | `split` | `replace` — each with its own branch; only the last two ask anything.
|
|
84
86
|
|
|
87
|
+
> **Resolved before the gap loop starts, never carried into it (hard rule).** A `split` or a `replace` is asked, answered and applied **immediately** — its own structured-choice, in its own step, between the baseline and the first gap batch. It never travels in `pending_human`: that collection is rebuilt on every iteration and is reserved for questions about functional, technical or scope **gaps**, so a shape decision parked there is erased by the next batch — or never asked at all, because a spec with no blocking gap breaks out of the loop before the batch is built. The resolution lands in `CHECKPOINT` **before** anything else runs, so a resume re-enters with the shape already decided and never re-asks it.
|
|
88
|
+
|
|
85
89
|
- same outcome — more clarity, or more technical components → **`same`**: no shape question, keep refining this spec;
|
|
86
90
|
- independent functional outcomes discovered → **`split`** (below);
|
|
87
91
|
- purpose fundamentally changed → **`replace`** (below);
|
|
@@ -97,6 +101,8 @@ Runs once the baseline exists and **before** closing details: the investigation
|
|
|
97
101
|
- **New spec:** this one is **preserved**, its purpose never silently rewritten; the new one is minted with `aw next-number docs/specs`, born **`status: draft`**, its `## Origin` recording the origin spec, the replaced purpose and the user's decision. Its path goes to the `CHECKPOINT`; the run closes reporting `/w:spec-refine <new path>` as the next step.
|
|
98
102
|
- **Reformulate:** same number/path, the work treated as `refining` while rewritten; baseline, gap classification and the *ready-for-plan gate* run again over the new purpose; `status` is stamped only on the save that follows the passing gate, and the material decision lands in `## Decisions`.
|
|
99
103
|
|
|
104
|
+
**Every branch has a way out that changes nothing.** The `flow` control present on every structured-choice (chassis) is that exit here: `Cerrar` closes the run **without applying the shape change** — no sibling minted, no spec reformulated, the document untouched and the decision recorded in `CHECKPOINT` as declined. And no branch writes a file without the user's confirmation: minting siblings and minting a replacement both go through the same confirm-before-write rule as an in-place save.
|
|
105
|
+
|
|
100
106
|
Neither branch adds a `superseded` status or archives the replaced spec: a historical close needs its own runtime contract, out of scope here.
|
|
101
107
|
|
|
102
108
|
## Deliverable schema (the spec, edited in place)
|
|
@@ -193,15 +199,23 @@ spec-refine-loop(spec):
|
|
|
193
199
|
adopt(spec-new facts + assumptions + open questions + conversation) # never re-derive (§ Reads)
|
|
194
200
|
baseline = resolve_current_behavior(work) # inline research, ONLY what the change rests on
|
|
195
201
|
shape = change_shape_gate(work, baseline) # BEFORE closing details → same | split | replace
|
|
196
|
-
if shape
|
|
197
|
-
|
|
202
|
+
if shape != same: # RESOLVED HERE — never queued into pending_human
|
|
203
|
+
ans = structured_choice(content: [the offer of THIS branch], # split and replace never share labels
|
|
204
|
+
flow: [Compactar, Cerrar])
|
|
205
|
+
write CHECKPOINT (the decision + its consequence) # BEFORE acting: a resume re-enters already decided
|
|
206
|
+
flow Cerrar → goto finalize # closed without applying the change; the spec stays untouched
|
|
207
|
+
`Una sola spec` → shape resolved as same; keep refining this spec
|
|
208
|
+
`Dividir en varias specs` → the accepted cut is fixed now; its writes wait for `Guardar specs`
|
|
209
|
+
`Crear una nueva spec` → mint draft with confirmation (## Origin) ; THIS spec untouched ;
|
|
210
|
+
CHECKPOINT.Next = refine it ; goto finalize
|
|
211
|
+
`Reformular esta spec` → same number/path ; re-run baseline + this gate before any stamp
|
|
198
212
|
attempts = {} # anti re-fire per gap
|
|
199
213
|
repeat:
|
|
200
214
|
gaps = classify_by_destination(detect_gaps(work)) minus the "exhausted" gaps
|
|
201
215
|
record(gaps.plan_owned + gaps.deferrable) → ## Open questions with destination # never closed here
|
|
202
216
|
blocking = gaps.spec_blocking
|
|
203
217
|
if blocking == ∅: break
|
|
204
|
-
batch = top ≤3 blocking ; pending_human = []
|
|
218
|
+
batch = top ≤3 blocking ; pending_human = [] # gap questions ONLY — the shape was resolved above
|
|
205
219
|
seed CHECKPOINT.Pending/Next = batch (refine_session) # BEFORE: seed the intent (artifact-first)
|
|
206
220
|
for each gap in batch:
|
|
207
221
|
if gap = UI (requirement involves UI, ## UI spec missing):
|
|
@@ -222,9 +236,7 @@ spec-refine-loop(spec):
|
|
|
222
236
|
switch(flow):
|
|
223
237
|
Compactar → write CHECKPOINT (refine_session) ; compact(harness) ; continue
|
|
224
238
|
Cerrar → goto finalize
|
|
225
|
-
work = integrate(work, ans) # → Decisions / Open questions
|
|
226
|
-
accepted `Crear una nueva spec` → mint draft (## Origin) ; this one untouched ; CHECKPOINT.Next = refine it ; goto finalize
|
|
227
|
-
accepted `Reformular esta spec` → same number/path ; re-run baseline + gaps + ready-for-plan gate before any stamp
|
|
239
|
+
work = integrate(work, ans) # → Decisions / Open questions
|
|
228
240
|
ideation offer accepted → run the round NOW, then its verdicts as a NEW ≤3+flow batch (§ Ideation gate)
|
|
229
241
|
ideation offer declined → mark that gap exhausted # anti re-fire; on-demand entry stays open
|
|
230
242
|
# no BLOCKING gaps → ready-for-plan gate = Success criteria green (read-only) before offering Guardar:
|
|
@@ -247,6 +259,7 @@ finalize:
|
|
|
247
259
|
Full mechanism (3 cases, `Compactar`, re-run on demand with `--reopen`) in the chassis (§ *Compact / resume*). SPEC keys:
|
|
248
260
|
|
|
249
261
|
- The **prior-work mark** is the frontmatter `status: ready-for-plan` (legacy specs: `## Refinement decisions`, older ones also `## Q&A traceability`).
|
|
262
|
+
- The **shape decision survives a resume.** It is written to `CHECKPOINT` the moment it is taken, before anything acts on it, so a compact, a `Cerrar` or a crash between the gate and the save re-enters with the shape settled — the gate is not re-run and the question is not re-asked. Only a *new* run over a spec whose baseline changed re-opens it.
|
|
250
263
|
- Re-refining on demand is a **first-class operation** while the flow stays in SPEC (new requirements, scope changes, after re-reading the spec): it always reads the **spec itself**, incremental re-refinement; on `Guardar`, edits in place with confirmation.
|
|
251
264
|
- **Legacy migration happens only here.** A re-refined legacy spec runs the gate like any other; on `Guardar`, its `## Refinement decisions` is renamed `## Decisions` and pruned to the material decisions — **in the same write that stamps `status`**, so the spec is never left with no mark. Specs nobody re-refines are not migrated.
|
|
252
265
|
- **`Cerrar` before converging leaves the spec untouched**: the progress lives in the `CHECKPOINT`, and `status` is neither invented nor downgraded. `refining` is understood **on read** (a hand-written spec may declare it) — this loop never writes a partial spec.
|