baldart 3.23.0 → 3.25.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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,78 @@ All notable changes to BALDART will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.25.0] - 2026-05-27
|
|
9
|
+
|
|
10
|
+
Strict-phase-gating + workspace-hygiene gates per `/new`. Risolve l'incident **FEAT-0006**: epic team-mode (4-layer L0→L1×5→L2×2→L3×2, 10 sub-card) che ha saltato per ogni card le fasi MANDATORY 2.5b (AC-Closure), 2.55 (Simplify), 2.6 (E2E-Review), 3 (Doc-Review), 3.5 (QA-Sentinel), 3.7 (Codexreview) — giustificazione documentata come "time budget", parola **inventata dal modello a runtime**, non esistente nella skill. In aggiunta, AC-IMG-3 "deferred dal coder 09" senza passare dal gate, e main repo lasciato con orphan commit non pushato + local `develop` diverged. Tre root cause radicate: (1) Phase 2.5b non era propagata in team-mode Step D, (2) coder `completion-report` accettava `status: partial`/`blocked` come terminale, (3) zero gate di workspace hygiene su `$MAIN`.
|
|
11
|
+
|
|
12
|
+
### Added — Phase 0: Workspace Hygiene Pre-flight (BLOCKING)
|
|
13
|
+
|
|
14
|
+
- **[framework/.claude/skills/new/SKILL.md](framework/.claude/skills/new/SKILL.md)**: nuova `## Phase 0` prima di `## Pre-flight (once)`. Su `$MAIN`: `fetch origin`, dirty-tree gate (`git status --porcelain` → `AskUserQuestion` con opzioni `[stash auto] / [commit ora] / [procedi senza stash] / [abort]`), divergence gate (`rev-list --left-right --count` → `AskUserQuestion` per ahead/behind/diverged). Stash ref salvato nel tracker sotto `## Workspace Snapshot` per il restore di Phase 6c. Anti-bypass guard finale che rifiuta di proseguire senza `## Phase 0: PASS` nel tracker. Auto Mode NON override.
|
|
15
|
+
|
|
16
|
+
### Added — Phase 6c: Workspace Hygiene Post-merge (BLOCKING)
|
|
17
|
+
|
|
18
|
+
- **[framework/.claude/skills/new/SKILL.md](framework/.claude/skills/new/SKILL.md)**: nuova `### Phase 6c` dopo Phase 6b. Parse del marker `[SYNC-DEFERRED]` emesso da `/mw`, clean-tree assertion, divergence assertion (cattura il pattern FEAT-0006 orphan commit con `AskUserQuestion` opzioni `[push adesso] / [cherry-pick] / [reset --hard con conferma esplicita] / [halt]`), restore dello stash di Phase 0 (con `AskUserQuestion` su conflict, mai silent drop). Anti-bypass guard come in Phase 0.
|
|
19
|
+
|
|
20
|
+
### Added — Team-mode Step D rewrite (FEAT-0006 anti-regression)
|
|
21
|
+
|
|
22
|
+
- **[framework/.claude/skills/new/SKILL.md](framework/.claude/skills/new/SKILL.md)** righe ~1988: nuovo Step D con clausola di apertura esplicita ("La lean Step D è ora FORBIDDEN") + sub-step MANDATORY per-card propagati identici al sequential mode:
|
|
23
|
+
- **D.3a** — Phase 2.5b AC-Closure Gate per-card (sequenziale), bloccante.
|
|
24
|
+
- **D.3b** — Phase 2.55 Simplify per-card (diff per-card per attribuibilità).
|
|
25
|
+
- **D.3c** — Phase 2.6 E2E-Review per-card (honora il Gate table esistente — skip backend-only/docs/chore con motivazione documentata, mai con "time budget").
|
|
26
|
+
- **D.4a** — Phase 3 Doc Review per-card (oltre al D.2 combined).
|
|
27
|
+
- **Coverage assertion** end-of-group MANDATORY: prima di Step E, il tracker deve contenere per OGNI card le entry `AC Closure Ledger`, `simplify`, `e2e-review`, `doc-review`, `qa`, `codex-review`. Entry mancante → ritorno alla sub-step mancante. Documentare "skipped per time budget" è violazione esplicita.
|
|
28
|
+
|
|
29
|
+
### Added — Top-of-file rigidity clause + tracker header
|
|
30
|
+
|
|
31
|
+
- **[framework/.claude/skills/new/SKILL.md](framework/.claude/skills/new/SKILL.md)**: nuovo blockquote `> **NO PHASE SKIP FOR PERCEIVED TIME, EVER (BLOCKING)**` subito sotto SCOPE CLOSURE DISCIPLINE. Enumera esplicitamente le phrase forbidden (`time budget`, `context budget`, `context pressure as override`, `for time`, `to save tokens`, `to save iterations`). Self-correction trigger: se il modello produce una di queste phrase nel proprio output, deve fermarsi e routare via `AskUserQuestion`.
|
|
32
|
+
- **Tracker template** (~riga 50): HTML comment header che sopravvive alle compaction e ricorda la regola dopo ogni context recovery.
|
|
33
|
+
|
|
34
|
+
### Changed — `coder` agent completion report (semantica binaria)
|
|
35
|
+
|
|
36
|
+
- **[framework/.claude/agents/coder.md](framework/.claude/agents/coder.md)**: card-level `status:` enum ridotto a `done | failed` (era `done | partial | failed`). Per-requirement e per-AC `status:` ridotto a `done | not_implemented` (era `done | partial | blocked`). Le legacy values `partial`/`blocked` erano usate come canali di silent deferral. Aggiunta a `Forbidden Actions`: "Don't defer acceptance criteria" + "Don't invent skip reasons". Retro-compatibile: coder che emettono ancora `partial` faranno triggerare il gate Phase 2.5b invece di passare in silenzio.
|
|
37
|
+
|
|
38
|
+
### Changed — `framework/agents/workflows.md` Scope Closure Discipline
|
|
39
|
+
|
|
40
|
+
- Nuovo `### Coder authority (no defer)` in coda alla sezione: chiarisce che coder e orchestratori L0/L1 relay-ano i signal nel gate, non li aggregano/filtrano. Citable da skill e agent.
|
|
41
|
+
|
|
42
|
+
### Changed — `/mw` `[SYNC-DEFERRED]` structured marker
|
|
43
|
+
|
|
44
|
+
- **[framework/.claude/skills/worktree-manager/SKILL.md](framework/.claude/skills/worktree-manager/SKILL.md)** righe ~835–855: quando `$MAIN` HEAD ≠ develop, oltre al `fetch` esistente emette ora `[SYNC-DEFERRED] main repo HEAD=<branch>, ...` su stdout. `/mw` standalone preserva l'isolamento terminale (no auto-checkout); orchestratori upstream (Phase 6c di `/new`) parsano il marker e routano la riconciliazione via user gate.
|
|
45
|
+
|
|
46
|
+
### Why MINOR (not MAJOR)
|
|
47
|
+
|
|
48
|
+
Tutte le fasi MANDATORY esistevano già — vengono solo propagate (team-mode Step D) e rese non-bypassabili. Le nuove Phase 0/6c sono additive bloccanti, non rimuovono né rinominano capability. La semantica del `completion-report` cambia ma è retro-compatibile: coder pre-3.25 che emettono `partial`/`blocked` triggerano il gate invece di passare silently, e il gate ora esiste in team-mode. Per la decision tree in MAINTAINING.md "Tightened existing MANDATORY gates without removing capabilities → MINOR". L'incident FEAT-0006 era un fallimento di propagazione, non di design — la fix riallinea l'implementazione all'intent originale di v3.24.0.
|
|
49
|
+
|
|
50
|
+
### Why no schema-change propagation
|
|
51
|
+
|
|
52
|
+
Modifiche testuali a 4 file framework. Zero chiavi nuove in `baldart.config.yml`, zero modifiche CLI (`src/commands/*`), zero hook nuovi, zero adapter, zero template. Considerato e scartato `policy.strict_phase_gating: true`: sarebbe 5 punti di propagazione (template + configure + update + skill + CHANGELOG) per zero beneficio tunable dall'utente — gli overlay `.baldart/overlays/new.md` restano la via per personalizzazioni progettuali. Verifica: `grep -r "policy.strict_phase_gating\|features.strict_phase_gating" framework/ src/` deve restituire vuoto.
|
|
53
|
+
|
|
54
|
+
## [3.24.0] - 2026-05-27
|
|
55
|
+
|
|
56
|
+
Nuovo gate **AC-Closure** (Phase 2.5b) in `/new` + regola **Scope Closure Discipline** in `framework/agents/workflows.md`. Risolve il pattern ricorrente in cui l'orchestratore — sotto pressione di context-window o complessità inattesa — defer-iva unilateralmente acceptance criteria numerate marcandole `deferred` negli `implementation_notes` YAML con razionalizzazione post-hoc ("ApproveSheet già copre il confirm"). Caso reale che ha innescato la fix: sessione `/new` su FEAT-0005 (2026-05-27) dove 5 AC su 22 sono state silenziosamente deferite con razionalizzazione poi rivelata falsa alla verifica funzionale. Le decisioni di deferral sono ora **sempre routate all'utente via `AskUserQuestion`** una-per-AC.
|
|
57
|
+
|
|
58
|
+
### Added — Phase 2.5b AC-Closure Gate (BLOCKING)
|
|
59
|
+
|
|
60
|
+
- **[framework/.claude/skills/new/SKILL.md](framework/.claude/skills/new/SKILL.md)**: nuova Phase 2.5b inserita tra Phase 2.5 (Completeness Check) e Phase 2.55 (Simplify). 6 step:
|
|
61
|
+
1. **AC Closure Ledger** — tabella esplicita una-riga-per-AC con status enum binario `implemented` | `deferred` (nessuna terza categoria — l'AC è nel diff o sta venendo deferita), evidence `file:line`, campo `User-approved?`.
|
|
62
|
+
2. **Rationalization scan** — per ogni AC `deferred`, se la giustificazione matcha pattern `covered by X` / `already handles` / `redundant with Y` / `out of scope`, l'orchestratore DEVE leggere `X/Y` e produrre una scope-mapping line-per-line nel tracker sotto `## Rationalization Verification`. Il pattern senza verifica NON auto-approva il deferral.
|
|
63
|
+
3. **User gate** — `AskUserQuestion` BLOCKING uno-per-AC (mai batched), con testo AC verbatim + 4 opzioni: implementa adesso (spawna fix coder scoped al ownership map) / approva deferral (registra `[USER-APPROVED DEFERRAL] <date>: <reason>` in `implementation_notes`) / sposta su follow-up card (crea `<CARD-ID>-followup-AC<N>.yml` con `status: TODO`) / ferma il batch.
|
|
64
|
+
4. **`implementation_notes` audit** — grep finale per phrase `deferred` / `out of scope` / `covered by` / `skipped` etc.; ogni match deve carry il prefisso `[USER-APPROVED DEFERRAL]` o tornare allo Step 3.
|
|
65
|
+
5. **Context-pressure exception** — directive esplicita: sotto context pressure si ferma e si chiede, NON si compensa skippando AC. Auto Mode's "bias toward proceeding" non override questa regola.
|
|
66
|
+
- **Top-level directive** in `/new` SKILL.md (riga 13, subito dopo YOLO MODE banner): riassume la Scope Closure Discipline e linka workflows.md.
|
|
67
|
+
|
|
68
|
+
### Added — Scope Closure Discipline rule (citable protocol)
|
|
69
|
+
|
|
70
|
+
- **[framework/agents/workflows.md](framework/agents/workflows.md)**: nuova sezione `## Scope Closure Discipline (MUST)` tra "Status Tracking" e "Deploys and Publications". 3 violazioni esplicite (silent deferral, rationalization-without-verification, scope reduction under context pressure) + protocollo di enforcement via `AskUserQuestion`. Citable da skill/agent come autorità — un finding "silent AC deferral" è BLOCKING in code review.
|
|
71
|
+
|
|
72
|
+
### Why MINOR (not PATCH)
|
|
73
|
+
|
|
74
|
+
Aggiunta di capability: nuovo gate obbligatorio in `/new` che cambia comportamento osservabile per i consumer (Phase 2.55 non parte più finché Phase 2.5b non passa). Nessun breaking change — card senza AC-deferral passano il gate transparently in <1s con `ac-closure: implemented=N | deferrals=0 | follow-ups=0`. Per la decision tree in MAINTAINING.md "Added an agent / command / skill / routine / template (or capability)? → MINOR".
|
|
75
|
+
|
|
76
|
+
### Why no schema-change propagation
|
|
77
|
+
|
|
78
|
+
Modifiche testuali a due file framework. Zero chiavi nuove in `baldart.config.yml`, zero modifiche CLI (`src/commands/*`), zero hook, zero adapter, zero template. Il gate sfrutta strutture YAML già esistenti (`acceptance_criteria`, `implementation_notes`) e `${paths.backlog_dir}` già nella config schema da v3.0.0.
|
|
79
|
+
|
|
8
80
|
## [3.23.0] - 2026-05-27
|
|
9
81
|
|
|
10
82
|
Aggiunto il flag `-full` / `--full` a `/new` per espandere un epic ai suoi figli in un colpo solo — `/new FEAT-005 -full` lancia automaticamente `FEAT-005-1`, `FEAT-005-2`, … senza domande di grouping né di branch. Risolve il pattern ricorrente "ho un epic con 5 child card, le voglio tutte ora": prima richiedeva di listarle a mano (`/new FEAT-005-1 FEAT-005-2 FEAT-005-3 …`) o di usare l'hyphen-range solo se gli ID erano numericamente contigui.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.25.0
|
|
@@ -250,21 +250,22 @@ Do NOT wait until the end to verify your work. After each sub-task that changes
|
|
|
250
250
|
|
|
251
251
|
```completion-report
|
|
252
252
|
card: <CARD-ID>
|
|
253
|
+
status: done | failed
|
|
253
254
|
files_modified: [src/path/a.ts, src/path/b.ts]
|
|
254
255
|
files_created: [src/path/new.ts]
|
|
255
256
|
tsc_clean: true | false
|
|
256
257
|
requirements:
|
|
257
258
|
- id: 1
|
|
258
259
|
text: "[verbatim requirement text from card]"
|
|
259
|
-
status: done |
|
|
260
|
+
status: done | not_implemented
|
|
260
261
|
evidence: "src/path/to/file.ts:LINE_NUMBER"
|
|
261
|
-
notes: "[if
|
|
262
|
+
notes: "[if not_implemented: state factually what is missing; do NOT propose deferral or rationalization]"
|
|
262
263
|
- id: 2
|
|
263
264
|
[repeat for each requirement]
|
|
264
265
|
acceptance_criteria:
|
|
265
266
|
- id: 1
|
|
266
267
|
text: "[verbatim criterion text from card]"
|
|
267
|
-
status: done |
|
|
268
|
+
status: done | not_implemented
|
|
268
269
|
evidence: "src/path/to/file.ts:LINE_NUMBER"
|
|
269
270
|
components_reused: [ComponentName from src/path]
|
|
270
271
|
components_created: [NewComponent in src/path]
|
|
@@ -282,8 +283,10 @@ scope_boundaries_respected: true | false
|
|
|
282
283
|
```
|
|
283
284
|
|
|
284
285
|
Rules for the report:
|
|
286
|
+
- `status` at card level is **binary**: `done` (all requirements and acceptance criteria are `done`) or `failed` (anything else, including a single `not_implemented` row). There is no `partial`. The orchestrator's AC-Closure Gate decides what happens with `failed` cards — your job is to report state truthfully.
|
|
287
|
+
- Per-requirement and per-AC `status` is **binary**: `done` or `not_implemented`. The legacy values `partial` and `blocked` are removed — they were used as silent deferral channels and the gate now intercepts them at the orchestrator. Report what is in the diff and what is not. Do not propose a verdict.
|
|
285
288
|
- `evidence` MUST be a real file path and line number you actually wrote/modified — do NOT fabricate.
|
|
286
|
-
- If a requirement
|
|
289
|
+
- If a requirement or AC is `not_implemented`, the `notes` field is required and MUST describe factually what is missing (e.g. "no LCP measurement wired in `app/orders/page.tsx`"). It MUST NOT contain phrases like "deferred to follow-up", "covered by X", "out of scope", "redundant with Y", "time budget", "context pressure" — those are deferral verdicts and only the user issues verdicts via the gate.
|
|
287
290
|
- List every requirement and acceptance criterion from the card — do not skip any.
|
|
288
291
|
- `files_modified` and `files_created` MUST list every file you touched — downstream reviewers use this as their scope boundary.
|
|
289
292
|
- `tsc_clean` MUST reflect the actual result of your last `npx tsc --noEmit` run.
|
|
@@ -312,6 +315,8 @@ Use judgment on review depth, but do not bypass repo-required QA gates.
|
|
|
312
315
|
- Don't add dependencies without documenting them.
|
|
313
316
|
- Don't force push without owner approval.
|
|
314
317
|
- Don't invent alternative git workflows or testing gates.
|
|
318
|
+
- **Don't defer acceptance criteria.** Deferral is a user decision routed through the orchestrator's AC-Closure Gate (`AskUserQuestion`, one question per AC). You report `done` or `not_implemented`; the gate decides whether `not_implemented` becomes an approved deferral, a fix-loop, or a halt. Do NOT mark an AC as `partial`, `blocked`, `deferred`, `out of scope`, `redundant with X`, `covered by Y`, or any equivalent — those values do not exist for you.
|
|
319
|
+
- **Don't invent skip reasons.** Phrases like `time budget`, `context budget`, `context pressure as override`, `not in scope of this card`, `optional`, or any constraint not enumerated in the card YAML or in a phase's documented Gate table are forbidden. If you genuinely cannot make progress after 3 self-heal attempts, set the card-level `status: failed`, leave per-requirement statuses honest, and stop. The orchestrator handles the rest.
|
|
315
320
|
- **NEVER create, checkout, or switch a git branch autonomously.** See the Hard Rule at the top of this file. No `git checkout -b`, no `git switch -c`, no `git branch`, no `git worktree add`. The `git_strategy` field is descriptive context, NOT authorization. Only an explicit literal instruction in the task prompt ("create branch X", "checkout Y") authorizes branch operations. When in doubt: stay on the current branch and report back in the completion report.
|
|
316
321
|
|
|
317
322
|
Keep it simple. Write good code. Ask if unsure.
|
|
@@ -10,6 +10,10 @@ description: >
|
|
|
10
10
|
|
|
11
11
|
> **YOLO MODE**: All agents spawned via the Task tool MUST use `mode: "bypassPermissions"`. No exceptions.
|
|
12
12
|
|
|
13
|
+
> **SCOPE CLOSURE DISCIPLINE (BLOCKING)**: This orchestrator NEVER unilaterally defers an acceptance criterion. Silent deferral via `implementation_notes`, commit message, or final recap is a protocol violation per `framework/agents/workflows.md § Scope Closure Discipline`. Under context-window pressure, time pressure, or unforeseen complexity, the correct action is to STOP and route the decision back to the user via `AskUserQuestion` — Auto Mode's "bias toward proceeding" applies to routine decisions, NOT to scope reduction. **Phase 2.5b (AC-Closure Gate)** enforces this at the per-card level before commit and is non-skippable.
|
|
14
|
+
|
|
15
|
+
> **NO PHASE SKIP FOR PERCEIVED TIME, EVER (BLOCKING)**: MANDATORY phases are non-negotiable in BOTH sequential mode and team mode. The phrases `time budget`, `context budget`, `context pressure as override`, `for time`, `to save tokens`, `to save iterations`, or any model-invented constraint are NOT valid skip reasons. The only valid skip reasons are those explicitly enumerated in each phase's Gate table (e.g. `features.has_e2e_review: false`, backend-only diff, card type `docs`/`chore`/`config`). Documenting skipped phases at the end of a batch as `"saltati per time budget"` is a protocol violation per the FEAT-0006 incident — treat any such phrase in your own output as a self-correction trigger: stop, surface the situation via `AskUserQuestion`, and resume only after explicit user direction. Auto Mode does NOT override this. Team-mode orchestrators (L0/L1) propagate every MANDATORY phase per-card and never aggregate, reduce, or pre-filter the per-card pipeline.
|
|
16
|
+
|
|
13
17
|
## Project Context
|
|
14
18
|
|
|
15
19
|
**Reads from `baldart.config.yml`:** `paths.backlog_dir`, `paths.references_dir`.
|
|
@@ -47,9 +51,16 @@ At batch start, create `/tmp/batch-tracker-<FIRST-CARD-ID>.md` with:
|
|
|
47
51
|
|
|
48
52
|
```markdown
|
|
49
53
|
# Batch Run: [CARD-IDS]
|
|
54
|
+
<!-- MANDATORY phases are non-skippable in BOTH sequential and team mode.
|
|
55
|
+
Inventing reasons ("time budget", "context pressure", "out of scope of this card")
|
|
56
|
+
to skip phases or defer ACs is a protocol violation. See FEAT-0006 incident.
|
|
57
|
+
Only the user, via AskUserQuestion, can approve a deferral. -->
|
|
50
58
|
Started: [timestamp]
|
|
51
59
|
Total cards: [N]
|
|
52
60
|
|
|
61
|
+
## Workspace Snapshot
|
|
62
|
+
(none — Phase 0 will populate if `git stash` was used on the main repo)
|
|
63
|
+
|
|
53
64
|
## Worktree
|
|
54
65
|
Branch: [feat/FEAT-XXXX-slug]
|
|
55
66
|
Path: [.worktrees/feat-FEAT-XXXX-slug]
|
|
@@ -104,6 +115,71 @@ Main repo: [/absolute/path/to/main/repo]
|
|
|
104
115
|
|
|
105
116
|
---
|
|
106
117
|
|
|
118
|
+
## Phase 0 — Workspace Hygiene Pre-flight (BLOCKING — non-skippable)
|
|
119
|
+
|
|
120
|
+
**Why this exists**: FEAT-0006 incident left the main repo with an unpushed orphan commit (`c9d41f9`) and `develop` diverged from `origin/develop` because `/new` started work on a dirty/diverged repo without surfacing the situation. This phase reconciles the main repo state BEFORE any worktree is created, and snapshots any in-progress user work so Phase 6c can restore it after the batch.
|
|
121
|
+
|
|
122
|
+
**Auto Mode does NOT override this phase.** Every `AskUserQuestion` below is non-bypassable — the model has no authority to pick an option on the user's behalf.
|
|
123
|
+
|
|
124
|
+
**Steps:**
|
|
125
|
+
|
|
126
|
+
1. **Resolve `$MAIN`** — the absolute path of the main repo (not a worktree). If `/new` was invoked from inside a worktree, walk up to the parent repo via `git rev-parse --show-superproject-working-tree` or `git worktree list` until you find the non-worktree root. Persist as `Main repo:` in the tracker `## Worktree` section.
|
|
127
|
+
|
|
128
|
+
2. **Fetch remote state**:
|
|
129
|
+
```bash
|
|
130
|
+
git -C "$MAIN" fetch origin --quiet
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
3. **Dirty-tree gate (BLOCKING)** — capture the working tree state of the main repo:
|
|
134
|
+
```bash
|
|
135
|
+
git -C "$MAIN" status --porcelain
|
|
136
|
+
```
|
|
137
|
+
If the output is non-empty, invoke `AskUserQuestion`:
|
|
138
|
+
- Question: `"Main repo ($MAIN) ha modifiche non committate prima di partire con la batch. Come procedo?"`
|
|
139
|
+
- Options (max 4):
|
|
140
|
+
1. **"Stash automatico (restore in Phase 6c)"** — run `git -C "$MAIN" stash push -u -m "baldart-new-phase0-<FIRST-CARD-ID>-<timestamp>"`, capture the returned stash ref (e.g. `stash@{0}`), and write it to the tracker under `## Workspace Snapshot: <ref> (created <timestamp>)`. Phase 6c will pop it.
|
|
141
|
+
2. **"Committa adesso (apri editor)"** — halt the batch with a clear message asking the user to commit in their terminal and re-invoke `/new`. Do NOT proceed to step 4.
|
|
142
|
+
3. **"Procedi senza stash (lavoro mio, lo gestisco io)"** — explicit user override. Log in tracker: `## Workspace Snapshot: dirty-tree override @ <timestamp> — user accepted responsibility`. Phase 6c will still check post-merge state but will NOT attempt restore.
|
|
143
|
+
4. **"Abort batch"** — halt the batch, leave the tracker file in place, exit.
|
|
144
|
+
|
|
145
|
+
Do NOT silently proceed. Do NOT auto-stash without the user picking option 1.
|
|
146
|
+
|
|
147
|
+
4. **Divergence gate (BLOCKING)** — compare local `develop` against `origin/develop`:
|
|
148
|
+
```bash
|
|
149
|
+
git -C "$MAIN" rev-list --left-right --count origin/develop...develop
|
|
150
|
+
```
|
|
151
|
+
The output is `<behind>\t<ahead>`. Branch on the result:
|
|
152
|
+
|
|
153
|
+
- **`0\t0`** — synchronized. Proceed to step 5.
|
|
154
|
+
- **`N\t0`** (only behind, N > 0) — invoke `AskUserQuestion`:
|
|
155
|
+
- Question: `"Local develop è behind origin/develop di N commit. Come procedo?"`
|
|
156
|
+
- Options: `[Fast-forward pull adesso]` / `[Procedi senza pull]` / `[Abort]`.
|
|
157
|
+
- On `Fast-forward pull adesso`: if `$MAIN` HEAD == develop, run `git -C "$MAIN" pull --ff-only origin develop`; otherwise log "main HEAD is `<branch>` — fetch already updated `refs/remotes/origin/develop`, local `develop` ref will be reconciled in Phase 6c".
|
|
158
|
+
- **`0\tM`** (only ahead, M > 0 — UNPUSHED LOCAL COMMITS, this is the FEAT-0006 pattern) — invoke `AskUserQuestion`:
|
|
159
|
+
- Question: `"Local develop è ahead di origin/develop di M commit (commit locali non pushati). Cosa faccio?"`
|
|
160
|
+
- Show the commit list inline: `git -C "$MAIN" log --oneline origin/develop..develop`.
|
|
161
|
+
- Options: `[Push adesso (git push origin develop)]` / `[Cherry-pick a parte e continua]` / `[Lascia così e procedi (lo gestisco io)]` / `[Abort]`.
|
|
162
|
+
- **`N\tM`** (diverged both ways) — invoke `AskUserQuestion`:
|
|
163
|
+
- Question: `"Local develop è diverged da origin/develop: N behind, M ahead. Servono entrambe le riconciliazioni. Come procedo?"`
|
|
164
|
+
- Options: `[Rebase local develop su origin/develop]` / `[Mostrami i commit e fammi decidere]` / `[Abort]`.
|
|
165
|
+
|
|
166
|
+
The same gate applies if the user-configured trunk branch is something other than `develop` — read `git.trunk_branch` from `baldart.config.yml` if present, default to `develop`.
|
|
167
|
+
|
|
168
|
+
5. **Log and proceed** — write to the tracker:
|
|
169
|
+
```
|
|
170
|
+
## Phase 0 — Workspace Hygiene Pre-flight
|
|
171
|
+
Status: PASS
|
|
172
|
+
Main repo: $MAIN
|
|
173
|
+
Dirty: <none | stashed: stash@{0} | user-override>
|
|
174
|
+
Divergence (local…origin/develop): <0\t0 | resolved: ff-pull | resolved: pushed | user-deferred>
|
|
175
|
+
Completed: <timestamp>
|
|
176
|
+
```
|
|
177
|
+
If any step ended in HALT, set `Status: HALT` and stop — do NOT continue to `## Pre-flight (once)`.
|
|
178
|
+
|
|
179
|
+
6. **Anti-bypass guard** — before exiting Phase 0, re-read the tracker section you just wrote. If `## Phase 0` is missing or shows `Status: HALT`, refuse to proceed. There is no `--skip-phase-0` flag; if you find yourself reaching for one, treat it as a self-correction trigger and stop.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
107
183
|
## Pre-flight (once)
|
|
108
184
|
|
|
109
185
|
1. Read each backlog card from `${paths.backlog_dir}/*.yml` to understand scope and dependencies. Also read the project's canonical-docs registry — typically `${paths.references_dir}/ssot-registry.md` plus any linking-protocol guide — to understand which canonical docs exist for the feature area being implemented. Exact filenames are listed in `.baldart/overlays/new.md`; skip when absent.
|
|
@@ -793,6 +869,75 @@ Rationale: BUG-0558's introducing card (FEAT-0850-02) had its tests deferred to
|
|
|
793
869
|
|
|
794
870
|
6. **Update tracker**: phase = "2.5-completeness DONE", log result (PASS / GAPS REMAIN + count).
|
|
795
871
|
|
|
872
|
+
### Phase 2.5b — AC-Closure Gate (BLOCKING — Scope Closure Discipline)
|
|
873
|
+
|
|
874
|
+
This gate enforces `framework/agents/workflows.md § Scope Closure Discipline` at the per-card level. It runs after Phase 2.5's gap-resolution loops have settled and BEFORE Phase 2.55 (Simplify). It is non-skippable.
|
|
875
|
+
|
|
876
|
+
**Why this exists**: Phase 2.5's fix loops handle items an agent can implement autonomously. They do NOT handle the case where the implementer (or you, the orchestrator) decides — under context pressure or perceived complexity — that an AC is "good enough as is" or "already covered by an existing component". Burying that decision in the card YAML's `implementation_notes`, in a commit message, or in a final recap is a silent scope reduction. The decision belongs to the user.
|
|
877
|
+
|
|
878
|
+
**Step-by-step**:
|
|
879
|
+
|
|
880
|
+
1. **Update tracker**: phase = "2.5b-ac-closure".
|
|
881
|
+
|
|
882
|
+
2. **Build the AC Closure Ledger** — one row per `acceptance_criteria` entry from the card YAML (NOT requirements — only the AC list, because ACs are the user-facing contract):
|
|
883
|
+
|
|
884
|
+
```
|
|
885
|
+
## AC Closure Ledger — <CARD-ID>
|
|
886
|
+
| AC# | Text (verbatim) | Status | Evidence (file:line) | User-approved? |
|
|
887
|
+
|-----|-----------------|--------|----------------------|----------------|
|
|
888
|
+
| AC-1 | [text] | implemented | src/x.ts:42 | n/a |
|
|
889
|
+
| AC-2 | [text] | deferred | n/a | pending |
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
Status enum: `implemented` | `deferred`. The Phase 2.5 categories map as follows: `Done` → `implemented`; `Partial` or `Missing` (after gap-resolution exhausted retries) → `deferred`. There is no third option — an AC is either in the diff or it is being deferred.
|
|
893
|
+
|
|
894
|
+
3. **Rationalization scan (BLOCKING for every `deferred` row)** — read the coder's completion report and the card's `implementation_notes`. If the justification for a `deferred` AC matches any of the patterns below, classify the row as `RATIONALIZATION_NEEDS_PROOF`:
|
|
895
|
+
|
|
896
|
+
- "covered by <X>" / "already covers" / "existing <X> handles" / "<X> already does"
|
|
897
|
+
- "implicit in <X>" / "no longer needed" / "redundant with <X>"
|
|
898
|
+
- "out of scope of this card" (when the AC is clearly listed in the card YAML)
|
|
899
|
+
|
|
900
|
+
For each `RATIONALIZATION_NEEDS_PROOF` row, the orchestrator MUST verify by reading `<X>` and producing a line-for-line scope mapping between the AC text and the alleged coverage. The mapping goes in the tracker under `## Rationalization Verification`. If the mapping does not hold (or cannot be produced confidently), the row stays `deferred` and proceeds to Step 4 — the rationalization does NOT auto-approve the deferral.
|
|
901
|
+
|
|
902
|
+
4. **User gate (BLOCKING `AskUserQuestion` — one per `deferred` AC that is not pre-approved)**:
|
|
903
|
+
|
|
904
|
+
For each `deferred` row whose `User-approved?` is `pending`, invoke `AskUserQuestion` with:
|
|
905
|
+
- Question: `"AC-<N> of <CARD-ID> non implementata. Testo verbatim: '<AC text>'. Motivazione dell'implementer: '<reason or 'nessuna — silent skip'>'. Come procedo?"`
|
|
906
|
+
- Options (max 4):
|
|
907
|
+
1. **"Implementa adesso"** — spawn a targeted fix `coder` agent scoped to this card's MAY EDIT files (from `## File Ownership Map`) with the instruction "Implement ONLY AC-<N>: '<AC text>'. Do not refactor or expand scope." Re-run Phase 2.5 verification on the resulting diff. On second failure of the same AC, return to this gate (do NOT loop indefinitely).
|
|
908
|
+
2. **"Approva il deferral"** — record `[USER-APPROVED DEFERRAL] <today>: <user-supplied reason>` on its own line in the card's `implementation_notes`. Mark the row `User-approved? yes`.
|
|
909
|
+
3. **"Sposta su follow-up card"** — create a backlog stub at `${paths.backlog_dir}/<CARD-ID>-followup-AC<N>.yml` with the AC text + minimal context + `status: TODO`. Mark the row `User-approved? yes (follow-up: <new-card-id>)`. Do NOT proceed to Phase 2.55 until the follow-up file exists on disk.
|
|
910
|
+
4. **"Ferma il batch"** — halt the orchestrator, leave the worktree intact, log the reason in `## Issues & Flags`. Do NOT commit.
|
|
911
|
+
|
|
912
|
+
Do NOT batch the question across multiple ACs — one `AskUserQuestion` per AC, so the user sees each AC's text in isolation. Issue the questions sequentially.
|
|
913
|
+
|
|
914
|
+
5. **`implementation_notes` deferral audit (cheap text grep — also BLOCKING)** — before exiting the phase, scan the card YAML's `implementation_notes` field (post-edits, including any text added during this phase) for any of these phrases:
|
|
915
|
+
|
|
916
|
+
- `deferred` / `deferral` / `defer to`
|
|
917
|
+
- `out of scope` / `scope cut`
|
|
918
|
+
- `covered by` / `already handles` / `redundant`
|
|
919
|
+
- `skipped` / `dropped`
|
|
920
|
+
|
|
921
|
+
For each match, verify the line carries the `[USER-APPROVED DEFERRAL]` prefix AND the corresponding AC row in the ledger has `User-approved? yes`. Any mismatch is a silent deferral that escaped Step 4 — trigger the Step 4 `AskUserQuestion` for the AC referenced (or for "the unspecified AC implied by this note" if no AC is named, asking the user to clarify which AC the note refers to).
|
|
922
|
+
|
|
923
|
+
6. **Update tracker**: phase = "2.5b-ac-closure DONE". Persist the AC Closure Ledger AND the Rationalization Verification (if any) in the tracker. Log counts on one line:
|
|
924
|
+
|
|
925
|
+
```
|
|
926
|
+
ac-closure: implemented=N | user-approved deferrals=M | follow-up cards created=K | rationalization-verifications passed=L
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
The gate exits PASS only when every ledger row is either `implemented` or `deferred` with `User-approved? yes`. Phase 2.55 (Simplify) MUST NOT start until this gate exits PASS.
|
|
930
|
+
|
|
931
|
+
#### Context-pressure exception (still BLOCKING — no escape)
|
|
932
|
+
|
|
933
|
+
If at any point in Phases 2 / 2.5 / 2.5b you detect context-window pressure (your context is being summarized, you have ≥ 1 forced compaction, you are racing through verification, you are tempted to "just mark this AC as covered"), do NOT compensate by skipping ACs. The correct response is:
|
|
934
|
+
|
|
935
|
+
1. Stop the current card's pipeline.
|
|
936
|
+
2. Write the current state to the tracker under `## Issues & Flags` with the prefix `[CONTEXT-PRESSURE]` (which Phase 2 finished, which ACs are open, which files are dirty).
|
|
937
|
+
3. Invoke `AskUserQuestion` with options: (a) finish remaining ACs in a fresh `/new` session that resumes from the tracker, (b) commit the complete ACs and route the rest through this gate's Step 4, (c) hand off the worktree intact to the user.
|
|
938
|
+
|
|
939
|
+
Auto Mode does NOT override this rule. "Bias toward proceeding" applies to routine decisions ("should I rerun this check?", "should I confirm this safe rename?"), NEVER to scope reduction.
|
|
940
|
+
|
|
796
941
|
### Phase 2.55 — Simplify (code cleanup before review)
|
|
797
942
|
|
|
798
943
|
After completeness is verified, clean up the implementation before it reaches reviewers and E2E tests. This phase launches three parallel agents on the card's diff, then applies fixes directly.
|
|
@@ -1433,6 +1578,71 @@ The most common failure mode is leaving cards IN_PROGRESS after merge. This crea
|
|
|
1433
1578
|
|
|
1434
1579
|
**Why this exists**: Agents frequently skip the DONE marking in Phase 4 (step 27) due to context compaction, commit failures that interrupt the flow, or team mode where Step D.6 gets lost. This gate is the safety net that catches ALL of these cases.
|
|
1435
1580
|
|
|
1581
|
+
### Phase 6c — Workspace Hygiene Post-merge (BLOCKING — non-skippable)
|
|
1582
|
+
|
|
1583
|
+
**Why this exists**: FEAT-0006 incident closed the batch leaving the main repo with an unpushed orphan commit (`c9d41f9`) and local `develop` diverged from `origin/develop` for a manual fix. This phase closes the loop opened by Phase 0: it verifies the main repo is clean and synchronized, parses the `[SYNC-DEFERRED]` marker emitted by `/mw` when HEAD ≠ develop, and restores any stash saved in Phase 0.
|
|
1584
|
+
|
|
1585
|
+
**Auto Mode does NOT override this phase.** Every `AskUserQuestion` below is non-bypassable.
|
|
1586
|
+
|
|
1587
|
+
**Steps:**
|
|
1588
|
+
|
|
1589
|
+
1. **Fetch remote state**:
|
|
1590
|
+
```bash
|
|
1591
|
+
git -C "$MAIN" fetch origin --quiet
|
|
1592
|
+
```
|
|
1593
|
+
|
|
1594
|
+
2. **Parse `[SYNC-DEFERRED]` markers** — scan the captured stdout from every `/mw` invocation in this batch (kept in the tracker under `## Worktree Merges`) for `[SYNC-DEFERRED] main repo HEAD=<branch>` lines. If present, surface to the user via `AskUserQuestion`:
|
|
1595
|
+
- Question: `"Una o più merge worktree hanno deferito la sincronizzazione di local develop (main repo HEAD non era develop). Come riconcilio adesso?"`
|
|
1596
|
+
- Options: `[Ora HEAD è develop → ff-pull adesso]` / `[Lascia deferred (riconcilio io manualmente)]` / `[Mostra dettagli e fammi decidere]`.
|
|
1597
|
+
|
|
1598
|
+
3. **Clean-tree assertion (BLOCKING)**:
|
|
1599
|
+
```bash
|
|
1600
|
+
git -C "$MAIN" status --porcelain
|
|
1601
|
+
```
|
|
1602
|
+
If non-empty AND no Phase 0 stash is pending → invoke `AskUserQuestion`:
|
|
1603
|
+
- Question: `"Main repo ha modifiche non committate dopo il batch (non c'era stash di Phase 0). Cosa faccio?"`
|
|
1604
|
+
- Options: `[Mostrami il diff e fammi decidere]` / `[Stash adesso con label baldart-post-batch-<timestamp>]` / `[Lascia così (lo gestisco io)]` / `[Halt]`.
|
|
1605
|
+
|
|
1606
|
+
4. **Divergence assertion (BLOCKING — this catches the FEAT-0006 orphan-commit pattern)**:
|
|
1607
|
+
```bash
|
|
1608
|
+
git -C "$MAIN" rev-list --left-right --count origin/develop...develop
|
|
1609
|
+
```
|
|
1610
|
+
If the output is anything other than `0\t0`:
|
|
1611
|
+
- **Ahead only (M > 0, unpushed commits)** — invoke `AskUserQuestion`:
|
|
1612
|
+
- Question: `"Local develop ha M commit non pushati su origin/develop al termine del batch. Lista: <git log --oneline origin/develop..develop>. Cosa faccio?"`
|
|
1613
|
+
- Options: `[Push adesso (git push origin develop)]` / `[Cherry-pick selettivo su origin/develop]` / `[Reset --hard origin/develop (richiede conferma esplicita, DISTRUTTIVO)]` / `[Halt con stato preservato]`.
|
|
1614
|
+
- On `Reset --hard origin/develop` re-ask `AskUserQuestion` to confirm: `"Confermi reset --hard? I commit <list> verranno persi se non pushati altrove."` Solo dopo conferma esplicita esegui il reset.
|
|
1615
|
+
- **Behind only (N > 0)** — invoke `AskUserQuestion`:
|
|
1616
|
+
- Question: `"Local develop è behind origin/develop di N commit (qualcuno ha pushato durante il batch). Faccio ff-pull adesso?"`
|
|
1617
|
+
- Options: `[Fast-forward pull]` / `[Lascia behind (lo gestisco io)]`.
|
|
1618
|
+
- **Diverged both ways** — invoke `AskUserQuestion`:
|
|
1619
|
+
- Question: `"Local develop è diverged (N behind, M ahead). Servono entrambe le riconciliazioni. Come procedo?"`
|
|
1620
|
+
- Options: `[Rebase local develop su origin/develop]` / `[Mostrami i commit locali e decidiamo]` / `[Halt]`.
|
|
1621
|
+
|
|
1622
|
+
5. **Restore Phase 0 stash (if any)** — read the tracker for `## Workspace Snapshot: <ref>`:
|
|
1623
|
+
- If `<ref>` is `dirty-tree override` → skip restore, log "user retained dirty-tree responsibility".
|
|
1624
|
+
- If `<ref>` is `stash@{N}` (or similar):
|
|
1625
|
+
```bash
|
|
1626
|
+
git -C "$MAIN" stash pop <ref>
|
|
1627
|
+
```
|
|
1628
|
+
On conflict, do NOT silent-drop — invoke `AskUserQuestion`:
|
|
1629
|
+
- Question: `"Restore dello stash di Phase 0 ha generato conflitti. Lo stash è ancora presente (NON eliminato). Come procedo?"`
|
|
1630
|
+
- Options: `[Lascia lo stash + apri istruzioni per merge manuale]` / `[Mostrami il conflitto inline]` / `[Halt]`.
|
|
1631
|
+
|
|
1632
|
+
6. **Log and exit**:
|
|
1633
|
+
```
|
|
1634
|
+
## Phase 6c — Workspace Hygiene Post-merge
|
|
1635
|
+
Status: PASS
|
|
1636
|
+
Clean-tree: <yes | resolved: stashed | user-retained>
|
|
1637
|
+
Divergence (local…origin/develop): <0\t0 | resolved: pushed/cherry-picked/ff-pulled/rebased>
|
|
1638
|
+
Sync-deferred markers: <none | reconciled | user-retained>
|
|
1639
|
+
Phase 0 snapshot restore: <n/a | popped clean | conflict-deferred-to-user>
|
|
1640
|
+
Completed: <timestamp>
|
|
1641
|
+
```
|
|
1642
|
+
If any step ended in HALT, set `Status: HALT` and report — Phase 7 must NOT start with an unclean main repo unless the user explicitly chose `[Lascia così]`.
|
|
1643
|
+
|
|
1644
|
+
7. **Anti-bypass guard** — like Phase 0, before exiting Phase 6c re-read the tracker section you just wrote. Missing `## Phase 6c` → refuse to proceed to Phase 7. There is no `--skip-phase-6c` flag; treat any urge to skip as a self-correction trigger.
|
|
1645
|
+
|
|
1436
1646
|
### Fail-safe rules (enforced by worktree-manager skill)
|
|
1437
1647
|
- **Never `git checkout`, `git switch`, `git checkout -b`, or `git branch` on the main repo** from inside this orchestrator. The main repo is shared across parallel terminals. Use the configured `git.merge_strategy` for develop merges and `git -C <main> pull --ff-only` (only when `HEAD = develop` already) for sync. See `/mw` step 4c.
|
|
1438
1648
|
- Never merge to `main` — only to `develop`, via the configured `git.merge_strategy` (NOT local checkout).
|
|
@@ -1840,21 +2050,31 @@ For each completed agent:
|
|
|
1840
2050
|
- Other agents in the group continue unaffected.
|
|
1841
2051
|
- After group completes, ask user: retry failed card or skip?
|
|
1842
2052
|
|
|
1843
|
-
#### Step D: Post-group review + QA
|
|
2053
|
+
#### Step D: Post-group review + QA (ALL sub-steps MANDATORY)
|
|
2054
|
+
|
|
2055
|
+
> **The sub-steps below are ALL MANDATORY.** The previous lean Step D (build → combined review → qa → codex → commit) was an incident-causing shortcut (FEAT-0006: 10 sub-cards committed with 0 invocations of Phase 2.5b / 2.55 / 2.6 / 3 / 3.5 / 3.7) and is now FORBIDDEN. Every card in the group MUST complete every per-card sub-step (D.3a, D.3b, D.3c, D.4a) before the group reaches D.5 commit. Skipping any sub-step "to save time", "to save tokens", "because the diff is small", or for any model-invented reason is a protocol violation. Auto Mode does NOT override this.
|
|
1844
2056
|
|
|
1845
2057
|
After ALL agents in the group complete successfully:
|
|
1846
2058
|
|
|
1847
|
-
1. **Build verification** — Run `npm run build` in the worktree to verify combined changes compile. If build fails, identify which card's changes broke it (from `git diff` per card), spawn a targeted fix-coder for those files only.
|
|
2059
|
+
1. **D.1 — Build verification (group)** — Run `npm run build` in the worktree to verify combined changes compile. If build fails, identify which card's changes broke it (from `git diff` per card), spawn a targeted fix-coder for those files only.
|
|
2060
|
+
|
|
2061
|
+
2. **D.2 — Combined static review (group)** — Invoke **code-reviewer** + **doc-reviewer** IN PARALLEL (read-only, same as Phase 3) across ALL changes in the group. This is ONE combined review, not per-card — efficient and catches cross-card issues. Per-card doc-review still runs in D.4a.
|
|
2062
|
+
|
|
2063
|
+
3. **D.3 — Apply fixes (group)** — If D.2 findings exist, spawn ONE fix-coder to apply all fixes in a single pass. Run build + lint after.
|
|
2064
|
+
|
|
2065
|
+
3a. **D.3a — Phase 2.5b AC-Closure Gate (per-card, BLOCKING — non-skippable)** — For EACH card in the group, **sequentially**, invoke the full Phase 2.5b gate as documented in `### Phase 2.5b — AC-Closure Gate (BLOCKING — Scope Closure Discipline)`. This includes: build the AC Closure Ledger from the card YAML, run the rationalization scan, invoke `AskUserQuestion` one-per-deferred-AC, run the `implementation_notes` deferral audit, and persist the ledger in the tracker. Until EVERY card in the group exits PASS, do NOT proceed to D.3b. Cards exiting with `not_implemented` ACs that the user routes to "Implementa adesso" must finish their fix-coder loop and re-pass the gate before D.3b starts for the next card. Log under `## AC Closure Ledger — <CARD-ID>` per card.
|
|
1848
2066
|
|
|
1849
|
-
|
|
2067
|
+
3b. **D.3b — Phase 2.55 Simplify (per-card)** — For EACH card in the group, invoke Phase 2.55 (Reuse / Quality / Efficiency parallel agents) on the per-card diff (`git diff --name-only` filtered by the card's File Ownership Map). Per-card (not group-aggregate) so findings are attributable. Apply fixes inline. After all cards: re-run `npm run lint` and `npx tsc --noEmit` on the worktree once.
|
|
1850
2068
|
|
|
1851
|
-
|
|
2069
|
+
3c. **D.3c — Phase 2.6 E2E-Review (per-card)** — For EACH card in the group, honor the existing Gate table (skip when `features.has_e2e_review: false`, backend-only diff per the diff predicate documented in Phase 2.6, or card type `docs`/`chore`/`config`). For cards that pass the gate, invoke `/e2e-review` in programmatic mode with that card's payload. BLOCKING per-card: if `/e2e-review` returns `"blocked"` or `"error"`, surface to the user via the same `AskUserQuestion` documented in Phase 2.6 — do NOT proceed to D.4 with an unresolved card. Skips are logged with the documented gate reason, never with `"time budget"` or similar.
|
|
1852
2070
|
|
|
1853
|
-
4. **QA gate** — Select the HIGHEST QA profile across all cards in the group (e.g., if one card is BALANCED and another is DEEP, use DEEP). Invoke **qa-sentinel** once for the group.
|
|
2071
|
+
4. **D.4 — QA gate (group)** — Select the HIGHEST QA profile across all cards in the group (e.g., if one card is BALANCED and another is DEEP, use DEEP). Invoke **qa-sentinel** once for the group.
|
|
1854
2072
|
|
|
1855
|
-
|
|
2073
|
+
4a. **D.4a — Phase 3 Doc Review per-card** — For EACH card in the group, invoke `doc-reviewer` scoped to that card's File Ownership Map + card YAML (mirrors Phase 3 of the sequential path). If findings exist, spawn a targeted fix-coder for that card only. This is in addition to the combined D.2 doc-reviewer pass — D.2 catches cross-card issues, D.4a verifies each card meets its own doc gate before commit.
|
|
1856
2074
|
|
|
1857
|
-
|
|
2075
|
+
4b. **D.4b — Pre-Merge Codex Review Gate (per-card, MANDATORY — UNCONDITIONAL)** — Invoke `/codexreview` for EACH card in the group, one at a time, BEFORE any commit. This mirrors Phase 3.7 of the sequential path and is non-skippable regardless of file paths or perceived risk. Apply the same fix sub-loop: if the consolidated report shows verified BLOCKER/HIGH findings, spawn a fix-coder and re-run `/codexreview <CARD-ID>` (max 2 retries per card). If still BLOCKER/HIGH after retries, ask the user before proceeding to D.5. The D.5 commits MUST NOT happen until every card in the group has a PASS verdict (or explicit user override via `AskUserQuestion`). Log results in the tracker under `## Pre-Merge Codex Review` per card.
|
|
2076
|
+
|
|
2077
|
+
5. **D.5 — Commit** — One commit per card using explicit staging from the ownership map. **NO stash in worktrees** (stashes are globally shared via `refs/stash` — see Phase 4 WORKTREE COMMIT RULE):
|
|
1858
2078
|
```bash
|
|
1859
2079
|
cd <worktree-path>
|
|
1860
2080
|
# For each card in the group:
|
|
@@ -1862,13 +2082,26 @@ After ALL agents in the group complete successfully:
|
|
|
1862
2082
|
git commit -m "[CARD-ID] Brief description"
|
|
1863
2083
|
```
|
|
1864
2084
|
|
|
1865
|
-
6. **Update backlog (MANDATORY — do NOT skip)** — For EACH card in the group:
|
|
1866
|
-
a. Edit the backlog YAML (`${paths.backlog_dir}/<CARD-ID>.yml`): set `status: DONE`, add `completed_date: <today>`, add implementation notes.
|
|
2085
|
+
6. **D.6 — Update backlog (MANDATORY — do NOT skip)** — For EACH card in the group:
|
|
2086
|
+
a. Edit the backlog YAML (`${paths.backlog_dir}/<CARD-ID>.yml`): set `status: DONE`, add `completed_date: <today>`, add implementation notes (NEVER include `[USER-APPROVED DEFERRAL]` lines that didn't actually pass through D.3a's gate).
|
|
1867
2087
|
b. **Verify the write**: re-read the YAML file and confirm `status: DONE` is present. If not, retry.
|
|
1868
2088
|
c. Stage the updated YAML and include it in the card's commit (or as an immediate follow-up commit).
|
|
1869
2089
|
d. Log in tracker: `card_status: DONE (verified)` for each card.
|
|
1870
2090
|
Note: Phase 6b (Status Reconciliation) will catch any card missed here, but aim for zero misses.
|
|
1871
2091
|
|
|
2092
|
+
#### Step D coverage assertion (MANDATORY end-of-group check)
|
|
2093
|
+
|
|
2094
|
+
Before moving to Step E, the orchestrator MUST verify the tracker contains, for EACH card in the group, ALL of the following entries (or an explicit gate-skip log with the documented reason):
|
|
2095
|
+
|
|
2096
|
+
- `## AC Closure Ledger — <CARD-ID>` with `ac-closure: implemented=N | user-approved deferrals=M | follow-up cards created=K`
|
|
2097
|
+
- `simplify: <N fixes | clean — 0 fixes>` (per-card from D.3b)
|
|
2098
|
+
- `e2e-review: <status>` (with documented gate-skip reason if SKIP)
|
|
2099
|
+
- `doc-review: <status>` (from D.4a)
|
|
2100
|
+
- `qa: <profile=... | verdict=...>` (group-level from D.4 — same value cited per card)
|
|
2101
|
+
- `codex-review: <verdict>` (per-card from D.4b)
|
|
2102
|
+
|
|
2103
|
+
A missing entry means a sub-step was skipped. If any entry is missing, do NOT proceed to Step E — return to the missing sub-step and execute it. Documenting "skipped per time budget" or similar is a protocol violation per the top-of-file rigidity clause.
|
|
2104
|
+
|
|
1872
2105
|
#### Step E: Context purge + next group
|
|
1873
2106
|
|
|
1874
2107
|
After committing all cards in the group:
|
|
@@ -846,6 +846,10 @@ if [ "$CURRENT_BRANCH" = "develop" ]; then
|
|
|
846
846
|
else
|
|
847
847
|
echo "ℹ️ Main repo HEAD is '$CURRENT_BRANCH' — not switching. Next manual `git pull` on develop will sync."
|
|
848
848
|
git -C "$MAIN" fetch origin develop --quiet
|
|
849
|
+
# Structured marker for upstream orchestrators (e.g. /new Phase 6c).
|
|
850
|
+
# `/mw` standalone keeps fetch-only behavior (terminal isolation); orchestrators
|
|
851
|
+
# parse this marker and route reconciliation through an explicit user gate.
|
|
852
|
+
echo "[SYNC-DEFERRED] main repo HEAD=${CURRENT_BRANCH}, local develop not fast-forwarded — orchestrator workspace-hygiene phase must reconcile."
|
|
849
853
|
fi
|
|
850
854
|
```
|
|
851
855
|
|
|
@@ -51,6 +51,20 @@ Define how agents plan, track, and complete work safely.
|
|
|
51
51
|
- `IN_PROGRESS` requires Active Code Context set.
|
|
52
52
|
- `BLOCKED` requires blocker documented in card and status file.
|
|
53
53
|
|
|
54
|
+
## Scope Closure Discipline (MUST)
|
|
55
|
+
|
|
56
|
+
When a card's `acceptance_criteria` cannot be fully implemented as written, the deferral is a USER decision, not an agent decision. The following are protocol violations regardless of perceived risk or convenience:
|
|
57
|
+
|
|
58
|
+
- **Silent deferral** — marking an AC as not implemented inside the card YAML (`implementation_notes`, `notes`, comments) without explicit user approval recorded in the same session. Approved deferrals MUST carry the `[USER-APPROVED DEFERRAL] <date>: <reason>` prefix on the same line; the prefix is the audit trail.
|
|
59
|
+
- **Rationalization-without-verification** — justifying an unimplemented AC with "X already covers it" / "Y already handles this" / "redundant with Z" without (a) reading X / Y / Z, and (b) showing a line-for-line scope mapping between the AC and the alleged coverage. The mapping lives in the tracker under `## Rationalization Verification`.
|
|
60
|
+
- **Scope reduction under context pressure** — when context-window pressure, time pressure, or unforeseen complexity makes the original scope hard to meet, the correct action is to STOP and surface the situation via `AskUserQuestion` (preferred options: implement now, defer with explicit approval, move to a follow-up card, halt and hand off). Trading completeness for visible coverage across more cards is forbidden.
|
|
61
|
+
|
|
62
|
+
Any deferral travels through an explicit `AskUserQuestion` with the AC text quoted verbatim, one question per AC. For orchestrator skills (`/new`, `/prd`) this discipline is enforced in the per-card AC-closure gate before commit. Auto Mode's "bias toward proceeding" applies to routine decisions, NOT to scope reduction — silent deferral of a numbered AC is a violation even in Auto Mode.
|
|
63
|
+
|
|
64
|
+
### Coder authority (no defer)
|
|
65
|
+
|
|
66
|
+
Coder agents report `done | failed` at card level. Per-requirement signals (`done | not_implemented`) are inputs to the orchestrator's AC-Closure Gate, never terminal verdicts. Coders have NO authority to declare an AC `deferred`, `out of scope`, `covered by X`, `partial`, `blocked`, or any equivalent. Only the user, via the gate's `AskUserQuestion`, can approve a deferral. Inventing constraints — `time budget`, `context budget`, `context pressure as override`, or any phrase not enumerated in a phase's documented Gate table — to skip phases or defer ACs is a protocol violation. The same rule applies to orchestrator agents (sequential and team-mode L0/L1/L2/L3): they relay coder signals into the gate; they do not aggregate, summarize, or pre-filter deferrals.
|
|
67
|
+
|
|
54
68
|
## Deploys and Publications
|
|
55
69
|
|
|
56
70
|
- Production deploys and publications must follow `agents/deployment-protocol.md` if it exists.
|