Skip to content

Small fixes: arg parsing (#309), demo-video rules (#237), port holder before run --local (#262), detection gaps (#299), test strength (#172) - #313

Merged
MendixMau merged 6 commits into
masterfrom
fix/small-batch-2026-10-13
Oct 13, 2026
Merged

MendixMau merged 6 commits into
masterfrom
fix/small-batch-2026-10-13

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Five independent fixes, one commit each, plus one commit that keeps the baseline skills inside their word budget. Each commit carries its own CHANGELOG line.

Direct lane

1. build-plan-status.sh flag order and restore-mpr.sh bare timestamp (AlvinnYeo's inbox PR #309): Refs #309

Two bugs from #309. #309 itself is not merged or modified here.

  • Problem (a): the script read $1 as the path. When $1 was a flag it fell back to the git top level and then ran shift anyway. So build-plan-status.sh --json <root> dropped --json and rejected the real path with "unknown arg" (exit 2). The quiet variant: --json on its own, run inside a project, wrote no JSON and printed no error.
  • Fix (a): one loop now parses the flags and the path in any order. An unknown --flag still exits 2, and so does a second path.
  • Problem (b): the usage line says [timestamp], but the script used the argument as given after cd "$MODEL_DIR". A bare timestamp therefore failed with "snapshot … is missing App.mpr". On a two-tree checkout a caller-relative path failed the same way. This confirms the hypothesis in inbox: eight field notes from an existing-app legacy-widget rebuild (exec.sh crash gap, restore-mpr usage, #228/#244 confirmations, durable-rebuild kit, learned widget entries) #309.
  • Fix (b): the argument is resolved before the cd. It is tried first as a directory as given, then as a folder name under .mpr-snapshots/. If neither matches, the script exits 1, names the argument and lists the three newest snapshots. The usage line now reads [timestamp | snapshot path]. Two ls | head substitutions also got || true, because under set -e + pipefail they could exit silently when no snapshot existed.
  • Fixtures:
    • tests/wave2/test-build-plan-status-args.sh: 6 cases, 4 fail on master.
    • tests/wave2/test-restore-mpr-arg.sh: 10 cases across both layouts, with snapshots made by the real snapshot-mpr.sh. 5 fail on master.

2. record-demo-video.md rules from patch 0005: Closes #237

  • What changed: patch 0005 applied. Hunks 1–4 applied cleanly. Hunk 5 (four failure-mode rows) was re-placed by hand, because learn: four retro findings from a 2026-10-12 UX-fix run (#277 #279 #281 #283) #303 added two rows to the same table; the new rows go before the egress row.
  • The rules: spawnSync(...).stderr for ffmpeg's freezedetect report; the step counter shows the step number with no guessed total; skipped beats are counted and give a non-zero exit; grid rows are found by the key the grid displays; the base URL is checked before launch; recording and post-processing are separate steps.

3. Name the process holding the port before run --local: Closes #262

  • Problem: Studio Pro's runtime held the app and admin ports. mxcli run --local then reported "Authentication failed", and the next journey ran against Studio Pro's runtime.
  • project-bin/app-restart.sh, before stopping anything:
    • It checks the app port and the admin port (the record's adminPort, else app port + 10).
    • If the holder is outside the recorded process tree (found by walking parent pids), the script exits 4: "instrument blocked — port :N is held by pid N (parent: …)". It touches nothing.
    • It skips this pre-check when the holder can't be named, or on Windows (Git Bash shows no parent pids).
  • project-bin/app-restart.sh, after the stop: the same check runs again. This one is exact, since whatever still holds a port at that point is not ours. The old "still answers → exit 1" path is replaced by this check (exit 4).
  • project-bin/test-stack-up.sh: the same check runs wherever the script would tell you to start run --local: --no-docker, no reachable Docker daemon, and --check when a leftover run-local record exists.
    • Ports checked, in order of preference: the record's ports, then RUN_LOCAL_APP_PORT/RUN_LOCAL_ADMIN_PORT from stack.conf, then mxcli's defaults 8080/8090. The defaults come from upstream cmd_run.go flag help.
    • Exit 4 is new for this script and documented in its header.
  • Holder lookup: lsof, then ss, then netstat -ano + tasklist on Windows. Last resort is a /dev/tcp connect, which gives "an unidentified process".
  • Fixtures:
    • test-app-restart.sh: 2 new cases (14 assertions). The stand-in record's adminPort is now port + 10. 11 assertions fail on master.
    • test-stack-up-local.sh: new T7. 4 of 6 fail on master.
  • Duplicated helper: port_holder/holder_text are copied into both scripts, because _common.sh was outside this PR's file scope. Moving them there is a follow-up.

4. Two UI detection gaps: Closes #299

  • learned-detection-gaps.md: two rows appended at the end of the table:
    • a lazy-loaded combo box filter hides its preset;
    • a theme that pins height on positional row classes lets the next row cover an inserted widget.
  • module-review.md §4c: two LOOK lines with denominators.

5. Three testing rules with denominators: Closes #172

  • testing-shape.md §7: three report lines:
    • N of N restricted pairs probed server-side
    • undeclared 4xx/5xx: 0 of M requests — each fails its step
    • one clean-DB run <id>: N of N scenarios incl. timers, not stitched
  • test-result-audit.md: new check 2e, with the reasons and the field evidence.
  • Inbox: contrib/inbox/2026-09-29-acceptance-test-strength.md is trimmed, not deleted. Its "Keep" items (timer compression, committed results trend, fresh data per variant) are not promoted anywhere yet.

Baseline budget (commit 6)

Field evidence

Checks run

  • Scoped fixtures (each new fixture was also run against master's script to confirm it fails there):
    • test-build-plan-status-args.sh 6/6
    • test-build-plan-json.sh 66/66
    • test-restore-mpr-arg.sh 10/10
    • test-wrong-verdicts.sh bin/gate-check.sh 20/20
    • test-bug07-08.sh project-bin/exec.sh 43/43
    • test-exec-lock-watch.sh 45/45
    • test-app-restart.sh 44/44
    • test-stack-up-local.sh 23/23
  • Repo checks:
    • bin/check-scripts.sh: clean
    • bin/check-portability.sh: clean
    • bin/check-no-private-citations.sh: clean
    • bin/check-pr-discipline.sh origin/master: clean
    • Leak guard (LEAKGUARD_ALLOW_NO_DENYLIST=1): clean
    • bin/render-routing.sh --check: rc 0
  • Full suites: not run locally (T3 is CI's).

Template checklist

  • No client data anywhere in the diff
  • Size cap: 10 non-fixture files, ~318 lines changed excluding fixtures and CHANGELOG
  • Test tier: T0 + T1 for every change. T2 is owed for [bug] A foreign runtime on the app's port makes the journey harness fail with "Authentication failed" #262 (see above).
  • Golden input: the existing captured run-local handshake is reused. Both layouts are covered for restore-mpr. Windows is handled in code (netstat/tasklist) but not executed.
  • CHANGELOG.md lines appended with credit (AlvinnYeo, MendixMau, jopterhorst)

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…in restore-mpr.sh

build-plan-status.sh: parse flags and the project path in one loop, so a
leading flag is no longer shifted away and the path no longer reported as
"unknown arg"; a second path is an error. restore-mpr.sh: resolve the
argument before cd into the model dir — a directory as given, else a
folder of that name under .mpr-snapshots/, else exit 1 naming it and
listing the newest snapshots.

Field report by AlvinnYeo in the inbox PR. Refs #309

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
Applies the patch from #237 (0005), rebased over #303: spawnSync for
ffmpeg's stderr report, step number without a guessed total, skipped
beats counted and set a non-zero exit, rows found by the displayed key,
base URL checked before launch, record and post as separate steps, and
four failure-mode rows placed before the egress row.

Closes #237

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
…, exit 4

Before stopping anything, app-restart.sh checks the app and admin port;
a holder outside the recorded process tree exits 4 "instrument blocked"
with its name, pid and parent, and is never touched. After the stop the
same check is exact. test-stack-up.sh runs the check wherever it would
advise starting run --local. Holder lookup: lsof, ss, netstat+tasklist.

Closes #262

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
…eights

Two register rows (first oracle: the running app, before touching the
filter / at each width) and two LOOK checklist lines with denominators.

Closes #299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
…xx fails, clean final run

Three false-green rows in testing-shape.md §4 with report lines in §7,
each carrying a denominator, and check 2e in test-result-audit.md that
asks for them. The inbox note behind it keeps only its unpromoted items.

Closes #172

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
…e budget

The first cut put 491 words into two baseline skills; the baseline tier
went to 80,466 against its 80,000 ratchet. The reasons for the three
testing rules now live in test-result-audit.md 2e (on demand), the LOOK
lines are one line each, and two redundant sentences in testing-shape.md
§4's verdict paragraphs are folded. Baseline: 79,997.

Refs #172 #299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau marked this pull request as ready for review October 13, 2026 14:27
@MendixMau
MendixMau merged commit b9cf37c into master Oct 13, 2026
1 check passed
MendixMau pushed a commit that referenced this pull request Oct 13, 2026
Measured with LC_ALL=C on the branch after master (#313) was merged in:
79,997 -> 76,259 (-3,738); the old line used pre-#313 figures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 13, 2026
…it 4

1. graph-sweep.sh / app-facts.sh: the first cut required a 'call' edge and
   refused a model with no microflow-to-microflow calls (reached only from
   pages/buttons), which master swept. Now FAULT only on an empty or
   kind-less refs table, report per-kind counts, and graph-sweep warns when
   none of its orphan-read kinds is present. The per-kind query is fixed
   (aggregate in GROUP BY). Fixture renamed test-catalog-edge-guard.sh,
   adds the action-only and kind-less cases (16 checks).
2. review-module.sh reads every report of the run: --reuse-conformance
   <report-date.tsv> also reads its report-<date>-<BRD>.tsv siblings, and
   its own run slices every report newer than the run start, so a per-BRD
   module no longer FAULTs verify-module's rung 13 or drops BRDs.
   verify-module.sh documents the contract. test-review-conformance-per-brd.sh.
3. conformance-check.sh: per-BRD reports via while-read, so a BRD id with
   a space stays one BRD (fixture case 9).
4. CHANGELOG: missing LEDGER_FILE now FAULTs; per-BRD baseline rows are
   re-keyed <BRD>:<pointer>, so run once after upgrade and re-check.
5. #313 follow-up: verify-module.sh grades test-stack-up exit 4 (port held
   by another process) as FAULT on the stack rung only, not FINDING.
   test-verify-stack-blocked.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 13, 2026
Merge: origin/master (b9cf37c, #313). learned-detection-gaps.md
conflict resolved by keeping master's two new rows plus this branch's
row.

Review fixes (independent review of #314):
1. Never cache an unsettled result. ps_write_receipt records only clean /
   needs / failed / unsupported, and unsupported only when `mxcli fix
   --help` itself ran. A failed probe is an error now, not "unsupported".
   --if-stale short-circuits only on a recorded clean or unsupported, so
   a one-off error (locked model, not found, no version) re-checks on the
   next sync instead of repeating until mxcli changes.
2. The dry-run is bounded: MXTK_PROPSETS_TIMEOUT (default 300s), through
   a working `timeout`, else a polling watchdog. A timeout is NOT RUN
   (exit 2) and not recorded.
3. Appending the receipt to the project's .gitignore is announced.
4. In sync, an mxcli < v0.26 (exit 3) shows as an info line, not WARN.
5. Baseline budget: the learned-detection-gaps.md row is now trigger +
   rule + one failure line, and the intro is tightened. The mechanics live
   in platform-link.md (on-demand). render-routing --check went from
   80178 words (over budget) to 79999. Master alone measures 79997.

tests/wave2/test-property-sets.sh: 58 passed (23/58 pass on master's
scripts). New cases: errors not recorded, --if-stale re-checks after an
error and on needs, a failed help probe, short-circuit on unsupported,
timeouts via both the timeout binary and the watchdog, the .gitignore
note, and sync's info line for an old mxcli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 13, 2026
…gers (closes #259 #260; #313 follow-up)

Review: MERGE (two fix rounds + confirmation) — no-call models sweep again; per-BRD reports read by review/verify; BRD ids with spaces; verify stack rung exit 4 = FAULT.
@MendixMau
MendixMau deleted the fix/small-batch-2026-10-13 branch October 15, 2026 10:47
MendixMau added a commit to AlvinnYeo/mxcli-project-toolkit that referenced this pull request Oct 16, 2026
…e, merge master

Dropped: restore-mpr usage, build-plan-status flag order, other-project guard
(fixed on master by MendixMau#313 and MendixMau#304). Kept five. CHANGELOG line rewritten for five notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment