Repository navigation
fix(reconstruction): fall back to a kind-based title for blank graph labels - #6137
Conversation
A whitespace-only application observation or semantic node label passed through ?? as the obligation title, and the ledger schema (trimmed, min length 1) then rejected the whole ledger. Use trim() || so a blank label takes the generated title. Closes morluto#6126
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge. SummaryBlank application and semantic graph labels now receive kind-based obligation titles instead of causing the ledger to reject them.
Reviews (1) · Last reviewed commit: "Fall back to a kind-based obligation tit..." · Reviewed by Greptile |
|
Thanks for the fix, @mohithhhh! Falling back to kind-based titles for blank application and semantic labels keeps those labels from aborting the reconstruction obligation ledger. Welcome to REA. |
Summary
build-reconstruction-obligation-ledgeraborts when an application-graph observation label or a semantic-node label is whitespace-only (for example" "). Fixes #6126.Problem and expected behavior
ReconstructionObligationCandidates.tsbuilds the obligation title with??, which only falls back onnull/undefined. A label of" "is passed through as the title. The ledger schema (textSchema = z.string().trim().min(1)) thenrejects it, so the whole ledger fails.
Expected: a blank label takes the generated title (
<kind> boundary/<kind> semantic boundary), as a missing label already does.Change and scope
Both title expressions now use
label?.trim() || fallback. This changes which title is chosen for a blank label. A non-blank label with surrounding spaces is now also trimmed at candidate derivation. The ledger schema already trims titles(
textSchema, used fortitleinreconstructionObligationLedgerSchemas.ts), and obligation ids come from the node key rather than the title, so ledger output for non-blank labels is unchanged.Not included: no change to the schema, the graph builders, or any other label handling. Contribution scope: not applicable, this is an ordinary fix within existing boundaries.
Contract and boundary impact
src/application/ReconstructionObligationCandidates.ts, candidate derivationEvidence and regression coverage
Executed (not only source-derived).
src/application/ReconstructionObligationCandidates.test.ts, one for an application node with a blank observation label and one for a semantic node with a blank label.applicationWithUnknownsgained optional
kindandlabelparameters to build the first case.expected ' ' to be 'package boundary'andexpected ' ' to be 'request semantic boundary', then pass with the change.build-reconstruction-obligation-ledgerend to end on a real bundle. The tests cover the candidate title, which is where the blank value enters.Validation performed
npx vitest run src/application/ReconstructionObligationCandidates.test.ts— 6 passed (both new tests failed before the change)npx vitest run src/application/ReconstructionObligation src/domain/reconstructionObligationLedgerSchemas.test.ts tests/boundary/mcp/reconstructionObligationLedgerMcp.test.ts— 22 passednpx tsc --noEmit -p tsconfig.json— no errorsnpx prettier --checkon the two changed files — cleannpm run verify:test-discovery— passednpx oxlinton the two changed files — onemax-lines-per-functionwarning (101 lines) inReconstructionObligationCandidates.ts; it is also present on the unmodified filetests/boundary/cli/reconstructionObligationLedgerCli.test.ts— 4 tests fail both with and without this change. I did not build the project and did not investigate the cause further.Compatibility, safety, and release
AI assistance was used to investigate and to draft the fix and tests.
Author readiness
Human owner: @mohithhhh