board-hygiene-operator-decision-rows
Solution written to ~/solution.md and empirically verified.
Root cause of collateral churn. The board is compact JSONL (separators=(",", ":"), often ensure_ascii=False), but a naive json.load → mutate → json.dumps rewrites every line with Python's defaults ((", ", ": "), ensure_ascii=True), so git diff --numstat becomes M/M instead of N/N. Secondary causes: whole-file rewrite, key reordering, \r\n/trailing-newline normalization, and boardctl update --normalize (which canonicalizes the whole file).
The fix. Per line, detect the original style from the raw bytes:
- separators: '": ' in body → default, else compact
- ensure_ascii: body.isascii()
Re-serialize only selected rows with their own style, round-trip-validate the result (falling back to the 4 candidate styles so a literal ": " inside a compact string can't corrupt it), and pass every untouched line through byte-for-byte. The script gates on a clean tree, a HEAD key-level drift check (only worker_status may change, and only on target rows), and numstat == N/N.
Verification (scratch repo, mixed styles + UTF-8):
| Scenario | Result |
|---|---|
| Naive whole-file dump | 7/7 churn |
| Script dry run | selected=6 rewritten=6 |
Script --apply |
numstat OK: +6/-6 = 6/6 |
--verify-only |
drift check passed |
| Re-apply after commit | rewritten=0, no diff (idempotent) |
| Injected untouched-row change | DRIFT: untouched row OTHER-1 changed, exit 3 |
Compact value containing literal ": " |
stayed compact, 1/1 |
The markdown document is self-contained: it includes the full mark_operator_blocked.py script, the exact tick-#409 command (--families LOGSEY,PULSE,LORE,DIGEST --worker-status blocked-operator), and copy-pasteable verification gates. The embedded script was extracted, compiled, and re-run against a fresh fixture to confirm it behaves identically to the tested version.
# Evidence - Problem class: board-hygiene-operator-decision-rows - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-19T21:16:59.530Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Marking decision-blocked task families operator-blocked on a git-tracked compact JSONL board without churning untouched rows: detect per-line style by probing for colon+space (compact vs default separators) and ensure_ascii (non-ASCII chars in line), re-serialize ONLY target rows with their own style via json.dumps(separators, ensure_ascii), verify with git diff --numstat (must equal N/N for N rows) and a key-level drift check against HEAD. Used at h3 tick #409 to mark 42 LOGSEY/PULSE/LORE/DIGEST rows worker_status=blocked-operator with 0 collateral churn.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "board-hygiene-operator-decision-rows", "provider": "openrouter", "solved_at": "2026-09-19T21:16:59.531Z", "version": ""}Solution written to ~/solution.md and empirically verified.
Root cause of collateral churn. The board is compact JSONL (separators=(",", ":"), often ensure_ascii=False), but a naive json.load → mutate → json.dumps rewrites every line with Python's defaults ((", ", ": "), ensure_ascii=True), so git diff --numstat becomes M/M instead of N/N. Secondary causes: whole-file rewrite, key reordering, \r\n/trailing-newline normalization, and boardctl update --normalize (which canonicalizes the whole file).
The fix. Per line, detect the original style from the raw bytes:
- separators: '": ' in body → default, else compact
- ensure_ascii: body.isascii()
Re-serialize only selected rows with their own style, round-trip-validate the result (falling back to the 4 candidate styles so a literal ": " inside a compact string can't corrupt it), and pass every untouched line through byte-for-byte. The script gates on a clean tree, a HEAD key-level drift check (only worker_status may change, and only on target rows), and numstat == N/N.
Verification (scratch repo, mixed styles + UTF-8):
| Scenario | Result |
|---|---|
| Naive whole-file dump | 7/7 churn |
| Script dry run | selected=6 rewritten=6 |
Script --apply |
numstat OK: +6/-6 = 6/6 |
--verify-only |
drift check passed |
| Re-apply after commit | rewritten=0, no diff (idempotent) |
| Injected untouched-row change | DRIFT: untouched row OTHER-1 changed, exit 3 |
Compact value containing literal ": " |
stayed compact, 1/1 |
The markdown document is self-contained: it includes the full mark_operator_blocked.py script, the exact tick-#409 command (--families LOGSEY,PULSE,LORE,DIGEST --worker-status blocked-operator), and copy-pasteable verification gates. The embedded script was extracted, compiled, and re-run against a fresh fixture to confirm it behaves identically to the tested version.
# Evidence - Problem class: board-hygiene-operator-decision-rows - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-19T21:16:59.530Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Marking decision-blocked task families operator-blocked on a git-tracked compact JSONL board without churning untouched rows: detect per-line style by probing for colon+space (compact vs default separators) and ensure_ascii (non-ASCII chars in line), re-serialize ONLY target rows with their own style via json.dumps(separators, ensure_ascii), verify with git diff --numstat (must equal N/N for N rows) and a key-level drift check against HEAD. Used at h3 tick #409 to mark 42 LOGSEY/PULSE/LORE/DIGEST rows worker_status=blocked-operator with 0 collateral churn.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "board-hygiene-operator-decision-rows", "provider": "openrouter", "solved_at": "2026-09-19T21:16:59.531Z", "version": ""}