fix(board): read emphasis on the status token, not only on the slug

The marker reader accepted **slug**: done and missed slug: **done**. That was
never a rule - it was whichever example happened to be in front of us when the
regex was written. The second form is in live use, and it makes a repo that HAS
declared look silent to --focus, which is the exact failure the held-back
report exists to surface.

Found by acting on the report's own output instead of reading it: enumerating
the held-back population turned up a repo whose declaration we were dropping
ourselves. The report blamed the repo; the defect was here.

The evidence field reports the status unwrapped - the emphasis is markdown the
operator typed, not part of the token, and "**done**" in a key=value field
reads as a value. board-selftest 114 -> 116.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186vKCzuUEN5WcJB82kddzF
This commit is contained in:
Kjell Tore Guttormsen 2026-08-02 20:34:53 +02:00
commit 402597b1e5
2 changed files with 31 additions and 2 deletions

View file

@ -248,6 +248,21 @@ mkrepo "$ROOT/repo-focus-bold"
printf -- '- **`demo-topic`**: planned %s pin bumpet, ikke startet\n' "$EMDASH"
} > "$ROOT/repo-focus-bold/STATE.md"
# repo-focus-boldstatus: the bold is on the STATUS token, not the slug. Found in
# the real tree AFTER the first release, which is the point: accepting bold on
# one half of the line and not the other is not a rule, it is an accident of
# which example was in front of us. The register's own grep loses this form too,
# so the repo writing it looks silent while having declared.
mkrepo "$ROOT/repo-focus-boldstatus"
{
echo "# STATE - repo-focus-boldstatus"
printf '## %s NESTE %s START HER\n' "$HAND" "$EMDASH"
echo "<!-- board: status=planned; blocked-on=-; next-cost=Sonnet 5/high -->"
echo "Neste steg for repo-focus-boldstatus."
echo ""
echo "demo-topic: **done** (1.8.1). akse-B naadd, ingen apen trad"
} > "$ROOT/repo-focus-boldstatus/STATE.md"
# repo-focus-mentions: names the slug in prose and declares NOTHING. This is
# the held-back class the report exists for. It is in-progress with a live
# next step, so the cutoff genuinely removes a repo that would otherwise be a
@ -721,6 +736,14 @@ check "a repo declaring the slug survives the focus" $?
printf '%s\n' "$FDEMO" | grep -q '^repo=repo-focus-bold$'
check "a bold/backtick declaration counts as declared (the register's grep loses it)" $?
# Bold around the STATUS rather than the slug. Accepting one and not the other
# is not a rule, just whichever example was in front of us first.
printf '%s\n' "$FDEMO" | grep -q '^repo=repo-focus-boldstatus$'
check "bold on the status token counts as declared, same as bold on the slug" $?
printf '%s\n' "$FDEMO" | grep '^fokus_treff=' | grep -q 'demo-topic: done'
check "the evidence reports the status unwrapped, never '**done**'" $?
printf '%s\n' "$FPLAIN" | grep -q '^repo=repo-a$'
printf '%s\n' "$FDEMO" | grep -q '^repo=repo-a$'; [ $? -ne 0 ]
check "an off-topic repo is in the full plan and gone from the focused one" $?

View file

@ -419,8 +419,12 @@ fi
# measurement behind this feature was invisible to exactly that grep.
FOCUS_STATUS='planned|in-progress|partial|blocked|deferred|done|not-applicable'
# The emphasis is optional on BOTH halves. Accepting `**slug**: done` but not
# `slug: **done**` is not a rule, only whichever example happened to be in front
# of us - and the second form is in live use, where it makes a repo that HAS
# declared look silent.
focus_marker_re() {
printf '^[[:space:]]*[-*]?[[:space:]]*\**`?%s`?\**:[[:space:]]+(%s)([[:space:]]|$)' \
printf '^[[:space:]]*[-*]?[[:space:]]*\**`?%s`?\**:[[:space:]]+\**(%s)\**([[:space:]]|$)' \
"$1" "$FOCUS_STATUS"
}
@ -473,7 +477,9 @@ focus_evidence() {
for fe_s in $FOCUS_SLUGS; do
fe_line="$(grep -m1 -E "$(focus_marker_re "$fe_s")" "$1/STATE.md" 2>/dev/null)"
if [ -n "$fe_line" ]; then
fe_st="$(printf '%s' "$fe_line" | sed -E "s/.*:[[:space:]]+($FOCUS_STATUS).*/\1/")"
# Reported unwrapped: the emphasis is markdown the operator typed, not
# part of the token, and "**done**" in a key=value field reads as a value.
fe_st="$(printf '%s' "$fe_line" | sed -E "s/.*:[[:space:]]+\**($FOCUS_STATUS)\**.*/\1/")"
printf '%s: %s\n' "$fe_s" "$fe_st"
return 0
fi