@tacuchi/agent-workflow-cli 23.0.0 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +37 -1
  2. package/dist/adapters/postgres-readonly-tools.js +277 -0
  3. package/dist/adapters/postgres-readonly-tools.js.map +1 -0
  4. package/dist/application/checkpoint/markdown.js +85 -5
  5. package/dist/application/checkpoint/markdown.js.map +1 -1
  6. package/dist/application/checkpoint-service.js +7 -6
  7. package/dist/application/checkpoint-service.js.map +1 -1
  8. package/dist/application/checkpoint-write-service.js +270 -16
  9. package/dist/application/checkpoint-write-service.js.map +1 -1
  10. package/dist/application/database-mcp-server.js +168 -0
  11. package/dist/application/database-mcp-server.js.map +1 -0
  12. package/dist/application/database-mcp-stdio.js +137 -0
  13. package/dist/application/database-mcp-stdio.js.map +1 -0
  14. package/dist/application/database-tool-catalog.js +226 -0
  15. package/dist/application/database-tool-catalog.js.map +1 -0
  16. package/dist/application/dsn-reader-service.js +1 -1
  17. package/dist/application/flow/advance.js +60 -10
  18. package/dist/application/flow/advance.js.map +1 -1
  19. package/dist/application/flow/internal-actions.js +1 -1
  20. package/dist/application/flow/internal-actions.js.map +1 -1
  21. package/dist/application/flow/submit.js +256 -9
  22. package/dist/application/flow/submit.js.map +1 -1
  23. package/dist/application/lifecycle-target.js +16 -19
  24. package/dist/application/lifecycle-target.js.map +1 -1
  25. package/dist/application/lock-service.js +96 -31
  26. package/dist/application/lock-service.js.map +1 -1
  27. package/dist/application/logging/log-events.js +19 -3
  28. package/dist/application/logging/log-events.js.map +1 -1
  29. package/dist/application/logging/logger.js +2 -2
  30. package/dist/application/logging/logger.js.map +1 -1
  31. package/dist/application/markdown.js +6 -2
  32. package/dist/application/markdown.js.map +1 -1
  33. package/dist/application/mcp-connections-service.js +115 -41
  34. package/dist/application/mcp-connections-service.js.map +1 -1
  35. package/dist/application/mcp-doctor-service.js +98 -54
  36. package/dist/application/mcp-doctor-service.js.map +1 -1
  37. package/dist/application/mcp-entry-classification.js +60 -0
  38. package/dist/application/mcp-entry-classification.js.map +1 -0
  39. package/dist/application/mcp-host-reader.js +102 -86
  40. package/dist/application/mcp-host-reader.js.map +1 -1
  41. package/dist/application/mcp-host-receipt-service.js +399 -0
  42. package/dist/application/mcp-host-receipt-service.js.map +1 -0
  43. package/dist/application/mcp-host-receipt-store.js +122 -0
  44. package/dist/application/mcp-host-receipt-store.js.map +1 -0
  45. package/dist/application/mcp-host-receipts.js +28 -0
  46. package/dist/application/mcp-host-receipts.js.map +1 -0
  47. package/dist/application/mcp-host-writer.js +209 -38
  48. package/dist/application/mcp-host-writer.js.map +1 -1
  49. package/dist/application/mcp-launch-probe-service.js +142 -0
  50. package/dist/application/mcp-launch-probe-service.js.map +1 -0
  51. package/dist/application/mcp-migration-service.js +351 -0
  52. package/dist/application/mcp-migration-service.js.map +1 -0
  53. package/dist/application/mcp-native-host-check-service.js +154 -0
  54. package/dist/application/mcp-native-host-check-service.js.map +1 -0
  55. package/dist/application/mcp-receipt-registration-service.js +105 -0
  56. package/dist/application/mcp-receipt-registration-service.js.map +1 -0
  57. package/dist/application/mcp-receipt-removal-service.js +62 -0
  58. package/dist/application/mcp-receipt-removal-service.js.map +1 -0
  59. package/dist/application/mcp-remove-service.js +83 -24
  60. package/dist/application/mcp-remove-service.js.map +1 -1
  61. package/dist/application/mcp-scope-common.js +1 -1
  62. package/dist/application/mcp-scope-common.js.map +1 -1
  63. package/dist/application/mcp-setup-service.js +59 -24
  64. package/dist/application/mcp-setup-service.js.map +1 -1
  65. package/dist/application/mcp-stdio-probe.js +526 -0
  66. package/dist/application/mcp-stdio-probe.js.map +1 -0
  67. package/dist/application/mcp-test-connection-service.js +23 -50
  68. package/dist/application/mcp-test-connection-service.js.map +1 -1
  69. package/dist/application/parsers/spec-functional.js +220 -0
  70. package/dist/application/parsers/spec-functional.js.map +1 -0
  71. package/dist/application/parsers/spec-relation.js +142 -5
  72. package/dist/application/parsers/spec-relation.js.map +1 -1
  73. package/dist/application/paths-service.js +13 -0
  74. package/dist/application/paths-service.js.map +1 -1
  75. package/dist/application/plan-exec-decision-service.js +57 -4
  76. package/dist/application/plan-exec-decision-service.js.map +1 -1
  77. package/dist/application/reseal-service.js +300 -0
  78. package/dist/application/reseal-service.js.map +1 -0
  79. package/dist/application/self/host-states.js.map +1 -1
  80. package/dist/application/self/install-skill.js +4 -34
  81. package/dist/application/self/install-skill.js.map +1 -1
  82. package/dist/application/self/mcp-config.js +369 -59
  83. package/dist/application/self/mcp-config.js.map +1 -1
  84. package/dist/application/self/mcp-via-state.js +9 -6
  85. package/dist/application/self/mcp-via-state.js.map +1 -1
  86. package/dist/application/self/uninstall-skill.js +3 -18
  87. package/dist/application/self/uninstall-skill.js.map +1 -1
  88. package/dist/application/self/uninstall.js +4 -23
  89. package/dist/application/self/uninstall.js.map +1 -1
  90. package/dist/application/workline-index-service.js +64 -6
  91. package/dist/application/workline-index-service.js.map +1 -1
  92. package/dist/application/workspace-init-service.js +4 -6
  93. package/dist/application/workspace-init-service.js.map +1 -1
  94. package/dist/cli/commands/checkpoint-write.js +24 -22
  95. package/dist/cli/commands/checkpoint-write.js.map +1 -1
  96. package/dist/cli/commands/index.js +7 -0
  97. package/dist/cli/commands/index.js.map +1 -1
  98. package/dist/cli/commands/mcp.js +642 -55
  99. package/dist/cli/commands/mcp.js.map +1 -1
  100. package/dist/cli/commands/reseal.js +140 -0
  101. package/dist/cli/commands/reseal.js.map +1 -0
  102. package/dist/cli/commands/status.js +5 -1
  103. package/dist/cli/commands/status.js.map +1 -1
  104. package/dist/cli/commands/tool.js +141 -0
  105. package/dist/cli/commands/tool.js.map +1 -0
  106. package/dist/cli/help-groups.js +7 -1
  107. package/dist/cli/help-groups.js.map +1 -1
  108. package/dist/cli/main.js +189 -57
  109. package/dist/cli/main.js.map +1 -1
  110. package/dist/cli/parser.js +5 -1
  111. package/dist/cli/parser.js.map +1 -1
  112. package/dist/cli/registry.js.map +1 -1
  113. package/dist/cli/render.js +15 -2
  114. package/dist/cli/render.js.map +1 -1
  115. package/dist/cli/tui/components/host-admin-section.js +2 -46
  116. package/dist/cli/tui/components/host-admin-section.js.map +1 -1
  117. package/dist/cli/tui/tabs/mcp-tab-helpers.js +71 -0
  118. package/dist/cli/tui/tabs/mcp-tab-helpers.js.map +1 -1
  119. package/dist/cli/tui/tabs/mcp-tab.js +101 -42
  120. package/dist/cli/tui/tabs/mcp-tab.js.map +1 -1
  121. package/dist/domain/database-tools.js +445 -0
  122. package/dist/domain/database-tools.js.map +1 -0
  123. package/dist/domain/effective-contract.js +10 -2
  124. package/dist/domain/effective-contract.js.map +1 -1
  125. package/dist/domain/flow/answer.js +4 -0
  126. package/dist/domain/flow/answer.js.map +1 -1
  127. package/dist/domain/flow/authority.js +103 -14
  128. package/dist/domain/flow/authority.js.map +1 -1
  129. package/dist/domain/flow/directive.js +2 -0
  130. package/dist/domain/flow/directive.js.map +1 -1
  131. package/dist/domain/flow/run-state.js +42 -0
  132. package/dist/domain/flow/run-state.js.map +1 -1
  133. package/dist/domain/lineage.js +38 -11
  134. package/dist/domain/lineage.js.map +1 -1
  135. package/dist/domain/mcp-entry.js +131 -17
  136. package/dist/domain/mcp-entry.js.map +1 -1
  137. package/dist/domain/postgres-object-search.js +320 -0
  138. package/dist/domain/postgres-object-search.js.map +1 -0
  139. package/dist/domain/redaction.js +47 -0
  140. package/dist/domain/redaction.js.map +1 -0
  141. package/dist/domain/workline-mcp-entry.js +6 -9
  142. package/dist/domain/workline-mcp-entry.js.map +1 -1
  143. package/dist/ports/postgres-tools.js +10 -0
  144. package/dist/ports/postgres-tools.js.map +1 -0
  145. package/package.json +5 -1
  146. package/skills/w/commands/plan-exec.md +1 -1
  147. package/skills/w/commands/spec-new.md +6 -5
  148. package/skills/w/context/MANIFEST.json +1 -1
  149. package/skills/w/harness/HARNESS.md +1 -1
  150. package/skills/w/hooks/README.md +13 -9
  151. package/skills/w/hooks/hooks.template.json +2 -2
  152. package/skills/w/loops/CHASSIS.md +1 -1
  153. package/skills/w/loops/plan-exec-loop/LOOP.md +7 -5
  154. package/skills/w/loops/plan-new-loop/LOOP.md +46 -41
  155. package/skills/w/loops/plan-refine-loop/LOOP.md +4 -4
  156. package/skills/w/loops/quick-loop/LOOP.md +12 -13
  157. package/skills/w/loops/spec-refine-loop/LOOP.md +7 -3
  158. package/skills/w/modules/COMPACTION.md +1 -1
  159. package/skills/w/modules/PLAN-INPUT.md +3 -3
  160. package/skills/w/modules/PROMPT-CONTINUITY.md +1 -1
  161. package/dist/application/mcp-dbhub-launcher.js +0 -216
  162. package/dist/application/mcp-dbhub-launcher.js.map +0 -1
  163. package/dist/application/self/mcp-offer.js +0 -96
  164. package/dist/application/self/mcp-offer.js.map +0 -1
