Repository navigation
feat(artifacts): inspect and extract .NET single-file bundles - #3787
Conversation
…2-dotnet-single-file
…2-dotnet-single-file
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. |
[Medium impact] The follow-up changes appear safe to merge; both numbered findings are fixed and no new blocking issue remains. SummaryAdds static inspection and extraction of .NET single-file bundles through the existing CLI and MCP tools.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Native host"] --> B["Source-bound marker probe"]
B --> C["Bounded bundle manifest"]
C --> D["Stream and decode members"]
D --> E["Inventory with host and member hashes"]
E --> F["Verify host identity"]
F --> G["Write fresh owned output"]
Reviews (10) · Last reviewed commit: "fix(artifacts): explain fixed bundle lim..." · Reviewed by Greptile |
baron
left a comment
There was a problem hiding this comment.
Integration hold for reviewed head d4ac1c7: all 40 reported checks are successful and the ordinary offline bundle-extraction scope has the linked maintainer acknowledgment, but the human Author readiness declaration remains entirely unchecked while this PR is non-draft. Current main CONTRIBUTING.md (Pull request ownership and readiness) requires the human owner to complete that declaration before requesting maintainer review; CI or automated review does not substitute for it. Please have the human owner complete the declaration, or retain draft status for early feedback. This is not an attestation on their behalf or an approval. Source inspection covered the bounded manifest/member reader and inventory/extraction identity boundary; no new code defect is asserted here. Local compiled-boundary tests were not executed (the source-test runner correctly refused that project; dependency lock differs from the available installation).
Thanks for reviewing the PR and pointing out the Author readiness gap. I’ve now reviewed the final diff and relevant code, checked the validation evidence, and completed all three Author readiness declarations in the PR description. The PR is ready for initial maintainer review. |
|
TL;DR: The three named test files pass on this branch, 35 of 35 tests. The feature is new, so there is no before result for the main tests. One test on main cannot load, because the new module is missing there. ResultsI ran three test files with Node 24.18.0 on Linux. The branch's changed files sat on top of an extracted main tree. I checked each one matched the head byte for byte.
The acceptance test inspects and extracts a bundle. It goes through the public CLI and a local MCP server. It also checks the path depth limit. It ran about 10 seconds. It sets HOME to a temporary folder. Before: main has no .NET bundle code. The PR's cleanup test fails on main. It cannot find the new reader module. That is expected for a new feature. It shows nothing more. All three files use the PR's built-in synthetic bundle builder. None makes a network call. None runs Not run
The maintainer review holds this PR. The author declaration in the template is unchecked. I did not test that. It is the author's call. Thanks, Zhong-fan, for the feature and for the synthetic fixture that makes it testable without a SDK. Commandsnpm ci && npm run build && npm run test:prepare
npm run test:focused -- tests/boundary/filesystem/dotnetBundleArtifacts.test.ts tests/boundary/filesystem/ownedArtifactReaderCleanup.test.ts tests/acceptance/dotnetBundleJourney.test.tsThe focused runner rebuilt the package itself before the tests. Logs are saved with this draft. Test setup🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
…2-dotnet-single-file # Conflicts: # src/artifacts/extraction/ArtifactExtraction.ts
Problem and outcome
Closes #2352. Ordinary .NET single-file apphosts previously appeared as native files without accessible bundled members. Existing
inspect-artifact/extract-artifactand MCP equivalents now inventory and materialize PE, ELF and thin Mach-O bundles with v1.0, v2.0 or v6.0 headers, including v6 raw-DEFLATE members. No target execution, assembly loading, new provider or protection recovery is added.The host retains its whole-file digest; members retain expanded-byte identities, original stored extents and declared version/type metadata. Declarations do not establish assembly validity. Existing summary delivery and filtered/paged inventory views work with the new format, retain provenance and preserve full Evidence. Unsupported versions/flags, malformed paths/ranges/compression and resource limits fail explicitly. Universal Mach-O contents remain unexpanded.
Implementation
A bounded manifest reader and streamed member decoder use the shared artifact factory, file-source ownership, resource scopes and safe output tree. Completed marker observations follow source identity through preflight, inventory and extraction: one scan instead of three. A recognized CArchive bounds the marker search, so an embedded apphost cannot replace the outer container. Closing joins late descriptor admission and retains failed cleanup for retry. Obsolete duplicate reader dispatch/type unions and the downstream native-format repair were removed; current main formats remain supported.
Fixed input failures name the effective ceiling and its units, declare that no runtime override exists, and explain why worker memory, summary delivery and paging do not raise it. The producing artifact error owner supplies the guidance and the explicit capacity boundary to both adapters.
Executed validation
Measured costs
Paired fresh MCP processes performed initialization, named schema validation, tools discovery, open, full inspection, extraction/byte verification and close of the same compressed producer host. Two runs per reader with reversed order; warm filesystem caches, true cold-cache costs unmeasured. Tokenx estimates cover all JSON-RPC frames, including catalog, instructions, text and structured replies; these are not billed-token measurements.
Both use compact input and artifact/session families. Compact output is an existing caller option, not a new default or a reader speedup. Catalog startup dominates this small-host workflow; stronger selected-path validation adds checks and no overall speedup is claimed. All eight tasks completed below the 1.5 GiB process-family guard, with no surviving children. Native files without a marker incur one additional streaming pass, and extraction additionally hashes the whole host to bind inventory identity. A separate public CLI capacity task with 1,000 distinct deep paths refused the path-tree budget in 1.94 s / 2.50 CPU s / 341 MB peak family RSS, returned a typed
truncated/limiterror (322 estimated command/reply tokens), and left no child processes. Metadata, member expansion and path-tree budgets are documented indocs/dotnet-bundles.md.Author readiness
Human owner: @Zhong-fan
Before merge
type(scope): outcome.