go-jsonl-raw-bytes-base64-mangling
I've produced the solution document. Here's a summary of the analysis and deliverable:
Written to ~/go-jsonl-raw-bytes-base64-mangling.md (self-contained markdown).
Root cause: embedDetail returns the finished, already-serialized JSON string VALUE, but it was routed through Row.SetGoValue as a []byte. SetGoValue's default branch runs values through json.Marshal(), and in Go's JSON encoder a []byte slice is base64-encoded (byte slices = opaque binary). Result: every --detail/--detail-text payload was stored as base64 garbage. Existing tests never decoded detail, so the defect was invisible.
Fix: write the finished JSON string verbatim via Row.SetRaw(row, "detail", detailJson) instead of SetGoValue(..., []byte). SetRaw writes bytes into the JSONL line with no JSON re-encoding, so the exact JSON string survives. Since embedDetail output is shared by create and update, it's a single call-site fix for every event type.
Verification: new regression tests decode detail on every event written by create/update (object-for-object assert), plus a manual boardctl check that the raw events.jsonl row shows a printable {"...":...} detail instead of a base64 blob.
One important caveat: I could not edit/compile the actual source — there is no boardctl source checkout in this environment (only the compiled ~/.local/bin/boardctl, and that build is a newer "topology B" variant with no --detail-text on create and a DuckDB header). The document is therefore written as a directly-applicable patch based on the described code shape (Row.SetGoValue/Row.SetRaw, embedDetail), to be dropped into the real repo.
# Evidence - Problem class: go-jsonl-raw-bytes-base64-mangling - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-04T18:27:39.120Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "boardctl AppendEvent detail payloads were base64-mangled: embedDetail returns the exact JSON string VALUE, but it was routed through Row.SetGoValue, whose default branch json.Marshal()s []byte (Go base64-encodes byte slices) \u2014 so every --detail/--detail-text event payload stored as base64 garbage. Existing tests never decoded detail, hiding it. Fix: write the finished JSON string verbatim via Row.SetRaw. New regression tests decode the detail of every event written by create/update.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-jsonl-raw-bytes-base64-mangling", "provider": "openrouter", "solved_at": "2026-09-04T18:27:39.120Z", "version": ""}I've produced the solution document. Here's a summary of the analysis and deliverable:
Written to ~/go-jsonl-raw-bytes-base64-mangling.md (self-contained markdown).
Root cause: embedDetail returns the finished, already-serialized JSON string VALUE, but it was routed through Row.SetGoValue as a []byte. SetGoValue's default branch runs values through json.Marshal(), and in Go's JSON encoder a []byte slice is base64-encoded (byte slices = opaque binary). Result: every --detail/--detail-text payload was stored as base64 garbage. Existing tests never decoded detail, so the defect was invisible.
Fix: write the finished JSON string verbatim via Row.SetRaw(row, "detail", detailJson) instead of SetGoValue(..., []byte). SetRaw writes bytes into the JSONL line with no JSON re-encoding, so the exact JSON string survives. Since embedDetail output is shared by create and update, it's a single call-site fix for every event type.
Verification: new regression tests decode detail on every event written by create/update (object-for-object assert), plus a manual boardctl check that the raw events.jsonl row shows a printable {"...":...} detail instead of a base64 blob.
One important caveat: I could not edit/compile the actual source — there is no boardctl source checkout in this environment (only the compiled ~/.local/bin/boardctl, and that build is a newer "topology B" variant with no --detail-text on create and a DuckDB header). The document is therefore written as a directly-applicable patch based on the described code shape (Row.SetGoValue/Row.SetRaw, embedDetail), to be dropped into the real repo.
# Evidence - Problem class: go-jsonl-raw-bytes-base64-mangling - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-04T18:27:39.120Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "boardctl AppendEvent detail payloads were base64-mangled: embedDetail returns the exact JSON string VALUE, but it was routed through Row.SetGoValue, whose default branch json.Marshal()s []byte (Go base64-encodes byte slices) \u2014 so every --detail/--detail-text event payload stored as base64 garbage. Existing tests never decoded detail, hiding it. Fix: write the finished JSON string verbatim via Row.SetRaw. New regression tests decode the detail of every event written by create/update.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-jsonl-raw-bytes-base64-mangling", "provider": "openrouter", "solved_at": "2026-09-04T18:27:39.120Z", "version": ""}