@@ -23,7 +23,7 @@ PLAN
23
23
  `/w:plan-exec` — **resumable** (same chassis mechanism; here resume keys off the plan-doc phase states + checkboxes + CHECKPOINT, see Delta 1).
24
24
 
25
25
  ## Reads
26
- `docs/plans/PPP-plan-<slug>.md` (locate via the `docs/plans/PPP-plan-*.md` glob or the exact path from the command argument) **and its source spec** (resolved through the plan's `## Origin`) — the entry gate reads both. It runs any plan whose source contract is executable: `> Límite de ejecución: checkout`, explicit phase/task sources and aliases from `AGENTS.md > Fuentes`. A legacy or v21 plan that lacks it fails closed to [`plan-refine-loop`](../plan-refine-loop/LOOP.md); plan-refine remains auxiliary only after that contract exists. If the plan pins design, it also reads the **UI Design Package** revisions its `## Design references` and its tasks name — **read-only**, at the exact revision each one fixed (§ *Design precondition gate*).
26
+ `docs/plans/PPP-plan-<slug>.md` (the `docs/plans/PPP-plan-*.md` glob, or the given path) **and its source spec** (from its `> Derived from`, else one in `## Origin`; none if `> Standalone:`) — the entry gate reads both. It runs any plan whose source contract is executable: `> Límite de ejecución: checkout`, explicit phase/task sources and aliases from `AGENTS.md > Fuentes`. A legacy or v21 plan that lacks it fails closed to [`plan-refine-loop`](../plan-refine-loop/LOOP.md); plan-refine remains auxiliary only after that contract exists. If the plan pins design, it also reads the **UI Design Package** revisions its `## Design references` and its tasks name — **read-only**, at the exact revision each one fixed (§ *Design precondition gate*).
27
27
 
28
28
  ## Writes
29
29
  - `docs/plans/PPP-plan-<slug>.md` (**read/update**, living doc: phase/task state, `Open questions`).
@@ -145,9 +145,11 @@ This gate lives **only** in this loop — the chassis does not carry it. It has
145
145
  run stops at it: declaring a deviation no longer carries on to the commit by itself.
146
146
 
147
147
  - **Local decision — `plan-exec` continues.** A class or method name; a local helper; internal code layout; imports; a choice between equivalent APIs already allowed; a fix needed to compile; a minor refactor that does not move the journey; one extra focused test for a risk found while implementing. Declares **no signal** — the gate is not raised — and is recorded in `DECISION` only when it is not obvious.
148
- - **Composable decision — a note is registered and execution continues.** The change amends how the promise is met without changing who promised it. It is the only exit that writes a **decision note**, and it is available **only** when all four closures hold (below). The spec and the plan stay byte-exact.
148
+ - **Composable decision — a note is registered and execution continues.** The change amends how the promise is met without changing who promised it. It is the only exit that writes a **decision note**, and it is available **only** when all four closures hold (below). The spec and the plan stay byte-exact. A **standalone** plan has no chain to add a note to: its decision stays in the run's trace and you write it into the session's `DECISION.md`.
149
149
  - **Structural deviation — stop and return to `plan-refine`.** Stop when the change touches: an input or output; an observable state; a relevant endpoint or public contract; the set of participating components or repositories; the phase order; the simulation boundary; the integration strategy; a material dependency; the main persistence mechanism; a phase already `validada`; the evidence needed to demonstrate the result. A decision that substantially expands or shrinks the work counts too.
150
- - **Functional change — return to `spec-refine`.** Stop when the change touches: the expected result; the functional scope; a business rule; an acceptance criterion; the actor or consumer; or a product decision.
150
+ - **Functional change — return to `spec-refine`.** Stop when the **promise of the product** moves: the expected result; the functional scope; a business rule; the outcome an acceptance criterion states; the actor or consumer; a product decision. A technical divergence that leaves the promise intact never comes back here — its first exit is `Registrar la decisión y seguir`.
151
+
152
+ > **How an affirmation is addressed:** a decision note names the criteria it amends as `S{NNN}/AC-nn` — `NNN` from the spec file's number, `AC-nn` the label the criterion carries in the spec's checklist. The CLI **derives** that id from the label plus the file number, so the readable form the spec template writes is already addressable (a criterion that spells the full id is read the same way, never counted twice). A note amending a criterion the spec does not state **at all** is refused with `CONTRACT_ASSERTION_ABSENT`, and the exit is the spec stating it (`spec-refine`), never a second spelling of the id here.
151
153
 
152
154
  **Eligibility is closure, never size.** The composable exit opens only when the four close: the
153
155
  divergence stays in the **same functional lineage**; its **intent is settled**, so nothing further has
@@ -178,7 +180,7 @@ erases an earlier one.
178
180
  | Add a participating repository | stops | — | yes | — |
179
181
  | Move the simulation to another boundary | stops | — | yes | — |
180
182
  | Change the phase order | stops | — | yes | — |
181
- | Add a functional rule · change an acceptance criterion | stops | — | — | yes |
183
+ | Add a functional rule · move the outcome a criterion promises | stops | — | — | yes |
182
184
  | Does not compose against this lineage at all | stops | — | — | a spec of its own |
183
185
 
184
186
  ## Delta 2 — Git policy: **safe branch + proposed commits**
@@ -201,7 +203,7 @@ adds nothing of its own beyond running on a verified branch and never
201
203
  order, then the justified checks and cross-cutting validations. `isolated` runs the same stack for
202
204
  its single phase.
203
205
  - Each added test is re-weighed at the closing review gate ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate* → *Test-value lens*, tag `overtest`): over-testing is a **finding to fix or justify**, never an automatic rejection.
