@tacuchi/agent-workflow-cli 20.23.0 → 20.24.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/dist/application/context/budget-service.js +128 -0
- package/dist/application/context/budget-service.js.map +1 -0
- package/dist/application/context/bundle-root.js +41 -0
- package/dist/application/context/bundle-root.js.map +1 -0
- package/dist/application/context/manifest.js +150 -0
- package/dist/application/context/manifest.js.map +1 -0
- package/dist/application/context/measure.js +227 -0
- package/dist/application/context/measure.js.map +1 -0
- package/dist/application/context/plan-service.js +177 -0
- package/dist/application/context/plan-service.js.map +1 -0
- package/dist/cli/commands/context-budget.js +79 -0
- package/dist/cli/commands/context-budget.js.map +1 -0
- package/dist/cli/commands/context-plan.js +75 -0
- package/dist/cli/commands/context-plan.js.map +1 -0
- package/dist/cli/commands/index.js +4 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/help-groups.js +4 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/parser.js +4 -0
- package/dist/cli/parser.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +2 -2
- package/skills/w/commands/export-diagrams.md +10 -27
- package/skills/w/commands/export-manuals.md +13 -29
- package/skills/w/commands/export-reports.md +11 -27
- package/skills/w/commands/export-scripts.md +12 -29
- package/skills/w/commands/fix-git.md +21 -32
- package/skills/w/commands/generate-launch.md +13 -32
- package/skills/w/commands/persist.md +8 -29
- package/skills/w/commands/plan-exec.md +14 -30
- package/skills/w/commands/plan-new.md +11 -38
- package/skills/w/commands/plan-refine.md +13 -41
- package/skills/w/commands/quick.md +13 -20
- package/skills/w/commands/resume.md +17 -33
- package/skills/w/commands/spec-new.md +28 -69
- package/skills/w/commands/spec-refine.md +12 -37
- package/skills/w/commands/status.md +12 -19
- package/skills/w/commands/workspace-init.md +13 -20
- package/skills/w/context/MANIFEST.json +486 -0
- package/skills/w/harness/HARNESS.md +1 -1
- package/skills/w/loops/CHASSIS.md +53 -104
- package/skills/w/loops/CODE-POLICIES.md +4 -9
- package/skills/w/loops/plan-exec-loop/LOOP.md +5 -12
- package/skills/w/loops/plan-new-loop/LOOP.md +8 -32
- package/skills/w/loops/plan-refine-loop/LOOP.md +8 -36
- package/skills/w/loops/quick-loop/LOOP.md +4 -10
- package/skills/w/loops/spec-refine-loop/LOOP.md +7 -49
- package/skills/w/modules/ADOPTED-CONTEXT.md +10 -0
- package/skills/w/modules/COMPACTION.md +13 -0
- package/skills/w/modules/DB-RESEARCH-RULE.md +11 -0
- package/skills/w/modules/DB-SCRIPTS-ONLY.md +12 -0
- package/skills/w/modules/EXEC-DB-POLICY.md +7 -0
- package/skills/w/modules/EXEC-PROBE-TASKS.md +11 -0
- package/skills/w/modules/IDEATION-GATE.md +16 -0
- package/skills/w/modules/INCREMENTAL-STRATEGY.md +7 -0
- package/skills/w/modules/LAUNCH-DETECTION.md +26 -0
- package/skills/w/modules/PERSIST-ROUTING.md +16 -0
- package/skills/w/modules/PLAN-DESIGN-SPECS.md +12 -0
- package/skills/w/modules/PLAN-INPUT.md +26 -0
- package/skills/w/modules/PLAN-MODE.md +26 -0
- package/skills/w/modules/PLAN-PROBE-TASKS.md +10 -0
- package/skills/w/modules/PLAN-REFINE-DESIGN-SPECS.md +7 -0
- package/skills/w/modules/PLAN-REFINE-KEYS.md +9 -0
- package/skills/w/modules/PLAN-REFINE-SPLIT.md +12 -0
- package/skills/w/modules/PLAN-SPLIT-GATE.md +14 -0
- package/skills/w/modules/PROBE.md +12 -0
- package/skills/w/modules/PROMPT-CONTINUITY.md +13 -0
- package/skills/w/modules/RECONNAISSANCE.md +48 -0
- package/skills/w/modules/REPLANNING.md +12 -0
- package/skills/w/modules/SESSION-NUMBERING.md +19 -0
- package/skills/w/modules/SIMULATION-LIFECYCLE.md +11 -0
- package/skills/w/modules/SPEC-CHANGE-SHAPE.md +37 -0
- package/skills/w/modules/SPEC-REFINE-KEYS.md +14 -0
- package/skills/w/modules/SPLIT-GATE.md +42 -0
- package/skills/w/modules/WORKSPACE-SCAFFOLD.md +28 -0
- package/skills/w/roles/ui-spec/ROLE.md +1 -1
|
@@ -6,27 +6,27 @@ This document is the **common engine** of the Workline loops: the doctrine every
|
|
|
6
6
|
|
|
7
7
|
The **5 loops** run this engine; each adds only its deltas:
|
|
8
8
|
|
|
9
|
-
- [`spec-refine-loop`](spec-refine-loop/LOOP.md) — refines the **spec** in place
|
|
10
|
-
- [`plan-new-loop`](plan-new-loop/LOOP.md) — generates the **plan** from the spec
|
|
11
|
-
- [`plan-refine-loop`](plan-refine-loop/LOOP.md) — refines the **plan** in place (auxiliary
|
|
12
|
-
- [`plan-exec-loop`](plan-exec-loop/LOOP.md) — **executes** the plan: code
|
|
13
|
-
- [`quick-loop`](quick-loop/LOOP.md) —
|
|
9
|
+
- [`spec-refine-loop`](spec-refine-loop/LOOP.md) — refines the **spec** in place.
|
|
10
|
+
- [`plan-new-loop`](plan-new-loop/LOOP.md) — generates the **plan** from the spec.
|
|
11
|
+
- [`plan-refine-loop`](plan-refine-loop/LOOP.md) — refines the **plan** in place (auxiliary).
|
|
12
|
+
- [`plan-exec-loop`](plan-exec-loop/LOOP.md) — **executes** the plan: code, DB and git.
|
|
13
|
+
- [`quick-loop`](quick-loop/LOOP.md) — **minimal ceremony** (the prompt *is* the objective).
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The two that edit code also apply [`CODE-POLICIES.md`](CODE-POLICIES.md).
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Persistent objective
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
A loop **is a persistent objective**: it exists to fulfill the `SESSION.Objective` declared at start, and **it is not finished until the convergence gate confirms the objective was met**. Gap-driven iteration is the *method*; the artifacts are the *record*; the objective is the *frame*.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
"Don't stop until convergence" is sustained by the loop itself — its `repeat:` plus the convergence gate — never by a host hook, which is what makes it harness-agnostic. Each heir instantiates the frame: `spec-refine` pursues the spec; the plan loops pursue the plan up to their gate; `plan-exec` up to its final validation; `quick-loop` most directly of all (the prompt *is* the objective).
|
|
22
22
|
|
|
23
|
-
> **Inter-turn continuity.** The same `CHECKPOINT`+resume
|
|
23
|
+
> **Inter-turn continuity.** The same `CHECKPOINT`+resume governs the **next prompt**: the objective persists **across turns**, not only within a run. The canonical rules (command = new work line · re-run = `create_or_resume` · bare prompt = continue the most recent session · reopening closed sessions · consented escalation) live in [`../SKILL.md`](../SKILL.md) § *Operating context* — **single source**; this engine executes them via *Compact / resume* (case 3).
|
|
24
24
|
|
|
25
25
|
## Verification-first
|
|
26
26
|
|
|
27
27
|
The persistent objective needs a **checkable done-condition** — otherwise the loop cannot know when it is done (or chases a target it invented). That condition is **seeded BEFORE executing**, never improvised at the end: it is **generalized TDD**. Together with artifact-first (next section) these are the **two seeds** of every gap/phase: *how will I know it worked* + *what am I about to do*.
|
|
28
28
|
|
|
29
|
-
**Where it lives:** in `SESSION.Success criteria`
|
|
29
|
+
**Where it lives:** in `SESSION.Success criteria` — a `[ ]` checklist of **falsifiable** criteria (that *can* fail). `CHECKPOINT.Pending/Completed` tracks the **red→green** progress. Two forms, by deliverable:
|
|
30
30
|
|
|
31
31
|
| Deliverable | Criterion = | Cycle |
|
|
32
32
|
|---|---|---|
|
|
@@ -35,18 +35,13 @@ The persistent objective needs a **checkable done-condition** — otherwise the
|
|
|
35
35
|
| spec / plan | **rubric** = the document's acceptance criteria (referenced, not duplicated) | rubric |
|
|
36
36
|
| analysis / design | **rubric falsifiable by inspection** (e.g. "every affected site with `file:line`"; "each decision: rationale + ≥1 alternative") | rubric |
|
|
37
37
|
|
|
38
|
-
- **Form and weight scale
|
|
39
|
-
- **Subjective deliverable** (analysis/design): the AI **proposes** the rubric and the **human ratifies** it
|
|
40
|
-
- **Unresolvable criterion** (no evidence, DB unavailable): closes as `inconclusive` and the loop **degrades**
|
|
41
|
-
|
|
42
|
-
> The **convergence gate** (section *Convergence / exit*) is, operationally, **"all `Success criteria` green"**. The per-heir gates (analyze gate; plan coherence — plan-new and plan-refine; final validation; proportional spot validation) are **instances** of it, with the criteria seeded at start.
|
|
38
|
+
- **Form and weight scale**: a chore = "existing tests/build stay green" (one line); a feature = real acceptance tests. The rule is "**always declare the check before**", not "always write new tests".
|
|
39
|
+
- **Subjective deliverable** (analysis/design): the AI **proposes** the rubric and the **human ratifies** it before pursuing it.
|
|
40
|
+
- **Unresolvable criterion** (no evidence, DB unavailable): closes as `inconclusive` and the loop **degrades** — **never iterates against a fake target**.
|
|
43
41
|
|
|
44
|
-
**
|
|
42
|
+
> The **convergence gate** is, operationally, **"all `Success criteria` green"**. The per-heir gates are **instances** of it, with the criteria seeded at start.
|
|
45
43
|
|
|
46
|
-
- modify the check or loosen a `Success criterion` to force green;
|
|
47
|
-
- weaken, delete or skip tests/validations;
|
|
48
|
-
- use trivial or tautological asserts that always pass (the expected value comes from an independent source, never from the output itself);
|
|
49
|
-
- patch the test instead of fixing the cause (prefer fixing production code).
|
|
44
|
+
**Gate integrity (anti-gaming + independent verification).** The gate only counts if it is not gamed to pass. The loop does **not**: modify the check or loosen a `Success criterion` to force green; weaken, delete or skip tests/validations; use trivial or tautological asserts that always pass (the expected value comes from an independent source, never from the output itself); patch the test instead of fixing the cause (prefer fixing production code).
|
|
50
45
|
|
|
51
46
|
Facing a real blocker it **stops and reports it** (→ `Open questions`/`BACKLOG`) instead of gaming the metric. The verdict counts **only the check's output, never the implementer's self-declaration**: when the deliverable warrants it, the final verification is an **independent** pass (subagent or clean re-read) that does not assume the implementation is correct — *only command output counts*.
|
|
52
47
|
|
|
@@ -66,9 +61,9 @@ The loop works **artifact-first**: the artifact is **seeded before** executing a
|
|
|
66
61
|
2. **EXECUTE.** Resolve the gap / run the phase / edit the code.
|
|
67
62
|
3. **AFTER — bring to actual state.** `CHECKPOINT.Pending → Completed`; `DECISION` records the non-obvious **as it is decided**; `BACKLOG` **only if** something is deferred/follow-up (`session-close` no longer fabricates an empty BACKLOG).
|
|
68
63
|
|
|
69
|
-
> The artifact expresses the **intent** (
|
|
64
|
+
> The artifact expresses the **intent** (before) and then the **result** (after), at **every** gap/phase boundary — not only on `Compactar`/`Cerrar`. Session artifacts are the run's live log; the spec/plan is the **guiding base**.
|
|
70
65
|
|
|
71
|
-
> **Fixed form (hard rule):** an artifact keeps its template's `##` headings **exactly** and is updated **in place** — appending a **duplicate heading** is a contract violation.
|
|
66
|
+
> **Fixed form (hard rule):** an artifact keeps its template's `##` headings **exactly** and is updated **in place** — appending a **duplicate heading** is a contract violation. A filled section **replaces** its `<!-- … -->` guidance comment. Canonical headings per artifact: its template under [`../artifacts/`](../artifacts/) (CHECKPOINT: `Completed` · `Pending / Next`; `Open questions` only while live doubts exist).
|
|
72
67
|
|
|
73
68
|
## Gap-driven convergent engine
|
|
74
69
|
|
|
@@ -82,126 +77,80 @@ The common cycle — each heir instantiates it in its `## Sequence` with its own
|
|
|
82
77
|
|
|
83
78
|
## Internal sessions (managed) — one session per run
|
|
84
79
|
|
|
85
|
-
The loop creates and manages its session under `.workflow/sessions
|
|
86
|
-
|
|
87
|
-
> **INLINE research** — investigation is **not** a separate session: it is an activity **inside the current session** that writes its artifacts (`ANALYSIS-FILE`/`CONCLUSIONS`, + read-only `SCRIPTS.sql` if it queries DB) **into the run's own session folder**. See *Research: autonomy, scope & failure*.
|
|
88
|
-
|
|
89
|
-
> The flow's input document (spec/plan) **never** goes inside a session; it lives in `docs/`.
|
|
80
|
+
The loop creates and manages its session under `.workflow/sessions/`; **the user never creates it**. **A single session per run**: it keeps progress live (`CHECKPOINT`) and enables resume. Artifacts: `SESSION.md` · `CHECKPOINT.md` (· `BACKLOG.md` only if something is deferred; code-editing loops add `DECISION` and `SCRIPTS.sql`). Each heir declares its descriptor and `Type` in its own `## Internal sessions`.
|
|
90
81
|
|
|
91
|
-
|
|
82
|
+
> Research is **inline** — an activity inside this same session, never a session of its own — and the flow's input document (spec/plan) **never** goes inside a session; it lives in `docs/`.
|
|
92
83
|
|
|
93
|
-
|
|
84
|
+
**CLI**: `aw session-create --type <type> --name <slug>-<flow> --objetivo "<one-line objective>"` opens it · `aw checkpoint-write` / `aw checkpoint-read` keep it resumable · `aw session-close` closes it and upserts its HISTORY.md row.
|
|
94
85
|
|
|
95
|
-
>
|
|
96
|
-
>
|
|
97
|
-
> **Resume**: locate the existing session by **scanning** `.workflow/sessions/` for descriptor + `## Origin` (which spec/plan), **not** by reconstructing the number (global, not derivable from the artifact). `aw session-resume --code <NNN | folder>` resolves both forms.
|
|
98
|
-
|
|
99
|
-
**CLI**:
|
|
100
|
-
|
|
101
|
-
- `aw session-create --type <type> --name <slug>-<flow> --objetivo "<one-line objective>"` → creates `NNN-<slug>-<flow>` / `aw session-resume --code <…>` (detects `CHECKPOINT`).
|
|
102
|
-
- `aw checkpoint-write` / `aw checkpoint-read` for resume.
|
|
103
|
-
- `aw session-close` on close — also upserts the session's HISTORY.md row (the durable record; sessions/ is gitignored). Non-fatal: on `history_error` in its output, re-run `aw history-update --code <NNN> --state closed`. `aw session-artifacts` to inspect.
|
|
104
|
-
- **Reopen to continue** (operating context, row 2): `aw session-resume --code <NNN> --reopen` reactivates a **closed** session (removes `.closed` → active) to keep working in it; without `--reopen`, resume is read-only. To detect the most recent closed one: `aw resume-summary --include-recent-closed` (or `aw sessions --state all`).
|
|
86
|
+
> The caller passes **only the descriptor** via `--name` — **never** a number; the CLI owns the global `NNN`. How it is assigned, how a session is located or reopened, and how a failed history upsert is repaired, are in the `sessions` module.
|
|
105
87
|
|
|
106
88
|
## Ask-vs-research rule (the discriminator)
|
|
107
89
|
|
|
108
90
|
For every gap, a single question picks the resolver:
|
|
109
91
|
|
|
110
|
-
> *"Was this already established in the current conversation?"* → **adopt it** (
|
|
92
|
+
> *"Was this already established in the current conversation?"* → **adopt it** (`adopted` module) — never re-ask or re-research settled conclusions.
|
|
111
93
|
> *"Can I answer this by reading the repo/data?"* → **research** (autonomous).
|
|
112
|
-
> *"Can I only answer it by RUNNING a small experiment?"* → **probe** (
|
|
94
|
+
> *"Can I only answer it by RUNNING a small experiment?"* → **probe** (`probe` module).
|
|
113
95
|
> *"Does it depend on what the user wants?"* → **ask the human** (structured-choice).
|
|
114
96
|
|
|
115
|
-
## Adopted context (host as producer)
|
|
116
|
-
|
|
117
|
-
The host is not only the loop's executor — it is a legitimate **producer** of input. Conclusions **already established in the current conversation** (a host-native analysis, answers the user already gave, a plan built with the host's planner) count as **completed research**: on entry, **adopt** them — seed `SESSION.Objective`/`Success criteria`, reference them in `CONCLUSIONS`, record provenance (`## Origin` = adopted from the host conversation) — never re-derive or re-ask them.
|
|
118
|
-
|
|
119
|
-
- Adoption is **transcription, not trust**: the convergence gate still verifies adopted conclusions (*gate integrity*); anti-duplicate still applies.
|
|
120
|
-
- Materialization pattern = the quick escalation's (single-pass, **NO RESEARCH**), inverted: **host → flow**.
|
|
121
|
-
- Gap signals already resolved by adopted context do **not** fire (e.g. "ambiguous requirements" after a host pre-analysis).
|
|
122
|
-
- To persist finished work without a loop: [`/w:persist`](../commands/persist.md) (transversal).
|
|
123
|
-
|
|
124
97
|
## Research: autonomy, scope & failure
|
|
125
98
|
|
|
126
|
-
Investigation is **inline**: an activity **inside the run's current session**, never a separate session. It writes its artifacts (`ANALYSIS-FILE` → `CONCLUSIONS`, + read-only `SCRIPTS.sql` if it queries DB) into the
|
|
127
|
-
|
|
128
|
-
- **Autonomous**: the AI investigates inline and reports **without asking permission**. The human learns of it at integration time (in the flow's decision record — each heir names its own) and keeps control via the `flow` control.
|
|
129
|
-
- **Scope**: the current conversation (*adopted context* — settled conclusions are reused, never re-derived) + workspace + associated repos (sources) + DB MCPs.
|
|
130
|
-
- **DB rule** (the single exception to autonomy):
|
|
131
|
-
1. **MCP choice**: if the gap needs DB and there is **>1 candidate MCP with no configured default**, the AI asks which one to use. That question goes through the **same structured-choice** as a **content question** (counts inside the ≤3 + `flow` limit), **before** running queries. A single MCP or a default → no question.
|
|
132
|
-
2. Write the queries **first** into the session's `SCRIPTS.sql`.
|
|
133
|
-
3. Execute them **read-only** via MCP (respect `sql-mutation-guard`: never DML/DDL).
|
|
134
|
-
- **Inconclusive research** (DB unavailable, insufficient evidence, unresolvable factual gap):
|
|
135
|
-
- The investigation closes with status **`inconclusive`** in `CONCLUSIONS` and reports why.
|
|
136
|
-
- The loop **degrades** the gap: to a **human question** (next batch → the flow's decision record) or, failing that, **defers** it to the flow doc's `## Open questions` (spec/plan) — or the session's `BACKLOG` when the flow has no doc (quick).
|
|
137
|
-
- The gap is marked **"already tried via research"** (`attempts[gap]++`, `MAX` cap) so `detect_gaps` does **not** re-fire it in a loop → guarantees convergence.
|
|
138
|
-
|
|
139
|
-
## Proof of concept (probe)
|
|
99
|
+
Investigation is **inline**: an activity **inside the run's current session**, never a separate session. It writes its artifacts (`ANALYSIS-FILE` → `CONCLUSIONS`, + read-only `SCRIPTS.sql` if it queries DB) **into the session's own folder**.
|
|
140
100
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
- **
|
|
145
|
-
- **Isolation**: probe code lives in the **session folder** (gitignored) — never the source tree, **never committed**; DB probes are read-only (never DDL/DML).
|
|
146
|
-
- A **failed probe is a finding, not a failure** — report it; the human decides if the plan reshapes.
|
|
101
|
+
- **Autonomous**: the AI investigates inline and reports **without asking permission**. The human learns of it at integration time and keeps control via the `flow` control.
|
|
102
|
+
- **Scope**: the current conversation (settled conclusions are reused, never re-derived) + workspace + associated repos + DB MCPs.
|
|
103
|
+
- **DB rule** — the single exception to autonomy: it lives in the `db` module and is loaded **before** any query runs.
|
|
104
|
+
- **Inconclusive research** (DB unavailable, insufficient evidence, unresolvable factual gap): the investigation closes with status **`inconclusive`** in `CONCLUSIONS` and reports why. The loop **degrades** the gap — to a human question, or failing that to the flow doc's `## Open questions` (the session's `BACKLOG` when the flow has no doc) — and marks it **"already tried via research"** (`attempts[gap]++`, `MAX` cap) so `detect_gaps` does **not** re-fire it in a loop. That is what guarantees convergence.
|
|
147
105
|
|
|
148
106
|
## Structured-choice (design & batching)
|
|
149
107
|
|
|
150
108
|
**Canonical rule (single source — the rest of the corpus only references it):** *structured-choice* = **≤3 content questions + 1 `flow` control**, always. Per-harness binding in [`../harness/HARNESS.md`](../harness/HARNESS.md) (Claude Code: `AskUserQuestion`, max 4 questions/call; without structured choice it degrades to **numbered markdown**).
|
|
151
109
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- **
|
|
155
|
-
- **
|
|
156
|
-
- human doubts (non-factual gaps);
|
|
157
|
-
- MCP choice (DB rule) — before running queries;
|
|
158
|
-
- at **convergence**, the loop's own closing action — **each heir defines it in its *Convergence / exit*** (e.g. `Guardar especificación refinada` · `Cerrar tarea`) — | `Preguntar algo más`.
|
|
159
|
-
- **Batching**: group up to 3 human gaps in one call. With more than 3 pending, prioritize (the ones that unblock other gaps first) and defer the rest to the next round.
|
|
160
|
-
- **Recommended answer per question**: every content question **always** carries the AI's recommended answer — as the first option (marked *recommended*) in `AskUserQuestion`, or flagged in the numbered-markdown fallback. Never ask "cold": the human ratifies or corrects a proposal, never starts from zero. The AI recommends based on what it researched (ask-vs-research rule), never on an empty default.
|
|
110
|
+
- **`flow` control** (lifecycle, always present): `Compactar` | `Cerrar`. Answering only the content questions = keep iterating. Under context pressure the loop **raises the choice itself**, with `Compactar` recommended.
|
|
111
|
+
- **Content questions** are: human doubts (non-factual gaps) · MCP choice (DB rule), before running queries · at **convergence**, the loop's own closing action — each heir defines it in its *Convergence / exit* (e.g. `Guardar especificación refinada` · `Cerrar tarea`) — | `Preguntar algo más`.
|
|
112
|
+
- **Batching**: up to 3 human gaps per call; with more pending, prioritize the ones that unblock others and defer the rest.
|
|
113
|
+
- **Recommended answer per question**: every content question **always** carries the AI's recommended answer — the first option, marked *recommended*. Never ask "cold": the human ratifies or corrects a proposal, never starts from zero. The recommendation comes from what was researched (ask-vs-research rule), never from an empty default.
|
|
161
114
|
|
|
162
|
-
> **Label language:** the literal option labels (`Compactar`, `Cerrar`, `Guardar plan`, …) are **canonical product strings** — present them **verbatim
|
|
115
|
+
> **Label language:** the literal option labels (`Compactar`, `Cerrar`, `Guardar plan`, …) are **canonical product strings** — present them **verbatim**. All other user-facing output follows [`../SKILL.md`](../SKILL.md) § *Language policy*.
|
|
163
116
|
|
|
164
117
|
## Compact / resume
|
|
165
118
|
|
|
166
119
|
Resume **keys off the `CHECKPOINT`** of the run's session, not the existence of a separate file. Three cases when the flow's command runs over an input:
|
|
167
120
|
|
|
168
121
|
1. **In progress** (a `CHECKPOINT.md` exists in the session) → resume from the recorded progress (resolved gaps, Q&A, `attempts`, in-flight inline research).
|
|
169
|
-
2. **No progress** (no CHECKPOINT and the input doc does **not** have the flow's prior-work mark) → start from zero reading the input doc (plus any
|
|
170
|
-
3. **Already converged / re-run on demand** (no open CHECKPOINT but the doc **already has** the mark) → **first-class operation**: while the flow stays in its stage, re-running the command over the same input **as many times as needed** is supported. `create_or_resume` finds the existing session — typically **closed** after convergence — by descriptor + `## Origin` and **reopens** it
|
|
171
|
-
|
|
172
|
-
> Each heir defines its **prior-work mark** and its own legacy tolerances: spec-refine keys off the spec's frontmatter `status`; plan-refine off `## Refinement decisions` in the plan; plan-exec off the plan-doc's `- [x]` checkboxes; quick has no doc (resume by CHECKPOINT only).
|
|
122
|
+
2. **No progress** (no CHECKPOINT and the input doc does **not** have the flow's prior-work mark) → start from zero reading the input doc (plus any settled in-conversation conclusions, which are input, not something to re-derive).
|
|
123
|
+
3. **Already converged / re-run on demand** (no open CHECKPOINT but the doc **already has** the mark) → **first-class operation**: while the flow stays in its stage, re-running the command over the same input **as many times as needed** is supported. `create_or_resume` finds the existing session — typically **closed** after convergence — by descriptor + `## Origin` and **reopens** it; incremental work reading the **doc itself**.
|
|
173
124
|
|
|
174
|
-
>
|
|
125
|
+
> Each heir defines its **prior-work mark**: spec-refine the spec's frontmatter `status`; plan-refine `## Refinement decisions`; plan-exec the plan-doc's `- [x]` checkboxes; quick has no doc (CHECKPOINT only).
|
|
175
126
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
`Compactar` is not only reactive: the loop **watches its own context pressure** and raises compaction itself.
|
|
179
|
-
|
|
180
|
-
- **Signal**: the host's context-pressure signal when it exists (see the *compaction* capability in [`../harness/HARNESS.md`](../harness/HARNESS.md)); with no signal the fallback is **qualitative** — at batch/phase boundaries of an already-long run, ask *"would a fresh reader need the CHECKPOINT to continue?"*. Doctrine fixes **no numeric thresholds** (harness-agnostic).
|
|
181
|
-
- **Modes** — config `[compaction]` table in `.workflow/skills.toml`, key `mode` (values `confirm` | `auto`):
|
|
182
|
-
- **`confirm`** (default, also with no config): raise a **proactive structured-choice** whose `flow` control carries `Compactar` as the recommended action — the human ratifies; consent is never skipped.
|
|
183
|
-
- **`auto`** (opt-in): write `CHECKPOINT.md`, then trigger the host's compaction binding **without asking**. Viable only where the host has a **non-interactive** mechanism (see the *Harness binding matrix*); otherwise it **degrades to `confirm`**.
|
|
184
|
-
- **Invariant — CHECKPOINT before compacting**: in every mode, `CHECKPOINT.md` is written (or verified fresh) **before** any compaction fires; resume keys off it (the 3 cases above).
|
|
127
|
+
> **`Compactar`** (the `flow` control, across all 3 cases) → write `CHECKPOINT.md` in the session → trigger the harness compaction → resume by reading the checkpoint. **CHECKPOINT before compacting** is invariant. The proactive raise, its two modes and their host binding live in the `compaction` module.
|
|
185
128
|
|
|
186
129
|
## Convergence / exit
|
|
187
130
|
|
|
188
|
-
- **No material gaps** → **convergence gate** (read-only) = **`Success criteria` green** (*verification-first*). Whatever fails **comes back as a gap**; if it passes → the loop **flips the green criteria** in `SESSION.md` (`- [ ]` → `- [x]`) and offers its closing action. The checklist must reflect the real final state: a criterion left unchecked at `finalize` needs an explicit reason
|
|
189
|
-
- `Cerrar` (the `flow` control, at any time) → `finalize`. **`finalize` always persists `CHECKPOINT.md`** (resumable) and, **only if something was deferred
|
|
131
|
+
- **No material gaps** → **convergence gate** (read-only) = **`Success criteria` green** (*verification-first*). Whatever fails **comes back as a gap**; if it passes → the loop **flips the green criteria** in `SESSION.md` (`- [ ]` → `- [x]`) and offers its closing action. The checklist must reflect the real final state: a criterion left unchecked at `finalize` needs an explicit reason. Each heir names its own instance of this gate.
|
|
132
|
+
- `Cerrar` (the `flow` control, at any time) → `finalize`. **`finalize` always persists `CHECKPOINT.md`** (resumable) and, **only if** something was deferred, writes `BACKLOG.md` (close reason + the deferred items); closes the session and reports. Progress survives even without a prior `Compactar`.
|
|
190
133
|
|
|
191
134
|
## docs/ boundary — no auto-export (hard rule)
|
|
192
135
|
|
|
193
|
-
A loop writes into `docs/` **only** its own flow's doc (spec-refine: `docs/specs` · plan
|
|
136
|
+
A loop writes into `docs/` **only** its own flow's doc (spec-refine: `docs/specs` · the three plan flows: `docs/plans` · quick: **none** — it never touches `docs/`). No loop **graduates/promotes artifacts** into `docs/`: migrations → `docs/scripts`, manuals → `docs/manuals`, diagrams → `docs/diagrams` are done by the separate **`export-*`** skills, as an explicit later step; artifacts stay in their sessions until then. A task that creates a tool/utility has it documented in `docs/tools` by the ambient `creating-tools` skill (auto-discovered; Workline does not bind it).
|
|
194
137
|
|
|
195
|
-
##
|
|
138
|
+
## Conditional modules
|
|
196
139
|
|
|
197
|
-
The
|
|
140
|
+
The engine above is what every run needs. The branches below apply only under their signal, and `aw context-plan` returns them exactly then — never just in case:
|
|
141
|
+
|
|
142
|
+
- `adopted` → [`../modules/ADOPTED-CONTEXT.md`](../modules/ADOPTED-CONTEXT.md) · `probe` → [`../modules/PROBE.md`](../modules/PROBE.md) · `db` → [`../modules/DB-RESEARCH-RULE.md`](../modules/DB-RESEARCH-RULE.md)
|
|
143
|
+
- `compaction` → [`../modules/COMPACTION.md`](../modules/COMPACTION.md) · `sessions` → [`../modules/SESSION-NUMBERING.md`](../modules/SESSION-NUMBERING.md)
|
|
144
|
+
- `code` → [`CODE-POLICIES.md`](CODE-POLICIES.md), which the two code-editing loops order read from their `## Inherits`
|
|
198
145
|
|
|
199
146
|
## Reference resolution (global layout rule) — and what the chassis is NOT
|
|
200
147
|
|
|
201
148
|
Applies to **every** relative reference in the doctrine — never repeated per link:
|
|
202
149
|
|
|
203
|
-
1. **Normal install** (the `w/` tree): the relative path resolves as-is
|
|
204
|
-
2. **Synthesized command skills** (hosts without a commands dir
|
|
205
|
-
3. A reference that does not resolve = **optional deep-dive** — this engine
|
|
150
|
+
1. **Normal install** (the `w/` tree): the relative path resolves as-is.
|
|
151
|
+
2. **Synthesized command skills** (hosts without a commands dir): each command installs as a sibling skill `w-<command>/` with its references rewritten into the bundle (`../loops/…` → `../w/loops/…`).
|
|
152
|
+
3. A reference that does not resolve = **optional deep-dive** — this engine is self-contained.
|
|
153
|
+
|
|
154
|
+
> `aw context-plan` hands back **absolute** paths, so a run that asks the CLI for its read-set resolves no relative reference at all. This rule is the fallback for one that does not ask.
|
|
206
155
|
|
|
207
|
-
The chassis **is not a skill** (no frontmatter; never invoked nor bound
|
|
156
|
+
The chassis **is not a skill** (no frontmatter; never invoked nor bound): it enters the context only because a loop orders it read from its `## Inherits`. It does not define flow, deliverable or gap taxonomy — that belongs to each heir.
|
|
@@ -9,15 +9,6 @@ They apply to **`plan-exec-loop`** (per plan phase) and **`quick-loop`** (the si
|
|
|
9
9
|
- **Rejected commit**: the changes **stay in the working tree** (never reverted). Re-proposing / editing the message is allowed. Record in `CHECKPOINT` + `BACKLOG` that the phase/task remained **uncommitted** (resumable).
|
|
10
10
|
- **Between-phase precondition** (plan-exec): `branch-check` validates branch *identity*, **not** working-tree *cleanliness*. Before starting the next phase, each source's working tree must be **clean** (committed) or explicitly **acknowledged** as "uncommitted changes from phase N" — so two phases never co-mingle in one commit.
|
|
11
11
|
|
|
12
|
-
## DB scripts-only — the AI never executes DML/DDL
|
|
13
|
-
|
|
14
|
-
Distinguished by **execution**, not by file (see the [`SCRIPTS.sql`](../artifacts/artifacts-core/SCRIPTS.sql) schema):
|
|
15
|
-
|
|
16
|
-
- **Read-only queries** (diagnosis/validation) → `SCRIPTS.sql` (session artifact); the AI **does** execute them read-only via MCP (`sql-mutation-guard`).
|
|
17
|
-
- **DDL/DML migrations** (schema/data changes) → the AI **drafts them in `SCRIPTS.sql`** (session artifact) but **NEVER executes them**.
|
|
18
|
-
|
|
19
|
-
> Mutating SQL **stays in the session**; it is never moved to `docs/`. Its promotion to `docs/scripts/` (forward + rollback) is done by a separate `export-*`, never by the loop.
|
|
20
|
-
|
|
21
12
|
## Closing review gate (conventions, pre-commit)
|
|
22
13
|
|
|
23
14
|
After validation (of the phase in plan-exec; of the task in quick, proportional) and **before proposing its commits** (also on an early `Cerrar`, before proposing the pending commits), the diff passes a **closing review gate**:
|
|
@@ -36,3 +27,7 @@ Only with the gate green are the commits proposed.
|
|
|
36
27
|
## Location
|
|
37
28
|
|
|
38
29
|
Same as the chassis: code-editing loops reference it as `../CODE-POLICIES.md` — the `w/loops/` tree is installed intact on every host (chassis § *Reference resolution*).
|
|
30
|
+
|
|
31
|
+
## Conditional modules
|
|
32
|
+
|
|
33
|
+
- `db` — the DB scripts-only rule → `../modules/DB-SCRIPTS-ONLY.md`
|
|
@@ -110,10 +110,6 @@ On either return path: `CHECKPOINT` records the state reached and the trigger, t
|
|
|
110
110
|
|
|
111
111
|
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Safe git*: branch-check before editing, rejected commit — changes stay + get recorded —, working-tree precondition between phases). **Inline:** before editing, verify each source's expected branch (`aw check-branch --source <alias>`; on mismatch → pause and resolve with the human); at each phase close and **after the review gate** (Delta 5), **proposed commits per source** (approve first) — never `push`/`--amend`/`--no-verify`.
|
|
112
112
|
|
|
113
|
-
## Delta 3 — DB policy: **the AI never executes DML**
|
|
114
|
-
|
|
115
|
-
Full policy in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *DB scripts-only*). **Inline:** read-only queries → the session's `SCRIPTS.sql`, executed via MCP (`sql-mutation-guard`); DDL/DML migrations → the AI **drafts them in `SCRIPTS.sql` but NEVER executes them** — their promotion to `docs/scripts/` is done by a separate `export-*`, never this loop.
|
|
116
|
-
|
|
117
113
|
## Delta 4 — Validation: phase proof + progressive tests
|
|
118
114
|
|
|
119
115
|
- The phase's **primary proof** is its `Validación de fase`: it demonstrates the **state reached**, not the structure written. Three levels, and the loop never descends one automatically:
|
|
@@ -142,14 +138,6 @@ Full gate in [`../CODE-POLICIES.md`](../CODE-POLICIES.md) (§ *Closing review ga
|
|
|
142
138
|
- **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.
|
|
143
139
|
- **No automatic export**: the artifacts (`SCRIPTS.sql`, `DECISION`, …) stay in the session. Promoting them to `docs/` (scripts, manuals, …) is a separate step via `export-*`.
|
|
144
140
|
|
|
145
|
-
## Delta 7 — Probe (PoC) tasks
|
|
146
|
-
|
|
147
|
-
Chassis § *Proof of concept (probe)*, instantiated for execution — for a plan's explicit probe task or a runnable doubt inside a task:
|
|
148
|
-
|
|
149
|
-
- Seed the question + pass/fail check → run **throwaway code in the session folder** (never the source tree, never committed; DB probe = read-only) → verdict in `CONCLUSIONS`, consequences in `DECISION` (tagged by task) → mark the task with its verdict.
|
|
150
|
-
- A **failed probe does not fail the phase** — it de-risked it: surface it (structured-choice); reshaping the plan goes to `Open questions` + `BACKLOG` (or `/w:plan-refine`).
|
|
151
|
-
- **Promotion**: probe code reaches the sources only as a normal task edit (branch-check + review gate) — never by committing the probe.
|
|
152
|
-
|
|
153
141
|
## Sequence
|
|
154
142
|
|
|
155
143
|
```
|
|
@@ -210,3 +198,8 @@ finalize: CHECKPOINT (+ BACKLOG if something is deferred) + close session + repo
|
|
|
210
198
|
- A **structural deviation** or a **functional change** exits this loop without converging (§ *Deviation gate*): `CHECKPOINT` + `finalize`, and the work continues in `plan-refine` / `spec-refine`. Same exit when the entry gate finds a structural gap.
|
|
211
199
|
- `Cerrar` (`flow` control, at any time) → `finalize` persists `CHECKPOINT` (and `BACKLOG` only if something remained unexecuted / uncommitted / unapplied), closes the session, reports.
|
|
212
200
|
- Promoting artifacts to `docs/` (via `export-*`) is **always** a later, explicit step outside this loop.
|
|
201
|
+
|
|
202
|
+
## Conditional modules
|
|
203
|
+
|
|
204
|
+
- `probe` — probe (PoC) tasks → `../../modules/EXEC-PROBE-TASKS.md`
|
|
205
|
+
- `db` — the DB policy → `../../modules/EXEC-DB-POLICY.md`
|
|
@@ -33,7 +33,7 @@ PLAN
|
|
|
33
33
|
|
|
34
34
|
> **slug**: short kebab-case derived from the spec's Requirement — only `[a-z0-9-]`, ≤ ~5 words / ≤ 40 chars. `aw next-number docs/plans` returns JSON (field `next` = `PPP`); the loop builds the full name. To locate plans, glob `docs/plans/PPP-plan-*.md`.
|
|
35
35
|
|
|
36
|
-
> **Adoption (command mode 4):** an **externally-built plan** (host plan mode, hand-written, another agent) is materialized by the **command** in a single pass — this loop does not run: transcribe + normalize into the Delta 1 schema, `## Origin` = "adopted from <source>" + attribution; then `plan-refine` closes schema gaps (its coherence gate degrades for spec-less plans). See `../../
|
|
36
|
+
> **Adoption (command mode 4):** an **externally-built plan** (host plan mode, hand-written, another agent) is materialized by the **command** in a single pass — this loop does not run: transcribe + normalize into the Delta 1 schema, `## Origin` = "adopted from <source>" + attribution; then `plan-refine` closes schema gaps (its coherence gate degrades for spec-less plans). See `../../modules/PLAN-INPUT.md` (the command's `input` module).
|
|
37
37
|
|
|
38
38
|
## Inherits
|
|
39
39
|
|
|
@@ -124,10 +124,6 @@ A `### Fn` block is a **verifiable state of the system**, never a list of layers
|
|
|
124
124
|
|
|
125
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.
|
|
126
126
|
|
|
127
|
-
## Incremental strategy (reference, never a template)
|
|
128
|
-
|
|
129
|
-
A change spread over consumer, service and data often lands well as: consumer shell → minimal real integration → vertical skeleton → real implementation from the source outwards → hardening → finish. **Reference to adapt, never a mandatory shape.** Backend-only, CLI, batch, library and database-only changes have their own journey, and inserting a layer the project does not have fails the minimality lens. A small change may be **one phase**, when that phase already is a coherent verifiable state.
|
|
130
|
-
|
|
131
127
|
## Delta 2 — Gap taxonomy (of "plan")
|
|
132
128
|
|
|
133
129
|
Replaces the spec gap taxonomy with a planning-oriented one:
|
|
@@ -156,33 +152,6 @@ Replaces the spec gap taxonomy with a planning-oriented one:
|
|
|
156
152
|
|
|
157
153
|
The chassis' **inline** research specializes: mapping **code/impact** — affected FE/BE/DB components, AS-IS wiring, dependencies. It feeds `Solution` (its AS-IS → TO-BE delta) and `Impacted`. The chassis DB rule applies unchanged (read-only queries into `SCRIPTS.sql`, MCP chosen via a content question when >1 without default).
|
|
158
154
|
|
|
159
|
-
## Delta 4 — Design SPECs (when the plan includes UI)
|
|
160
|
-
|
|
161
|
-
The **UI without design SPEC** gap is resolved by **composing** the **`ui-design`** capability (built-in default [`ui-spec`](../../roles/ui-spec/ROLE.md); rebindable via `.workflow/skills.toml`; `off` → degrades to human / `Open questions`):
|
|
162
|
-
|
|
163
|
-
- It authors **one design SPEC per screen** as a session artifact: `NNN-SPEC-<SLUG>.md` (numbering local to the session — see [`SPEC.md`](../../artifacts/artifacts-design/SPEC.md)).
|
|
164
|
-
- It **derives** from the spec's `## UI spec` section when present (splits it per screen and raises it to executable detail); otherwise it authors from the `Requirement` (design system/theme/ambiguities via *structured-choice*, counts in the batch).
|
|
165
|
-
- The plan's **UI Tasks reference** their SPEC's path — that reference is the **source of truth** — and `plan-exec-loop` reads them as the design reference.
|
|
166
|
-
- It is the chassis' composed-capability resolution mode (next to *research*, *probe* and *human*).
|
|
167
|
-
|
|
168
|
-
## Delta 5 — Probe (PoC) tasks — de-risk early
|
|
169
|
-
|
|
170
|
-
Chassis § *Proof of concept (probe)*, instantiated for planning. Two placements:
|
|
171
|
-
|
|
172
|
-
- **Plan-shaping unknown** (the `Solution` itself depends on the answer) → run the probe **inline now**; the verdict (`CONCLUSIONS`) feeds `Solution` / `Risks / impact`.
|
|
173
|
-
- **Execution-time risk** (a task will build on a risky, runnable assumption) → encode an explicit **probe task**, placed **early** — before the tasks that depend on its verdict; the matching `Risks / impact` entry references it.
|
|
174
|
-
|
|
175
|
-
## Split gate (multi-plan)
|
|
176
|
-
|
|
177
|
-
Resolves the **Plan splittable** gap (Delta 2) — the canonical definition for **both** plan loops (`plan-refine-loop` references it, never redefines it). It fires **only on clear signals** (≥2 of: tranches independently executable/deliverable · no shared deps/risk between tranches · different requested moments/priorities · the plan far exceeds S-complexity phases · the user asked for staging); borderline → **one plan, no question**. It can be assessed during decomposition or at the coherence gate, always **before** `Guardar`.
|
|
178
|
-
|
|
179
|
-
- **The offer** enters the batch as a **content question** (counts in the ≤3): the body shows the proposed cut in the **user's language** — per sibling, a name + slug, a 1-line scope, the phase mapping and the order. Labels: `Dividir en varios planes` (recommended when the signals hold) | `Un solo plan`. Declining marks the gap **exhausted** (no re-offer this run); a free-form answer adjusts the cut. The accepted cut is seeded into `CHECKPOINT` — a resume does **not** re-ask.
|
|
180
|
-
- **Anti-duplicate** (the `create_or_resume` spirit): if sibling plans whose `## Origin` references this same spec/split already exist, the recommended option becomes resuming them (`/w:plan-refine` / `/w:plan-exec` semantics) — never a second set.
|
|
181
|
-
- **On acceptance** — same run, same session (one session per run, one HISTORY row): **all N siblings are elaborated complete** in this run — each gets the full Delta 1 schema and is immediately executable (`plan-exec` runs any plan; a seed without `## Tasks` would break that contract). Context pressure is absorbed by self-regulation (chassis § *Compact / resume*). Numbering: `aw next-number docs/plans` **immediately before each write** — numbers come out consecutive, so every sibling path is known after the first mint.
|
|
182
|
-
- **Sibling contract**: each `## Origin` records the shared source spec + `split (part i/N)` + the **siblings by path** + the order; `## Dependencies` (the existing optional section) carries the inter-plan order — **acyclic and advisory** (`plan-exec` does not enforce it; it only orients what to attack first).
|
|
183
|
-
- **Coherence gate, re-framed**: every spec acceptance criterion traces to **exactly one** sibling — a **complete, disjoint partition**; each sibling's Final behavior block (in `## Solution`) covers its subset; the union covers the spec. Spec-less plans anchor the partition to their own Final behavior block / `Validations`.
|
|
184
|
-
- **Closing action** on the split branch: `Guardar planes` (the single-plan branch keeps `Guardar plan`).
|
|
185
|
-
|
|
186
155
|
## Sequence
|
|
187
156
|
|
|
188
157
|
```
|
|
@@ -229,3 +198,10 @@ finalize: CHECKPOINT persisted (+ BACKLOG only if something is deferred) + close
|
|
|
229
198
|
- `Cerrar` at any time → `finalize` (persists `CHECKPOINT`; `BACKLOG` only if something is deferred; closes the session, reports).
|
|
230
199
|
|
|
231
200
|
> **After generating:** the plan can go straight to `plan-exec`, or — if changes arise before executing (new requirements, scope adjustments) — pass through [`plan-refine-loop`](../plan-refine-loop/LOOP.md) (`/w:plan-refine`, auxiliary and **not mandatory**), which refines it in place.
|
|
201
|
+
|
|
202
|
+
## Conditional modules
|
|
203
|
+
|
|
204
|
+
- `split` — the canonical multi-plan gate → `../../modules/PLAN-SPLIT-GATE.md`
|
|
205
|
+
- `split` — the incremental journey shape → `../../modules/INCREMENTAL-STRATEGY.md`
|
|
206
|
+
- `ui` — per-screen design SPECs → `../../modules/PLAN-DESIGN-SPECS.md`
|
|
207
|
+
- `probe` — probe (PoC) tasks → `../../modules/PLAN-PROBE-TASKS.md`
|
|
@@ -91,10 +91,6 @@ Reuses plan-new-loop's gap taxonomy **in full** ([`plan-new-loop`](../plan-new-l
|
|
|
91
91
|
|
|
92
92
|
Same as plan-new (maps code/impact: FE/BE/DB components, AS-IS wiring, deps), but **scoped to the delta**: it re-verifies only what the change touches (never re-maps the whole plan). Chassis DB rule unchanged (read-only into `SCRIPTS.sql`, MCP via a question when >1 without default).
|
|
93
93
|
|
|
94
|
-
## Delta 4 — Design SPECs (when the refine touches UI)
|
|
95
|
-
|
|
96
|
-
Same mechanism as [`plan-new-loop`](../plan-new-loop/LOOP.md) (§ *Delta 4*: the **`ui-design`** capability → per-screen `NNN-SPEC-<SLUG>.md`, see [`SPEC.md`](../../artifacts/artifacts-design/SPEC.md)), **scoped to the delta**: only the screens **new or changed** by the refine get a design SPEC. The updated SPEC is written in **plan-refine's own session** (each loop manages ITS session's artifacts — it never edits plan-new's) and the plan **re-points** the UI Task reference to the current SPEC. Untouched screens keep their original SPEC.
|
|
97
|
-
|
|
98
94
|
## Functional journey map
|
|
99
95
|
|
|
100
96
|
Before re-shaping phases, the plan must answer what execution would otherwise have to invent. The answers land **inside the existing sections** (`## Solution`, `## Impacted`, the `### Fn` blocks) — this loop adds no plan section beyond its trace:
|
|
@@ -106,14 +102,6 @@ Before re-shaping phases, the plan must answer what execution would otherwise ha
|
|
|
106
102
|
|
|
107
103
|
> **Bounded research** (Delta 3, sharpened): investigate **only** what is needed to order the phases — journey, boundaries, existing contracts, where the simulation can live, risks that change the plan's design. What `plan-exec` resolves locally is **not** pre-investigated here.
|
|
108
104
|
|
|
109
|
-
## Simulation lifecycle
|
|
110
|
-
|
|
111
|
-
**This section applies only when the journey introduces temporary behavior** — a stub, fake, in-memory adapter, controlled fixture or temporary response. None in the change → no `Límite de simulación`, and no artificial phase invented to retire one. When there is, it is planned, never improvised: every simulation declares **purpose · location · the contract it stands for · the phase where it appears · the phase where it moves or disappears · what prevents its accidental selection in a production runtime · the minimum proof needed while it exists**.
|
|
112
|
-
|
|
113
|
-
- **Explicit over hidden**: `Stub…` / `Fake…`, in-memory adapter, temporary provider or controlled fixture — never a hardcode buried inside production code.
|
|
114
|
-
- **Displacement rule**: each affected phase writes its `Límite de simulación` as normalized prose — `antes <where it is>` → `después <where it lands, or removed>` — never as an implicit assumption.
|
|
115
|
-
- **Removal gate**: the change is not complete while a main-path simulation stays active, a configuration can still select it, the plan does not explain why it remains, or its removal was never validated. Test doubles isolated from the production runtime may stay.
|
|
116
|
-
|
|
117
105
|
## Evidence by behavior
|
|
118
106
|
|
|
119
107
|
Each phase carries proof of behavior, not of structure. Three levels, **chosen** — never descended automatically:
|
|
@@ -137,30 +125,6 @@ This loop's instance of the chassis convergence gate — the same one `plan-exec
|
|
|
137
125
|
- **Evidence** — every phase declares its primary proof, per-layer tests are justified, the same scenario is not duplicated by default, declared risks have evidence or an explicit deferral.
|
|
138
126
|
- **Resumability** — tasks legible enough for a `CHECKPOINT`, intermediate states stable, pending work distinguishable from work already `validada`.
|
|
139
127
|
|
|
140
|
-
## Replanning executed work
|
|
141
|
-
|
|
142
|
-
A partially executed plan is replanned **forward**, never rewritten backwards:
|
|
143
|
-
|
|
144
|
-
- Phases already `validada` **stay as they are**, and their result becomes the initial state of what follows. Completed tasks are not re-written as if they had never happened.
|
|
145
|
-
- Only pending work is re-designed. A `validada` phase that the new shape invalidates gets a **compensating correction** as a new phase — never a silent edit of the closed one.
|
|
146
|
-
- **Return from `plan-exec`** (structural deviation — [`plan-exec-loop`](../plan-exec-loop/LOOP.md) § *Deviation gate*): the deviation enters as a **material gap** of this run. Changed input or output, observable state, public contract, participating components, phase order, simulation boundary or integration strategy — all land in `## Refinement decisions` with what execution already proved.
|
|
147
|
-
- **Legacy plans** (no phase state, micro-task shape) are migrated to the phase contract when this round touches them: completed tasks preserved, micro-tasks grouped by purpose, results and exit conditions derived from the spec and from the plan itself. Functional evidence that neither backs is **not invented** — it becomes an `## Open questions` entry.
|
|
148
|
-
|
|
149
|
-
## Split gate — refine semantics
|
|
150
|
-
|
|
151
|
-
The gate itself — signals, offer, anti-duplicate, sibling contract, partition — is defined **once** in [`plan-new-loop`](../plan-new-loop/LOOP.md) § *Split gate (multi-plan)* (this flow's guaranteed load already includes that file); this loop only adds the **in-place semantics** of splitting an existing plan:
|
|
152
|
-
|
|
153
|
-
- The original plan **keeps its number/path**: it is rewritten **reduced** to its remaining tranche (in place, with confirmation). The extracted tranches become newly minted sibling plans (`aw next-number docs/plans` immediately before each write); their `## Origin` records "split from `docs/plans/PPP-plan-<slug>.md`" + the source spec + the siblings by path.
|
|
154
|
-
- The gate also fires on **partially executed** plans. **Completed tasks (`- [x]`) never move to a sibling** — execution history stays anchored to the original path (plan-exec sessions' `## Origin` keep resolving); only pending work is extracted.
|
|
155
|
-
- The split is recorded in `## Refinement decisions` (what moved where + why); original + siblings together keep the **complete, disjoint partition** of the spec criteria (spec-less: the Delta 2 degradation applies).
|
|
156
|
-
- **Closing action** on the split branch: `Guardar planes` (edit the original reduced + write the extracted siblings); the normal branch keeps `Guardar plan refinado`.
|
|
157
|
-
|
|
158
|
-
## Compact / resume — PLAN-refine keys
|
|
159
|
-
|
|
160
|
-
Full mechanism (3 cases, `Compactar`, re-run with `--reopen`) in the chassis (§ *Compact / resume*). PLAN-refine keys: prior-work mark = `## Refinement decisions` **in the plan** (legacy plans may also carry `## Q&A traceability`); re-refine on demand is **first-class** as many times as needed while the flow stays in PLAN.
|
|
161
|
-
|
|
162
|
-
> **Inter-turn continuity** (chassis, row 2): a flow command opens a "new work line" (new session) — **except re-running the same flow over the same input** (same plan), which does `create_or_resume` (resumes/reopens instead of duplicating).
|
|
163
|
-
|
|
164
128
|
## Sequence
|
|
165
129
|
|
|
166
130
|
```
|
|
@@ -202,3 +166,11 @@ finalize: CHECKPOINT persisted (+ BACKLOG only if something is deferred) + close
|
|
|
202
166
|
- `Cerrar` at any time → `finalize` (persists `CHECKPOINT`; `BACKLOG` only if something is deferred; closes the session, reports).
|
|
203
167
|
|
|
204
168
|
> **After refining:** the plan goes to `plan-exec`, which re-checks this same gate on entry — a plan saved here should never bounce back for its structure.
|
|
169
|
+
|
|
170
|
+
## Conditional modules
|
|
171
|
+
|
|
172
|
+
- `ui` — design SPECs for changed screens → `../../modules/PLAN-REFINE-DESIGN-SPECS.md`
|
|
173
|
+
- `simulation` — the life of temporary behavior → `../../modules/SIMULATION-LIFECYCLE.md`
|
|
174
|
+
- `replan` — replanning executed work → `../../modules/REPLANNING.md`
|
|
175
|
+
- `split` — splitting a plan in place → `../../modules/PLAN-REFINE-SPLIT.md`
|
|
176
|
+
- `resume` — this loop's compact / resume keys → `../../modules/PLAN-REFINE-KEYS.md`
|
|
@@ -67,16 +67,6 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
|
|
|
67
67
|
3. The artifacts (`DECISION`, `SCRIPTS.sql`) **stay in the quick session** as referenceable context for the new session (never migrated).
|
|
68
68
|
4. **SPEC enters live**: after `finalize`, run the *Live transition to SPEC* (draft **only if no spec exists** for this objective; then the loop). **Asymmetry** intact: PLAN can **absorb** the progress (plan-exec picks up the existing working tree); SPEC **restarts** the design cycle and treats the half-done code as context/reference, never as ingested work.
|
|
69
69
|
|
|
70
|
-
## Continuity across prompts (operating context)
|
|
71
|
-
|
|
72
|
-
`quick` is where the **continuity rule** ([`../../SKILL.md`](../../SKILL.md) § *Operating context*) shows most clearly. Inside a workspace:
|
|
73
|
-
|
|
74
|
-
1. `/w:quick "first prompt"` (**command**) → creates session `NNN-<slug>-quick`, starts the loop. Scripts go to **its** `SCRIPTS.sql`.
|
|
75
|
-
2. `"second prompt"` (**no command**, related work) → does **not** create another session: **continues/reopens the most recent one** (from step 1) and appends the new scripts to **that same** `SCRIPTS.sql`.
|
|
76
|
-
3. `/w:quick "third prompt"` (**command** again) → **new** session, new loop.
|
|
77
|
-
|
|
78
|
-
> The **command** signals "new work line"; a **bare prompt** means "same line" → by default continue/reopen the most recent session (the *last started*). Clearly unrelated → offer choosing (`continuar NNN` | `trabajo nuevo`) or fall to the **no-flow** branch (write into `docs/` by convention + numbering). No workspace → **vanilla** behavior.
|
|
79
|
-
|
|
80
70
|
## Sequence
|
|
81
71
|
|
|
82
72
|
```
|
|
@@ -123,3 +113,7 @@ finalize: CHECKPOINT (AFTER: Pending→Completed) + BACKLOG (only if something i
|
|
|
123
113
|
- **No export**: nothing goes to `docs/`. Anything worth preserving → promoted separately via `export-*`, or escalated (to SPEC **live** — the line continues in spec-refine already as SPEC flow; to PLAN **deferred**, seed + pointer).
|
|
124
114
|
|
|
125
115
|
> QUICK's *convergence gate* is **proportional verification-first**: a **short** `Success criteria` seeded at start (not the *absence* of a checklist — its minimal version) — for code, "the change does what the prompt asked + tests/build green"; for analysis/design, a short ratified rubric. Minimal ceremony by design, but **always with the check declared first**.
|
|
116
|
+
|
|
117
|
+
## Conditional modules
|
|
118
|
+
|
|
119
|
+
- `resume` — continuity across prompts → `../../modules/PROMPT-CONTINUITY.md`
|