Skip to content

fix(reconstruction): fall back to a kind-based title for blank graph labels - #6137

Merged
morluto merged 1 commit into
morluto:mainfrom
mohithhhh:fix-obligation-title-whitespace-label
Oct 21, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
mohithhhh:fix-obligation-title-whitespace-label

Conversation

@mohithhhh

@mohithhhh mohithhhh commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-21T17:59:22.683859Z
We couldn’t complete this review. Comment @codex review to try again.
a85677d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Blank application and semantic graph labels now receive kind-based obligation titles instead of causing the ledger to reject them.

  • Reconstruction obligations get kind-based titles when graph labels are blank.

Reviews (1) · Last reviewed commit: "Fall back to a kind-based obligation tit..." · Reviewed by Greptile

@mohithhhh mohithhhh changed the title fix(reconstruction): fall back to a kind-based title for blank graph labels fix(reconstruction): fall back to a kind-based title for blank graph labels Oct 21, 2026
@morluto
morluto merged commit f23066f into morluto:main Oct 21, 2026
3 of 5 checks passed
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
@morluto

morluto commented Oct 25, 2026

Copy link
Copy Markdown
Owner

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.

@morluto morluto added area: evidence Evidence, artifacts, and reconstruction bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build-reconstruction-obligation-ledger fails when a graph label is whitespace-only

2 participants