204
- - Also run the plan's `## Validations` (cross-cutting rules and constraints) + the Final behavior block of `## Solution` (legacy plans: the `## Final behavior` section) + the spec's acceptance/success criteria (its `## Scenarios`, if present, are ready-made test cases: GIVEN=arrange · WHEN=act · THEN=assert).
206
+ - Also run the plan's `## Validations` (cross-cutting rules and constraints) + the Final behavior block of `## Solution` (legacy plans: the `## Final behavior` section). **What execution runs is the PLAN's evidence, never the spec's prose:** `plan-new` already derived those validations from the spec's acceptance criteria and its `## Scenarios`, so the spec is confirmed functionally **through** them. A criterion no validation covers is a gap of the plan, not a test to improvise here.
205
207
  - A validation that **runs and fails** → back into the phase (gap): no advancing, no `validada`.
206
208
 
207
209
  - **SQL delivery**: validate the migration's behavior against a fixture or ephemeral database in the acquired checkout. The forward/rollback script is delivered through `SCRIPTS.sql` and `export-scripts`; a real application is an optional handoff and never keeps a phase or the plan open.
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: plan-new-loop
3
3
  description: >-
4
- Generates an executable plan (docs/plans/PPP-plan-<slug>.md) from a spec.
5
- Heir of CHASSIS: phases are verifiable states; research maps impact and
6
- gaps; UI design roots are reused or promoted and pinned. Suggests
7
- spec-refine first when needed. Started by /w:plan-new; resumable.
4
+ Generates an executable plan (docs/plans/PPP-plan-<slug>.md) from a spec, or
5
+ standalone from the conversation. Heir of CHASSIS: phases are verifiable
6
+ states; research maps impact and gaps; UI design roots are reused or
7
+ promoted and pinned. Started by /w:plan-new; resumable.
8
8
  ---
9
9
 
10
10
  # plan-new-loop
@@ -21,14 +21,14 @@ PLAN
21
21
  `/w:plan-new` — **resumable** (same chassis mechanism, keyed off CHECKPOINT).
22
22
 
23
23
  ## Reads
24
- `docs/specs/NNN-spec-*.md` (glob or argument path). Readiness comes from frontmatter `status`, never the filename; an unrefined spec only suggests [`PLAN-INPUT`](../../modules/PLAN-INPUT.md)'s refine path. Questions routed to `PLAN` remain input to this loop.
24
+ `docs/specs/NNN-spec-*.md` (glob or argument path). Readiness comes from frontmatter `status`, never the filename; an unrefined spec only soft-suggests a refine ([`PLAN-INPUT`](../../modules/PLAN-INPUT.md)). Questions routed to `PLAN` remain input to this loop.
25
25
 
26
26
  ## Writes
27
27
  `docs/plans/PPP-plan-<slug>.md` (`generate`; overwrite needs confirmation), or sibling plans after an accepted split (§ *Split gate (multi-plan)*). With UI it also publishes the scoped design revision in `docs/designs/`; it never graduates/exports anything else to `docs/` — that is separate `export-*` work.
28
28
 
29
- > **Naming:** [`PLAN-INPUT`](../../modules/PLAN-INPUT.md) § *Numbering* claims `PPP` for its run; only its owner fills it and an unpublished close frees it. Plans glob as `docs/plans/PPP-plan-*.md`.
29
+ > **Naming:** [`PLAN-INPUT`](../../modules/PLAN-INPUT.md) § *Numbering* claims `PPP` for its run; only its owner fills it and an unpublished close frees it.
30
30
 
31
- > **Adoption (mode 4):** the command transcribes an externally-built plan once into Delta 1, records `## Origin`, then `plan-refine` closes schema gaps. See [`PLAN-INPUT`](../../modules/PLAN-INPUT.md).
31
+ > **Adoption (mode 4):** an external plan is transcribed once into Delta 1 with its `## Origin`; `plan-refine` closes the schema gaps.
32
32
 
33
33
  ## Inherits
34
34
 
@@ -36,15 +36,15 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
36
36
 
37
37
  ## Internal sessions — PLAN-new instance
38
38
 
39
- Full doctrine in the chassis (§ *Internal sessions* + *Numbering*). This loop's instance:
39
+ Full doctrine in the chassis (§ *Internal sessions* + *Numbering*):
40
40
 
41
41
  | Session | When | Artifacts | Role |
42
42
  |---|---|---|---|
43
- | **plan session** `NNN-<slug>-plan-new/` | when the loop starts (or resumes) | `SESSION.md` · `CHECKPOINT.md` (· `BACKLOG.md` only if something is deferred) | Owns the run. Type = `refine`; descriptor `<slug>-plan-new` (the `<slug>` comes from the input spec). |
43
+ | **plan session** `NNN-<slug>-plan-new/` | when the loop starts (or resumes) | `SESSION.md` · `CHECKPOINT.md` (· `BACKLOG.md` only if something is deferred) | Owns the run. Type = `refine`; descriptor `<slug>-plan-new`. |
44
44
 
45
- ## Delta 1 — Deliverable: the RICH PLAN (`PPP-plan-<slug>.md`)
45
+ ## Delta 1 — Deliverable: the RICH PLAN
46
46
 
47
- The plan keeps technical detail and roadmap inline:
47
+ Technical detail and roadmap stay inline:
48
48
 
49
49
  ```markdown
50
50
  # Plan PPP — <slug>
@@ -59,16 +59,23 @@ The plan keeps technical detail and roadmap inline:
59
59
  ## Dependencies docs · sources · DBs · sessions · inter-plan order (opt.)
60
60
  ## Design references the baselines this plan's roots pin (opt. — only with UI)
61
61
  ## Tasks `### Fn` blocks: the ONLY source of phases (core)
