Repository navigation
Add a local asset viewer and reusable parts index (ASSET-375) - #4763
whattheflop wants to merge 18 commits into
Conversation
(cherry picked from commit 387a5517297b36709635e6ac94aae2035d5e6c79)
(cherry picked from commit dbb1428e713afc39c48eb656b99e2161bcdea48b)
--window-mib exports large archives (levels.rpf by default) as consecutive rpf9dump --start/--length windows, converts and publishes each, checkpoints completed windows in the catalog folder and releases only that window's OBJ staging afterwards. Defaults and the whole-file path are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> (cherry picked from commit d25d5ac79107ecbd36c5cd17a26f44684eb76f8a)
…ging release Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> (cherry picked from commit 5c41cc963b26eff3eb9a7da3d111d4b4a3d5d627)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Index existing drawable, placement and texture exports in SQLite. Preserve scan coverage, model and texture ambiguity, and committed window GLB references for later assembly. AI-assisted (Codex). Verified with synthetic CPU tests on Python 3.12.13. (cherry picked from commit ae2d9b7333956c78f724be808834fcc312b8fd8c)
|
Tested head PR test files
Repo checks
One failure found —
Red control
Not covered
AI-assisted (Devin.) |
|
Thanks for the Windows verification. Confirmed that the example failed both CLI flag assertions. Updated it in |
kacper-serewis
left a comment
There was a problem hiding this comment.
ASSET-375 independent Windows CPU check at 66c8895. Repeat import of one cached retail export and placement file produced a byte-identical SQLite index and preserved all 1,438 catalog GLB hashes and timestamps. Of 75,551 placements, 1,488 joined uniquely and 74,063 remained unresolved. No ambiguous matches occurred. All 36,355 texture references were unresolved with these inputs. AI-assisted, no archive scan or GPU.
|
Tested 66c8895 merged with main 594f348 on Linux WSL2 (Python 3.12.16, node 22.23.5) and native Windows 11 (Python 3.13.1, node): pass
|
|
Small follow-up in |
|
Tested
|
|
Tested on Windows Server 2022, CPython 3.13.12: partial
The failures look like the same Windows path-resolution class as test_fuzzer_work_isolation on main (8.3 short temp paths like ADMINI~1 not comparing equal to the long form) - worth checking with the resolved-path comparison that #4805 uses.
|
|
Merged round-44 main Windows, uv CPython 3.12.13 and Node 24. The catalog passed 16/16, parts index 6/6, stdout guard 4/4, docs 33/33, server 40 with 3 Windows skips, and First Light 60 with 8 skips. Viewer Assets and Studio passed 13/13. Streaming passed 56/57. The same camera-speed fixture fails on pinned main with |
|
I reproduced all four Windows Server review failures using a real NTFS 8.3 alias for a disposable temporary directory. Fixed in With uv CPython 3.12.13 on Windows, catalog 16/16 and parts index 6/6 passed with both the default temp path and an actual short alias. Server passed 40 with 3 Windows skips, docs 33/33, and stdout checks 4/4. CPython 3.13 was unavailable on this machine. AI-assisted, synthetic inputs. |
|
Tested |
|
Tested 0e4f3d1 merged with main 8575d36 on Linux WSL2 (Python 3.12.16 -I, node 22): pass |
|
AI-assisted Windows retest after merging upstream dde82f2 into 67b006f. The single argument-parsing conflict retained the upstream coverage range check and both PNG guards. On uv CPython 3.12.13, catalog (16), parts index (6), First Light mesh (8), and ordinary viewer routes (4) passed. Both coverage boundaries passed and all eight invalid CLI combinations were rejected. On Node 24, Assets (10) and Studio (9) passed. Broader streaming, stdout and docs checks reproduced their baseline failures on the same upstream revision. |
|
AI-assisted independent Linux check of I also ran As a failure control, a malformed synthetic manifest exited 2; the digest of the last successful database stayed identical and the output directory contained only |
|
Windows counterpart to the Linux replacement check above, AI-assisted. At |
isfcrctfs
left a comment
There was a problem hiding this comment.
I read the new tools and the server changes, then ran the touched suites:
tests/test_viewer_serve.py, tests/test_viewer_catalog.py, tests/test_viewer_parts_index.py,
tests/test_first_light_mesh_draw.py and node tests/test_viewer_assets.cjs - all pass.
The new local-HTTP surface is guarded properly. viewer/serve.py still binds 127.0.0.1 only and keeps the Host
allow-list, and /catalog/ goes through safe_catalog_path + _safe_root_path: unquote(errors="strict"), no backslash
or control characters, no trailing dot or space, no empty/./../:/reserved-device segments, the resolved real path must
stay under the catalog root with the same extension, and catalog.json must be the literal, non-symlinked path. send_head
is the enforcement point so HEAD is covered; translate_path returns the same resolved path (the tests assert the two
agree); handle() now swallows the three broken-connection errors a cancelled chunk download causes.
Adversarial check of the guard. I called safe_catalog_path/safe_world_path directly with 28 payloads - ../,
..%2f, %2e%2e, sub/../../, %00, CRLF, C:, C:%5C, ::$DATA, NUL.glb, trailing . and space, //etc/passwd,
%2Fetc%2Fpasswd, a .gif, a symlink out of the root, a symlinked directory, a plain directory, and the legitimate names.
Every hostile form returned None; only the four legitimate names resolved.
Write safety. viewer_catalog.py invokes the exporter with an argument list (no shell), refuses an --out/--work
that overlaps the checkout or any input root, and routes every write through safe_destination + atomic_write.
viewer_parts_index.py refuses an --out inside the repo or any input root, and replaces the database only on success.
assets.js has no innerHTML/eval; catalog paths are validated per segment then URL-encoded, and fetches use
redirect: "error", so a GLB cannot pull a sidecar. Doc claims I checked against the code hold: --exports and
<work>/assets discovery, the per-archive headroom table, the window staging/checkpoint flow, retain_window's
manifest-then-catalog-map.json ordering and digest, and the "no failed rows in a checkpointed window" rule.
No defect found. One pre-existing note, not from this PR: assets.html loads three from cdn.jsdelivr.net through an
import map, exactly as index.html already does, so the local viewer still needs network for the 3D view.
AI-assisted
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
Claimed in the coordination issue as the local viewer catalog and ASSET-375.
What and why
first_light's translated Vulkan draw.Tested
2def9444against upstream98fa503f. Six parts-index, 16 catalog, seven First Light mesh, and 40 viewer-server tests passed with three Windows server skips. All 60 Node viewer tests passed. The game-data check andgit diff --checkpassed.AI-assisted: yes.
Checklist