[GH-ISSUE #5540] [Bug] decode-interface-builder misattributes object-limit omissions to the connection budget #3373

Closed
opened 2026-10-31 00:39:40 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5540

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

node scripts/rea.mjs decode-interface-builder "$workdir/Fixture.app" --json --max-objects 1 reports connection coverage as partial / connection_limit_reached, although both decoded connections fit within the effective max_connections=40000. The same result reports hierarchy coverage as partial / serialized_view_hierarchy_incomplete, which loses the object-budget cause. Raising only max_objects to 20000 makes both facets complete on the unchanged compiled NIB.

Partial coverage, the object-limit facets, and an unresolved edge with endpoint_omitted_by_object_limit remain visible. This report concerns the wrong or ambiguous cause in the connection and hierarchy reasons.

Reproduction

An independent verifier executed the following script from the baseline checkout with dependencies and the compiled runtime already available. It compiles the repository's source-owned fixture with real Xcode tools, isolates REA's writable directories, and runs the failing case and two controls. All three CLI invocations exited 0 with empty stderr. This exact script reproduced the same facet counts as the verifier's initial replay; broader frequency was not measured.

set -eu
checkout="$PWD"
workdir="$(mktemp -d)"
mkdir -p "$workdir/Fixture.app/Contents/MacOS" "$workdir/Fixture.app/Contents/Resources"
mkdir -p "$workdir/home" "$workdir/config" "$workdir/data" "$workdir/cache" "$workdir/state" "$workdir/temp"
xcrun clang "$checkout/tests/conformance/interface-builder/fixture.c" -o "$workdir/Fixture.app/Contents/MacOS/Fixture"
cat > "$workdir/Fixture.app/Contents/Info.plist" <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>CFBundleExecutable</key><string>Fixture</string><key>CFBundleIdentifier</key><string>dev.rea.fixture</string></dict></plist>
PLIST
xcrun ibtool --errors --warnings --compile "$workdir/Fixture.app/Contents/Resources/Main.nib" "$checkout/tests/conformance/interface-builder/Main.xib"
run_rea() {
  env HOME="$workdir/home" XDG_CONFIG_HOME="$workdir/config" XDG_DATA_HOME="$workdir/data" XDG_CACHE_HOME="$workdir/cache" XDG_STATE_HOME="$workdir/state" TMPDIR="$workdir/temp" REA_LOG_LEVEL=silent \
    node "$checkout/scripts/rea.mjs" decode-interface-builder "$workdir/Fixture.app" --json "$@"
}
run_rea --max-objects 1 > "$workdir/object-limited.json"
run_rea --max-objects 20000 > "$workdir/full-budget.json"
run_rea --max-objects 20000 --max-connections 1 > "$workdir/connection-limited.json"
python3 - "$workdir" <<'PYTHON'
import json, pathlib, sys
root = pathlib.Path(sys.argv[1])
for name in ("object-limited", "full-budget", "connection-limited"):
    evidence = json.loads((root / (name + ".json")).read_text())
    print(name, evidence["parameters"])
    for facet in evidence["normalized_result"]["graph"]["coverage"]:
        print(facet["facet"], facet["status"], facet["reason"], facet["examined"], facet["omitted"])
PYTHON

Expected behavior

Identify the object or graph budget when it prevents connections or hierarchy links from being retained, while preserving partial coverage and unresolved endpoint evidence. Reserve a connection-budget cause for actual connection-budget truncation; no particular replacement string is required.

Source contract: AGENTS.md (Architecture and Cleanup) requires meaningful failure reasons and preserved omission information; docs/tool-design.md:47-69 requires useful inline coverage and reported truncation; docs/native-investigation.md:626-632 applies partial hierarchy coverage to graph-limit omissions. CLI help distinguishes graph-object and decoded-connection budgets.

Impact and scope

The tested compiled AppKit NIB receives misleading diagnostic reasons under a caller-selected object limit. Assessment: P3, diagnostic wording. No silent completeness claim, incorrect retained connection, or consequential downstream failure was observed. The same result exposes the object budget through other facets and the unresolved edge. Raising max_objects to 20000 restored full coverage for this fixture; max_connections was already at its supported maximum. Larger archives beyond the supported object cap and real-app prevalence were not tested.

REA version

rea-agents 6.7.0; source commit 074768901f3cdc8205b61773fb1faf6f6c7b3ca8.

Runtime and platform

Node.js v26.12.0; macOS 27.0.1 arm64; Xcode 27.1 build 27A9275; ibtool 27.1 bundle 25098.

Target and artifact context

Disposable Mach-O app bundle containing a real compiled AppKit NIB, built from tests/conformance/interface-builder/fixture.c and tests/conformance/interface-builder/Main.xib. No target application launch is claimed.

Interface

CLI

Earliest failure stage

Native analysis or reconstruction

Relevant output or evidence

For --max-objects 1, the effective parameters are max_documents=64, max_objects=1, max_connections=40000. The result retains one node and one unresolved hierarchy edge with reason: endpoint_omitted_by_object_limit:

facet                                  status    reason                                examined  omitted
objects:Contents/Resources/Main.nib     partial   object_limit_reached                  0         8
connections:Contents/Resources/Main.nib partial   connection_limit_reached              2         5
hierarchy:Contents/Resources/Main.nib   partial   serialized_view_hierarchy_incomplete   1         2
graph_nodes                            partial   max_objects_reached                   1         6
archive_decode                         complete  null                                  1         0

On the unchanged NIB, --max-objects 20000 gives complete objects, connections and hierarchy with zero omissions; connections examined two and hierarchy examined three. Target and archive digests matched the failing run. With --max-objects 20000 --max-connections 1, connections correctly report partial / connection_limit_reached, examined one and omitted one, while hierarchy remains complete. These controls distinguish object-budget omissions from genuine connection-budget truncation. archive_decode=complete alone does not establish validity of every serialized hierarchy reference.

Typed outcome or recovery expected

Repeat all three cases on the same compiled fixture. The object-limited case should retain its partial statuses and omission evidence while identifying the responsible object or graph budget in both affected facets. The high-object-budget control should remain complete, and the genuine connection-budget control should continue to identify connection truncation.

Analysis or suspected cause

Source-derived corroboration at the tested commit: src/domain/apple/interfaceBuilderGraph.ts:193-202 counts connection edges whose source nodes were omitted; lines 506-511 label that count connection_limit_reached. src/artifacts/apple/InterfaceBuilderAnalysis.ts:123-127 passes the object limit into NIB hierarchy projection; its limit-triggered omissions at lines 619-621 are aggregated and forwarded at lines 181-185 and 668-681. src/domain/apple/interfaceBuilderGraph.ts:529-533 then reports that aggregate as serialized_view_hierarchy_incomplete. This supports loss of the budget cause through projection, not a claim of damaged serialized bytes.

Additional context

Prepared with AI assistance and independently reproduced through the production CLI. MCP was not exercised. Freshness check against origin/main at 25d3805e7f29c186ab824d3b8c1292089d141a02 found no changes since the verified baseline in the cited implementation or contract files; this was a source freshness check, not a runtime rerun on that revision.

Related reports were checked: #2484 addresses genuinely ownerless connectors; #3950 / #4162 address silent hierarchy loss past a parser cut; #2547 / #3156 address per-document completeness. They do not cover this compiled-NIB case where partial coverage is already present and the cause is misattributed. NIBArchive boolean polarity is a separate defect.

NOT_ENOUGH_INFO: The last known good version and regression introduction have not been established.

Originally created by @coygeek on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5540 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior `node scripts/rea.mjs decode-interface-builder "$workdir/Fixture.app" --json --max-objects 1` reports connection coverage as `partial / connection_limit_reached`, although both decoded connections fit within the effective `max_connections=40000`. The same result reports hierarchy coverage as `partial / serialized_view_hierarchy_incomplete`, which loses the object-budget cause. Raising only `max_objects` to 20000 makes both facets complete on the unchanged compiled NIB. Partial coverage, the object-limit facets, and an unresolved edge with `endpoint_omitted_by_object_limit` remain visible. This report concerns the wrong or ambiguous cause in the connection and hierarchy reasons. ### Reproduction An independent verifier executed the following script from the baseline checkout with dependencies and the compiled runtime already available. It compiles the repository's source-owned fixture with real Xcode tools, isolates REA's writable directories, and runs the failing case and two controls. All three CLI invocations exited 0 with empty stderr. This exact script reproduced the same facet counts as the verifier's initial replay; broader frequency was not measured. ```sh set -eu checkout="$PWD" workdir="$(mktemp -d)" mkdir -p "$workdir/Fixture.app/Contents/MacOS" "$workdir/Fixture.app/Contents/Resources" mkdir -p "$workdir/home" "$workdir/config" "$workdir/data" "$workdir/cache" "$workdir/state" "$workdir/temp" xcrun clang "$checkout/tests/conformance/interface-builder/fixture.c" -o "$workdir/Fixture.app/Contents/MacOS/Fixture" cat > "$workdir/Fixture.app/Contents/Info.plist" <<'PLIST' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"><dict><key>CFBundleExecutable</key><string>Fixture</string><key>CFBundleIdentifier</key><string>dev.rea.fixture</string></dict></plist> PLIST xcrun ibtool --errors --warnings --compile "$workdir/Fixture.app/Contents/Resources/Main.nib" "$checkout/tests/conformance/interface-builder/Main.xib" run_rea() { env HOME="$workdir/home" XDG_CONFIG_HOME="$workdir/config" XDG_DATA_HOME="$workdir/data" XDG_CACHE_HOME="$workdir/cache" XDG_STATE_HOME="$workdir/state" TMPDIR="$workdir/temp" REA_LOG_LEVEL=silent \ node "$checkout/scripts/rea.mjs" decode-interface-builder "$workdir/Fixture.app" --json "$@" } run_rea --max-objects 1 > "$workdir/object-limited.json" run_rea --max-objects 20000 > "$workdir/full-budget.json" run_rea --max-objects 20000 --max-connections 1 > "$workdir/connection-limited.json" python3 - "$workdir" <<'PYTHON' import json, pathlib, sys root = pathlib.Path(sys.argv[1]) for name in ("object-limited", "full-budget", "connection-limited"): evidence = json.loads((root / (name + ".json")).read_text()) print(name, evidence["parameters"]) for facet in evidence["normalized_result"]["graph"]["coverage"]: print(facet["facet"], facet["status"], facet["reason"], facet["examined"], facet["omitted"]) PYTHON ``` ### Expected behavior Identify the object or graph budget when it prevents connections or hierarchy links from being retained, while preserving partial coverage and unresolved endpoint evidence. Reserve a connection-budget cause for actual connection-budget truncation; no particular replacement string is required. Source contract: `AGENTS.md` (Architecture and Cleanup) requires meaningful failure reasons and preserved omission information; `docs/tool-design.md:47-69` requires useful inline coverage and reported truncation; `docs/native-investigation.md:626-632` applies partial hierarchy coverage to graph-limit omissions. CLI help distinguishes graph-object and decoded-connection budgets. ### Impact and scope The tested compiled AppKit NIB receives misleading diagnostic reasons under a caller-selected object limit. Assessment: P3, diagnostic wording. No silent completeness claim, incorrect retained connection, or consequential downstream failure was observed. The same result exposes the object budget through other facets and the unresolved edge. Raising `max_objects` to 20000 restored full coverage for this fixture; `max_connections` was already at its supported maximum. Larger archives beyond the supported object cap and real-app prevalence were not tested. ### REA version rea-agents 6.7.0; source commit `074768901f3cdc8205b61773fb1faf6f6c7b3ca8`. ### Runtime and platform Node.js v26.12.0; macOS 27.0.1 arm64; Xcode 27.1 build 27A9275; ibtool 27.1 bundle 25098. ### Target and artifact context Disposable Mach-O app bundle containing a real compiled AppKit NIB, built from `tests/conformance/interface-builder/fixture.c` and `tests/conformance/interface-builder/Main.xib`. No target application launch is claimed. ### Interface CLI ### Earliest failure stage Native analysis or reconstruction ### Relevant output or evidence For `--max-objects 1`, the effective parameters are `max_documents=64`, `max_objects=1`, `max_connections=40000`. The result retains one node and one unresolved hierarchy edge with `reason: endpoint_omitted_by_object_limit`: ```text facet status reason examined omitted objects:Contents/Resources/Main.nib partial object_limit_reached 0 8 connections:Contents/Resources/Main.nib partial connection_limit_reached 2 5 hierarchy:Contents/Resources/Main.nib partial serialized_view_hierarchy_incomplete 1 2 graph_nodes partial max_objects_reached 1 6 archive_decode complete null 1 0 ``` On the unchanged NIB, `--max-objects 20000` gives complete objects, connections and hierarchy with zero omissions; connections examined two and hierarchy examined three. Target and archive digests matched the failing run. With `--max-objects 20000 --max-connections 1`, connections correctly report `partial / connection_limit_reached`, examined one and omitted one, while hierarchy remains complete. These controls distinguish object-budget omissions from genuine connection-budget truncation. `archive_decode=complete` alone does not establish validity of every serialized hierarchy reference. ### Typed outcome or recovery expected Repeat all three cases on the same compiled fixture. The object-limited case should retain its partial statuses and omission evidence while identifying the responsible object or graph budget in both affected facets. The high-object-budget control should remain complete, and the genuine connection-budget control should continue to identify connection truncation. ### Analysis or suspected cause Source-derived corroboration at the tested commit: `src/domain/apple/interfaceBuilderGraph.ts:193-202` counts connection edges whose source nodes were omitted; lines 506-511 label that count `connection_limit_reached`. `src/artifacts/apple/InterfaceBuilderAnalysis.ts:123-127` passes the object limit into NIB hierarchy projection; its limit-triggered omissions at lines 619-621 are aggregated and forwarded at lines 181-185 and 668-681. `src/domain/apple/interfaceBuilderGraph.ts:529-533` then reports that aggregate as `serialized_view_hierarchy_incomplete`. This supports loss of the budget cause through projection, not a claim of damaged serialized bytes. ### Additional context Prepared with AI assistance and independently reproduced through the production CLI. MCP was not exercised. Freshness check against `origin/main` at `25d3805e7f29c186ab824d3b8c1292089d141a02` found no changes since the verified baseline in the cited implementation or contract files; this was a source freshness check, not a runtime rerun on that revision. Related reports were checked: #2484 addresses genuinely ownerless connectors; #3950 / #4162 address silent hierarchy loss past a parser cut; #2547 / #3156 address per-document completeness. They do not cover this compiled-NIB case where partial coverage is already present and the cause is misattributed. NIBArchive boolean polarity is a separate defect. NOT_ENOUGH_INFO: The last known good version and regression introduction have not been established.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

The connection half has progressed at d87e73f: a specific graph regression now requires object_limit_reached when omitted source nodes prevent connection retention.

The hierarchy half remains source-derived and unresolved. In the compiled-NIB producer, the hierarchy traversal increments the same omission count for the object/node ceiling, depth/cycle bounds and missing objects, then combines that with recovered/merged omissions. The graph receives an aggregate serialized-omission count and chooses serialized_view_hierarchy_incomplete before graph_limit_reached. That preserves partial coverage but cannot identify the object budget responsible for the reported case.

The native object-budget regression requires partial hierarchy and a truncated graph, but does not assert the reason. It therefore does not establish that this diagnostic requirement is fixed. I inspected these assertions; I did not execute them or reproduce the compiled-NIB run on this revision.

Closure needs the same unchanged NIB checked with low object/high connection limits, high limits, and a genuine low connection limit. Both affected facets must identify the responsible budget while retaining omission counts and unresolved endpoints; the controls must remain complete or correctly connection-limited. Preserve distinct depth/malformed-reference causes rather than relabeling all partial hierarchy as object exhaustion. No particular replacement reason string is required.

<!-- gh-comment-id:6380892051 --> @coygeek commented on GitHub (Oct 24, 2026): The connection half has progressed at `d87e73f`: a [specific graph regression](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/domain/apple/interfaceBuilderGraph.test.ts#L1272-L1302) now requires `object_limit_reached` when omitted source nodes prevent connection retention. The hierarchy half remains source-derived and unresolved. In the compiled-NIB producer, [the hierarchy traversal](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/artifacts/apple/InterfaceBuilderAnalysis.ts#L933-L1007) increments the same omission count for the object/node ceiling, depth/cycle bounds and missing objects, then combines that with recovered/merged omissions. The graph receives an aggregate serialized-omission count and [chooses serialized_view_hierarchy_incomplete before graph_limit_reached](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/domain/apple/interfaceBuilderGraph.ts#L557-L574). That preserves partial coverage but cannot identify the object budget responsible for the reported case. The [native object-budget regression](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/tests/boundary/filesystem/nibNativeHierarchy.test.ts#L170-L187) requires partial hierarchy and a truncated graph, but does not assert the reason. It therefore does not establish that this diagnostic requirement is fixed. I inspected these assertions; I did not execute them or reproduce the compiled-NIB run on this revision. Closure needs the same unchanged NIB checked with low object/high connection limits, high limits, and a genuine low connection limit. Both affected facets must identify the responsible budget while retaining omission counts and unresolved endpoints; the controls must remain complete or correctly connection-limited. Preserve distinct depth/malformed-reference causes rather than relabeling all partial hierarchy as object exhaustion. No particular replacement reason string is required.
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#3373
No description provided.