62
- ## Execution batches complete phase partition; contract in PLAN-EXECUTION-BATCHES (core)
63
- ## Validations cross-cutting validations and constraints (core)
62
+ ## Execution batches complete phase partition (core)
63
+ ## Validations cross-cutting rules + the evidence derived from the spec (core)
64
64
  ## Risks / impact technical risks and impacts (opt.)
65
65
  ## Assumptions delta over the spec only (opt.)
66
66
  ## Open questions pending; core when any exist; OMIT the section when empty
67
67
  ```
68
68
 
69
69
  Core sections always appear; optional ones only when warranted. Legacy readers tolerate the old
70
- separate sections. New plans never write them. The exec session has no `TECHNICAL-NOTE` or own
71
- `TASKS`: detail and progress live in this plan.
70
+ separate sections, which new plans never write.
71
+
72
+ > **Header, seal and evidence.** A plan born from the conversation carries
73
+ > `> Standalone: <origen> · generated by plan-new-loop` instead of `> Derived from …` (fixed label, free
74
+ > prose): it seals no baseline and its deviations go to the session, never to a contract note. With a
75
+ > spec, the `> Baseline:` the CLI seals is a **functional** digest of it: an editorial edit leaves this
76
+ > plan aligned, and a seal still reading one as divergent is re-sealed (`aw reseal`: `prepare` → `apply
77
+ > --approval`, or a re-publication), never redesigned. `## Validations` **derives** from the spec's
78
+ > acceptance criteria and `## Scenarios` — tests, evidence and commands live here, outcomes there.
72
79
 
73
80
  Batch syntax, inference and runtime semantics are defined once in
74
81
  [`PLAN-EXECUTION-BATCHES`](../../modules/PLAN-EXECUTION-BATCHES.md).
@@ -76,7 +83,6 @@ Batch syntax, inference and runtime semantics are defined once in
76
83
  ## Phase contract (canonical)
77
84
 
78
85
  A `### Fn` block is a **verifiable state of the system**, never a list of layers, files or classes.
79
- This is the single contract; the other PLAN loops reference it.
80
86
 
81
87
  ```markdown
82
88
  ### F1 — <result-oriented name>
@@ -91,13 +97,13 @@ This is the single contract; the other PLAN loops reference it.
91
97
  ```
92
98
 
93
99
  **Required**: `Resultado` · `Trabajo` · `Validación de fase` · `Condición de salida` · the state
94
- line · `Fuentes`. Every task declares `_(fuentes: …)_`; task sources are a phase subset and either
95
- `workspace` or an exact `AGENTS.md > Fuentes` alias. `Impacted` never substitutes them. **Conditional**: `Estado inicial` when unclear · `Recorrido afectado` for a distributed
100
+ line · `Fuentes`. Every task declares `_(fuentes: …)_`, a phase subset (`workspace` or an exact
101
+ `AGENTS.md > Fuentes` alias); `Impacted` never substitutes them. **Conditional**: `Estado inicial` when unclear · `Recorrido afectado` for a distributed
96
102
  change · `Dependencias` when direct sequence is insufficient · `Límite de simulación` (**only** when temporary behavior exists) · `Diferido` when work was consciously excluded.
97
103
  **A new phase never writes an empty conditional block.**
98
104
 
99
- **Checkout is the only closing surface.** Proof is a local command, fixture, ephemeral DB or checkout
100
- inspection. A deployed host, product or remote read is research or non-blocking `Handoff operativo`, never phase closure.
105
+ **Checkout is the only closing surface**: proof is a local command, fixture, ephemeral DB or checkout
106
+ inspection — a deployed host, product or remote read is research or a non-blocking `Handoff operativo`.
101
107
 
102
108
  **Phase state = machine state.** One bare `> Estado: <value>` line uses `pendiente` | `en ejecución`
103
109
  | `bloqueada` | `validada`. It is updated in place and counted
@@ -115,18 +121,18 @@ closure is `final_validation_pending`.
115
121
 
116
122
  **Granularity is semantic, not mechanical.** A phase leaves a demonstrable state. A task is a
117
123
  coherent purpose and may touch many files; an edit operation is a **micro step**, never a plan
118
- entry. `XS–S` informs risk and scope but does not force mechanical splitting.
124
+ entry. Size labels inform risk and scope; they never force a mechanical split.
119
125
 
120
126
  ## Delta 2 — Gap taxonomy (of "plan")
121
127
 
122
- Replaces the spec gap taxonomy with a planning-oriented one:
128
+ Replaces the spec taxonomy with a planning one:
123
129
 
124
130
  | Gap | Signal | Resolved by |
125
131
  |---|---|---|
126
132
  | Approach/Solution undefined | the how is vague | research / human |
127
133
  | Components unidentified | FE/BE/DB impact unknown | **research** (maps the code) |
128
134
  | AS-IS wiring unknown | current state unknown | **research** |
129
- | Journey unmapped | the observable contract, the participating components or the repo/process boundaries are unknown — the phases cannot be ordered | **research** |
135
+ | Journey unmapped | the observable contract, the participating components or the repo/process boundaries are unknown, so the phases cannot be ordered | **research** |
130
136
  | Phase without a state | a `### Fn` mixes unrelated functional states, or nothing can be validated until the very end | the AI re-shapes it by state (**human** confirms an order change) |
131
137
  | Plan splittable | independently deliverable tranches — different moments/priorities, no shared deps/risk | **human consents** → split (see *Split gate (multi-plan)*) |
132
138
  | Task named as an edit | the name states an edit operation ("create class X", "add method Y") instead of a purpose | the AI re-states it by purpose |
@@ -134,13 +140,13 @@ Replaces the spec gap taxonomy with a planning-oriented one:
134
140
  | Simulation without lifecycle | temporary behavior exists with no phase that displaces it and no phase that retires it | the AI derives both / **human** |
135
141
  | Phase without evidence | the block declares no `Validación de fase` | the AI derives it from the criteria / **human** |
136
142
  | Invalid execution batches | phases are missing/duplicated or cross an ineligible continuous boundary | the AI re-infers the maximal partition |
137
- | Over-engineered solution | approach heavier than the criteria need — needless abstraction/layer/dependency, or a phase/task not required to meet the spec (chassis § *Minimality*) | AI proposes the lighter path + **human** confirms (**probe** if "lighter works" is a runnable doubt) |
143
+ | Over-engineered solution | approach heavier than the criteria need — needless abstraction/layer/dependency, or a phase/task the spec does not require (chassis § *Minimality*) | AI proposes the lighter path + **human** confirms (**probe** if "lighter works" is a runnable doubt) |
138
144
  | Missing deps | order unclear | research / human |
139
- | Spec criteria uncovered | tasks don't trace to acceptance criteria | the AI derives + human confirms |
145
+ | Spec criteria uncovered | no task or evidence traces to a criterion | the AI derives + human confirms |
140
146
  | Unaddressed risks | technical risks unmitigated/undeclared | human / **probe** (Delta 5) |
141
- | UI without design *(if it applies)* | the plan includes UI (FE/screens in `Impacted`, `## Design references` in the spec, or UI tasks) and pins no exact root, or its roots are not `handoff` | **`design`** (promote the closure, pin the roots — reusing an already valid compact handoff instead of re-promoting it) |
147
+ | UI without design *(if it applies)* | the plan includes UI (FE/screens in `Impacted`, `## Design references` in the spec, or UI tasks) and pins no exact root, or its roots are not `handoff` | **`design`** (promote the closure, pin the roots — reusing a valid compact handoff instead of re-promoting it) |
142
148
 
