From 3421847c1544b4b301483570336091a35c9010dd Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Fri, 24 Jul 2026 10:27:06 +0200 Subject: [PATCH] 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 --- skills/loop/blueprint/blueprint-format.md | 10 ++++++++++ skills/loop/weave/SKILL.md | 13 +++++++++++-- skills/loop/write-OKF/okf-layout.md | 4 +++- skills/loop/write-OKF/scripts/okf-check | 20 ++++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/skills/loop/blueprint/blueprint-format.md b/skills/loop/blueprint/blueprint-format.md index 4e0d419..e7986cd 100644 --- a/skills/loop/blueprint/blueprint-format.md +++ b/skills/loop/blueprint/blueprint-format.md @@ -6,6 +6,12 @@ type: Blueprint status: draft | locked | implemented | superseded-by-NNN traces-to: ROADMAP.md phase N | ferries//D- | user request sounded: YYYY-MM-DD +muster: true # optional — opt into the human review gate +review-base: # set when muster is on: parent of where weave begins +tally: # recorded at the muster halt; required to reach implemented + intent: + matches: yes | no + note: --- # NNN — @@ -44,6 +50,10 @@ up in the diff.> [sieve](../../engineering/sieve/SKILL.md)'s Real test by definition. - `sounded:` is the date [sound](../sound/SKILL.md) verified what the 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 edit. Justification may gain references; status may advance. - A blueprint grows into `NNN-/` (blueprint.md + notes) when one file won't diff --git a/skills/loop/weave/SKILL.md b/skills/loop/weave/SKILL.md index 636de0d..905ac53 100644 --- a/skills/loop/weave/SKILL.md +++ b/skills/loop/weave/SKILL.md @@ -23,7 +23,9 @@ superpowers' subagent-driven-development, jj-native. ## Process 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 - 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 from the Contract section, tests only at the listed seams, red→green one 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 message body cites `blueprint NNN`. Fix + regression test in the same 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 --to @ --git | hunk patch -` + (git: `git diff ..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 [architect](../architect/SKILL.md) revise mode; wiki-worthy learnings → `OKF/LEARNINGS.md` ([write-OKF](../write-OKF/SKILL.md) refresh if diff --git a/skills/loop/write-OKF/okf-layout.md b/skills/loop/write-OKF/okf-layout.md index 5c2ddc5..487ecb6 100644 --- a/skills/loop/write-OKF/okf-layout.md +++ b/skills/loop/write-OKF/okf-layout.md @@ -88,7 +88,9 @@ loop, not on disk. lists the register, not its members. - **blueprints/** — blueprint output; status lives in frontmatter, so the "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 ferry is `/` with MAP.md as its per-ferry index; index.md lists ` — n/m resolved → MAP.md` and never its decisions (single diff --git a/skills/loop/write-OKF/scripts/okf-check b/skills/loop/write-OKF/scripts/okf-check index c72398f..8676254 100755 --- a/skills/loop/write-OKF/scripts/okf-check +++ b/skills/loop/write-OKF/scripts/okf-check @@ -135,6 +135,17 @@ def pin(text): 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): """A page directly under ferries/ is a moored ferry: pinned, collapsed.""" ferries = okf / "ferries" @@ -220,6 +231,15 @@ def main(argv): and not fields.get("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 # and ferries carry their own frontmatter contracts. if {"blueprints", "ferries"} & set(rel.parts) or page.name == "index.md":