board.sh's status classifier and route_cmd_for()'s four-trait extraction
both used a [a-z-]* sed capture that stops at the first byte outside that
class instead of running to the field's real boundary. status=done2
silently classified as done (excluded from --plan like a real done repo,
shown green); status=Planned captured as empty and read as "?" (no board
line at all), feeding the MERK footer a false count. route_cmd_for() had
the same defect on all four traits: path=known2 truncated to known, which
route.sh's own exact-match validation then accepted, producing a
safely-worded but WRONG startup command instead of a refusal.
Fixed by capturing to the next ';' or the closing '-->' (the same
[^;>]* + trim shape next-cost already used), so the exact-match case
statements downstream see the real, un-truncated value.
Selftest: repo-status-prefix, repo-status-case, repo-trait-prefix and
repo-revers-prefix pin all four cases, with known-positive controls that
a genuinely absent board line still reads ? and a genuinely valid route
line still derives a real command. All four suites green: coord 220,
board 229, route 69, guard 40. Verified no MALFORMED regression against
the real ~/repos tree (empty set before and after).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxLmbNN6qswBuu6XkSYVrt