Skip to content

fix(glb): preserve JSON chunk read failures - #15181

Merged
vincentkoc merged 2 commits into
morluto:mainfrom
ShuaixinHuang:fix/artifacts-glb-read-failures
Nov 30, 2026
Merged

vincentkoc merged 2 commits into
morluto:mainfrom
ShuaixinHuang:fix/artifacts-glb-read-failures

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A read error in a valid GLB's JSON chunk was swallowed by the JSON fallback. Inventory could succeed with json_status: "invalid", no asset version and empty collection counts even though the file contained valid JSON. A valid 64-byte GLB with one mesh reproduced this when its JSON-range read rejected with EIO.

Read the chunk before entering the UTF-8/JSON interpretation catch. File I/O and exact-read coverage failures now propagate through the existing artifact failure path; successfully read malformed JSON retains its existing unknown-coverage fallback. Failed preparation publishes no metadata and can retry the unchanged file.

This is a correction to the existing offline GLB reader, with no new schema, provider, dependency, target execution or mutation authority. A maintainer scope decision is not applicable. No separate issue was opened because the real-file reproduction and regression are included here. Targeted searches found no same-root PR; #14296 and its related PRs concern malformed JSON shapes rather than source-read failures.

Verification

Linux x64, Node 24.22.1 / npm 11.21.3, based on main 97322254dd95fee5dbfb72c2cf65de61ee2e282c.

  • Both new real-file reader regressions failed before the fix: injected EIO and a zero-byte read before the admitted end resolved successfully instead of rejecting. After the fix they preserve the original I/O error or integrity / read-coverage, leave metadata unpublished, and retry successfully on the same reader.
  • 106 source tests passed across GLB/GPU/media layout and reader suites, including the existing malformed-JSON cases. The final focused run passed the two new regressions again plus eight compiled public CLI/MCP tests: 114 distinct tests total.
  • npm run check passed with explicit OXLINT_TSGOLINT_PATH=$PWD/node_modules/.bin/tsrs-lint (locked TSRS 7.1.0-beta.tsrs4). Typecheck, ordinary lint, formatting, Knip, metadata, architecture guards and production reachability completed; typed lint checked 8,655 files with zero errors and 6,391 non-failing warnings. The default Go typed-lint backend was not qualified.
  • git diff --check passed.

Read faults were injected into a real admitted FileHandle; no physical failing-storage campaign or public CLI/MCP fault injection was performed. Public boundary tests exercise ordinary inventories/extraction and malformed input. No new real-world GLB corpus or other-OS run is claimed. No advertised contract/generated documentation changed, so docs:check was not run.

Author readiness

Human owner: @ShuaixinHuang

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

@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-30T07:24:40.404435Z
We couldn’t complete this review. Comment @codex review to try again.
6aae003 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

[Low impact] The PR appears safe to merge.

Summary

The PR separates GLB JSON reads from JSON interpretation. Read errors now fail the inventory instead of producing misleading invalid-JSON facts.

  • GLB inventory now stops when its JSON chunk cannot be read.

Reviews (2) · Last reviewed commit: "chore: merge main for GLB read validatio..." · Reviewed by Greptile

* commit '91380cff6a6ce8b82b042ceb4e5013f3cc87a9d0':
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
@vincentkoc

Copy link
Copy Markdown
Collaborator

thanks! canonical review is clean: read failures keep their original meaning, while malformed JSON still gets its existing diagnostic. the branch is updated with pinned main; waiting for CI on 1b1b7d1.

Copy link
Copy Markdown
Contributor Author

@vincentkoc Thanks for reviewing and updating the branch. The required CI gate has passed on 1b1b7d1d5, and GitHub now shows the PR as clean.

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

Copy link
Copy Markdown
Collaborator

thanks! merged after clean canonical review and green CI, including all 23 selected tests. read failures retain their original classification, and failed preparation remains retryable.

vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '6053481d47c518af7de8e6a88a3579f1f95e7851':
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
vincentkoc added a commit to sandivd/rea that referenced this pull request Nov 30, 2026
* commit '5c3c1edd72453746266691deca2c7355a8df9b0d': (623 commits)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  ...

# Conflicts:
#	src/cli/cliCommandRegistrations.ts
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '11c8de1bc1c2ab922b190117e20ee48e90671db3':
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
vincentkoc added a commit to sx4im/rea that referenced this pull request Nov 30, 2026
* commit 'ba90eb225510c1342c7513754e62d1139d73f472':
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
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