[PR #6137] [MERGED] fix(reconstruction): fall back to a kind-based title for blank graph labels #7151

Closed
opened 2026-11-01 21:45:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6137
Author: @mohithhhh
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix-obligation-title-whitespace-label


📝 Commits (1)

  • a85677d Fall back to a kind-based obligation title when a graph label is blank

📊 Changes

2 files changed (+111 additions, -5 deletions)

View changed files

📝 src/application/ReconstructionObligationCandidates.test.ts (+109 -3)
📝 src/application/ReconstructionObligationCandidates.ts (+2 -2)

📄 Description

Summary

build-reconstruction-obligation-ledger aborts when an application-graph observation label or a semantic-node label is whitespace-only (for example " "). Fixes #6126.

Problem and expected behavior

ReconstructionObligationCandidates.ts builds the obligation title with ??, which only falls back on null/undefined. A label of " " is passed through as the title. The ledger schema (textSchema = z.string().trim().min(1)) then
rejects 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 for title in reconstructionObligationLedgerSchemas.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

  • Semantic owner and earliest changed stage: src/application/ReconstructionObligationCandidates.ts, candidate derivation
  • Contribution scope fit and linked maintainer decision: not applicable
  • CLI and MCP/tool-catalog contract: none
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable
  • Generated metadata, package, or installation impact: none

Evidence and regression coverage

Executed (not only source-derived).

  • Tests added or updated: two tests in 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. applicationWithUnknowns
    gained optional kind and label parameters to build the first case.
  • Base reproduction or other evidence: both new tests fail on the base revision with expected ' ' to be 'package boundary' and expected ' ' to be 'request semantic boundary', then pass with the change.
  • User-visible CLI/MCP output (if applicable): not applicable
  • Remaining proof gaps: I did not run build-reconstruction-obligation-ledger end 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 passed
  • npx tsc --noEmit -p tsconfig.json — no errors
  • npx prettier --check on the two changed files — clean
  • npm run verify:test-discovery — passed
  • npx oxlint on the two changed files — one max-lines-per-function warning (101 lines) in ReconstructionObligationCandidates.ts; it is also present on the unmodified file
  • tests/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

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: none; not relevant to this change
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none; no target interaction

AI assistance was used to investigate and to draft the fix and tests.

Author readiness

Human owner: @mohithhhh

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6137 **Author:** [@mohithhhh](https://github.com/mohithhhh) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix-obligation-title-whitespace-label` --- ### 📝 Commits (1) - [`a85677d`](https://github.com/morluto/rea/commit/a85677ddacaa5e62ca722e62a5e98af010cc3fec) Fall back to a kind-based obligation title when a graph label is blank ### 📊 Changes **2 files changed** (+111 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ReconstructionObligationCandidates.test.ts` (+109 -3) 📝 `src/application/ReconstructionObligationCandidates.ts` (+2 -2) </details> ### 📄 Description ## Summary `build-reconstruction-obligation-ledger` aborts when an application-graph observation label or a semantic-node label is whitespace-only (for example `" "`). Fixes #6126. ## Problem and expected behavior `ReconstructionObligationCandidates.ts` builds the obligation title with `??`, which only falls back on `null`/`undefined`. A label of `" "` is passed through as the title. The ledger schema (`textSchema = z.string().trim().min(1)`) then rejects 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 for `title` in `reconstructionObligationLedgerSchemas.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 - Semantic owner and earliest changed stage: `src/application/ReconstructionObligationCandidates.ts`, candidate derivation - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: none - Provider, bridge, target-format, or platform compatibility: none - Evidence, artifact, provenance, or reconstruction contract: none - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable - Generated metadata, package, or installation impact: none ## Evidence and regression coverage Executed (not only source-derived). - Tests added or updated: two tests in `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. `applicationWithUnknowns` gained optional `kind` and `label` parameters to build the first case. - Base reproduction or other evidence: both new tests fail on the base revision with `expected ' ' to be 'package boundary'` and `expected ' ' to be 'request semantic boundary'`, then pass with the change. - User-visible CLI/MCP output (if applicable): not applicable - Remaining proof gaps: I did not run `build-reconstruction-obligation-ledger` end 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 passed - `npx tsc --noEmit -p tsconfig.json` — no errors - `npx prettier --check` on the two changed files — clean - `npm run verify:test-discovery` — passed - `npx oxlint` on the two changed files — one `max-lines-per-function` warning (101 lines) in `ReconstructionObligationCandidates.ts`; it is also present on the unmodified file - `tests/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 - Breaking changes or migration steps: none - Real Hopper/Ghidra, browser, or OS coverage: none; not relevant to this change - Package or release metadata impact: none - Security, privacy, process, or containment review: none; no target interaction AI assistance was used to investigate and to draft the fix and tests. ## Author readiness Human owner: @mohithhhh - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:46 +00:00
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#7151
No description provided.