[PR #5563] [CLOSED] fix(apple): attribute object-budget omissions to the object budget #6963

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5563
Author: @kaoru0822-kitauji
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/ib-object-limit-reasons


📝 Commits (2)

  • 5412c73 fix(apple): attribute object-budget omissions to the object budget
  • 8c72326 Merge origin/main into fix/ib-object-limit-reasons

📊 Changes

6 files changed (+106 additions, -16 deletions)

View changed files

📝 src/artifacts/apple/InterfaceBuilderAnalysis.ts (+10 -1)
📝 src/artifacts/apple/NibViewHierarchy.test.ts (+16 -5)
📝 src/artifacts/apple/NibViewHierarchy.ts (+8 -2)
📝 src/domain/apple/interfaceBuilderGraph.ts (+17 -7)
📝 tests/boundary/filesystem/interfaceBuilderBundle.test.ts (+52 -1)
📝 tests/boundary/filesystem/nibNativeHierarchy.test.ts (+3 -0)

📄 Description

Summary

Fixes #5540. With a small --max-objects, decode-interface-builder blamed the connection budget (connection_limit_reached) and an incomplete serialized hierarchy (serialized_view_hierarchy_incomplete) for omissions actually caused by the caller's object budget. Both facets now report graph_limit_reached for that cause, matching the existing hierarchy reason for graph-limit omissions (docs/native-investigation.md, "Interface Builder hierarchy coverage").

Problem and expected behavior

  • Connections: interfaceBuilderGraph.ts counted a connection whose source node did not fit the graph node budget (max_objects) in the same per-document counter as edges dropped by the connection edge budget, and mapped any nonzero count to connection_limit_reached.
  • Hierarchy: the NIB projection (hierarchyFor, projectNibViewHierarchy, mergeNibHierarchies) bounds nodes by max_objects, but returned only an omission count. The graph therefore could not distinguish budget omissions from depth, cycle or missing-reference omissions, and reported serialized_view_hierarchy_incomplete for all of them.

Expected: name the object/graph budget when it caused the omission; keep connection_limit_reached for actual connection-budget truncation. Partial status, omitted counts and unresolved endpoint_omitted_by_object_limit edges are unchanged.

Change and scope

  • Graph: separate counter for connection-edge-budget omissions; connections dropped because their source node was not retained report graph_limit_reached. Precedence is unchanged (connection budget first, then graph limit, then connection_unresolved).
  • NIB projection: the producer now also returns limitReached when its node bound (the caller's max_objects) stopped the projection. The document input carries it as serializedHierarchyLimitReached, and the hierarchy facet reports graph_limit_reached in that case. Depth/cycle/missing-reference omissions still report serialized_view_hierarchy_incomplete.
  • Not included: per-cause omitted counts; when both a budget and a genuine archive gap apply, the recoverable budget reason wins, matching the existing connection-facet precedence.

Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: NIB projection in src/artifacts/apple/ (producer of the hierarchy omission) and src/domain/apple/interfaceBuilderGraph.ts (coverage owner).

  • Contribution scope fit and linked maintainer decision: ordinary fix; not applicable.

  • CLI and MCP/tool-catalog contract: coverage reason strings change for the cases above; no schema change (reason is a free string, and graph_limit_reached is already emitted).

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: coverage reasons only; nodes, edges, counts and statuses unchanged.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:

    • interfaceBuilderBundle.test.ts: new synthetic NIBArchive case with max_objects: 1 expects connections:Cell.nib → graph_limit_reached. The existing "partial at the caller object limit" case now expects graph_limit_reached instead of serialized_view_hierarchy_incomplete.
    • nibNativeHierarchy.test.ts: the ibtool-compiled object-budget case now asserts graph_limit_reached (requires Xcode; see gaps).
    • NibViewHierarchy.test.ts: the record-bound case asserts limitReached: true; other results assert limitReached: false.
  • Base reproduction: with the source changes stashed and the new tests kept, both boundary regressions fail on base (connection_limit_reached / serialized_view_hierarchy_incomplete received).

  • Remaining proof gaps: this host has only Command Line Tools (no ibtool), so the issue's compiled-fixture CLI repro and the ibtool-gated nibNativeHierarchy cases were not run locally; the native Apple CI lane runs them.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- src/artifacts/apple/NibViewHierarchy.test.ts tests/boundary/filesystem/interfaceBuilderBundle.test.ts tests/boundary/filesystem/nibNativeHierarchy.test.ts: 66 passed, 7 skipped (ibtool/Xcode-gated)
  • Same command with source changes stashed: 12 failed, including both boundary regressions; the rest fail only on the new limitReached field
  • npm run check:fast: passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none; only coverage reason text changes for budget-caused omissions.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS (darwin) without Xcode; no provider involved.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new reads, processes or side effects.

Author readiness

Human owner: @kaoru0822-kitauji

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code


🔄 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/5563 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/ib-object-limit-reasons` --- ### 📝 Commits (2) - [`5412c73`](https://github.com/morluto/rea/commit/5412c7361b2789a5e48f64eb2b205e46cc797036) fix(apple): attribute object-budget omissions to the object budget - [`8c72326`](https://github.com/morluto/rea/commit/8c723269cba0bf9efbe50ffcec23e63766a2d476) Merge origin/main into fix/ib-object-limit-reasons ### 📊 Changes **6 files changed** (+106 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/apple/InterfaceBuilderAnalysis.ts` (+10 -1) 📝 `src/artifacts/apple/NibViewHierarchy.test.ts` (+16 -5) 📝 `src/artifacts/apple/NibViewHierarchy.ts` (+8 -2) 📝 `src/domain/apple/interfaceBuilderGraph.ts` (+17 -7) 📝 `tests/boundary/filesystem/interfaceBuilderBundle.test.ts` (+52 -1) 📝 `tests/boundary/filesystem/nibNativeHierarchy.test.ts` (+3 -0) </details> ### 📄 Description ## Summary Fixes #5540. With a small `--max-objects`, `decode-interface-builder` blamed the connection budget (`connection_limit_reached`) and an incomplete serialized hierarchy (`serialized_view_hierarchy_incomplete`) for omissions actually caused by the caller's object budget. Both facets now report `graph_limit_reached` for that cause, matching the existing hierarchy reason for graph-limit omissions (`docs/native-investigation.md`, "Interface Builder hierarchy coverage"). ## Problem and expected behavior - Connections: `interfaceBuilderGraph.ts` counted a connection whose source node did not fit the graph node budget (`max_objects`) in the same per-document counter as edges dropped by the connection edge budget, and mapped any nonzero count to `connection_limit_reached`. - Hierarchy: the NIB projection (`hierarchyFor`, `projectNibViewHierarchy`, `mergeNibHierarchies`) bounds nodes by `max_objects`, but returned only an omission count. The graph therefore could not distinguish budget omissions from depth, cycle or missing-reference omissions, and reported `serialized_view_hierarchy_incomplete` for all of them. Expected: name the object/graph budget when it caused the omission; keep `connection_limit_reached` for actual connection-budget truncation. Partial status, omitted counts and unresolved `endpoint_omitted_by_object_limit` edges are unchanged. ## Change and scope - Graph: separate counter for connection-edge-budget omissions; connections dropped because their source node was not retained report `graph_limit_reached`. Precedence is unchanged (connection budget first, then graph limit, then `connection_unresolved`). - NIB projection: the producer now also returns `limitReached` when its node bound (the caller's `max_objects`) stopped the projection. The document input carries it as `serializedHierarchyLimitReached`, and the hierarchy facet reports `graph_limit_reached` in that case. Depth/cycle/missing-reference omissions still report `serialized_view_hierarchy_incomplete`. - Not included: per-cause omitted counts; when both a budget and a genuine archive gap apply, the recoverable budget reason wins, matching the existing connection-facet precedence. Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: NIB projection in `src/artifacts/apple/` (producer of the hierarchy omission) and `src/domain/apple/interfaceBuilderGraph.ts` (coverage owner). - Contribution scope fit and linked maintainer decision: ordinary fix; not applicable. - CLI and MCP/tool-catalog contract: coverage `reason` strings change for the cases above; no schema change (`reason` is a free string, and `graph_limit_reached` is already emitted). - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: coverage reasons only; nodes, edges, counts and statuses unchanged. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: - `interfaceBuilderBundle.test.ts`: new synthetic NIBArchive case with `max_objects: 1` expects `connections:Cell.nib` → `graph_limit_reached`. The existing "partial at the caller object limit" case now expects `graph_limit_reached` instead of `serialized_view_hierarchy_incomplete`. - `nibNativeHierarchy.test.ts`: the ibtool-compiled object-budget case now asserts `graph_limit_reached` (requires Xcode; see gaps). - `NibViewHierarchy.test.ts`: the record-bound case asserts `limitReached: true`; other results assert `limitReached: false`. - Base reproduction: with the source changes stashed and the new tests kept, both boundary regressions fail on base (`connection_limit_reached` / `serialized_view_hierarchy_incomplete` received). - Remaining proof gaps: this host has only Command Line Tools (no `ibtool`), so the issue's compiled-fixture CLI repro and the ibtool-gated `nibNativeHierarchy` cases were not run locally; the native Apple CI lane runs them. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- src/artifacts/apple/NibViewHierarchy.test.ts tests/boundary/filesystem/interfaceBuilderBundle.test.ts tests/boundary/filesystem/nibNativeHierarchy.test.ts`: 66 passed, 7 skipped (ibtool/Xcode-gated) - Same command with source changes stashed: 12 failed, including both boundary regressions; the rest fail only on the new `limitReached` field - `npm run check:fast`: passed ## Compatibility, safety, and release - Breaking changes or migration steps: none; only coverage reason text changes for budget-caused omissions. - Real Hopper/Ghidra, browser, or OS coverage: macOS (darwin) without Xcode; no provider involved. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new reads, processes or side effects. ## Author readiness Human owner: @kaoru0822-kitauji - [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. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:21 +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#6963
No description provided.