feat(loop): add blueprint-level muster, the human review gate in weave

implements blueprint 011:
- okf-check: error on muster+implemented without a tally: (pin-style parser)
- weave: Muster step halts after the seal; review-base recorded at Frame
- blueprint-format, okf-layout: document muster / review-base / tally
This commit is contained in:
Łukasz Boryń 2026-07-24 10:27:06 +02:00
parent 4e719008a4
commit 3421847c15
4 changed files with 44 additions and 3 deletions

View File

@ -6,6 +6,12 @@ type: Blueprint
status: draft | locked | implemented | superseded-by-NNN status: draft | locked | implemented | superseded-by-NNN
traces-to: ROADMAP.md phase N | ferries/<topic>/D-<n> | user request <date> traces-to: ROADMAP.md phase N | ferries/<topic>/D-<n> | user request <date>
sounded: YYYY-MM-DD sounded: YYYY-MM-DD
muster: true # optional — opt into the human review gate
review-base: <changeid> # set when muster is on: parent of where weave begins
tally: # recorded at the muster halt; required to reach implemented
intent: <what the change was meant to do>
matches: yes | no
note: <optional>
--- ---
# NNN — <imperative title, completes "this change will…"> # NNN — <imperative title, completes "this change will…">
@ -44,6 +50,10 @@ up in the diff.>
[sieve](../../engineering/sieve/SKILL.md)'s Real test by definition. [sieve](../../engineering/sieve/SKILL.md)'s Real test by definition.
- `sounded:` is the date [sound](../sound/SKILL.md) verified what the - `sounded:` is the date [sound](../sound/SKILL.md) verified what the
blueprint rests on; absent until then, and required to lock. blueprint rests on; absent until then, and required to lock.
- `muster: true` (optional) opts into the human review gate: weave halts
after the seal, shows the whole `review-base..@` diff in hunk, and records
a `tally:` block. `okf-check` errors on a `muster` blueprint reaching
`implemented` without one. Absent → weave runs unchanged.
- Locked blueprint's Contract/Verify sections are immutable — supersede, don't - Locked blueprint's Contract/Verify sections are immutable — supersede, don't
edit. Justification may gain references; status may advance. edit. Justification may gain references; status may advance.
- A blueprint grows into `NNN-<slug>/` (blueprint.md + notes) when one file won't - A blueprint grows into `NNN-<slug>/` (blueprint.md + notes) when one file won't

View File