143
- > **Author the Solution the laziest-that-works way** (chassis § *Minimality*, generative side): reuse what the codebase/stdlib/platform already provides before proposing new abstractions, layers or dependencies — the coherence gate then only *confirms* minimality, never repairs over-engineering after the fact.
149
+ > **Author the Solution the laziest-that-works way** (chassis § *Minimality*, generative side): reuse what the codebase/stdlib/platform already provides before adding abstractions, layers or dependencies — the gate then *confirms* minimality instead of repairing over-engineering.
144
150
 
145
151
  ## Delta 3 — What research investigates here
146
152
 
@@ -162,14 +168,14 @@ plan-new-loop(spec):
162
168
  gaps = detect_gaps(work) (Delta 2 taxonomy) minus the exhausted ones
163
169
  if gaps == ∅: break
164
170
  batch ≤3 → seed CHECKPOINT.Pending/Next → resolve each gap:
165
- research · human (structured-choice) · probe · design (reuse valid handoff or promote missing closure + pin roots)
171
+ research · human (structured-choice) · probe · design (reuse a valid handoff, or promote + pin roots)
166
172
  integrate + update CHECKPOINT
167
173
  coherence gate (read-only) = Success criteria green:
168
- - every spec criterion traces to a phase/task (split: exactly one sibling)
174
+ - every spec criterion traces to a phase/task + evidence (`## Validations`/`Validación de fase`) (split: exactly one sibling)
169
175
  - the Final behavior block of ## Solution covers the criteria
170
176
  - every ### Fn leaves a verifiable state with its own exit condition — never a list of layers or files
171
177
  - the order allows early integration · deps without cycles · Impacted consistent with Solution
172
- - ONLY when the change carries simulation, its displacement and retirement are owned
178
+ - only when the change carries simulation, its displacement and retirement are owned
173
179
  - every phase declares primary evidence; layer tests are justified
174
180
  - Execution batches partitions every phase once and crosses only eligible boundaries
175
181
  - resumable between units and within one through states/checkboxes
@@ -177,25 +183,24 @@ plan-new-loop(spec):
177
183
  - (UI) every screen/UI task pins an exact root against a declared baseline · that closure is handoff · nothing outside it was promoted
178
184
  whatever fails → comes back as a gap
179
185
  hand the CLI the exact bytes of the plan — and of the siblings, if the split was accepted
180
- the CLI seals them into ONE proposal and shows its preview: destination, weight, what it replaces
186
+ the CLI seals them into ONE proposal and previews it: destination, weight, what it replaces
181
187
  structured_choice(content: [Aprobar y guardar, Refinar], flow: [Compactar, Cerrar])
182
- Aprobar y guardar → the CLI writes every file of the preview, together or not at all
183
- Refinar → nothing is written and the generation stays open
188
+ Aprobar y guardar → every file of the preview is written, together or not at all
189
+ Refinar → nothing is written and the generation stays open
184
190
  finalize: CHECKPOINT persisted (+ BACKLOG only if something is deferred) + close session + report
185
191
  ```
186
192
 
187
193
  ## Convergence / exit
188
194
 
189
- - **No material gaps** → **coherence gate** (the *Sequence* checklist; the PLAN-new instance of the chassis convergence gate). Criterion→task traceability is a **checked invariant**, never a separate section.
190
- - **The gate judges functional states, not size.** Each phase needs an exit condition, evidence and,
191
- **only when the change carries one**, its simulation lifecycle.
192
- - Passes → the save confirmation and, only after it, the write (confirmed again if the document
193
- exists) → `finalize`. On the split branch the same step writes the N siblings.
195
+ - **No material gaps** → **coherence gate** (the *Sequence* checklist). Criterion→task traceability is a **checked invariant**, never a separate section, and it runs one way: the PLAN covers the SPEC, never the reverse.
196
+ - **The gate judges functional states, not size.**
197
+ - Passes → the save confirmation and only then the write (confirmed again if the document exists) →
198
+ `finalize`. The split branch writes the N siblings in that same step.
194
199
 
195
- > **When the gate is evaluated, when the offer appears and with what alternatives, is not this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document. The *Sequence* above stays as the loop's shape; it is not its scheduler.
196
- - `Cerrar` at any time → `finalize` (persists `CHECKPOINT`; `BACKLOG` only if something is deferred; closes the session, reports).
200
+ > **When the gate is evaluated, when the offer appears and with what alternatives, is not this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document.
201
+ - `Cerrar` at any time → `finalize` (persists `CHECKPOINT`, closes the session, reports).
197
202
 
198
- > **After generating:** run `plan-exec`; use optional `plan-refine` when the structure changes first.
203
+ > **After generating:** run `plan-exec` (`plan-refine` first only if the structure changes).
199
204
 
200
205
  ## Conditional modules
201
206
 
@@ -90,9 +90,9 @@ Reuses plan-new-loop's gap taxonomy **in full** ([`plan-new-loop`](../plan-new-l
90
90
 
91
91
  | Gap | Signal | Resolved by |
92
92
  |---|---|---|
93
- | Plan↔spec drift | the spec was re-refined and the plan fell out of line | **research** (re-reads the spec) / **human** |
93
+ | Plan↔spec drift | the spec changed **functionally** (requirement, scope, criteria, scenarios, behavioral changes) and the plan fell out of line — an editorial edit of the spec is not drift: a `> Baseline:` that still reads one as divergent is closed by **re-sealing** (`aw reseal`, or the re-publication of the plan this loop's own save performs), never by a redesign, and the run does not converge leaving it divergent | **research** (re-reads the spec) / **human** |
94
94
 
95
- > **Spec-less degradation (hand-written / adopted plans).** When the plan has **no source spec** (`## Origin` = adopted / hand-written), the spec-anchored checks **degrade gracefully**: "spec criteria uncovered" and "plan↔spec drift" do **not** apply — criterion→task traceability anchors to the plan's **own** Final behavior block (in `## Solution`) / `## Validations` instead. The rest of the taxonomy (phase shape, simulation, evidence, deps, Impacted↔Solution, UI→SPEC) applies unchanged. Normalizing an adopted plan to the full Delta 1 schema **is** this loop's job (missing `(core)` sections are gaps).
95
+ > **A spec-less plan is a first-class mode (standalone / hand-written / adopted).** When the plan has **no source spec** (`> Standalone:`, or `## Origin` = adopted / hand-written), the spec-anchored checks do not apply: "spec criteria uncovered" and "plan↔spec drift" are out, and criterion→task traceability anchors to the plan's **own** Final behavior block (in `## Solution`) / `## Validations` instead. The rest of the taxonomy (phase shape, simulation, evidence, deps, Impacted↔Solution, UI→SPEC) applies unchanged. Normalizing an adopted plan to the full Delta 1 schema **is** this loop's job (missing `(core)` sections are gaps).
96
96
 
97
97
  > **Adjust the Solution the laziest-that-works way** (chassis § *Minimality*, generative side): reuse what already exists before adding abstractions, layers or dependencies — the coherence gate only *confirms* minimality, and a re-refine is a chance to *remove* over-building, not add it.
98
98
 
@@ -119,7 +119,7 @@ Each phase carries proof of behavior, not of structure. Three levels, **chosen**
119
119
  2. **Focused proofs** — where a layer owns rules, a relevant transformation, error handling, persistence, transactions, temporal logic or an external integration.
120
120
  3. **Risk proofs** — security, concurrency, idempotency, retries, known regressions, plausible high-impact failures.
