baldart 4.26.1 → 4.27.1
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 +25 -0
- package/VERSION +1 -1
- package/framework/.claude/skills/prd/SKILL.md +24 -16
- package/framework/.claude/skills/prd/assets/state-template.md +5 -3
- package/framework/.claude/skills/prd/references/discovery-phase.md +11 -0
- package/framework/.claude/skills/prd/references/obsidian-backref.md +120 -0
- package/framework/.claude/skills/prd/references/prd-writing-phase.md +3 -2
- package/framework/.claude/skills/prd/references/validation-phase.md +21 -65
- package/framework/.claude/workflows/new2-resolve.js +14 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ 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
|
+
## [4.27.1] - 2026-06-11
|
|
9
|
+
|
|
10
|
+
**`new2` resolve: never run an adversarial doc review.** When a resolution pass fixed a `doc`-domain finding, the fixer was `doc-reviewer` (which applies *and* self-verifies the fix in one pass) — but `judgeVerify()` then spawned `doc-reviewer` *again* as the mandatory adversarial judge, plus the terminal-judge ratification used it a third time. That is `doc-reviewer` judging `doc-reviewer`: zero cross-model diversity, pure waste of tokens and time. The doc domain now trusts the single reviewer-writer pass — the adversarial judge and the terminal-judge ratification are both skipped for `doc` only (every other domain keeps the mandatory cross-check unchanged, since their fixer and judge are genuinely independent specialists). **PATCH** (cost/latency optimization on the EXPERIMENTAL `new2` surface; no config key, no change to `/new`, no behavior change for code/ui/security/perf/test resolutions).
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **`framework/.claude/workflows/new2-resolve.js`** — `judgeVerify()` short-circuits for `domain === 'doc'` (accepts the first verified attempt without re-spawning), and the terminal-judge branch ratifies a doc terminal verdict directly instead of re-running `doc-reviewer`. `meta.description` updated to document the doc exception.
|
|
15
|
+
|
|
16
|
+
## [4.27.0] - 2026-06-11
|
|
17
|
+
|
|
18
|
+
**`/prd`: the Obsidian back-reference is now two-phase — the spec note is linked the moment the PRD starts, not only at merge.** The end-of-run snippet (v4.22.0) is gated on a successful merge, so a PRD that is paused or abandoned mid-flow (e.g. parked at the UI-design step, worktree never merged) left its origin note empty — even though detection already happened at Step 1. Observed in the wild: a `realtime-order-collaboration` PRD stuck at `ui-design` never wrote back, while a completed sibling PRD did. **MINOR** (additive capability on `/prd`; reuses the existing slug-keyed markers + the snippet `status:` lifecycle field; no `baldart.config.yml` key, so the schema-change propagation rule does not apply).
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`framework/.claude/skills/prd/references/obsidian-backref.md`** — new shared SSOT for the back-reference: the marker contract (`<!-- BALDART:prd:<slug> START/END -->`), the idempotent read-replace-or-append write procedure, the skip conditions (no note / `path: none` / unwritable → log, never fatal), and the two write modes. Both call sites cite it, so the snippet shape can't drift between them.
|
|
23
|
+
- **Provisional write at detection (discovery-phase Step 1 point 2).** Right after the Obsidian note is detected, `/prd` writes a lightweight `status: drafting` block (slug + deterministic branch `prd/<slug>` + planned PRD path + trunk) into the note and sets state `## Obsidian Spec Note / status: provisional-written`. The note reflects "a PRD was started here" immediately.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **Final write upgrades the provisional block in place (validation-phase Step 7.6).** Same slug-keyed markers, so the post-merge full payload (epic + card IDs, merge SHA/PR, `resources:`, `status: planned`) replaces the `drafting` block — no duplicates. Step 7.6 is now a lean delegation to `obsidian-backref.md § Mode: FINAL` instead of an inlined copy of the snippet.
|
|
28
|
+
- **Snippet `status:` enum tightened to `drafting | planned | done`** (was `planned | in-progress | done`) — a clean ladder: PRD in stesura → mergiato/pianificato → in produzione.
|
|
29
|
+
- **State `## Obsidian Spec Note / status` enum** gains `provisional-written`: `none → detected → provisional-written → back-reference-written`.
|
|
30
|
+
- **Coupling fix:** `prd-writing-phase.md` Step 4 point 2 now adds the PRD Canonical Sources row when the note status is anything other than `none` (was hard-coded to `== detected`), so the provisional-write status change doesn't suppress the traceability row.
|
|
31
|
+
- **`SKILL.md` HARD RULE 19** rewritten for the two-phase lifecycle; flow-table gains a `1.2` row and annotates `7.6` as the FINAL upgrade.
|
|
32
|
+
|
|
8
33
|
## [4.26.1] - 2026-06-11
|
|
9
34
|
|
|
10
35
|
**`new2`: specialization integrity — a full audit of every agent spawn; no role mixing anywhere.** User principle: code is written ONLY by `coder`, UI only by `ui-expert`, each agent does one thing. The audit of all 16 spawn sites found two genuine violations and three under-specified plumbing roles. **PATCH** (role-integrity fixes on the EXPERIMENTAL `new2` surface; no config key, no change to `/new`).
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.27.1
|
|
@@ -38,6 +38,7 @@ message. You ask questions, wait for answers, and iterate.
|
|
|
38
38
|
|------|-------|-----------|
|
|
39
39
|
| 0 | Context Recovery | [discovery-phase.md](references/discovery-phase.md) |
|
|
40
40
|
| 1 | Kickoff | [discovery-phase.md](references/discovery-phase.md) |
|
|
41
|
+
| 1.2 | Obsidian provisional back-reference (only if a spec note was given) | [discovery-phase.md](references/discovery-phase.md) + [obsidian-backref.md](references/obsidian-backref.md) |
|
|
41
42
|
| 1.6 | Mockup Intake | [discovery-phase.md](references/discovery-phase.md) |
|
|
42
43
|
| 2 | Discovery Question Loop (+ Codex completeness cross-check at exit, v4.19.0) | [discovery-phase.md](references/discovery-phase.md) |
|
|
43
44
|
| 2→CR | Change Request (auto/manual) | the canonical **`prd-add` skill** ([../prd-add/SKILL.md](../prd-add/SKILL.md)) — worktree-aware (`references/prd-add-phase.md` is a redirect stub, not the implementation) |
|
|
@@ -49,7 +50,7 @@ message. You ask questions, wait for answers, and iterate.
|
|
|
49
50
|
| 5 | Backlog Cards | [backlog-phase.md](references/backlog-phase.md) |
|
|
50
51
|
| 6 | Quality Audit | [validation-phase.md](references/validation-phase.md) |
|
|
51
52
|
| 7 | Resolution, Commit & Merge | [validation-phase.md](references/validation-phase.md) |
|
|
52
|
-
| 7.6 | Obsidian back-reference (only if a spec note was given) | [validation-phase.md](references/validation-phase.md) |
|
|
53
|
+
| 7.6 | Obsidian back-reference — FINAL (upgrades the 1.2 provisional block; only if a spec note was given) | [validation-phase.md](references/validation-phase.md) + [obsidian-backref.md](references/obsidian-backref.md) |
|
|
53
54
|
|
|
54
55
|
**Before starting each phase, read the corresponding reference file.**
|
|
55
56
|
|
|
@@ -234,21 +235,28 @@ message. You ask questions, wait for answers, and iterate.
|
|
|
234
235
|
transcripts for REAL per-role token + wall-clock cost. The token itself is NOT part
|
|
235
236
|
of the feature description — strip it before recording the user's verbatim feature
|
|
236
237
|
text in `## Feature Description`.
|
|
237
|
-
19. **Obsidian back-reference (MANDATORY when a spec note was given
|
|
238
|
-
kicked off the PRD from an Obsidian note (any of: `[[Note]]`
|
|
239
|
-
`obsidian://open?…` URI, or a pasted `.md` path),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
238
|
+
19. **Obsidian back-reference (MANDATORY when a spec note was given — TWO-PHASE since
|
|
239
|
+
v4.27.0).** If the user kicked off the PRD from an Obsidian note (any of: `[[Note]]`
|
|
240
|
+
wikilink, `obsidian://open?…` URI, or a pasted `.md` path), the same note becomes the
|
|
241
|
+
durable index the user can later query ("come è stata sviluppata la feature X, dov'è
|
|
242
|
+
finita"). It is written in two phases against ONE slug-keyed marker block
|
|
243
|
+
(`<!-- BALDART:prd:<slug> START/END -->`), so the second write replaces the first in
|
|
244
|
+
place (idempotent, no duplicates):
|
|
245
|
+
- **Provisional** — at Step 1 detection (discovery-phase Step 1 point 2): a lightweight
|
|
246
|
+
`status: drafting` block with slug + branch `prd/<slug>` + planned PRD path. So the
|
|
247
|
+
note reflects "a PRD was started here" **immediately**, even if the run is later
|
|
248
|
+
paused or abandoned before merge.
|
|
249
|
+
- **Final** — at the END of the run, **after** the merge (validation-phase Step 7 item
|
|
250
|
+
9) so paths/IDs/SHA are final (Step 7.6): the full payload — feature slug, PRD path,
|
|
251
|
+
epic + card IDs, branch, merge commit/PR, Canonical Sources as `resources:`,
|
|
252
|
+
`status: planned`.
|
|
253
|
+
|
|
254
|
+
The note lives in the user's **vault, outside the worktree and outside git** — a plain
|
|
255
|
+
filesystem write, never staged/committed. Both writes are **NON-BLOCKING**: no spec
|
|
256
|
+
note, unresolved vault path, or an unwritable note all skip with a log line, never
|
|
257
|
+
aborting the PRD. SSOT for the marker contract + write procedure + both modes:
|
|
258
|
+
[obsidian-backref.md](references/obsidian-backref.md). See also discovery-phase.md Step
|
|
259
|
+
1 point 2 and validation-phase.md Step 7.6.
|
|
252
260
|
|
|
253
261
|
---
|
|
254
262
|
|
|
@@ -16,10 +16,12 @@ stats_enabled: {{true if invoked with -stats/--stats, else false}}
|
|
|
16
16
|
|
|
17
17
|
<!-- Populated by discovery-phase.md Step 1 point 2 ONLY when the user passed an
|
|
18
18
|
Obsidian note as the documental starting point. When no note was given, leave
|
|
19
|
-
status: none and
|
|
19
|
+
status: none and both back-reference writes are skipped. -->
|
|
20
20
|
wikilink: none # [[Note Name]] form — feeds PRD Canonical Sources row
|
|
21
|
-
path: none # absolute fs path of the note — target of the
|
|
22
|
-
status: none # none | detected | back-reference-written
|
|
21
|
+
path: none # absolute fs path of the note — target of the back-reference writeback
|
|
22
|
+
status: none # none | detected | provisional-written | back-reference-written
|
|
23
|
+
# detected → provisional snippet written at Step 1.2 (provisional-written)
|
|
24
|
+
# → upgraded to the full payload at Step 7.6 (back-reference-written)
|
|
23
25
|
|
|
24
26
|
## Feature Description
|
|
25
27
|
{{user's description verbatim}}
|
|
@@ -84,6 +84,17 @@ this is a fresh session (no existing state file).
|
|
|
84
84
|
Then read the note content (from `path:`) to pre-populate discovery dimensions
|
|
85
85
|
where possible — treat it as a user-provided spec. This same note becomes the
|
|
86
86
|
target of the back-reference snippet at the end of the run (HARD RULE 19).
|
|
87
|
+
|
|
88
|
+
**Provisional back-reference (NON-BLOCKING — v4.27.0).** Immediately after detection,
|
|
89
|
+
write a *provisional* snippet into the note so it reflects "a PRD was started here" even
|
|
90
|
+
if this session is later paused or abandoned before merge (the FINAL snippet at
|
|
91
|
+
validation-phase Step 7.6 is gated on a successful merge and would otherwise never run
|
|
92
|
+
for an incomplete PRD). Follow [obsidian-backref.md](obsidian-backref.md) **§ Mode:
|
|
93
|
+
PROVISIONAL** — the marker block is keyed on `<slug>`, so the FINAL write later replaces
|
|
94
|
+
it in place (no duplicates). All skip conditions in that module apply (no note / `path:
|
|
95
|
+
none` / unwritable → log and continue, never fatal). On success the module sets
|
|
96
|
+
`## Obsidian Spec Note / status: provisional-written`. The branch is the deterministic
|
|
97
|
+
`prd/<slug>` that `nw-docs` creates in the next point.
|
|
87
98
|
3. **Create the docs worktree (MANDATORY — HARD RULE 17)** — invoke the
|
|
88
99
|
`worktree-manager` skill in programmatic docs mode BEFORE any file write:
|
|
89
100
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Obsidian Back-Reference (shared SSOT)
|
|
2
|
+
|
|
3
|
+
Single source of truth for the **idempotent back-reference snippet** that `/prd` writes
|
|
4
|
+
into the user's Obsidian spec note. Two phases call this module; both target the SAME
|
|
5
|
+
marker block keyed on the slug, so the later write **replaces the earlier one in place** —
|
|
6
|
+
the note never accumulates duplicates.
|
|
7
|
+
|
|
8
|
+
| Phase | Caller | Mode | Trigger |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| Provisional | `discovery-phase.md` Step 1 point 2 | `PROVISIONAL` | right after the note is detected — the PRD has only just started |
|
|
11
|
+
| Final | `validation-phase.md` Step 7.6 | `FINAL` | after the merge succeeds — paths, card IDs, branch, SHA are now final |
|
|
12
|
+
|
|
13
|
+
**Why two phases (v4.27.0).** A PRD can be paused or abandoned mid-flow (e.g. parked at the
|
|
14
|
+
UI-design step, worktree never merged). The FINAL write is gated on a successful merge, so
|
|
15
|
+
without a provisional write the note would stay empty for every incomplete PRD — even
|
|
16
|
+
though detection already happened at Step 1. The provisional write makes the note reflect
|
|
17
|
+
"a PRD was started here" immediately; the FINAL write upgrades it to the full,
|
|
18
|
+
queryable payload once the run completes.
|
|
19
|
+
|
|
20
|
+
## Marker contract
|
|
21
|
+
|
|
22
|
+
The block is delimited by HTML-comment markers keyed on `<slug>`:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
<!-- BALDART:prd:<slug> START -->
|
|
26
|
+
…block…
|
|
27
|
+
<!-- BALDART:prd:<slug> END -->
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Write procedure (identical for both modes):**
|
|
31
|
+
1. Read the current note content at the absolute `path:` from state `## Obsidian Spec Note`.
|
|
32
|
+
2. If both markers are present → REPLACE everything between them (inclusive) with the new block.
|
|
33
|
+
3. If markers are absent → APPEND the new block at the end of the note, preceded by one blank line.
|
|
34
|
+
4. Write the note back to `path:`.
|
|
35
|
+
|
|
36
|
+
The note lives in the user's **vault, outside the worktree and outside git** — it is a
|
|
37
|
+
plain filesystem write to the absolute `path:`, NEVER staged or committed.
|
|
38
|
+
|
|
39
|
+
## Skip conditions (each logged, NEVER fatal — both phases)
|
|
40
|
+
|
|
41
|
+
- `## Obsidian Spec Note / status` is `none` (no note was given) → skip silently.
|
|
42
|
+
- `path:` is `none`/empty (vault root never resolved at Step 1) → skip with a one-line note.
|
|
43
|
+
- The file at `path:` does not exist or is not writable → skip with a one-line warning.
|
|
44
|
+
|
|
45
|
+
The back-reference is a convenience index, never a gate. Any failure logs
|
|
46
|
+
`"Obsidian back-reference: SKIPPED (<reason>)"` and the run continues.
|
|
47
|
+
|
|
48
|
+
## Mode: PROVISIONAL — `discovery-phase.md` Step 1 point 2
|
|
49
|
+
|
|
50
|
+
**Known here:** `<slug>`, the deterministic branch `prd/<slug>` (the name `worktree-manager
|
|
51
|
+
nw-docs` always uses), the planned PRD path, `git.trunk_branch`, the detection timestamp.
|
|
52
|
+
**Not yet known:** epic/card IDs (Step 5), the merge SHA/PR (Step 7), the full Canonical
|
|
53
|
+
Sources list (Step 4). Write the lighter block:
|
|
54
|
+
|
|
55
|
+
````markdown
|
|
56
|
+
<!-- BALDART:prd:<slug> START -->
|
|
57
|
+
## 🛠 Sviluppo BALDART — <slug>
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
feature: <slug>
|
|
61
|
+
prd: ${paths.prd_dir}/<slug>/PRD.md # path pianificato — il file viene scritto a Step 4
|
|
62
|
+
branch: prd/<slug>
|
|
63
|
+
trunk_branch: <git.trunk_branch>
|
|
64
|
+
started: <ISO-8601 UTC>
|
|
65
|
+
status: drafting # drafting | planned | done
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- **Stato:** PRD in stesura sul branch `prd/<slug>`. Lo snippet verrà completato al merge.
|
|
69
|
+
|
|
70
|
+
_Avviato da `/prd` il <date>. Questo blocco si aggiorna automaticamente con card, merge e sorgenti canoniche quando il PRD viene mergiato._
|
|
71
|
+
<!-- BALDART:prd:<slug> END -->
|
|
72
|
+
````
|
|
73
|
+
|
|
74
|
+
After the write, set `## Obsidian Spec Note / status: provisional-written` in the state file.
|
|
75
|
+
|
|
76
|
+
## Mode: FINAL — `validation-phase.md` Step 7.6
|
|
77
|
+
|
|
78
|
+
Runs AFTER the merge (Step 7 item 9). All identifiers are final. Write the full block,
|
|
79
|
+
REPLACING the provisional one in place:
|
|
80
|
+
|
|
81
|
+
````markdown
|
|
82
|
+
<!-- BALDART:prd:<slug> START -->
|
|
83
|
+
## 🛠 Sviluppo BALDART — <slug>
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
feature: <slug>
|
|
87
|
+
prd: ${paths.prd_dir}/<slug>/PRD.md
|
|
88
|
+
epic: FEAT-XXXX-00-<slug>-epic
|
|
89
|
+
cards:
|
|
90
|
+
- FEAT-XXXX-01-<sub-slug>
|
|
91
|
+
- FEAT-XXXX-02-<sub-slug>
|
|
92
|
+
resources: # other Canonical Sources from the PRD (mockups, ADRs, ref docs, research)
|
|
93
|
+
- ${paths.prd_dir}/<slug>/design.html # omit if no design
|
|
94
|
+
- <ssot-registry entry / ADR path / research link>
|
|
95
|
+
branch: prd/<slug>
|
|
96
|
+
merge_commit: <SHA from state ## Validation>
|
|
97
|
+
pr: <PR number, or n/a for local-push>
|
|
98
|
+
trunk_branch: <git.trunk_branch>
|
|
99
|
+
date: <ISO-8601 UTC>
|
|
100
|
+
status: planned # drafting | planned | done
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- **PRD:** `${paths.prd_dir}/<slug>/PRD.md`
|
|
104
|
+
- **Cards:** FEAT-XXXX-00 (epic) · FEAT-XXXX-01 · FEAT-XXXX-02 …
|
|
105
|
+
- **Merge:** `<SHA>` su `<git.trunk_branch>`<!-- · PR #N -->
|
|
106
|
+
|
|
107
|
+
_Generato da `/prd` il <date>. Aggiorna `status:` a `done` quando la feature è in produzione._
|
|
108
|
+
<!-- BALDART:prd:<slug> END -->
|
|
109
|
+
````
|
|
110
|
+
|
|
111
|
+
Fill the `yaml` from the final state: `<slug>`, the real epic + child card IDs created in
|
|
112
|
+
Step 5, the merge SHA written under `## Validation` (Step 7 item 8), the PR number from the
|
|
113
|
+
`mw-docs` return (or `n/a`), and the Canonical Sources the PRD already assembled
|
|
114
|
+
(`prd-writing-phase.md` Step 4 point 3) for `resources:`. The inner ```yaml``` block is
|
|
115
|
+
fenced, NOT real top-of-file frontmatter — it is the queryable payload Claude reads back
|
|
116
|
+
when asked about the feature later.
|
|
117
|
+
|
|
118
|
+
After the write, set `## Obsidian Spec Note / status: back-reference-written` in the state
|
|
119
|
+
file. (The state file is already committed; this is a local marker for a possible resume —
|
|
120
|
+
do NOT re-commit just for this field.)
|
|
@@ -8,8 +8,9 @@ Mark task 3 as `in_progress`.
|
|
|
8
8
|
|
|
9
9
|
1. Create directory `${paths.prd_dir}/<slug>/` if it doesn't exist.
|
|
10
10
|
2. **Obsidian spec note (if present):** if the state file `## Obsidian Spec Note`
|
|
11
|
-
section has `status
|
|
12
|
-
|
|
11
|
+
section has `status` other than `none` (i.e. `detected`, `provisional-written`, or
|
|
12
|
+
`back-reference-written` — a note was given), add a row to the Canonical Sources table
|
|
13
|
+
in the PRD using its `wikilink:` value:
|
|
13
14
|
`| Obsidian spec | [[Note Name]] |`
|
|
14
15
|
This preserves traceability from the user's original spec note to the final PRD, and
|
|
15
16
|
the same note receives the end-of-run back-reference snippet (validation-phase Step 7.6).
|
|
@@ -249,76 +249,32 @@ branch is gone (or its deletion is explicitly user-deferred).
|
|
|
249
249
|
|
|
250
250
|
### Step 7.6 — Obsidian back-reference (NON-BLOCKING — runs only when a spec note was given)
|
|
251
251
|
|
|
252
|
-
**Why this exists.** When the user kicked off the PRD from an Obsidian note (state
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
machine-and-human readable snippet back into the note.
|
|
252
|
+
**Why this exists.** When the user kicked off the PRD from an Obsidian note (state file
|
|
253
|
+
`## Obsidian Spec Note / status` is not `none`, see HARD RULE 19), they want that same note
|
|
254
|
+
to become the durable index of *how the feature was developed and where it landed* — so
|
|
255
|
+
they can later ask "come è stata sviluppata la feature X?" and get the PRD, cards, and
|
|
256
|
+
merge from the note itself.
|
|
258
257
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
**Skip conditions (each logged, never fatal):**
|
|
265
|
-
- `## Obsidian Spec Note / status` is `none` (no note was given) → skip silently.
|
|
266
|
-
- `path:` is `none` or empty (vault root never resolved at Step 1) → skip with a note.
|
|
267
|
-
- The file at `path:` does not exist or is not writable → skip with a one-line warning.
|
|
268
|
-
|
|
269
|
-
**Procedure:**
|
|
270
|
-
|
|
271
|
-
1. Read the current content of the note at `path:`.
|
|
272
|
-
2. Build the snippet, delimited by HTML-comment markers keyed on the slug so the step
|
|
273
|
-
is **idempotent** — a re-run (or a later `/prd-add`) REPLACES the block between the
|
|
274
|
-
markers in place instead of appending a duplicate. If the markers are absent, append
|
|
275
|
-
the block at the end of the note (preceded by one blank line).
|
|
276
|
-
|
|
277
|
-
```markdown
|
|
278
|
-
<!-- BALDART:prd:<slug> START -->
|
|
279
|
-
## 🛠 Sviluppo BALDART — <slug>
|
|
280
|
-
|
|
281
|
-
```yaml
|
|
282
|
-
feature: <slug>
|
|
283
|
-
prd: ${paths.prd_dir}/<slug>/PRD.md
|
|
284
|
-
epic: FEAT-XXXX-00-<slug>-epic
|
|
285
|
-
cards:
|
|
286
|
-
- FEAT-XXXX-01-<sub-slug>
|
|
287
|
-
- FEAT-XXXX-02-<sub-slug>
|
|
288
|
-
resources: # other Canonical Sources from the PRD (mockups, ADRs, ref docs, research)
|
|
289
|
-
- ${paths.prd_dir}/<slug>/design.html # omit if no design
|
|
290
|
-
- <ssot-registry entry / ADR path / research link>
|
|
291
|
-
branch: prd/<slug>
|
|
292
|
-
merge_commit: <SHA from state ## Validation>
|
|
293
|
-
pr: <PR number, or n/a for local-push>
|
|
294
|
-
trunk_branch: <git.trunk_branch>
|
|
295
|
-
date: <ISO-8601 UTC>
|
|
296
|
-
status: planned # planned | in-progress | done
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
- **PRD:** [`${paths.prd_dir}/<slug>/PRD.md`](...)
|
|
300
|
-
- **Cards:** FEAT-XXXX-00 (epic) · FEAT-XXXX-01 · FEAT-XXXX-02 …
|
|
301
|
-
- **Merge:** `<SHA>` su `<git.trunk_branch>`<!-- · PR #N -->
|
|
258
|
+
This is the **FINAL** write of the two-phase back-reference (the provisional write already
|
|
259
|
+
happened at discovery-phase Step 1 point 2, status `provisional-written`). It **upgrades
|
|
260
|
+
the provisional block in place** — same slug-keyed markers — replacing the lightweight
|
|
261
|
+
"PRD in stesura" block with the full, queryable payload.
|
|
302
262
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Fill the `yaml` block from the final state: `<slug>`, the real epic + child card
|
|
308
|
-
IDs created in Step 5, the merge SHA written under `## Validation` (Step 7 item 8),
|
|
309
|
-
the PR number from the `mw-docs` return (or `n/a`), and the Canonical Sources list
|
|
310
|
-
the PRD already assembled (prd-writing-phase.md Step 4 point 3) for `resources:`.
|
|
311
|
-
The inner ```` ```yaml ```` block is fenced, NOT real top-of-file frontmatter — it
|
|
312
|
-
is the queryable payload Claude reads back when asked about the feature later.
|
|
263
|
+
**Runs AFTER the merge (Step 7 item 9) succeeds** — only then are the canonical paths,
|
|
264
|
+
card IDs, branch, PR/SHA final.
|
|
313
265
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
266
|
+
**Procedure:** follow [obsidian-backref.md](obsidian-backref.md) **§ Mode: FINAL** — it is
|
|
267
|
+
the SSOT for the marker contract, the idempotent read-replace-or-append write procedure,
|
|
268
|
+
the full snippet template, the skip conditions (no note / `path: none` / unwritable → log
|
|
269
|
+
and continue, never fatal), and the final state update to
|
|
270
|
+
`## Obsidian Spec Note / status: back-reference-written`. Fill the `yaml` from the final
|
|
271
|
+
state: the real epic + child card IDs (Step 5), the merge SHA under `## Validation` (Step 7
|
|
272
|
+
item 8), the PR number from the `mw-docs` return (or `n/a`), and the Canonical Sources the
|
|
273
|
+
PRD assembled (prd-writing-phase.md Step 4 point 3) for `resources:`.
|
|
318
274
|
|
|
319
275
|
**This step is NON-BLOCKING** — any failure (note moved, vault unmounted, permission
|
|
320
|
-
denied) logs "Obsidian back-reference: SKIPPED (<reason>)" and the run completes. The
|
|
321
|
-
|
|
276
|
+
denied) logs "Obsidian back-reference: SKIPPED (<reason>)" and the run completes. The PRD
|
|
277
|
+
merge has already happened; the back-reference is a convenience index, never a gate.
|
|
322
278
|
|
|
323
279
|
### Final output
|
|
324
280
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const meta = {
|
|
2
2
|
name: 'new2-resolve',
|
|
3
3
|
description:
|
|
4
|
-
"Self-healing resolution pass for the autonomous new2 batch workflow. Called by new2 whenever a deterministic gate would otherwise need a human: a card fail/blocker (ac-unmet | blocker | qa-fail | e2e-blocked | merge-blocker) or a legitimate scope-EXPANDING finding (scope-expansion). Tier-1 targeted fix with a TERMINAL short-circuit (skips the costly multi-attempt when the problem is impossible-by-definition, verified not trusted), then a judged multi-attempt; a MANDATORY adversarial judge cross-checks every verified claim against the real diff (prevents fabricated success). Specialized per domain (doc→doc-reviewer, ui→ui-expert, security→security-reviewer judge, perf→api-perf-cost-auditor judge). Terminal is a tracked follow-up. Accepts a `findings` list (batched per area). Uses agent()/parallel() only — no nested workflows.",
|
|
4
|
+
"Self-healing resolution pass for the autonomous new2 batch workflow. Called by new2 whenever a deterministic gate would otherwise need a human: a card fail/blocker (ac-unmet | blocker | qa-fail | e2e-blocked | merge-blocker) or a legitimate scope-EXPANDING finding (scope-expansion). Tier-1 targeted fix with a TERMINAL short-circuit (skips the costly multi-attempt when the problem is impossible-by-definition, verified not trusted), then a judged multi-attempt; a MANDATORY adversarial judge cross-checks every verified claim against the real diff (prevents fabricated success) for every domain EXCEPT doc — doc-reviewer is a reviewer-writer that owns its domain (applies + self-verifies in one pass), so a second adversarial doc-reviewer would just judge itself: wasteful, so the doc judge is skipped. Specialized per domain (doc→doc-reviewer single pass, ui→ui-expert, security→security-reviewer judge, perf→api-perf-cost-auditor judge). Terminal is a tracked follow-up. Accepts a `findings` list (batched per area). Uses agent()/parallel() only — no nested workflows.",
|
|
5
5
|
phases: [
|
|
6
6
|
{ title: 'Diagnose', detail: 'classify + terminal short-circuit + scope-expansion boundary' },
|
|
7
7
|
{ title: 'Repair', detail: 'targeted fix, then judged multi-attempt if needed' },
|
|
@@ -197,6 +197,11 @@ if (attempt && attempt.terminal) {
|
|
|
197
197
|
let confirmed = false
|
|
198
198
|
if (tr === 'out-of-ownership') {
|
|
199
199
|
confirmed = !filesInScope(attempt.remedyFiles) // genuinely terminal iff remedy files are NOT in MAY-EDIT
|
|
200
|
+
} else if (domain === 'doc') {
|
|
201
|
+
// doc is fixed by doc-reviewer (reviewer-writer that owns its domain). Ratifying its
|
|
202
|
+
// terminal verdict with a SECOND doc-reviewer is doc-reviewer-judges-doc-reviewer —
|
|
203
|
+
// no cross-model diversity, pure waste. Trust the single pass; no adversarial re-run.
|
|
204
|
+
confirmed = true
|
|
200
205
|
} else {
|
|
201
206
|
// owner-gated / not-a-code-defect / baseline-not-reached — ratify with the judge.
|
|
202
207
|
try {
|
|
@@ -260,6 +265,14 @@ return await materialiseFollowup(kind, (attempt && attempt.note) || 'unresolved
|
|
|
260
265
|
// returns the files it independently confirmed changed; we cross-check ⊆ MAY-EDIT.
|
|
261
266
|
async function judgeVerify(verifiedAttempts) {
|
|
262
267
|
if (!verifiedAttempts.length) return { ok: false, best: 0 }
|
|
268
|
+
// doc-reviewer is a reviewer-writer that owns its domain: it applies the fix AND
|
|
269
|
+
// self-verifies in the same pass. A SECOND adversarial doc-reviewer cross-check is
|
|
270
|
+
// doc-reviewer-judges-doc-reviewer — no cross-model diversity, a pure waste of tokens
|
|
271
|
+
// and time. Trust the single pass; accept the first verified attempt without re-spawning.
|
|
272
|
+
if (domain === 'doc') {
|
|
273
|
+
const first = verifiedAttempts.find((v) => v.r && v.r.verified) || verifiedAttempts[0]
|
|
274
|
+
return { ok: true, best: first.i }
|
|
275
|
+
}
|
|
263
276
|
let judge = null
|
|
264
277
|
try {
|
|
265
278
|
judge = await agentSafe(
|