@ -23,7 +23,9 @@ superpowers' subagent-driven-development, jj-native.
## Process ## Process
1. **Frame** — restate the blueprint's Contract section in one sentence; list its 1. **Frame** — restate the blueprint's Contract section in one sentence; list its
Seams touched as the pre-agreed test surfaces. Mismatch with what you Seams touched as the pre-agreed test surfaces. Mismatch with what you
find on disk → stop, surface it (blueprint may need superseding). find on disk → stop, surface it (blueprint may need superseding). If the
blueprint carries `muster: true`, record `review-base:` on it now — `@-`
(jj) or `git rev-parse HEAD` (git), the parent of where Build begins.
2. **Build** — hand to [bdd](../../engineering/bdd/SKILL.md): scenarios 2. **Build** — hand to [bdd](../../engineering/bdd/SKILL.md): scenarios
from the Contract section, tests only at the listed seams, red→green one from the Contract section, tests only at the listed seams, red→green one
scenario at a time. scenario at a time.
@ -39,7 +41,14 @@ superpowers' subagent-driven-development, jj-native.
5. **Seal** — [commit-atomic-jj](../../productivity/commit-atomic-jj/SKILL.md); the 5. **Seal** — [commit-atomic-jj](../../productivity/commit-atomic-jj/SKILL.md); the
message body cites `blueprint NNN`. Fix + regression test in the same message body cites `blueprint NNN`. Fix + regression test in the same
change. change.
6. **Close the loop** — flip blueprint status to `implemented`; update its 6. **Muster (only if `muster: true`)** — halt before closing: pipe the whole
change to hunk — `jj diff --from <review-base> --to @ --git | hunk patch -`
(git: `git diff <review-base>..HEAD | hunk patch -`; no hunk → show the
range raw). Record the `tally:` block on the blueprint
([blueprint-format.md](../blueprint/blueprint-format.md)). `matches: no` →
stay halted for a fix + re-muster; never flip on a known miss. No
`muster:` field → skip entirely.
7. **Close the loop** — flip blueprint status to `implemented`; update its
index.md line; tick the roadmap item via index.md line; tick the roadmap item via
[architect](../architect/SKILL.md) revise mode; wiki-worthy learnings [architect](../architect/SKILL.md) revise mode; wiki-worthy learnings
→ `OKF/LEARNINGS.md` ([write-OKF](../write-OKF/SKILL.md) refresh if → `OKF/LEARNINGS.md` ([write-OKF](../write-OKF/SKILL.md) refresh if

View File

@ -88,7 +88,9 @@ loop, not on disk.
lists the register, not its members. lists the register, not its members.
- **blueprints/** — blueprint output; status lives in frontmatter, so the - **blueprints/** — blueprint output; status lives in frontmatter, so the
"tracker" is `grep -r "^status:" OKF/blueprints/`. index.md lists one "tracker" is `grep -r "^status:" OKF/blueprints/`. index.md lists one
line per blueprint: `NNN — title — status`. line per blueprint: `NNN — title — status`. A blueprint may opt into the
human review gate with `muster: true` (+ `review-base:`, and a `tally:`
block once mustered); `okf-check` requires the tally at `implemented`.
- **ferries/** — **directory means open, file means moored.** An open - **ferries/** — **directory means open, file means moored.** An open
ferry is `<topic>/` with MAP.md as its per-ferry index; index.md lists ferry is `<topic>/` with MAP.md as its per-ferry index; index.md lists
`<topic> — n/m resolved → MAP.md` and never its decisions (single `<topic> — n/m resolved → MAP.md` and never its decisions (single

View File

@ -135,6 +135,17 @@ def pin(text):
return dict(re.findall(r"([a-z]+):\s*(\S+)", block.group(1))) if block else {} return dict(re.findall(r"([a-z]+):\s*(\S+)", block.group(1))) if block else {}
def tally(text):
"""Fields of `tally:`, muster's verdict block — parsed like `pin`.
The generic frontmatter parser flattens a nested block to an empty
list, so a dedicated grab is the only way to see it.
"""
head = text.partition("\n---")[0] if text.startswith("---\n") else ""
block = re.search(r"^tally:\n((?:[ \t]+.*\n?)+)", head, re.M)
return dict(re.findall(r"([a-z]+):\s*(\S+)", block.group(1))) if block else {}
def check_ferries(okf, errors): def check_ferries(okf, errors):
"""A page directly under ferries/ is a moored ferry: pinned, collapsed.""" """A page directly under ferries/ is a moored ferry: pinned, collapsed."""
ferries = okf / "ferries" ferries = okf / "ferries"
@ -220,6 +231,15 @@ def main(argv):
and not fields.get("sounded")): and not fields.get("sounded")):
warnings.append(f"{rel}: locked without sounded:") warnings.append(f"{rel}: locked without sounded:")
# muster is opt-in: a blueprint carrying `muster: true` may not
# reach `implemented` without its `tally:` — the human verdict the
# gate exists to force. Blueprints without the field are untouched.
if ("blueprints" in rel.parts
and str(fields.get("muster", "")).lower() == "true"
and fields.get("status") == "implemented"
and not tally(text)):
errors.append(f"{rel}: muster: true, implemented without tally:")
# The warrant contract covers durable synthesis pages; blueprints # The warrant contract covers durable synthesis pages; blueprints
# and ferries carry their own frontmatter contracts. # and ferries carry their own frontmatter contracts.
if {"blueprints", "ferries"} & set(rel.parts) or page.name == "index.md": if {"blueprints", "ferries"} & set(rel.parts) or page.name == "index.md":