Skip to content

fix(artifacts): bound embedded GLB images by the declared buffer length - #15207

Merged
vincentkoc merged 1 commit into
morluto:mainfrom
xu91102:codex/glb-logical-image-range
Nov 30, 2026
Merged

vincentkoc merged 1 commit into
morluto:mainfrom
xu91102:codex/glb-logical-image-range

Conversation

@xu91102

@xu91102 xu91102 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Embedded image regions now have to fit both the logical glTF buffer and its physical BIN chunk. The chunk remains available in full, including alignment padding.

Problem and expected behavior

A valid 69-byte PNG occupies a buffer of 69 bytes, stored in a 72-byte BIN chunk. On the base commit, adding an image view that overlaps the last three bytes can create a second verified image and report complete coverage. Khronos glTF Validator reports BUFFER_VIEW_TOO_LONG at the offending view. The corrected inventory retains the first PNG with its original SHA-256, omits the out-of-range view and reports unknown coverage.

Contract and boundary impact

The existing GLB layout reader uses the smaller of the declared buffer length and the physical chunk length before handing a view to the shared region inventory. An unavailable length leaves that view unresolved. URI-backed image handling, chunk enumeration and physical-file extent checks retain their original owners. This is a correction to the existing read-only file inventory used by the CLI and MCP. The relevant existing implementations were checked in #14248, #14297, #14340, #15150 and #15181 and on the latest main. The contribution adds no provider or execution capability.

What should REA do?

  • Read existing files or captured data.

Evidence and regression coverage

  • On 11c8de1, the new unit cases failed against the original implementation. The public CLI reproduced the same behavior on c91c504.
  • 69-byte image, 72-byte BIN, second view entering padding: base lists both images / complete; fixed lists only images/0.png / unknown. The original 72 bytes remain in chunks/1.bin.
  • Khronos glTF Validator 2.0.0-dev.3.10 verified the valid-file control and reported the out-of-bounds views. The four files cover a view ending exactly at the logical end, partial and whole padding, and a view extending past the BIN.
  • Across 4 immutable inputs, the compiled CLI and a real stdio MCP session agreed on the relevant structured metadata, region bytes and content hashes (12 total MCP calls including opens and closes).

Validation performed

  • Seven related test files passed 94 tests. The independent README check passed 8 more.
  • npm run check, docs:check, verify:test-discovery and npm pack --dry-run passed. An isolated installation of the actual tarball reproduced the source results for 4 CLI samples and 12 stdio MCP calls. The full generic installation and update verifier also passed.

Compatibility, safety, and release

Existing command, tool and metadata schemas are preserved. File inventory, region lengths and hashes were exercised on macOS. GUI model import, GPU rendering, other host operating systems and performance were outside this run.

Author readiness

Human owner: @xu91102

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

Author checklist (completed by the PR author before requesting review)

  • 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.
  • I ran every test, build, or measurement needed to validate this change, reported a browser, GPU, or environment gap only when that runtime or hardware is unavailable, and reported the checks I ran and their results without presenting inferred correctness or speedups as measured.
  • Comments explain constraints or non-obvious decisions; task history and conversations stay out of code and docs.
  • Documentation is concise and factual, without punchy slogans or promotional language.
  • This change fixes the root cause and follows the engineering rules in AGENTS.md.
  • Formatted input is interpreted once at the owning boundary, and consumers use the owner's parsed facts. See Interpret boundary facts once.
  • Combined failures preserve partial observations, remaining resources, and cleanup facts. See Own the lifecycle.
  • A hardcoded limit is an REA_ runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-30T10:09:33.450039Z
We couldn’t complete this review. Comment @codex review to try again.
eb1de93 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Embedded GLB images must now fit both buffers[0].byteLength and the BIN chunk.

  • GLB image regions stop at the declared buffer boundary.

Reviews (1) · Last reviewed commit: "fix(artifacts): bound GLB embedded image..." · Reviewed by Greptile

@vincentkoc
vincentkoc merged commit 177e26e into morluto:main Nov 30, 2026
40 checks passed
@vincentkoc

Copy link
Copy Markdown
Collaborator

Thanks, merged! Logical buffer bounds now preserve the raw BIN padding. All 23 selected tests and CI passed.

vincentkoc added a commit to xu91102/rea that referenced this pull request Nov 30, 2026
* commit '81657ccedea257a7138c11908a4681dc5986eca3':
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  fix(artifacts): classify member presence from the absent side coverage (morluto#15200)
  fix(tar): account for retained pax owner names (morluto#15195)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
…5210-evidence-completion

* commit 'acce96912d7bf048f9a5499ecd960c370062306f':
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
…5219-evidence-inspection

* commit 'd0694fb5b7d8426d7c776f6ecc904f8e03839976':
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
vincentkoc added a commit to 2SinceJuly/rea that referenced this pull request Nov 30, 2026
…180-warc-archive

* commit '5f15fdf457a890a149cbe574cce96e32422c1904': (206 commits)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  fix(artifacts): classify member presence from the absent side coverage (morluto#15200)
  fix(tar): account for retained pax owner names (morluto#15195)
  fix(conformance): validate paired fixture count expectations (morluto#14125)
  ...
vincentkoc added a commit to 2SinceJuly/rea that referenced this pull request Nov 30, 2026
…186-evtx-archive

* commit '5f15fdf457a890a149cbe574cce96e32422c1904': (89 commits)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  fix(artifacts): classify member presence from the absent side coverage (morluto#15200)
  fix(tar): account for retained pax owner names (morluto#15195)
  fix(conformance): validate paired fixture count expectations (morluto#14125)
  ...
vincentkoc added a commit to Afloat16/rea that referenced this pull request Nov 30, 2026
…4075-env-argv0

* commit 'aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8': (738 commits)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  ...
vincentkoc added a commit to 2SinceJuly/rea that referenced this pull request Nov 30, 2026
…0374-skill-guidance

* commit 'aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8': (3508 commits)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  ...
vincentkoc added a commit to Afloat16/rea that referenced this pull request Nov 30, 2026
…063-native-alias-cancellation

* commit 'aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8': (881 commits)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  ...
vincentkoc added a commit to Afloat16/rea that referenced this pull request Nov 30, 2026
…279-mcp-config-validation

* commit 'aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8': (2392 commits)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants