Preserve version one error record scopes

This commit is contained in:
2026-11-17 03:54:41 +00:00
parent 0c2a2164ec
commit c6be2ec20d
7 changed files with 71 additions and 47 deletions

View File

@@ -100,7 +100,7 @@ func TestStageIDIsLiteralInMarkdownAndExactInYAML(t *testing.T) {
snapshot := Snapshot{
StageNames: []string{StageLabel(0, "grammar", &id), StageLabel(1, "grammar", nil)},
WorkUnits: []WorkUnit{{StageIndex: 0, ChunkIndex: 0, State: "completed", ErrorCount: 1}},
Errors: []ErrorRecord{{Scope: "work_unit", StageID: &id}},
Errors: []ErrorRecord{{Scope: "work_unit", FailureDetails: FailureDetails{StageID: &id}}},
}
header := `| Chunk | 1: grammar (\[party\](https://example.invalid/) \*bold\* \_emphasis\_ \~\~strike\~\~ \\| <tag>) | 2: grammar |`
if rows := markdownTableRows(string(Markdown(snapshot))); len(rows) == 0 || rows[0] != header {