You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Judge parser: a lone score object inside an unterminated array is accepted, inside an unterminated object it is not #1048
_parse_judge_json fails closed on a score object that follows an undecodable { (the object's extent is unknown, so the score object may be nested inside it). It does not do the same for an undecodable [, so a lone score object inside an unterminated array is accepted as the verdict, while the same object inside an unterminated object, or inside a terminated array, is not.
An object that sits in a container that was never closed cannot be shown to be the judge's own verdict, which is the reason the { rule exists. A reply cut off by the token cap is already rejected by #1045; this covers a reply that ends normally but is malformed.
Fix
Keep the rule for {. For an undecodable [, count a score object that follows as nested when the bracket is still open where the object starts (the number of [ minus the number of ] between the bracket and the object is above zero). Prose that closes its brackets before the verdict stays accepted: See [1] and [source](https://example.org): {"score": 2} and As noted [1] the answer is fine. {"score": 7} (both are pinned by tests today).
Acceptance criteria
The first two rows above return None; every reply the existing parser tests accept is still accepted.
Regression tests: the rows above, a nested unterminated array ([ [x] , {...}), brackets that close before the verdict, and a stray unclosed [ in prose before a verdict (documented as failing closed).
A ### Fixed entry under ## [Unreleased] in CHANGELOG.md.
Activity
fix(judge): decide "plain note or unterminated array" per bracket, no…