Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m

## Unreleased

- fix(progress-report, build-plan-status): **HARNESS rows are no longer counted as built rows, and a module's `verify-module.sh` row shows once, as that module's sign-off status on its phase card, instead of as a row.** A HARNESS step is a module's sign-off, not a build, so it is out of every "x of y built" count: the phase cards, the plan rollup and the Stage 5 card in `progress-report.html`, and the lede of `build-plan-status.sh --html` ("N build rows", plus a "Not counted: N HARNESS rows" note). The verify row's evidence is read exactly as #501 reads it (`harness_verify`'s rule, now `verify_evidence` + `module_status` in `progress-report.py`; nothing new measured, no extra script run, no mxcli or mxbuild call) and shown as one line per module: `Verified ✓ <date> (LOOK n/n)`, `Verify owed - LOOK + CONFIRM`, `Verify stale (N builds since)` (or `(a script was marked done- after it)`), `Verify not run`, `built? no verify summary`, `Verify not clean <date> (<why>)` for a summary with a FAULT, FINDING or SKIPPED row, or `Verify clean <date>, LOOK n/n - held: State says <State>` when State is blocked or pending a person (held is not signed off, as #501 never promoted it); a State cell that disagrees is flagged under it, the rollup says how many modules are verified, and the Stage 5 card, KPI and owed text add ", k of n modules signed off". The Phase state badge is read from the build rows only (a phase of HARNESS rows alone says "sign-off only" and its card "Sign-off phase: no build rows"). A module with no verify row shows no status. Other HARNESS rows (a coherence pass, a harness run) stay in the row list, marked "(not counted)". `build-plan.md`, `build-plan.json` and the text output are unchanged, so agents still see every HARNESS step. **Behaviour change to check in your project:** the progress report's built counts drop the HARNESS rows (a plan of 10 rows with 2 HARNESS reads "x of 8"), and the verify rows leave the row tables. Fixture: `test-progress-harness-verify.sh` (H1-H10, N1-N6, both layouts). — MendixMau (decision 2026-10-21)
- fix(exec): **a script restated from a stale DESCRIBE now WARNs instead of silently reverting an earlier exec** (#261). A script drafted from a DESCRIBE taken before an earlier script of the batch ran put four old messages back, with check, mxbuild and lint green. New `project-bin/describe-baseline.sh stamp` writes `-- baseline: <Doc> sha256=<hash>` (plus `-- baseline-mxcli: <version>`) from a DESCRIBE at draft time; `exec.sh` runs `verify` only for a script that carries the header, so other scripts cost one grep and no mxcli call. It reports DRIFT with the first lines of the diff, STALEHEADER, and RESTAMP after an mxcli upgrade (DESCRIBE text may change, so that is not called drift). A re-run by the script's own last recorded write (the #269 ledger) and a fresh model are not drift. Nothing is refused and the exit codes do not change. Preflight STOP 21 gains one clause (`-- supersedes:`, `stamp`, exec.sh only warns) and its trigger names `create or modify` (+24 words). Not-found DESCRIBE and `--version` output are captured from mxcli v0.26.0. Lands after the #269 PR; with it, supersedes draft #311. **Behaviour change to check in your project:** `exec.sh` output can carry `WARN: stale draft: …` lines, and the BUILD-LOG detail cell `WARN stale baseline: <docs>`; `MXTK_RESTATE_GUARD=off` skips the check. — AlvinnYeo (#261)
- fix(exec): **re-running an older `mdlsource/` script over a newer owner's live work now WARNs instead of passing silently** (#269). Three field apps had 99/579, 130/357 and 38/159 documents created by more than one script, and a replay of an older one reverted the newer with exit 0 and every gate green. New `project-bin/script-owners.sh` maps each microflow, nanoflow, page and snippet to the scripts that create or restate it, in run order (digit runs compared as numbers, so `2-core/` runs before `11-fixes/`; `done-` ignored), and reads `-- supersedes:` / `-- superseded-by:` headers. `exec.sh` records every kept write in a machine-local last-writer ledger (`.claude/loop/script-owners/`, self-gitignored, compacted per write); `restore-mpr.sh` marks it on a manual restore. A replay WARNs only when the newer owner's write is live: ledger first, else one DESCRIBE per document, at most 5 per exec (the rest print `CONFLICT (not checked)`). A new owner without a supersedes header gets one `NOTE:` line on its first run, kept out of BUILD-LOG. Nothing is refused and the exit codes do not change. With no co-owner, `exec.sh` runs one grep over `mdlsource/` and no mxcli call. `gate-check.sh` prints the co-owned count when it is above 0. Part of the rebuilt draft #311 (with the #261 PR). **Behaviour change to check in your project:** `exec.sh` output can carry `WARN: restatement: …` and `NOTE: new owner of …` lines; the BUILD-LOG detail cell can carry `WARN reverts: <docs>`. Set `MXTK_RESTATE_GUARD=off` to skip the check. — MendixMau (#269)
- fix(exec): **re-running an older `mdlsource/` script over a newer owner's live work now WARNs instead of passing silently** (#269). Three field apps had 99/579, 130/357 and 38/159 documents created by more than one script, and a replay of an older one reverted the newer with exit 0 and every gate green. New `project-bin/script-owners.sh` maps each microflow, nanoflow, page and snippet to the scripts that create or restate it, in run order (digit runs compared as numbers, so `2-core/` runs before `11-fixes/`; `done-` ignored), and reads `-- supersedes:` / `-- superseded-by:` headers. `exec.sh` records every kept write in a machine-local last-writer ledger (`.claude/loop/script-owners/`, self-gitignored, compacted per write); `restore-mpr.sh` marks it on a manual restore. A script counts as run when it has a ledger row, a `done-` name, or an applied `docs/BUILD-LOG.md` row, so a fresh clone or cloud session (empty ledger) still warns on a replay over committed newer work; a script nobody ran yet (draft-ahead) stays quiet. The ledger cannot see Studio Pro edits or a `git pull`/`checkout` of the `.mpr`. A replay WARNs only when the newer owner's write is live: ledger first, else one DESCRIBE per document, at most 5 per exec (the rest print `CONFLICT (not checked)`). A new owner without a supersedes header gets one `NOTE:` line on its first run, kept out of BUILD-LOG. Nothing is refused and the exit codes do not change. With no co-owner, `exec.sh` runs one grep over `mdlsource/` and no mxcli call. `gate-check.sh` prints the co-owned count when it is above 0. Part of the rebuilt draft #311 (with the #261 PR). **Behaviour change to check in your project:** `exec.sh` output can carry `WARN: restatement: …` and `NOTE: new owner of …` lines; the BUILD-LOG detail cell can carry `WARN reverts: <docs>`. Set `MXTK_RESTATE_GUARD=off` to skip the check. — MendixMau (#269)
Expand Down
56 changes: 33 additions & 23 deletions project-bin/build-plan-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,17 @@ render_plan_section() { # stdout: the plan section's HTML
import fnmatch, html, json, os, re, sys

src, mdl, detail_out, proj, gen = sys.argv[1:6]
# A HARNESS row that runs verify-module.sh <Module> is read from that module's verify summary as
# well as from State; the rule lives in progress-report.py (harness_verify), so the page's
# counts and these rows cannot disagree. Without it, State alone decides, as before.
harness_verify = lambda *a, **k: None
_logs = []
# HARNESS rows are not build rows (MendixMau decision 2026-10-21): they are out of the tally, and a
# HARNESS row that runs verify-module.sh <Module> is not listed here at all, because
# progress-report.py shows it once as that module's sign-off status on the phase card
# (verify_evidence / module_status there). build-plan.json and build-plan.md keep every row.
VERIFY_STEP = re.compile(r"verify-module\.sh`?\s+[`\"']?([A-Za-z_]\w*)") # same as progress-report.py's
try:
import importlib.util
sys.dont_write_bytecode = True # no bin/__pycache__/ left in the project
_spec = importlib.util.spec_from_file_location("progress_report", gen)
_m = importlib.util.module_from_spec(_spec); _spec.loader.exec_module(_m)
harness_verify = _m.harness_verify
_logs = _m.build_log_rows(proj)
VERIFY_STEP = _m.VERIFY_STEP
except (Exception, SystemExit): # a broken or old generator: the generator's own run reports it
pass
d = json.load(open(src, encoding="utf-8"))
Expand Down Expand Up @@ -591,24 +590,36 @@ def classify(state): # the parser's rollup reading, per row (keep in step with

CLS = {"built": "st-built", "not built": "st-todo", "pending a person": "st-person",
"partial": "st-progress", "blocked": "st-todo", "skipped": "st-todo",
"in progress": "st-progress", "unknown": "st-unknown", None: "st-unknown"}
"in progress": "st-progress", "unknown": "st-unknown", "sign-off only": "st-person", None: "st-unknown"}

phases = d.get("phases", [])
all_steps = [s for p in phases for s in p["steps"]]
tally = {"built": 0, "not built": 0, "pending a person": 0, "partial": 0, "blocked": 0, "skipped": 0, None: 0}
by_n = {str(s["number"]): s for s in all_steps}
for s in all_steps:
try: hv = harness_verify(proj, s, by_n, _logs)
except Exception: hv = None # an older progress-report.py beside this script: State decides
# (class for the tally, State cell text, drift flag); only "built" overrides the State reading
s["_ev"] = (("built" if hv[0] == "built" else classify(s["state"])),) + tuple(hv[1:]) if hv else None
tally[s["_ev"][0] if s["_ev"] else classify(s["state"])] += 1
ev_rows = sum(1 for s in all_steps if s["_ev"] and s["_ev"][2])
is_harness = lambda s: (s.get("kind") or "").strip().upper() == "HARNESS"
is_signoff = lambda s: is_harness(s) and bool(VERIFY_STEP.search(s.get("step") or ""))
build_steps = [s for s in all_steps if not is_harness(s)]
n_signoff = sum(1 for s in all_steps if is_signoff(s)); n_harness = len(all_steps) - len(build_steps)
signoff_mods = {VERIFY_STEP.search(s["step"] or "").group(1) for s in all_steps if is_signoff(s)} # modules, as the card's "k of n modules"

def disp_rollup(steps): # the badge: parse_plan's rollup over the build rows only (build-plan.json keeps its own)
rows = [s for s in steps if not is_harness(s)]
if not rows: return "sign-off only" if steps else "unknown"
kinds = [classify(s["state"]) for s in rows]
if None in kinds: return "unknown"
kinds = [k for k in kinds if k != "skipped"]
if not kinds: return "unknown"
if all(k == "built" for k in kinds): return "built"
if all(k in ("not built", "blocked") for k in kinds): return "not built"
if all(k in ("built", "pending a person") for k in kinds): return "pending a person"
return "in progress"
for s in build_steps:
tally[classify(s["state"])] += 1
named_total = named_done = drift_rows = 0
rows_html = []
for p in phases:
out = []
for s in p["steps"]:
if is_signoff(s): continue # shown once, as the module's sign-off status on the phase card
names = named_scripts(s["step"], s["produces"])
k = classify(s["state"])
disk = ""
Expand All @@ -633,25 +644,24 @@ for p in phases:
drift_rows += 1
disk += '<div class=drift>&#9888; %s</div>' % e(drift)
st = e(s["state"])
if s["_ev"]:
k = s["_ev"][0]
st = e(s["_ev"][1]) + ('<div class=drift>&#9888; %s</div>' % e(s["_ev"][2]) if s["_ev"][2] else "")
kind = e(s["kind"]) + (' <span class=mut>(not counted)</span>' if is_harness(s) else "")
out.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class="%s">%s</td><td>%s</td></tr>' % (
e(s["number"]), e(s["kind"]), ec(s["step"]), ec(s["produces"]),
e(s["number"]), kind, ec(s["step"]), ec(s["produces"]),
e(", ".join(s["dependsOn"])), CLS[k], st, disk))
rows_html.append(out)

