Repository navigation
feat(artifacts): inspect and extract Godot PCK with retained facts - #3634
Conversation
Add a Godot Engine PCK artifact reader for standalone packs and packs embedded behind an executable trailer (formats 2 and 3). Members are uncompressed byte ranges verified against their declared MD5 on read. Encrypted directories, sparse bundles, patch removal entries, unknown flags and format 1 fail closed as unavailable; encrypted members are reported without being read. inspect-artifact and extract-artifact recognize standalone packs by their GDPC magic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The changes appear safe to merge; no new blocking issue was found. SummaryAdds static Godot PCK inventory and extraction with retained header facts, MD5 checks and selected inventory views.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open carrier] --> B[Read PCK header and directory]
B --> C{Readable bytes fit budget?}
C -->|No| D[Reject before yielding members]
C -->|Yes| E[Build retained inventory]
E --> F[Query selected historical facts]
E --> G[Verify carrier before extraction]
G --> H[Write fresh output tree]
Reviews (6) · Last reviewed commit: "fix(artifacts): bound aggregate PCK memb..." · Reviewed by Greptile |
Cap member paths at 4096 bytes and the retained directory at 64 MiB before allocation. Read members with positional chunk reads through pipeline so cancellation is typed, abandoned consumers release their source, and the shared descriptor stays reader-owned. Retain the root descriptor for godot-pck inventory, as for ZIP and universal Mach-O. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: All 18 new Godot PCK tests pass with this PR's change added to current main. So do 113 older tests nearby. On main without the change, the new test file cannot even load, because the reader does not exist yet. Thanks, 0xthearchitect, for the care in this PR. Results
The 14 files are The count of 18 matches the PR body. This is a feature, so there is no bug to show before and after. The PR diff applied to main with small line offsets (1 to 4 lines) in three files. So the neighbour tests and the typecheck ran on the merged result. Only the new test file also ran on the bare head. No test makes a real network call. The reader tests build small Godot packs in memory and in temp files. Godot Engine (MIT) is named only as the format's source. I ran no Godot software. Real CI has not run on this PR. The only check on the PR page is a code-review bot named Greptile Review, and it passed. That is not CI. One note on process. The PR body calls this a draft prototype that informs the scope decision in #3633. GitHub shows the PR as ready for review. I made no judgement on the scope decision. Not run
Test setup
Commandsexport PATH=~/.local/opt/node24/bin:$PATH npm_config_cache=/tmp/t26-1015/npm-cache TURBO_TELEMETRY_DISABLED=1
# main c7f6b8bad extracted to /tmp/t26-1015/main, dependencies installed with npm ci
# before: add only the new test file
patch -p1 -d /tmp/t26-1015/main -i /tmp/t26-1015/3634-tests.diff
npm run test:focused --prefix /tmp/t26-1015/main -- src/artifacts/GodotPckArtifactReader.test.ts
# head run: extract d8d5e86b0 to /tmp/t26-1015/p3634, npm ci, then the same one-file command
# after: add the rest of the PR diff, then run the test file and its neighbours
patch -p1 -d /tmp/t26-1015/main -i /tmp/t26-1015/3634-src.diff
npm run test:focused --prefix /tmp/t26-1015/main -- \
src/artifacts/GodotPckArtifactReader.test.ts \
src/artifacts/ArtifactPaths.test.ts \
src/artifacts/ArtifactResourceScope.test.ts \
src/artifacts/hostExecutableMarking.test.ts \
src/artifacts/MachOSliceArtifactReader.test.ts \
src/artifacts/OrderedReads.test.ts \
src/artifacts/OwnedFileHandle.test.ts \
src/artifacts/RegularFileAdmission.test.ts \
src/artifacts/ZipArtifactReader.test.ts \
src/artifacts/inventory/ArtifactGraphConstruction.test.ts \
src/artifacts/inventory/ArtifactOccurrenceIdentity.test.ts \
src/domain/analysisSnapshot.test.ts \
src/domain/artifactGraph.test.ts \
src/domain/evidence.test.ts
npm exec --prefix /tmp/t26-1015/main -- tsc -p /tmp/t26-1015/main/tsconfig.json --noEmit🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
Comments Outside DiffThese findings could not be posted inline.
|
…ansition-view Resolve the inspect_analysis_view description conflict with main's Godot PCK inventory change (morluto#3634). Keep main's rewritten inventory text and add this branch's capture_browser_scenario parent and view sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the inspect_analysis_view description conflict with morluto#3634 by keeping main's inventory wording and adding the environment-state sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Complete the original author's static Godot PCK reader with shared CLI/MCP inventory and extraction. Ordinary formats 2, 3 and 4 now retain engine/header/directory facts, verify declared MD5 through the shared integrity policy, and expose stable occurrence/content identities through selected inventory views. Refs #3633 and #3631; the broader resource/GDScript/signal work in #3631 remains open.
Use
inspect_artifact({"detail":"summary"})for a standalone active pack, theninspect_analysis_viewwith exact paths or occurrence IDs, batch content IDs and selected fields. Complete Evidence remains retained; unknown encrypted coverage never becomes a claim of absence. CLI supportsinspect-artifact PATH --detail summary --evidence_output BUNDLE --json; export never overwrites. Existing complete delivery and native target defaults remain compatible. CLI artifact inspection/extraction also locate exact embedded EOF trailers.Approach and boundaries
Executed validation
npm run check,npm run docs:check,npm run verify:test-discovery— passed on the final source tree, including generated error-schema consistency and authored skill/docs.f1535a575(formats 2/3/4 and embedded-carrier budget), using a roughly 0.32 MiB fixture declaring 275 MiB across 1,100 aliases; no amplified payload hashing/writes were run on the affected revision. After correction, all 35 reader/budget tests and 35 public CLI/MCP/ZIP/coverage tests passed. Both integrity policies reject the over-budget pack with typed truncation before extraction output exists. All 13 real corpus packs were verified again against the independent oracle.989666e8c4619bc4022903cfb58fd29d88b881a136452952a3df06b8cf99ad70.Measured completed task
The actual stdio SDK finds three exact paths in an official 5,000-unique-member PCK 3, joins their observed SHA-256/size, unlinks the owned input copy and retrieves their stable identities again. Both implementations use summary delivery and the best available batch path query; the original reader integrated with current main must read all 5,001 content nodes for the join. The follow-up selects three nodes. Both complete in 6 calls including open/close, with independent oracle, schema and provenance assertions and zero retries.
Two alternating pairs on pinned revisions, in baseline/follow-up/follow-up/baseline order:
00bedf665047fe3a84Includes staging/input hashing, discovery, advertised-schema validation, protocol envelopes, calls and teardown; build/install excluded. Actual model/host-rendered tokens are unmeasured. Fresh processes and analysis caches, two CPUs, bounded heaps, disabled Node compile caches, 20 ms process-family memory sampling; OS cache and host load uncontrolled. Runtime and RSS varied between earlier probes, so no general speed or memory improvement is claimed. Cold analysis, first retained view and warm retained queries are recorded separately; warm reads after source removal are historical facts, not current filesystem claims.
The final resource-bound tree passed the complete SDK task again: 23,492 / 240,960 / 1,006,151 tokenx estimates respectively, 18.07 s elapsed, 19.74 s CPU and 1081 MiB sampled peak RSS. The paired table pins its earlier revisions; this final probe covers the atomic-root compatibility and aggregate expansion corrections.
Remaining verification limits
Real corpus/SDK verification ran on Linux. PCK 1, signed/section-only embedded discovery, patch/removal entries and encrypted contents are unsupported. Sparse-bundle unknown coverage has synthetic tests; real sparse producers and shipped PE/Mach-O embedded games were not verified. Complete Evidence preserves the observed header/directory facts and limitations; it is not a retained copy of every source payload.
Author readiness
Human owner: @gensokyo-dev
The repository operator explicitly delegated these declarations and authorized ready review, CI follow-up and normal merge in this session. Codex reviewed the final diff and executed evidence; independent human review was not observed. Original author commits remain in this PR's history.