[GH-ISSUE #6126] build-reconstruction-obligation-ledger fails when a graph label is whitespace-only #3754

Closed
opened 2026-10-31 00:43:42 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @carlogiovannineri-rgb on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6126

Version: rea-agents 6.7.0 (npm) and current main

What happens
build-reconstruction-obligation-ledger aborts with a schema validation error on a JavaScript
application graph whose evidence contains nodes/observations with a label of " " (a single space).

Cause
src/application/ReconstructionObligationCandidates.ts builds the obligation title with ??:

title: node.observations[0]?.label ?? `${node.kind} boundary`,   // line 117
title: node.label ?? `${node.kind} semantic boundary`,            // line 146

?? only falls back on null/undefined, so a whitespace-only label is passed through.
src/domain/reconstructionObligationLedgerSchemas.ts:22 then rejects it
(textSchema = z.string().trim().min(1)), and the whole ledger fails.

Expected
Whitespace-only labels fall back to the generated title, e.g.

title: node.observations[0]?.label?.trim() || `${node.kind} boundary`,
title: node.label?.trim() || `${node.kind} semantic boundary`,

Repro
Any analyze-javascript-application evidence where a node or observation label is " "
(seen twice in one real-world bundle), then run build-reconstruction-obligation-ledger on it.

Note
Patching the labels in the evidence file is not a workaround: the graph id is content-bound,
so graph validation fails afterwards and the ledger comes back with 0 obligations.

Originally created by @carlogiovannineri-rgb on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6126 **Version:** rea-agents 6.7.0 (npm) and current main **What happens** `build-reconstruction-obligation-ledger` aborts with a schema validation error on a JavaScript application graph whose evidence contains nodes/observations with a label of `" "` (a single space). **Cause** `src/application/ReconstructionObligationCandidates.ts` builds the obligation title with `??`: ```ts title: node.observations[0]?.label ?? `${node.kind} boundary`, // line 117 title: node.label ?? `${node.kind} semantic boundary`, // line 146 ``` `??` only falls back on `null`/`undefined`, so a whitespace-only label is passed through. `src/domain/reconstructionObligationLedgerSchemas.ts:22` then rejects it (`textSchema = z.string().trim().min(1)`), and the whole ledger fails. **Expected** Whitespace-only labels fall back to the generated title, e.g. ```ts title: node.observations[0]?.label?.trim() || `${node.kind} boundary`, title: node.label?.trim() || `${node.kind} semantic boundary`, ``` **Repro** Any `analyze-javascript-application` evidence where a node or observation label is `" "` (seen twice in one real-world bundle), then run `build-reconstruction-obligation-ledger` on it. **Note** Patching the labels in the evidence file is not a workaround: the graph id is content-bound, so graph validation fails afterwards and the ledger comes back with 0 obligations.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3754
No description provided.