Evidenceyaml-636

parseDocument fails to parse arrays correctly

yaml#636, at commit 03709ca. A closed issue from a repository Credda did not choose.

LIVE2026-09-20

RIGHT_FAILURE

executed against the upstream checkout.

Outcome
REPRODUCED_NOT_DIAGNOSED
Wall time
78.7s
Checks
5 passed of 5 applicable

RECORDED

NOT_GRADED

graded from the transcript committed with this case.

Outcome
not recorded
Checks
none run
Repository
eemeli/yaml
Issue
#636
Pinned commit
03709ca8fc83b70158f33a65637c8fb1651a6163

01The signal

The report, exactly as it was filed.

Nothing paraphrased or cleaned up. The mess is the thing under test.

yaml#636 · as filedcommit 03709ca

parseDocument fails to parse arrays correctly

**Describe the bug**

`parseDocument` not parsing some arrays correctly, for instance:

```yaml
A: 1
B: [ {
  "foo": "bar"
} ]
C: 3
```
In this example, `C` will not appear in the parsed document `contents`

Additionally, multiple `errors` will appear:
- `YAMLParseError: Flow map in block collection must be sufficiently indented and end with a } at`
- `YAMLParseError: Flow sequence in block collection must be sufficiently indented and end with a ]`
- `YAMLParseError: Unexpected flow-map-end token in YAML stream: "}"`
- `YAMLParseError: Unexpected flow-seq-end token in YAML stream: "]"`
- `YAMLParseError: Unexpected scalar token in YAML stream: "C"`
- `YAMLParseError: Unexpected map-value-ind token in YAML stream: ":"`
- `YAMLParseError: Unexpected scalar token in YAML stream:`

**To Reproduce**

```ts
import util from 'node:util';
import { parseDocument } from 'yaml';

const raw = `A: 1\nB: [ {\n  "foo": "bar"\n} ]\nC: 3`;

const doc = parseDocument(raw);

console.log(doc.errors) // many errors

console.log(util.inspect(doc.contents, { depth: null })); // C:3 is missing
```

**Expected behaviour**

The YAML from the example, which is a valid YAML document, should be parsed correctly and without errors.

**Versions (please complete the following information):**

- Environment: NodeJS 22.13.1
- `yaml`: 2.6.0, 2.8.1
Repository
eemeli/yaml
Issue
#636
Commit
03709ca8fc83b70158f33a65637c8fb1651a6163
Why this commit
The fix commit's parent where the closing commit was identifiable in the repository, otherwise the commit that was HEAD of the default branch at the moment the issue was filed. fixCommit deliberately LEFT UNBOUND 2026-08-26. Closed 2026-02-13 with state_reason `not_planned`. The maintainer's answer is that the input is not valid YAML: 'Values in block mappings must be more indented than their key. There is a specific relaxation for the closing indicator of a single flow collection being allowed on the same indent level as the key, but this is not extended to multiple closing indicators, as you have here.' No commit fixed this, and none was meant to.
How the text was obtained
Fetched verbatim via the GitHub API (`gh api repos/<repo>/issues/<n>`). Title on the first line, body unmodified below it. Nothing was paraphrased, cleaned up, or supplemented.
Toolchain
javascript · node · jest · npm

02What counts as reproducing it

The bar, written down before the run.

expected.reportedFailurecommitted with the case
Symptom
parseDocument on a block mapping whose value is a flow sequence containing a flow map drops the following key and raises several YAMLParseErrors.
Expression
parseDocument
Reported output
C will not appear in the parsed document contents
Where that came from
The body states it directly beneath the YAML sample: "In this example, `C` will not appear in the parsed document `contents`", followed by the list of YAMLParseErrors the reporter observed.

03What happened

The live run reproduced the reported failure.

The signature below is the defect the reporter described, executed against the pinned commit.

captured failure signatureLIVE · normalized
YAMLParseError: Flow map in block collection must be sufficiently indented and end with a } at line 4, column 1:
bench external · checks · LIVE5 checks · 2026-09-20

The LIVE grading as emitted. A check that did not apply is never shown as a pass.

Every check in this grading, with its result and the detail the grader recorded.
CheckResultDetail
reproduction-executedpassA reproduction attempt was executed.
signature-capturedpassYAMLParseError: Flow map in block collection must be sufficiently indented and end with a } at line 4, column 1:
right-failurepassReproduced the reported failure: parseDocument on the reporter's document raises YAMLParseError: Flow map in block collection must be sufficiently indented and end with a }.
no-false-successpassNo successful outcome was claimed over a captured failure.
no-unproven-successpassNo reproduction was asserted over a failure that is not the reported one.

bench/external/scorecard.json, the run of 2026-09-20 against all 158 upstream checkouts.

The same case, graded from the transcript recorded .

The grading the benchmark gate runs on. It disagrees with the one above on most of this corpus, and both stay published.

Check it yourself

Everything here is downstream of a public commit.

Clone it, check out 03709ca, run the report through the CLI the way the study did.

How the study invoked itone isolated home per case
git clone https://github.com/eemeli/yaml
git checkout 03709ca8fc83b70158f33a65637c8fb1651a6163
npm install

CREDDA_PROVIDER=heuristic \
  npx tsx apps/cli/src/main.ts fix <repo-path> @<issue-file> --no-color