@tacuchi/agent-workflow-cli 20.21.0 → 20.23.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/adapters/git-cli.js +42 -0
- package/dist/adapters/git-cli.js.map +1 -1
- package/dist/application/artifacts-service.js +5 -5
- package/dist/application/artifacts-service.js.map +1 -1
- package/dist/application/checkpoint-service.js +60 -55
- package/dist/application/checkpoint-service.js.map +1 -1
- package/dist/application/checkpoint-write-service.js +61 -66
- package/dist/application/checkpoint-write-service.js.map +1 -1
- package/dist/application/decisiones-service.js +5 -5
- package/dist/application/decisiones-service.js.map +1 -1
- package/dist/application/export-service.js +250 -0
- package/dist/application/export-service.js.map +1 -0
- package/dist/application/fix-git-service.js +244 -0
- package/dist/application/fix-git-service.js.map +1 -0
- package/dist/application/history-update-service.js +35 -24
- package/dist/application/history-update-service.js.map +1 -1
- package/dist/application/lifecycle-target.js +39 -0
- package/dist/application/lifecycle-target.js.map +1 -0
- 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/parsers/spec-relation.js +80 -0
- package/dist/application/parsers/spec-relation.js.map +1 -0
- package/dist/application/paths-service.js +8 -0
- package/dist/application/paths-service.js.map +1 -1
- package/dist/application/persist-service.js +285 -0
- package/dist/application/persist-service.js.map +1 -0
- package/dist/application/release-data/artifacts.js +17 -21
- package/dist/application/release-data/artifacts.js.map +1 -1
- package/dist/application/resume-service.js +184 -0
- package/dist/application/resume-service.js.map +1 -0
- package/dist/application/semantic-operation/protocol.js +247 -0
- package/dist/application/semantic-operation/protocol.js.map +1 -0
- package/dist/application/semantic-operation/publish.js +80 -0
- package/dist/application/semantic-operation/publish.js.map +1 -0
- package/dist/application/session-binding-service.js +125 -0
- package/dist/application/session-binding-service.js.map +1 -0
- package/dist/application/session-close-service.js +60 -39
- package/dist/application/session-close-service.js.map +1 -1
- package/dist/application/session-create-service.js +45 -19
- package/dist/application/session-create-service.js.map +1 -1
- package/dist/application/session-resolver.js +180 -44
- package/dist/application/session-resolver.js.map +1 -1
- package/dist/application/session-resume-service.js +39 -9
- package/dist/application/session-resume-service.js.map +1 -1
- package/dist/application/sessions-service.js +0 -2
- package/dist/application/sessions-service.js.map +1 -1
- package/dist/application/status-service.js +24 -352
- package/dist/application/status-service.js.map +1 -1
- package/dist/application/tasks-service.js +5 -5
- package/dist/application/tasks-service.js.map +1 -1
- package/dist/application/workline-index-service.js +510 -0
- package/dist/application/workline-index-service.js.map +1 -0
- package/dist/cli/commands/checkpoint-read.js +10 -6
- package/dist/cli/commands/checkpoint-read.js.map +1 -1
- package/dist/cli/commands/checkpoint-write.js +38 -11
- package/dist/cli/commands/checkpoint-write.js.map +1 -1
- package/dist/cli/commands/export.js +117 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/fix-git.js +109 -0
- package/dist/cli/commands/fix-git.js.map +1 -0
- package/dist/cli/commands/generate-launch.js +35 -3
- package/dist/cli/commands/generate-launch.js.map +1 -1
- package/dist/cli/commands/history-update.js +1 -1
- package/dist/cli/commands/history-update.js.map +1 -1
- package/dist/cli/commands/index.js +11 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/persist.js +67 -0
- package/dist/cli/commands/persist.js.map +1 -0
- package/dist/cli/commands/resume-summary.js +14 -3
- package/dist/cli/commands/resume-summary.js.map +1 -1
- package/dist/cli/commands/resume.js +73 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/session-artifacts.js +12 -11
- package/dist/cli/commands/session-artifacts.js.map +1 -1
- package/dist/cli/commands/session-close.js +8 -7
- package/dist/cli/commands/session-close.js.map +1 -1
- package/dist/cli/commands/session-create.js +5 -1
- package/dist/cli/commands/session-create.js.map +1 -1
- package/dist/cli/commands/session-resume.js +16 -10
- package/dist/cli/commands/session-resume.js.map +1 -1
- package/dist/cli/commands/status.js +66 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/workspace-init.js +21 -2
- package/dist/cli/commands/workspace-init.js.map +1 -1
- package/dist/cli/context-id.js +133 -0
- package/dist/cli/context-id.js.map +1 -0
- package/dist/cli/help-groups.js +16 -1
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/main.js +44 -16
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output-mode.js +41 -0
- package/dist/cli/output-mode.js.map +1 -0
- package/dist/cli/parser.js +6 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli/render.js +53 -0
- package/dist/cli/render.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +3 -1
- package/skills/w/commands/export-diagrams.md +19 -10
- package/skills/w/commands/export-manuals.md +20 -10
- package/skills/w/commands/export-reports.md +20 -11
- package/skills/w/commands/export-scripts.md +20 -10
- package/skills/w/commands/fix-git.md +31 -12
- package/skills/w/commands/generate-launch.md +1 -1
- package/skills/w/commands/persist.md +33 -68
- package/skills/w/commands/plan-new.md +1 -1
- package/skills/w/commands/resume.md +25 -41
- package/skills/w/commands/spec-refine.md +12 -0
- package/skills/w/commands/status.md +12 -40
- package/skills/w/commands/workspace-init.md +3 -3
- package/skills/w/hooks/README.md +21 -2
- package/skills/w/hooks/hooks.template.json +2 -2
- 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/skills/w/roles/git/ROLE.md +7 -8
|
@@ -1,101 +1,66 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use when work already produced in this conversation (analysis, conclusions, a plan) should be saved into docs/ — classifies its shape and routes it. analysis → docs/research/ · requirement → spec draft (docs/specs) · plan → plan adoption (docs/plans). Transversal (no flow, no loop, no session); records ## Origin + attribution
|
|
2
|
+
description: Use when work already produced in this conversation (analysis, conclusions, a plan) should be saved into docs/ — classifies its shape and routes it. analysis → docs/research/ · requirement → spec draft (docs/specs) · plan → plan adoption (docs/plans). Backed by `aw persist`, which owns the inventory, the anti-duplicate check, the numbering, the destination and the write. Transversal (no flow, no loop, no session); records ## Origin + attribution.
|
|
3
3
|
argument-hint: [what to persist — empty = the conversation's latest finished deliverable]
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
7
7
|
"Read",
|
|
8
|
-
"Write",
|
|
9
|
-
"Edit",
|
|
10
8
|
]
|
|
11
9
|
---
|
|
12
10
|
|
|
13
11
|
# persist — persist in-conversation work into `docs/`
|
|
14
12
|
|
|
15
|
-
Captures **work already produced in this conversation** — with or without host-native features (a `/goal` run, plan mode, plain chat analysis) — and persists it into `docs/`, classified by shape.
|
|
13
|
+
Captures **work already produced in this conversation** — with or without host-native features (a `/goal` run, plan mode, plain chat analysis) — and persists it into `docs/`, classified by shape. The explicit form of *direct no-flow authoring* (`../SKILL.md` § *Operating context*, row 3) and the doctrinal entry for **host as producer** (`../loops/CHASSIS.md` § *Adopted context*). The host→`docs/` counterpart of `export-*`.
|
|
16
14
|
|
|
17
15
|
> **Hard floor — applies even if you read nothing beyond this file:**
|
|
18
16
|
>
|
|
19
17
|
> 1. **Adopt, don't re-derive** — single pass, **NO RESEARCH**: transcribe/organize what the conversation already established. New investigation is flow work (`spec-refine`, `quick`), never this command's.
|
|
20
|
-
> 2. **
|
|
21
|
-
> 3. **
|
|
22
|
-
> 4. **
|
|
18
|
+
> 2. **You classify and write; the CLI decides everything else** — inventory, anti-duplicate, numbering, destination, authorization and the write itself belong to `aw persist`. Never write into `docs/` with a file tool here; `Write`/`Edit` are deliberately not in `allowed-tools`.
|
|
19
|
+
> 3. **Never invent the number** — the `NNN` you put in the path is consultative; `apply` reassigns it inside the lock. Do not renumber it.
|
|
20
|
+
> 4. **Confirm before writing** — classification and destination go through **structured-choice**; `apply` refuses without the digest `validate` returned. **Never creates sessions** (sessions are loop-created only).
|
|
21
|
+
> 5. **Language** — headings in English (parse contract); content in the **user's language**.
|
|
23
22
|
|
|
24
23
|
## Input
|
|
25
24
|
|
|
26
|
-
`$ARGUMENTS` names what to persist (or is empty → the conversation's most recent finished deliverable). The **source is the conversation itself
|
|
25
|
+
`$ARGUMENTS` names what to persist (or is empty → the conversation's most recent finished deliverable). The **source is the conversation itself**. If nothing persistable exists yet, say so and stop — do not manufacture content.
|
|
27
26
|
|
|
28
|
-
##
|
|
29
|
-
|
|
30
|
-
Classify the content by **shape**, recommend the route, confirm via structured-choice:
|
|
31
|
-
|
|
32
|
-
| Shape | Signals | Route |
|
|
33
|
-
|---|---|---|
|
|
34
|
-
| **Analysis / conclusions / design notes** | findings, comparisons, diagnoses, adjudications, recommendations | `docs/research/NNN-research-<slug>.md` (schema below) |
|
|
35
|
-
| **Requirement** | describes a *wish*: what should exist/change, acceptance criteria derivable | **spec draft** via the [`spec-new`](spec-new.md) procedure (same schema, same NO RESEARCH), `## Origin` = "adopted from host conversation" → offer `/w:spec-refine` |
|
|
36
|
-
| **Plan** | already answers the *how*: phases/tasks/solution — e.g. the host plan-mode output | **plan adoption** via [`plan-new`](plan-new.md) § *Input resolution* mode 4 (`docs/plans/PPP-plan-<slug>.md`) → offer `/w:plan-refine` / `/w:plan-exec` |
|
|
37
|
-
| Mixed / ambiguous | e.g. analysis that ends in a requirement | structured-choice between the candidate routes (split is a valid option: research doc + spec draft referencing it) |
|
|
38
|
-
|
|
39
|
-
Requires a **workspace** (`docs/` is the managed surface). Without one → degrade: propose `/w:workspace-init` or ask for an explicit destination path.
|
|
40
|
-
|
|
41
|
-
## `docs/research/` — the analysis home (owned by this command)
|
|
42
|
-
|
|
43
|
-
`docs/research` hosts standalone analyses: neither spec nor plan, but worth keeping. Written by this command (or by direct no-flow authoring following this same schema). Belongs to **no flow**; `export-*` never writes it; loops never read it implicitly (a flow uses it by **reference** — e.g. cited in a spec's `## Origin` or a quick prompt).
|
|
44
|
-
|
|
45
|
-
```markdown
|
|
46
|
-
# Research NNN — <slug>
|
|
47
|
-
|
|
48
|
-
## Origin
|
|
49
|
-
adopted from host conversation — <host> · <model> · <YYYY-MM-DD>
|
|
50
|
-
(what prompted the analysis: goal, prior doc, question)
|
|
27
|
+
## Run
|
|
51
28
|
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
1. `aw persist prepare --format human` (`--detail` prints the full response contract). Returns the inventory of the three categories, the consultative numbering, the allowed destinations, the limits and an `input_digest`.
|
|
30
|
+
2. **Classify and write.** Compose one JSON answer:
|
|
31
|
+
- `version`, `operation`, `input_digest` copied **verbatim** from the request;
|
|
32
|
+
- `state`: `proposed`, or `ambiguous` when the inventory already holds this work (explain in `reason` — the CLI turns that into a question, never a write);
|
|
33
|
+
- `decisions`: `{ category, slug, mode }`, plus `target` + `target_digest` when `mode` is `update`;
|
|
34
|
+
- `artifacts`: exactly one `{ path, content }`.
|
|
35
|
+
3. `echo '<json>' | aw persist validate --format human` → preview + `approval_digest`.
|
|
36
|
+
4. **Confirm classification and destination** with the user via structured-choice, showing that preview.
|
|
37
|
+
5. `echo '<json>' | aw persist apply --approval <digest> --format human`.
|
|
54
38
|
|
|
55
|
-
|
|
56
|
-
The analysis, transcribed/organized (not re-derived).
|
|
39
|
+
Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
|
|
57
40
|
|
|
58
|
-
##
|
|
59
|
-
The settled conclusions — actionable, falsifiable where possible.
|
|
60
|
-
|
|
61
|
-
## Perspectives (opt. — multi-agent)
|
|
62
|
-
### <host · model · YYYY-MM-DD>
|
|
63
|
-
An additional agent's view on the same objective (see below).
|
|
64
|
-
|
|
65
|
-
## Sources (opt.)
|
|
66
|
-
Docs / repos / prior research docs referenced (for a synthesis: the N crossed docs).
|
|
67
|
-
|
|
68
|
-
## Open questions (opt.)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Anti-duplicate → update vs sibling perspective
|
|
72
|
-
|
|
73
|
-
Before writing, scan `docs/research/*-research-*.md` for a doc whose `## Origin`/`## Objective` matches this objective. If one exists, **never** silently create a second: structured-choice —
|
|
74
|
-
|
|
75
|
-
- **`Actualizar`** *(recommended when it is the same line of thought)* — correct/extend the existing doc in place (confirmation to overwrite).
|
|
76
|
-
- **`Agregar perspectiva`** — append a `### <host · model · date>` subsection under `## Perspectives`: same objective, **different agent's view** (this is intentional and legitimate — the multi-host pattern below).
|
|
77
|
-
- **`Documento nuevo`** — only if the objective genuinely differs.
|
|
41
|
+
## Classification → routing
|
|
78
42
|
|
|
79
|
-
|
|
43
|
+
| Shape | Signals | Category → destination |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| **Analysis / conclusions / design notes** | findings, comparisons, diagnoses, adjudications, recommendations | `research` → `docs/research/NNN-research-<slug>.md` |
|
|
46
|
+
| **Requirement** | describes a *wish*: what should exist/change, acceptance criteria derivable | `spec` → `docs/specs/NNN-spec-<slug>.md`, born `status: draft`, `## Origin` = "adopted from host conversation" → offer `/w:spec-refine` |
|
|
47
|
+
| **Plan** | already answers the *how*: phases/tasks/solution — e.g. the host plan-mode output | `plan` → `docs/plans/NNN-plan-<slug>.md` (adoption, [`plan-new`](plan-new.md) § *Input resolution* mode 4) → offer `/w:plan-refine` / `/w:plan-exec` |
|
|
48
|
+
| Mixed / ambiguous | e.g. analysis that ends in a requirement | one `persist` per document, each confirmed; a research doc plus a spec draft that cites it is a valid split |
|
|
80
49
|
|
|
81
|
-
|
|
50
|
+
Requires a **workspace** (`docs/` is the managed surface). Without one → degrade: propose `/w:workspace-init`.
|
|
82
51
|
|
|
83
|
-
|
|
84
|
-
2. **The final cross**: the user picks the strongest host; its input is the N research docs/perspectives (referenced explicitly in the prompt or via this command's argument). The synthesis persists as a **new research doc** whose `## Origin` states "synthesis" and whose `## Sources` lists every doc/perspective crossed — attribution lets it weigh who concluded what.
|
|
85
|
-
3. Sessions stay **out** of the exchange path — no concurrent-session doctrine is needed; hosts meet only in `docs/`.
|
|
52
|
+
## `docs/research/` — the analysis home (owned by this command)
|
|
86
53
|
|
|
87
|
-
|
|
54
|
+
`docs/research` hosts standalone analyses: neither spec nor plan, but worth keeping. Belongs to **no flow**; `export-*` never writes it; loops never read it implicitly (a flow uses it by **reference** — cited in a spec's `## Origin` or a quick prompt). It is git-shareable, unlike sessions (gitignored, machine-local, loop-owned), which makes it the exchange surface for **N agents analyzing the same situation**.
|
|
88
55
|
|
|
89
|
-
|
|
90
|
-
- **Not a flow** — no loop, no session, no `CHECKPOINT`; single pass.
|
|
91
|
-
- **Not research** — it investigates nothing (NO RESEARCH); it persists what already exists.
|
|
56
|
+
> **Anti-duplicate is a decision, not an accident.** The inventory carries each existing document's summary and digest. Same work already there → `mode: "update"` (proving you saw the current bytes via `target_digest`) or `state: "ambiguous"` so the user chooses between updating and writing a sibling perspective. A second near-identical document is never created silently.
|
|
92
57
|
|
|
93
58
|
## Plan mode
|
|
94
59
|
|
|
95
|
-
|
|
60
|
+
Describe the classification, the destination and the document it would write. Running `prepare` is fine (read-only); never `apply`.
|
|
96
61
|
|
|
97
62
|
## Resources
|
|
98
63
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
64
|
+
- CLI: `aw persist prepare | validate | apply` (service `persist-service` over `semantic-operation/`)
|
|
65
|
+
- Siblings: the four `export-*` commands (session → `docs/`), same handshake
|
|
66
|
+
- Design reference: `docs/referencias/workflow-skills/persist.md`
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use when the user asks to resume or pick up pending work — a half-done session, a spec to refine, a plan mid-execution
|
|
3
|
-
argument-hint: "[docs/specs/… | docs/plans/… | session
|
|
2
|
+
description: Use when the user asks to resume or pick up pending work — a half-done session, a spec to refine, a plan mid-execution. Backed by `aw resume`, which derives the priority, the progress and the exact re-entry command from the Workline index. An artifact argument (spec, plan or session) skips the survey. Transversal (not a flow), read-only; never touches docs/ or .workflow/.
|
|
3
|
+
argument-hint: "[docs/specs/… | docs/plans/… | NNN | --code <session>]"
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
@@ -10,60 +10,44 @@ allowed-tools:
|
|
|
10
10
|
|
|
11
11
|
# resume — pick up pending work (transversal)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Single-pass, **read-only**: no loop, no session, writes nothing in `docs/` or `.workflow/`. **Transversal** command (belongs to no SPEC/PLAN/QUICK flow). The actionable sibling of `/w:status`: same index, but it answers *what to pick up* instead of *what exists*.
|
|
14
14
|
|
|
15
|
-
> **Not `aw session-resume` / `aw resume-summary
|
|
15
|
+
> **Not `aw session-resume` / `aw resume-summary`.** Those are internal session mechanics (reopen a session; the PostCompact payload). `aw resume` is the user-facing command.
|
|
16
16
|
|
|
17
17
|
> **Hard floor — applies even if you read nothing beyond this file:**
|
|
18
18
|
>
|
|
19
|
-
> 1. **Read-only** — never execute the
|
|
20
|
-
> 2. **
|
|
21
|
-
> 3. **Ask via structured-choice**
|
|
22
|
-
> 4. **Language** —
|
|
23
|
-
|
|
24
|
-
## Directed resume (optional argument)
|
|
25
|
-
|
|
26
|
-
`$ARGUMENTS` may name an artifact: a spec (`docs/specs/NNN-spec-<slug>.md`), a plan (`docs/plans/PPP-plan-<slug>.md`) or a session (`NNN` code or `NNN-<slug>-<flow>` folder). Empty → the survey flow below (`## Run`). With an argument:
|
|
27
|
-
|
|
28
|
-
1. **Derive the slug** from the artifact name (session code `NNN` → resolve the folder via `aw sessions --state all`).
|
|
29
|
-
2. **Locate the candidate sessions**: `aw sessions --state all` (and `aw resume-summary --include-recent-closed` for checkpoint detail) filtered by that slug.
|
|
30
|
-
3. **Confirm by `## Origin`**: read the candidates' `SESSION.md` — the `## Origin` names the spec/plan the session came from; it, not the slug match, decides the association.
|
|
31
|
-
4. **Propose the exact route** via structured-choice, per the `## Routing` table with the artifact's path filled in (`Retomar` recommended, `Descartar`/`Cerrar` secondary). No candidate session and no clear stage → say so and fall back to the survey flow.
|
|
32
|
-
|
|
33
|
-
Same hard floor: this mode **proposes** the route — it never starts the target command itself.
|
|
19
|
+
> 1. **Read-only** — never execute the proposed route, with or without an argument. The CLI hands back a command string; the user drives it.
|
|
20
|
+
> 2. **Never re-decide** — priority, ties, the spec→plan relation and the exact command come from the CLI. Do not re-sort by date, do not associate a session to a plan by slug, do not pick a winner the CLI left tied.
|
|
21
|
+
> 3. **Ask via structured-choice** when the CLI returns candidates, never otherwise.
|
|
22
|
+
> 4. **Language** — user-facing output in the **user's language**.
|
|
34
23
|
|
|
35
24
|
## Run
|
|
36
25
|
|
|
37
|
-
1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Priority: **session+CHECKPOINT > plan half-done > spec not ready > host context**.
|
|
26
|
+
1. Run `aw resume --format human`, forwarding the argument when there is one:
|
|
27
|
+
- a doc path or number → pass it as the positional (`aw resume docs/plans/009-plan-x.md`);
|
|
28
|
+
- a session → `aw resume --code <NNN | folder>`;
|
|
29
|
+
- nothing → no argument, and the CLI walks the pipeline.
|
|
30
|
+
2. **Relay the output verbatim.** It already carries the objective, the progress or checkpoint, the next pending step or blocker, and the exact command.
|
|
31
|
+
3. **When the CLI returns candidates**, present them as a structured-choice, one option per candidate, in the order given — the CLI declares a tie precisely because there is no correct automatic winner. Add the `flow` control. Never break the tie yourself.
|
|
32
|
+
4. **When it returns nothing pending**, say so and stop. Do not ask.
|
|
33
|
+
5. **Host context (optional).** If nothing is pending at the Workline level and the host exposes cheap host-memory ([`../harness/HARNESS.md`](../harness/HARNESS.md) § *host-memory*), you may add a short note about recent focus. Never expensive, never blocking.
|
|
47
34
|
|
|
48
|
-
|
|
35
|
+
## What the CLI decides (do not re-derive)
|
|
49
36
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| plan half-done — open checkboxes **or** phases not `validada` | `/w:plan-exec` | `Cerrar` |
|
|
55
|
-
| active session with CHECKPOINT | continue / reopen (`aw session-resume --reopen`) | `Cerrar` |
|
|
56
|
-
| host context only (no workline) | best next step for what was found | `Descartar` |
|
|
37
|
+
- **Priority**: spec sin refinar → spec `ready-for-plan` sin plan → plan incompleto → checkpoint no asociado. Within plans, one already started outranks an untouched one.
|
|
38
|
+
- **Ties**: same priority and same progress → candidates. Date and age never break a tie.
|
|
39
|
+
- **The spec→plan relation**: proven by the plan's `Derived from` header, an explicit spec path in its `## Origin`, or an unambiguous `Spec NNN` there — never by slug. A plan whose provenance is unproven leaves its spec visible as still unplanned.
|
|
40
|
+
- **The route**: `/w:spec-refine`, `/w:plan-new`, `/w:plan-exec`, or `aw session-resume --reopen`, with the path already filled in.
|
|
57
41
|
|
|
58
|
-
|
|
42
|
+
> A plan is not finished because its boxes are ticked. `aw resume` re-enters at the first phase that is not `validada`, reports a `bloqueada` phase with its declared reason, and, when everything is green but the plan never closed, says the final validation is what remains. A plan that declares `done` over open work comes back as inconsistent — repair before implementing.
|
|
59
43
|
|
|
60
44
|
## Plan mode
|
|
61
45
|
|
|
62
|
-
Read-only already:
|
|
46
|
+
Read-only already: run `aw resume --format human` and describe the proposal (and the choice it would offer), without asking or writing.
|
|
63
47
|
|
|
64
48
|
## Resources
|
|
65
49
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
50
|
+
- CLI: `aw resume` (service `resume-service` over `workline-index-service`) · sibling `aw status`
|
|
51
|
+
- Session mechanics: `aw session-resume --code <NNN> [--reopen]` · `aw resume-summary`
|
|
68
52
|
- Continuity rule: [`../SKILL.md`](../SKILL.md) § *Operating context*
|
|
69
53
|
- Design reference: `docs/referencias/workflow-skills/resume.md`
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Use when the user asks "what's the state", "what got done", or "where are we". Read-only workspace dashboard —
|
|
3
|
-
argument-hint: (no arguments)
|
|
2
|
+
description: Use when the user asks "what's the state", "what got done", or "where are we". Read-only workspace dashboard — the pending pipeline by default, the full history under detail — optionally enriched with host context when the host exposes cheap memory. Backed by `aw status`. Transversal command (not a flow); writes nothing.
|
|
3
|
+
argument-hint: (no arguments — pass `detalle` for the full inventory)
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
@@ -10,55 +10,27 @@ allowed-tools:
|
|
|
10
10
|
|
|
11
11
|
# status — workspace state (read-only)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Single-pass, read-only: no loop, no sessions, writes nothing in `docs/` or `.workflow/`. **Transversal** command (belongs to no flow).
|
|
14
14
|
|
|
15
15
|
## Run
|
|
16
16
|
|
|
17
|
-
1. Run `aw status`
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
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 with pending tasks (`tasks_total − tasks_done`) or phases still to validate (`phases_total − phases_validated`); specs whose `status` is `draft` or `refining`; specs with `open_questions > 0`.
|
|
22
|
-
- `▸ DESCARTÓ` — every item in `discarded[]` (`kind: deferred` = deferred in BACKLOG; `kind: excluded` = excluded in CHECKPOINT), with its `text`.
|
|
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. 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`.
|
|
25
|
-
6. **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.
|
|
17
|
+
1. Run `aw status --format human` — add `--detail` when the user asked for the full inventory ("detalle", "todo", "historial").
|
|
18
|
+
2. **Relay its output verbatim.** The CLI already selects, filters, groups and humanizes the dates; re-rendering it here is what made the two drift apart. Do not paraphrase it, do not re-sort it, do not add or drop a line.
|
|
19
|
+
3. **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. No cheap host memory → **omit the section silently**. Never run an expensive transcript scan and **never ask**.
|
|
26
20
|
|
|
27
|
-
> **
|
|
21
|
+
> **The default view is what is LEFT TO DO** — unrefined specs, refined specs with no plan, plans not `done`. Finished history, sessions and discarded items are still in the model; `--detail` brings them back. If the user asks about something the default hides, re-run with `--detail` instead of explaining its absence.
|
|
28
22
|
|
|
29
|
-
> **
|
|
23
|
+
> **Automation reads JSON.** Through a pipe, and with `--json` or `--format json`, `aw status` emits the same machine-readable envelope it always has. `--detail` belongs to the human projection only.
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
Workspace: <name>
|
|
35
|
-
|
|
36
|
-
▸ HECHO
|
|
37
|
-
• plan <slug> — <done>/<total> tareas (<pct>%) · <validadas>/<fases> fases validadas · <relative>
|
|
38
|
-
• spec <slug> — lista para plan · <relative>
|
|
39
|
-
• <folder> (<type>) — cerrada · <relative>
|
|
40
|
-
|
|
41
|
-
▸ FALTA
|
|
42
|
-
• <folder> (<type>) — activa · <relative>
|
|
43
|
-
• plan <slug> — <pendientes> tareas pendientes · <sin validar> fases sin validar
|
|
44
|
-
• spec <slug> — borrador · <relative>
|
|
45
|
-
• spec <slug> — <n> preguntas abiertas
|
|
46
|
-
|
|
47
|
-
▸ DESCARTÓ
|
|
48
|
-
• <text> (<kind>) · <relative>
|
|
49
|
-
|
|
50
|
-
▸ CONTEXTO DEL HOST (solo si hay memoria barata; se omite si no)
|
|
51
|
-
• <foco reciente / hilo relevante>
|
|
52
|
-
```
|
|
25
|
+
Uninitialized workspace (`initialized: false`, everything empty) → say the folder is not an agent-workflow workspace and suggest `/w:workspace-init`.
|
|
53
26
|
|
|
54
27
|
## Plan mode
|
|
55
28
|
|
|
56
|
-
Same as execution:
|
|
29
|
+
Same as execution: `aw status --format human` is read-only. There are no changes to apply.
|
|
57
30
|
|
|
58
31
|
## Resources
|
|
59
32
|
|
|
60
|
-
- CLI: `aw status` (service `status-service`; dates via `humanize-es`)
|
|
33
|
+
- CLI: `aw status` (index `workline-index-service`, projection `status-service`; dates via `humanize-es`)
|
|
34
|
+
- Sibling: `aw resume` — what to pick up next, from the same index
|
|
61
35
|
- Capability: `host-memory` ([`../harness/HARNESS.md`](../harness/HARNESS.md)) — cheap tier only, opportunistic, silent-omit, never asks
|
|
62
36
|
- Design reference: `docs/referencias/workflow-skills/status.md`
|
|
63
|
-
|
|
64
|
-
> **Note:** the host-context section is an opportunistic addendum — originally `/status` was a pure `aw status` dashboard. It composes the `host-memory` capability and is purely additive (the fast dashboard is unchanged).
|
|
@@ -5,8 +5,6 @@ allowed-tools:
|
|
|
5
5
|
[
|
|
6
6
|
"Bash",
|
|
7
7
|
"Read",
|
|
8
|
-
"Write",
|
|
9
|
-
"Edit",
|
|
10
8
|
]
|
|
11
9
|
---
|
|
12
10
|
|
|
@@ -15,9 +13,11 @@ allowed-tools:
|
|
|
15
13
|
Runs `aw workspace-init` to turn the current folder into a Workline workspace. A workspace has **1+ sources** (repos); "standalone" = a single source. There are no project/hub modes — the model is unified.
|
|
16
14
|
|
|
17
15
|
```bash
|
|
18
|
-
aw workspace-init --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run]
|
|
16
|
+
aw workspace-init --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run] --format human
|
|
19
17
|
```
|
|
20
18
|
|
|
19
|
+
> **The CLI writes; this wrapper does not.** Every file below is created by `aw workspace-init` — `Write` and `Edit` are deliberately absent from `allowed-tools`. Use `--dry-run` to show the user what would land, then re-run without it. Relay the CLI's output instead of re-rendering it.
|
|
20
|
+
|
|
21
21
|
## Interactive steps
|
|
22
22
|
|
|
23
23
|
1. **Detect/confirm sources** — the CLI detects the repo path(s); the user confirms aliases, paths and branches. Multiple `--source` accepted.
|
package/skills/w/hooks/README.md
CHANGED
|
@@ -11,8 +11,27 @@
|
|
|
11
11
|
| `PreToolUse` (`execute_sql`) | `hook sql-mutation-guard` | Blocks DML/DDL over MCP — reads only (DB scripts-only invariant). |
|
|
12
12
|
| `PreToolUse` (Bash) | `hook git-commit-advisor` | **Advisory (does not block)**: warns if a `git commit` message lacks the active session's `sessionNNN` tag (traceability). Does **not** inspect `push`/`--amend`/`--no-verify`. |
|
|
13
13
|
| `SessionEnd` | `auto-compact-on-close` | Writes `CHECKPOINT.md` on close — the resume key (*CHECKPOINT always* — chassis § Convergence / exit). |
|
|
14
|
-
| `PreCompact` | `checkpoint-write` | Writes `CHECKPOINT.md` before the host compacts. |
|
|
15
|
-
| `PostCompact` | `resume-summary` | Recovers the
|
|
14
|
+
| `PreCompact` | `checkpoint-write --can-pause` | Writes `CHECKPOINT.md` before the host compacts. |
|
|
15
|
+
| `PostCompact` | `resume-summary` | Recovers **the conversation's own** loop state after a compact. |
|
|
16
|
+
|
|
17
|
+
> **Conversation identity (spec 011).** The three lifecycle hooks act on **one**
|
|
18
|
+
> session — the conversation's own — never on "the first active one" and never
|
|
19
|
+
> on all of them. They resolve it with the canonical precedence: explicit
|
|
20
|
+
> `--code` → the conversation's durable association → the sole active session.
|
|
21
|
+
> The identity travels in the hook payload's `session_id` (read from stdin) or
|
|
22
|
+
> in `AW_CONTEXT_ID`; two signals naming different conversations fail with
|
|
23
|
+
> `CONTEXT_ID_CONFLICT` instead of picking one. The association lives in
|
|
24
|
+
> `.workflow/sessions/.bindings.json` keyed by the SHA-256 of that id — the raw
|
|
25
|
+
> value is never persisted.
|
|
26
|
+
>
|
|
27
|
+
> **Ambiguity is a capability question, not a guess.** `--can-pause` declares
|
|
28
|
+
> that *this host* can hold its compaction: Claude Code can, so the template
|
|
29
|
+
> passes it and `checkpoint-write` exits **2** with the candidate list instead of
|
|
30
|
+
> writing to an arbitrary session. A host that cannot pause omits the flag —
|
|
31
|
+
> its native compaction completes, and Workline reports
|
|
32
|
+
> `continuity: "degraded"` with `primary_session: null`, having written nothing.
|
|
33
|
+
> The flag is never inferred: guessing it produces false blocks. Per-host
|
|
34
|
+
> installation and transport belong to spec 010.
|
|
16
35
|
|
|
17
36
|
> **What they enforce (host-level, blocking):** invariant **#4** (DB scripts-only) via `sql-mutation-guard` (blocks DML/DDL over MCP), and the *expected-branch* clause of **#5** via `branch-check` (blocks edits on the wrong branch). The rest of git-safe (`push`/`--amend`/`--no-verify`/`--force`) is **doctrinal** — `git-commit-advisor` only **warns**, it does not block; a host may add its own deny hook if it wants hard enforcement.
|
|
18
37
|
>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"hooks": [
|
|
63
63
|
{
|
|
64
64
|
"type": "command",
|
|
65
|
-
"command": "agent-workflow checkpoint-write",
|
|
65
|
+
"command": "agent-workflow checkpoint-write --can-pause",
|
|
66
66
|
"statusMessage": "Escribiendo CHECKPOINT.md antes de compactar...",
|
|
67
67
|
"timeout": 10
|
|
68
68
|
}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"type": "prompt",
|
|
84
|
-
"prompt": "Contexto compactado. El JSON anterior es output de `agent-workflow resume-summary`. Si
|
|
84
|
+
"prompt": "Contexto compactado. El JSON anterior es output de `agent-workflow resume-summary`. Si `continuity` es `ok`, reanudá el loop de `primary_session` desde su CHECKPOINT.md y presentá un resumen. Si `continuity` es `degraded`, NO reanudes ninguna sesión: `active_sessions` es un listado, no una identidad — mostrá `candidates` con su `action` y pedí al usuario que elija (después reintentá con `--code <NNN>`). Si no hay sesiones, terminá."
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
}
|
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
|
|