Repository navigation
fix(gate-check,status): mark a stale Current stage readout and list unlogged exec scripts (#767) - #777
fix(gate-check,status): mark a stale Current stage readout and list unlogged exec scripts (#767)#777MendixMau wants to merge 1 commit into
Conversation
…ge (#767) Warn-only, computed at read time, nothing per exec row (exec.sh untouched). - gate-check (every run) and status.sh (WATCH) print "Current stage line is from <date>; N exec rows since — re-run bin/gate-check.sh" when exec rows in docs/BUILD-LOG.md post-date the readout's stamp. - gate-check's rewrite stamps "· last exec <date>" inside the parenthesis, and rewrites when that date moved; the **Stage N prefix parsed by status.sh, token-burn.sh and obligation-check.sh is unchanged. - Under the "Change log:" line, a WARN lists exec scripts since Stage 5 started (first row the build plan names) with no cr: tag and no build-plan row. Verdict and exit code unchanged. New bin/lib/build-log-read.sh; fixtures test-stage-header.sh T13 and test-change-log.sh T10, built on the captured verify-446 BUILD-LOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review: MERGE. Both #767 warn-only options work, and no parsed output or verdict changes. One side effect, which is intended: gate-check now rewrites the Value: Fixes the issue as reported, with one shared library and no change to exec.sh.
Regression risk: No verdict or exit-code change.
Correctness: No bugs found.
Context cost: 66196 → 66196 always-loaded words (measured). No routed file is touched. Time cost: per gate-check or status read, one or two awk passes over BUILD-LOG, tens of ms on 300 rows. Nothing per exec row. Conflicts: none with origin/master. It conflicts with #776 in Generated by Claude Code |
Fixes #767
Direct lane
What changed and why (one paragraph): This implements triage options 1 and 3. Both only warn, and both are computed when someone reads the position, never per exec row.
project-bin/exec.shis not touched.Option 1 (staleness marker). When
docs/BUILD-LOG.mdhas exec rows dated after the## Current stagereadout, gate-check printsCurrent stage line is from <date>; N exec rows since — re-run bin/gate-check.sh. It does this on every run, after any rewrite.bin/status.shprints the same line under WATCH.· last exec <date>inside the parenthesis:(derived by gate-check on D · last exec D2; re-run it …).last execdate, which the log itself wrote, so UTC and local dates cannot disagree. Lines written before this change fall back to thederiveddate.Option 3 (change-log nudge). Under the
Change log:line, a separateWARN — N exec script(s) since Stage 5 started with no cr: tag and no build-plan row …lists those scripts, deduplicated, at most 10.architecture/build-plan.mdnames. The stage readout is the thing this issue found stale, so the nudge does not read it.060-…-customer_overview.mdlform thatbrd-to-build-plan.mduses.PASSon 0 rows) and the exit code are unchanged.Both readers live in one sourced library, the new
bin/lib/build-log-read.sh.Impact
test-change-log.shT10). Not done: having Stage 6 /--closeoutrefuse on a stale readout (the triage's open question; the maintainer approved warn-only).bin/gate-check.sh(readout block, Change log block) andbin/status.sh. Newbin/lib/build-log-read.sh. It readsdocs/BUILD-LOG.md, whichproject-bin/exec.shlog_build()writes on every exec, andarchitecture/build-plan.md(Stage 4, found withresolve_artifact, so both layouts). The BUILD-LOG path is the same hard-coded$PROJECT_DIR/docs/BUILD-LOG.mdthat gate-check and status.sh already use. The new stamp sits inside the parenthesis. The other parsers of^\*\*Stagewere checked:status.sh:56,token-burn.sh:353,obligation-check.sh:182. Fixture assertions cover status.sh WHERE and_ob_current_stage, andtest-token-burn.shpasses (63/63). Plain POSIX awk, checked under mawk (byte-oriented); the…match useslength("…"), which also holds in UTF-8 awks. Sharesbin/status.shwith #765's PR, so the two need a composition check.gate-check --no-htmlon a scaffolded fixture with a 300-row BUILD-LOG, alternating master and branch: master 1216 / 1247 / 1408 ms, branch 1218 / 1278 / 1386 ms (within noise). The three helpers alone took about 20 ms per run on the same 300 rows (10 runs: 198 ms).Time cost: per gate-check / status run · ~0.02 s on a Linux container (300-row log) · can force rework: n · offset: maintainer OK (nothing per exec row; exec.sh unchanged)
Field evidence: a field report from a greenfield build in auto mode, 2026-11-13, relayed by the maintainer and anonymised.
This PR has not been run against that project. The fixtures reproduce both symptoms on input built from the captured exec.sh BUILD-LOG in
tests/wave2/fixtures/verify-446/BUILD-LOG.captured.md. The stage-header fixture uses that file verbatim. The change-log fixture keeps the captured row shape and substitutes only timestamp, script name and thecr:tag.Fixture results, master vs branch (the same new fixture files run against each tree):
tests/wave2/test-stage-header.sh bin/gate-check.shtests/wave2/test-change-log.sh bin/gate-check.sh· last execstamp.Existing fixtures that cover the changed lines, all on the branch:
test-bug03-gates.shtest-status-bare-var.shtest-status-existing-app.shtest-status-lint-unversioned.shtest-status-session-cwd.shtest-obligation-final-look.shtest-token-burn.shChecks, all clean:
bin/check-scripts.sh, the leak guard against origin/master, andbin/check-portability.sh.resolve_artifact, and the BUILD-LOG path is the same one gate-check and status already use.CHANGELOG.mdline appended, crediting the field reportReview: pending independent review
Generated by Claude Code