go-jsonl-header-timestamp-dialect-fallback
Diagnosed and fixed. Here's what I found and produced.
/workspace/solution.md — the full solution write-up (title, root-cause analysis, exact fix, regression tests, verification)./workspace/fix.patch — the directly-applicable patch (565 lines, applies cleanly to the pristine affected tree)./workspace/boardctl/ — the fixed working tree.internal/board/write.go)UpdateTask with --commit-hash correctly set the task row's commit_hash, but then also called b.SetHeader(HeaderUpdate{LastCommit: spec.CommitHash}). That overwrote the header's last_commit — the board-edit drift pointer — with a task commit, silently degrading drift detection.SetHeader never touched updated_at, so real header mutations (--set-ticks-total, --set-last-commit, …) left the header's freshness timestamp stale or absent.spec.CommitHash != nil header bump from UpdateTask (commit hash is now task-row state only; the pointer moves only via header --set-last-commit).Board.headerTSFormat(header): samples existing updated_at, else last_tick/created_at/started_at/generated_at, else DefaultTSLayout, then delegates to the existing DetectTSLayout.SetHeader now always stamps updated_at via that helper on every successful mutation. Validation failures still write nothing, and the byte-identical untouched-line assertion is preserved.fix.patch: go test ./... → all packages ok.go test ./internal/board/... -run 'SetHeader|HeaderTSFormat|CommitHash' -v → 12/12 PASS, including TestUpdateCommitHashLeavesHeaderLastCommitUntouched, TestUpdateCommitHashPreservesLine1HeaderOnTopologyB, TestSetHeaderRefreshesUpdatedAt{TopologyA,OnTopologyB}, TestSetHeaderUpdatedAtDialectPreserved (legacy space dialect), TestSetHeaderUpdatedAtDialectFromLastTick (RFC3339 Z), and TestSetHeaderCombinedFlagsRefreshUpdatedAt.write.go reverted, the new tests fail (5 failures) / the package won't build without headerTSFormat, confirming they actually catch the bug.# Evidence - Problem class: go-jsonl-header-timestamp-dialect-fallback - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-13T11:53:28.204Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "In a JSONL board writer, task-only commit metadata must not mutate the board header last_commit pointer. Header mutations must refresh updated_at while preserving the header timestamp dialect: use RFC3339 when the existing timestamp parses as RFC3339, and fall back to the project legacy board timestamp layout otherwise. Regression tests should cover task commit_hash isolation, real header mutation, RFC3339 preservation, and legacy fallback.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "go-jsonl-header-timestamp-dialect-fallback", "provider": "openrouter", "solved_at": "2026-09-13T11:53:28.205Z", "version": ""}