121
121
 
122
- The primary proof lives **inside its `### Fn` block** (`Validación de fase`); `## Validations` keeps the cross-cutting rules and constraints. A simulation gets only the minimum proof that demonstrates the wiring — no suite is built around what the next phase retires.
122
+ The primary proof lives **inside its `### Fn` block** (`Validación de fase`); `## Validations` keeps the cross-cutting rules and the evidence derived from the spec's criteria and `## Scenarios`. A simulation gets only the minimum proof that demonstrates the wiring.
123
123
 
124
124
  > **Necessity gate** (design criterion, not a record to keep): what behavior does the test demonstrate, what unique failure would it catch, is that already demonstrated elsewhere, does it target a stable boundary or an internal detail, does the layer own logic or risk, is it still worth keeping once the simulation is gone? No clear answer → it is not planned. Whatever slips through and only mirrors structure is flagged `overtest` by execution's closing review gate.
125
125
 
@@ -158,7 +158,7 @@ plan-refine-loop(plan):
158
158
  integrate + update CHECKPOINT # artifact-first cycle
159
159
  executability gate (read-only) = Success criteria green:
160
160
  - contract · journey · phases · source boundary · simulation · evidence · execution batches · resumability (§ Executability gate)
161
- - plan-new checklist (criterion→task · Final behavior block of Solution · deps · Impacted↔Solution · UI→exact roots · minimality)
161
+ - plan-new checklist (criterion→task+evidence · Final behavior block of Solution · deps · Impacted↔Solution · UI→exact roots · minimality)
162
162
  # spec-less plan (adopted/hand-written): criteria anchor to the plan's own Final behavior block/Validations (see Delta 2)
163
163
  - re-refine's own check: the plan is REALIGNED with what changed
164
164
  whatever fails → comes back as a gap
@@ -34,7 +34,7 @@ QUICK
34
34
 
35
35
  ## Internal session
36
36
 
37
- - **ALWAYS** creates a light session with descriptor `<slug>-quick` → `NNN-<slug>-quick` (Type = `quick`, ≈ `exec`): `SESSION` · `DECISION` · `SCRIPTS.sql` · `CHECKPOINT` (+ `BACKLOG` only if something is deferred). A single session. Research is **inline** inside it (`ANALYSIS-FILE`/`CONCLUSIONS` + read-only `SCRIPTS.sql` in its folder). The caller passes only the descriptor; the CLI prepends the global sequential `NNN` (see chassis). **Exception:** if the entry **size gate** escalates to SPEC, the quick run never comes to exist — no quick session is created; the session is the `spec-refine-loop` one.
37
+ - **ALWAYS** creates a light session with descriptor `<slug>-quick` → `NNN-<slug>-quick` (Type = `quick`, ≈ `exec`): `SESSION` · `DECISION` · `SCRIPTS.sql` · `CHECKPOINT` (+ `BACKLOG` only if something is deferred). A single session. Research is **inline** inside it (`ANALYSIS-FILE`/`CONCLUSIONS` + read-only `SCRIPTS.sql` in its folder). **Exception:** an entry-gate escalation to SPEC creates no quick session — the run never comes to exist and the session is the `spec-refine-loop` one.
38
38
 
39
39
  ## Inherits
40
40
 
@@ -44,35 +44,32 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
44
44
 
45
45
  `git` · `sql` (DB rule) · `research` (inline). Resolved via `.workflow/skills.toml`.
46
46
 
47
- > **Ambient conventions (not roles):** code/testing/writing standards and `creating-tools` are standalone skills the host auto-discovers by `description` — Workline neither binds nor depends on them. Full doctrine: [../../roles/README.md](../../roles/README.md).
48
-
49
47
  ## QUICK delta — minimal ceremony
50
48
 
51
- > **Directed tranche:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document — it names the boundary in force, its alternatives, and the exact invocation when something has to run outside. What stays here is the *why*, plus every step that is judgment or preference.
49
+ > **Directed tranche:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document — it names the boundary in force, its alternatives and the exact invocation when something runs outside. What stays here is the *why*, and every step that is judgment.
52
50
 
53
51
  - **No phases, no plan-doc**: the prompt **is** the task (a single unit). No roadmap.
54
52
  - **Proportional verification-first** (minimal ceremony): even here the check is **seeded before**, sized to the task. Code: one test (bug repro → fix) or "existing build/lint/tests stay green" (chore). **Analysis/design**: a **short falsifiable rubric**, *ratified by the user* before pursuing it. It is the run's `SESSION.Success criteria` (see [chassis § *Verification-first*](../CHASSIS.md)).
55
53
  - **Git and DB inline** (full policies in [`../CODE-POLICIES.md`](../CODE-POLICIES.md)): before editing, verify each source's expected branch (`aw check-branch`); **proposed** commit (approve first) — never `push`/`--amend`/`--no-verify`. The AI **never executes DML/DDL**: migrations are drafted into the session's `SCRIPTS.sql`; fixture/ephemeral checks are local proof and any remote read is research context, never closure.