plural = lambda n, w: "%d %s%s" % (n, w, "" if n == 1 else "s")
print("<h2>The plan</h2>")
print("<p class=lede>From <code>architecture/build-plan.md</code>: %s, %s: "
"<b class=st-built>%d built</b>, <b class=st-progress>%d partial</b>, <b class=st-todo>%d not built</b>%s, <b class=st-person>%d pending a person</b>%s%s.</p>" % (
plural(len(phases), "phase"), plural(len(all_steps), "row"),
plural(len(phases), "phase"), plural(len(build_steps), "build row"),
tally["built"], tally["partial"], tally["not built"] + tally["blocked"],
(" (%d of them blocked)" % tally["blocked"]) if tally["blocked"] else "",
tally["pending a person"],
(", %d not needed" % tally["skipped"]) if tally["skipped"] else "",
(", <b class=st-unknown>%d with a State cell this page cannot read</b>" % tally[None]) if tally[None] else "")
+ ("<p class=note><span class=drift>&#9888; %s where State and the verify evidence (summary, LOOK report) disagree, or the evidence is incomplete (shown in State).</span></p>" % plural(ev_rows, "HARNESS row") if ev_rows else ""))
+ ("<p class=note>Not counted: %s (%s). A module's sign-off shows as its verify status on the phase card, not as a row.</p>" % (
plural(n_harness, "HARNESS row"), ", ".join(x for x in ((("sign-offs of " + plural(len(signoff_mods), "module")) if n_signoff else ""), (plural(n_harness - n_signoff, "harness pass") if n_harness - n_signoff else "")) if x)) if n_harness else ""))
if named_total:
print("<p class=note>Scripts named in the plan: %d, of which %d are renamed <code>done-</code> under <code>mdlsource/</code>.%s</p>" % (
named_total, named_done,
Expand All @@ -661,7 +671,7 @@ if named_total:
det = []
for p, out in zip(phases, rows_html):
h = ['<!--phase:%s-->' % e(p["id"]),
'<p class=note>Phase state: <span class="badge %s">%s</span></p>' % (CLS.get(p["state"], "st-unknown"), e(p["state"]))]
'<p class=note>Phase state: <span class="badge %s">%s</span></p>' % (CLS.get(disp_rollup(p["steps"]), "st-unknown"), e(disp_rollup(p["steps"])))]
if p.get("note"):
h.append("<p class=note>%s</p>" % e(p["note"]))
if p["steps"]:
Expand Down
Loading
Loading