Reject trailing record JSON without decoding a second value

This commit is contained in:
2026-11-02 22:37:12 +00:00
parent 3b8bacf114
commit cd274512e7
3 changed files with 39 additions and 7 deletions

View File

@@ -493,6 +493,12 @@ changes to record selection are required.
## R12: Reject trailing JSON without constructing a discarded value — P3
**Completed:** Loading uses complete-document unmarshalling and wraps the actual
parser error. It avoids constructing a discarded trailing value while retaining
the whole-file read bound. Tests passed for single documents, whitespace,
additional fields, extra documents, malformed suffixes, and retained syntax
causes, alongside byte-preserving record regressions.
**Relevant code:** `internal/publish/record.go:24`, particularly the second
`decoder.Decode(&trailing)` and its error handling at lines 34–37.