54
+ - **Fix preview, before executing**: declare the fix you are about to make — files to touch, intent, expected shape of the diff. It is **proportional**: one line for something trivial; approach, files and risks for something complex. Above the same signal threshold that fires the entry size gate (below), a person approves it (`Ejecutar tal cual` · `Ajustar el enfoque` · `Escalar a spec` → *Mid-loop escalation*). **Below the threshold there is no human stop**: the preview stays declared in the session and the task executes.
56
55
  - **One session. One commit** proposed at the end (only if there were code changes), **after the proportional closing review gate** ([`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Closing review gate*): diff re-read + ambient conventions; fix or defer; nothing reaches the commit unreviewed.
57
- - **Entry SIZE GATE** (before creating the session): a quick that should have been a spec costs more than the ceremony it saved, so the size of the objective is judged **before** anything exists. Your part is recognizing the signals; the threshold, the question and its options are the CLI's. A signal already resolved by *adopted context* is **not** a signal (chassis § *Adopted context*). A **resume** of an existing quick never re-fires it.
56
+ - **Entry SIZE GATE** (before creating the session): a quick that should have been a spec costs more than the ceremony it saved, so the size of the objective is judged **before** anything exists. Your part is recognizing the signals; the threshold, its anti-duplicate search, the question and its options are the CLI's. A signal already resolved by *adopted context* is **not** a signal (chassis § *Adopted context*). A **resume** of an existing quick never re-fires it.
58
57
  - **`Recortar alcance`**, if chosen: propose the **sub-task that DOES fit** a quick (`SESSION.Objective` = the sub-task; the original prompt goes into `## Origin`) and defer the rest to `BACKLOG` ("trimmed at the gate — may warrant its own spec, `/w:spec-new`").
59
58
  - **`Cambiar a SPEC`**, if chosen: **no quick session is created** — run the *Live transition to SPEC* (next bullet).
60
59
  - **Live transition to SPEC** (shared by the gate and mid-loop escalation). On acceptance, the work line **moves to the SPEC flow**: the explicit consent in the structured-choice **equals invoking the destination command** (*consented exception* — rule 3 of the *Continuity rule*, [`../../SKILL.md`](../../SKILL.md) § *Operating context*). On the SPEC side:
61
- 1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --publish spec-<slug>.md` with the finished draft on stdin (number assigned and document written in one atomic act, no reservation left), schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
60
+ 1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --publish spec-<slug>.md` with the finished draft on stdin (one atomic act: number assigned, document written, no reservation left), schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
62
61
  2. **Load and execute** [`../spec-refine-loop/LOOP.md`](../spec-refine-loop/LOOP.md) — over that spec (trampoline pattern).
63
62
  3. The run's session is that loop's **normal** `NNN-<slug>-spec-refine` (the CLI numbers it; its `## Origin` records the escalation). **Invariant 2 intact**: quick, while it is quick, never writes `docs/` — the draft is written by the SPEC flow, post-consent.
64
63
  - **Mid-loop escalation + handoff**: if the task grows, declare the signals again — the CLI applies the same threshold and, if it fires, asks. If the user accepts moving up:
65
- 1. The **already-edited code stays** in the working tree (never reverted) and is **recorded** in `CHECKPOINT` + `BACKLOG`: "uncommitted changes in `<source>` — decide commit/discard on resume" (the "rejected commit" pattern, [`../CODE-POLICIES.md`](../CODE-POLICIES.md) § *Safe git*).
66
- 2. The quick session goes to `finalize` with the **pointer** in `BACKLOG`: to **PLAN** → "escalated to `docs/plans/PPP` — resume there" (**deferred** as today: seed + pointer, no live entry); to **SPEC** → "escalated to `docs/specs/NNN` — **continued live** (session `NNN-<slug>-spec-refine`)".
67
- 3. The artifacts (`DECISION`, `SCRIPTS.sql`) **stay in the quick session** as referenceable context for the new session (never migrated).
64
+ 1. **Any already-edited code stays** in the working tree (never reverted) and is **recorded** in `CHECKPOINT` + `BACKLOG`: "uncommitted changes in `<source>` — decide commit/discard on resume" (the "rejected commit" pattern of *Safe git*).
65
+ 2. The quick session goes to `finalize` with the **pointer** in `BACKLOG`: to **PLAN** → "escalated to `docs/plans/PPP` — resume there" (**deferred**: seed + pointer, no live entry); to **SPEC** → "escalated to `docs/specs/NNN` — **continued live** (session `NNN-<slug>-spec-refine`)", or "escalated at the preview — continue in `/w:spec-new`" when no code and no `NNN` exist yet.
66
+ 3. The artifacts (`DECISION`, `SCRIPTS.sql`) **stay in the quick session** as referenceable context, never migrated.
68
67
  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
68
 
70
69
  ## Sequence
71
70
 
72
71
  ```
73
72
  quick-loop(prompt):
74
- # The CLI drives the entry gate, its anti-duplicate search and the session, and
75
- # stops at each boundary it cannot decide; it verifies the seeding afterwards.
76
73
  # `Cambiar a SPEC` → live transition (see delta): draft (spec-new procedure) +
77
74
  # load and execute ../spec-refine-loop/LOOP.md → END (no quick session)
78
75
  if the conversation already established analysis/conclusions → # adopted context (chassis)
@@ -80,6 +77,8 @@ quick-loop(prompt):
80
77
  author SESSION.Success criteria = the deliverable's check # test(s) if code · short RATIFIED rubric if analysis/design
81
78
  work the task (minimal loop):
82
79
  if it edits code → verify each source's expected branch (`aw check-branch`); mismatch → pause + resolve
80
+ declare the fix preview (files · intent · expected diff), proportional to the task
81
+ above the gate's threshold → the CLI asks for approval; below it, nothing stops
83
82
  produce the deliverable: edit code (minimal change) OR author the analysis/design
84
83
  if fixture/ephemeral DB check → run it from the checkout + capture its proof
85
84
  if DB change (DDL/DML) → SCRIPTS.sql (session artifact, DO NOT execute)
@@ -102,9 +101,9 @@ finalize: CHECKPOINT (AFTER: Pending→Completed) + BACKLOG (only if something i
102
101
 
103
102
  - Closing review gate passed and commit proposed if there was code (or skipping it approved) → `Cerrar`.
104
103
  - `Cerrar`/`Compactar` (`flow` control) → persists `CHECKPOINT` + `BACKLOG` (resumable).
105
- - **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).
104
+ - **No export**: nothing goes to `docs/` (§ *Writes*); escalating is the only way up.
106
105
 
107
- > QUICK's *convergence gate* is **proportional verification-first**: a **short** `Success criteria` declared at start (not the *absence* of a checklist — its minimal version). The CLI evaluates it, and it evaluates the **real output** of running those criteria — a claim that they passed is not a result.
106
+ > QUICK's *convergence gate* is that same **proportional verification-first**: a **short** `Success criteria` declared at start — its minimal version, never the *absence* of a checklist. The CLI evaluates the **real output** of running those criteria; a claim that they passed is not a result.
108
107
 
109
108
  ## Conditional modules
110
109
 
@@ -103,7 +103,8 @@ status: ready-for-plan ← stamped on Guardar (vocabulary: draft | refining |
103
103
  ## Behavioral changes (opt. — behavior added / modified / removed / preserved; only
104
104
  when existing behavior is touched — greenfield omits it)
105
105
  ## Scope (clear In / Out)
106
- ## Acceptance criteria (testable, - [ ]; EARS style; behavioral ones expand in ## Scenarios)
106
+ ## Acceptance criteria (functional, observable, product-level; - [ ] AC-nn; EARS style;
107
+ behavioral ones expand in ## Scenarios)
107
108
  ## Scenarios (opt. — GIVEN/WHEN/THEN/AND blocks; each traces to ≥1 criterion.
108
109
  Only when it adds GIVEN setup or edge semantics the criterion
109
110
  does not capture — NEVER a 1:1 restatement of a criterion)
@@ -124,7 +125,7 @@ The choices a reader needs in order to interpret the contract, each with its why
124
125
 
125
126
  > **`## Open questions` carries destinations.** Each entry states why it is still open, whether it blocks `ready-for-plan`, and where it goes: `PLAN`, the user, later research, another spec. A question may survive convergence **only** if it does not force `PLAN` to invent behavior.
126
127
 
127
- > **Acceptance criteria = static testable criteria** (the "what"): plan-exec validates them, but progress is tracked in the PLAN (its Tasks), never by ticking these `- [ ]` in the spec; the spec never mutates by execution, only by a re-refine.
128
+ > **Acceptance criteria = functional, observable outcomes at product level**, each labeled `AC-nn` — the label is what makes it addressable, and only under a `##` heading: the seal reads H2 only, so a nested `### Acceptance criteria` neither seals nor is addressable. A decision note amends it as `S{NNN}/AC-nn`, with `S{NNN}` derived from the spec's file number. A note naming a criterion the spec does not state is refused (`CONTRACT_ASSERTION_ABSENT`). **The verification strategy — tests, evidence, commands — is the PLAN's** (its `## Validations`): here goes the outcome, there goes how it is proven. Progress is tracked in the PLAN (its Tasks), never by ticking these `- [ ]` in the spec; the spec never mutates by execution, only by a re-refine.
128
129
 
129
130
  ## Who decides what
130
131
 
@@ -139,7 +140,8 @@ The choices a reader needs in order to interpret the contract, each with its why
139
140
  | Vague requirement | the what/why is ambiguous | **human** | SPEC — blocking |
140
141
  | Blurry scope | `Out` missing, or In/Out overlap | **human** | SPEC — blocking |
141
142
  | Business rule undefined | which condition decides an outcome | **research** or **human** | SPEC — blocking |
142
- | Untestable criteria | acceptance not verifiable | **human** (derive + confirm — often as a `### Scenario`) | SPEC — blocking |
143
+ | Unverifiable criterion | the outcome is not observable at product level | **human** (make the OUTCOME observable — often as a `### Scenario`) | SPEC — blocking |
144
+ | Test-shaped criterion | the criterion prescribes evidence or test mechanics instead of an outcome (naming the product's OWN command or flag is not test mechanics) | the AI proposes the functional rewrite + **human** confirms | SPEC (the mechanics travel to PLAN) |
143
145
  | Internal contradiction | sections contradict each other | **human** | SPEC — blocking |
144
146
  | Current behavior unknown | the baseline the change rests on is missing | **research** (inline) | SPEC → `Context` / `Behavioral changes` |
145
147
  | Incomplete context | systems/components unidentified | **research** | SPEC |
@@ -223,6 +225,8 @@ finalize:
223
225
  - **No blocking gaps** → **ready-for-plan gate** (read-only) = **`Success criteria` green** (*verification-first*; the SPEC instance of the chassis convergence gate). The checklist:
224
226
  - the requested outcome is understandable, the relevant current behavior is established, and the behavior change is described whenever existing behavior is touched;
225
227
  - `Scope` separates In from Out; every acceptance criterion traces to the `Requirement`; scenarios trace to ≥1 criterion and add GIVEN setup or edge semantics beyond it, without contradicting `Scope` (a 1:1 restatement is gold-plating: cut it);
228
+ - no criterion prescribes verification mechanics (test names, evidence, the commands that PROVE it) or an internal mechanism: that travels to `PLAN` with its destination declared — the product's own visible surface (a CLI's commands and flags, an API's endpoints, observable messages and formats) is behavior, not mechanics;
229
+ - every criterion carries its `AC-nn` label — what a decision note amends as `S{NNN}/AC-nn`; an unlabeled criterion is one no decision can address;
226
230
  - no material contradictions; the one-vs-many shape was validated at the *Change-shape gate*;
227
231
  - every **blocking** functional decision is resolved, and every remaining question carries its destination;
228
232
  - **Minimality** — no gold-plating: every criterion and scope item earns its place (chassis § *Minimality*); speculative scope is cut or deferred, and no technical solution was imposed that the requirement did not ask for;
@@ -4,6 +4,6 @@ Loaded when the run is long enough that context pressure governs its pacing (sig
4
4
 
5
5
  `Compactar` is not only reactive: the loop **watches its own context pressure** and raises compaction itself. Recognizing that pressure is judgment — the host's signal where it exists (*compaction* capability in [`../harness/HARNESS.md`](../harness/HARNESS.md)), otherwise the **qualitative** question *"would a fresh reader need the CHECKPOINT to continue?"* at a boundary of an already-long run. Doctrine fixes **no numeric thresholds**: a number that means anything is a number about one host.
6
6
 
7
- > **Which mode runs, and whether the host can honour it, is not this document's call:** `aw checkpoint-write --can-pause` decides it from the `[compaction]` config (`mode` = `confirm` | `auto`), the host's binding and the session's state. `auto` needs a **non-interactive** mechanism and **degrades to `confirm`** without one; **CHECKPOINT before compacting** holds in every mode. What this document keeps is why: consent is never skipped where a person can be asked, and a compaction that fires before the checkpoint loses the thread it was meant to protect.
7
+ > **Whether the host can honour it is not this document's call:** `aw checkpoint-write` writes the CHECKPOINT and **never holds the compaction back** — there is no configurable mode; an ambiguity degrades and parks a refuge checkpoint to adopt later. **CHECKPOINT before compacting** is the invariant. What this document keeps is why: consent lives in the `Compactar` control a person ratifies, and a compaction that fires before the checkpoint loses the thread it was meant to protect.
8
8
 
9
9
  > **`Compactar`** (the `flow` control) → write `CHECKPOINT.md` in the session (in-flight progress, remaining gaps, Q&A, `attempts`) → trigger the harness **compaction** (Claude Code: `/compact`; see [`../harness/HARNESS.md`](../harness/HARNESS.md)) → resume by reading the checkpoint.
@@ -6,10 +6,10 @@ Loaded when the input is not plainly a `ready-for-plan` spec (signal `input`).
6
6
 
7
7
  1. **Ready spec** (`docs/specs/NNN-spec-<slug>.md`, `status: ready-for-plan`) → proceed.
8
8
  2. **Spec not ready** (`draft`, `refining`, or no mark) → **soft-suggest** `/w:spec-refine`, never a block. `PLAN` questions remain input here.
9
- 3. **Prompt** (no spec) → propose and normally launch `/w:spec-new`, then continue.
9
+ 3. **Prompt** (no spec) → **two exits**: (a) **spec first** — propose and launch `/w:spec-new`; the default when the request reads as a product wish; (b) **standalone plan** — planned straight from the conversation, its header carrying `> Standalone: <origen> · sesión NNN-<slug>` instead of `> Derived from …`.
10
10
  4. **External plan** (host, hand-written, another agent) → **adopt once, NO RESEARCH** at `docs/plans/PPP-plan-<slug>.md`. Normalize only supplied material; set `## Origin` to "adopted from <source>" + host/model/date; offer `/w:plan-refine` or `/w:plan-exec`. A matching Origin resumes; never overwrite a plan-doc.
11
11
 
12
- > **Mode 3 vs 4:** a prompt that *describes a wish* → SPEC (mode 3); content that *already is a plan* → adopt (mode 4).
12
+ > **Mode 3 vs 4:** a prompt that *describes a wish* → mode 3 (spec first, or a standalone plan when the conversation already settled the how); content that *already is a plan* → adopt (mode 4).
13
13
 
14
14
  > Adoption is CLI-owned: the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document.
15
15
 
@@ -23,7 +23,7 @@ Loaded when the input is not plainly a `ready-for-plan` spec (signal `input`).
23
23
  2. **No plan** → soft-suggest `/w:plan-new`; the user decides.
24
24
  3. **Returned by `plan-exec`** (unexecutable entry or structural deviation) → retain `validada` phases and redesign only pending work.
25
25
 
26
- > **Spec-less plans are legitimate input.** The coherence gate **degrades gracefully**: criteria trace to the plan's own Final behavior block instead of spec criteria, and the "spec criteria uncovered" gap does not apply.
26
+ > **A spec-less plan is a FIRST-CLASS mode, not a defective plan** (`> Standalone:`, adopted or hand-written). Its contract is its own *Final behavior* block + `## Validations`, so the "spec criteria uncovered" gap does not apply. A marked plan seals no baseline and the board reports its own `standalone` mode, no unsealed notice: the mode here, not a defect. Its deviations register in the session's `DECISION.md` and the run continues — a contract note needs a spec.
27
27
 
28
28
  ## Numbering
29
29
 
@@ -4,7 +4,7 @@ Loaded when a bare prompt continues an existing work line (signal `resume`).
4
4
 
5
5
  ## Continuity across prompts (operating context)
6
6
 
7
- `quick` is where the **continuity rule** ([`../../SKILL.md`](../../SKILL.md) § *Operating context*) shows most clearly. Inside a workspace:
7
+ `quick` is where the **continuity rule** ([`../SKILL.md`](../SKILL.md) § *Operating context*) shows most clearly. Inside a workspace:
8
8
 
9
9
  1. `/w:quick "first prompt"` (**command**) → creates session `NNN-<slug>-quick`, starts the loop. Scripts go to **its** `SCRIPTS.sql`.
10
10
  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`.