# Builder report — F1 regex fix in bin/pos-ai-server Date: 2026-09-06 · Builder · Objective: fix `detect_llama_version` regex so `build 1.2.3` returns `1.2.3` not `1`. File scope: `bin/pos-ai-server` ONLY. No commit. ## TL;DR (status: IMPLEMENTED) - **Root cause:** `grep -oE '[0-9]+\.[0-9]+\.[0-9]+|build [0-9]+|b[0-9]+'` picks the LEFTMOST match; for input `build 1.2.3`, `build [0-9]+` wins → `build 1` → after `${version#build }` → `1`. - **Fix:** `bin/pos-ai-server:86` → `build [0-9]+(\.[0-9]+)*` (full dotted tail consumed). Stripping and guarded behavior unchanged. - **Gates:** `bash -n` clean; `make gen` rc 0 with generated files byte-identical (sha256 before == after); `make check` OK; `make lint` 0 FAIL / 0 WARN. - **Tests:** `tests/t-ai-llama-detect.sh` (was failing on F1) now 9/9 PASS; `tests/t-ai-server-validate.sh` (Tester's F1 suite, real extracted function) 27/27 PASS. ## Step 1: Read & confirm scope - Read `AgentsReport/tester/2026-09-06_ai-server-tests.md` (F1 finding: lines 9, 63). - Read `bin/pos-ai-server` (lines 82–90). - Scope confirmed: touch `bin/pos-ai-server` only; do NOT touch tests/. [PASS] ## Step 2: Apply regex fix - `bin/pos-ai-server:86`: `build [0-9]+` → `build [0-9]+(\.[0-9]+)*`. - Stripping (`version="${version#build }"`) and guarded behavior (`command -v` guard + `|| true` + `unknown` fallback) unchanged — per brief. [PASS] ## Step 3: Verification matrix (shipped regex evaluated against stub binaries) - `version: 0.4.0-dev (build 10822, commit …)` (stderr) → `0.4.0` PASS - `build 10822` → `10822` PASS - `build 1.2.3` → `1.2.3` PASS (regression fixed) - `b10822` → `b10822` — see Decision Note below (brief's conditional `10822` not taken) - missing binary → `unknown` PASS - unreadable / non-matching output → `unknown` PASS - Additional: `semver only (1.5.0)` → `1.5.0` PASS (leftmost semver still wins) ### Decision Note (b-token) Brief lists `b10822` → `10822` "if your regex keeps a b-token", but also mandates "keep the same stripping logic" (`${version#build }` — strips only `build `, never `b`). The two are mutually exclusive. Resolution per the hard constraint: kept the b-token (matches existing comment: very old builds print no semver) and kept stripping identical → `b10822` yields `b10822`. This is exactly what the Tester's own fixture asserts (`tests/t-ai-server-validate.sh:118` → `b10822`), and `t-ai-server-validate.sh` passes 27/27 with the real extracted function. [PASS] ## Step 4: Gates - `bash -n bin/pos-ai-server` → clean - `make gen` → rc 0; sha256 of `DOC/AGENT_Context_Project.md` + `completions/pos.bash` identical before/after → NO output change (regex is code, not a GEN: block) - `make check` → OK - `make lint` → 0 FAIL, 0 WARN [PASS] ## Step 5: Tester-requested regression verification - `./tests/run-tests.sh t-ai-llama-detect.sh` → PASS, 9/9 checks (was the failing test per Tester F1 finding; `llama.cpp build 1.2.3` fixture now yields `1.2.3`). - `./tests/run-tests.sh t-ai-server-validate.sh` → PASS, 27/27 checks (real extracted `detect_llama_version`, incl. `build 10822` → `10822` and `b10822` → `b10822` fixtures). [PASS] ## Handoff - Status: IMPLEMENTED. Files changed: `bin/pos-ai-server` (single regex line, line 86). Git: NOT committed (per brief). - Note: the working tree already carried the pre-existing uncommitted F1–F7 Builder changes plus 4 untracked Tester test files (per Tester report Step 6); none of that is mine. - Recommended next: Reviewer (independent gate + `make test` re-run). Separate track: F4 bus-gap fixture updates in 3 pre-existing DRY_RUN tests are already routed to Orchestrator — not touched here.