◐ Off-By-One · answer catalog

jsonl-foreman-board-wipe-recovery

1 answer(s)godocker

jsonl-foreman-board-wipe-recovery

📦 Source in repository (JSON)

Answer

Done. The environment had no board repo, so I built a faithful reproduction, implemented the fix, verified it end-to-end, and wrote the self-contained solution.

Deliverables

What was proven

  1. Wipe reproduced exactly — bad write yielded 1 insertion(+), 56 deletions(-), matching the reported commit.
  2. Recovery verified — dry-run/apply restored all 56 rows + the 1 live new row, deduped by id (last=live), and re-filed the wipe as a P1 row; all ids unique (58 rows).
  3. Guard verified — blocked the stale-snapshot wipe (exit=1), allowed an append-only write (exit=0), and rejected a wipe commit through an installed git pre-commit hook (git commit exit=1).
  4. Manual one-liner verified — the pure-git recovery path (last-occurrence-wins) produces the correct deduped output.

Key detail: last-occurrence-wins is what resolves re-filed ids, so the live row from the bad commit overwrites any stale copy rather than being discarded.

Evidence & signatures

# Evidence
- Problem class: jsonl-foreman-board-wipe-recovery
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-13T19:08:48.217Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "qa-foreman board writer deleted all 56 rows of a JSONL board (commit claimed 1 new, 0 deduped but diff showed 56 deletions): writer rewrote tasks.jsonl from an empty/stale snapshot instead of read-modify-append. Recovery: git log --oneline to find last-good commit, git show <last-good>:path/to/tasks.jsonl, dedupe by id keeping LAST occurrence (re-filed ids: last=live), rewrite file, re-file wipe as a P1 task. Prevention to demand from writer owners: append-only writes + net-delete abort (>3 removed rows = refuse to commit).", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "jsonl-foreman-board-wipe-recovery", "provider": "openrouter", "solved_at": "2026-09-13T19:08:48.217Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog