Repository navigation
feat(artifacts): select extraction entries and output destination - #4031
Conversation
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. |
[Medium impact] The reviewed changes appear safe to merge; no blocking issue remains. SummaryAdds exact occurrence selection and caller-chosen extraction destinations through CLI and MCP. The latest revision advertises the existing uniqueness rule and adds public-schema coverage.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
CLI[CLI options] --> Contract[Shared extraction contract]
MCP[MCP inputs] --> Contract
Contract --> Inventory[Full inventory and integrity checks]
Inventory --> Selection[Select active-reader occurrences]
Selection --> Verify[Match entries and verify selected bytes]
Verify --> Output[SafeOutputTree]
Output --> Success[Commit files and return manifest]
Output --> Failure[Roll back owned output on failure]
Reviews (7) · Last reviewed commit: "fix(contracts): advertise unique extract..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d2920e2e4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Integrate current main while preserving ordered ZIP occurrence selection, rejecting colliding selected destinations, and using SafeOutputTree canonical output-root semantics. Mark occurrence and destination fields optional in the CLI contract and update directory fixtures to the admitted-source contract. Cover CLI/MCP acceptance, duplicate paths, symlink parents, and rollback behavior.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Validate complete reader inventory independently from collisions among selected output entries. Use occurrence-parent ownership instead of filename prefixes so independently owned PyInstaller entries remain selectable while nested-reader members remain refused. Validate advertised MCP schemas through the shared acceptance helper and add real PyInstaller/ASAR and excluded-entry regressions.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Merge upstream main while preserving occurrence-based selection and caller-selected destinations. Keep UnityFS and wxapkg directory-status refusals before selection, and cover UnityFS refusal and absent output through both MCP schema profiles.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Reuse the shared host-absolute local path schema instead of an opaque refinement so SDK-converted JSON Schema preserves the runtime constraint. Extend the advertised-path and MCP-handler regression matrix for extract_artifact.output_root.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Maintainer-side automated verification of head 204766d9d combined with main fb453f293 (including the newly merged pseudocode paging), on Linux x64 / Node 24.22.1 / npm 11.16.0. No additional implementation changes were needed.
- 91 tests passed across 12 files: selection/destination contracts, public CLI/stdio MCP, absolute advertised path schemas, UnityFS refusals, completeness, source identity/admission, cancellation and output ownership. This includes the 17 source tests, 44 first public/provider boundary tests and 30 additional integrity/cancellation cases; no test allowance was weakened.
- Full source typecheck passed (one checker, 1536M soft target). Focused syntax lint of all changed TS files passed;
npm run docs:checkpassed, including 9 README consistency tests. Runtime compilation passed. - Real installed Apache Commons CLI 1.5.0 JAR
/usr/share/java/commons-cli.jar, SHA-256f990941be47ddb0895a3e4b0532bca9e1338db28a075119485efb15b6b59b973: requested an inventory summary, selected one exact path with field projection, then extracted onlyorg/apache/commons/cli/CommandLine.class. Its 7,026 bytes matched Python's independent ZIP reader (SHA-256982cb7617cfc22a99c97b18db981de2bc522a8c2234ead14239f4f19281e12dd). CLI/MCP artifact lists and selection manifests matched. Output remained readable after close; input digest remained unchanged. No target code was executed. - Selected CLI extraction returned 1 artifact / 3,521 JSON bytes in 2.065s; the all-files control returned 32 / 13,441 bytes in 2.266s. These are warm-cache illustrative runs, not a controlled speedup or model-token comparison. Both still validate the complete inventory. The whole verification (SDK discovery/validation, summary, projected occurrence, MCP extraction/close and both CLI controls) completed in 13.073s; wait-accounted user/system CPU 13.843/1.291s, sampled peak process-family RSS 1.28 GiB (200ms sampling, shared pages counted per process, short peaks may be missed). First view SDK preparation dominated about 4.24s.
Checks used two-CPU affinity and a 4 GiB family RSS guard; no guard stop occurred in this extraction verification. The build/public-boundary invocation peaked at 1.78 GiB. The earlier full-repository lint resource limit remains documented in the PR; focused lint is not a full local lint claim. Real Windows filesystem behavior and the original third-party APK were not rerun here. Existing review threads were already resolved. Full original-head CI is newly approved and still pending; original human author declarations are preserved, not re-attested by this automated review.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Maintainer-side automated follow-up on 29bc1d4: fixed the confirmed PR-owned CLI help failure by retaining canonical output_root metadata when adapting its optional wrapper. The unchanged global CLI help test failed before and passes after; both new extraction flags have descriptions. Final help/SDK/selection regressions (7), real Commons CLI JAR byte comparison and CLI/MCP parity, typecheck, focused lint, formatting and docs checks passed. Original 91-case integrity/lifecycle integration coverage is recorded in the current body. Latest main808491685 was synchronized; that sync changes evaluation docs/scripts only, not extraction runtime. Old failed-head CI was cancelled and final-head CI is newly approved. Existing author declarations are preserved; this is automated verification, not a human-readiness attestation.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Maintainer-side automated verification of 9ccb372: both confirmed PR-owned defects are corrected at their owners. CLI optional adaptation preserves canonical metadata; the canonical occurrence array advertises uniqueItems while retaining runtime refinement. Before/after public full-profile SDK validation proves the uniqueItems fix, with positive distinct-ID controls and runtime duplicate rejection before output creation. The 38-case selection/help/schema group, final acceptance controls, typecheck, lint, docs and real installed-JAR CLI/MCP byte-parity verification passed. The current body records corrected baseline-subtracted CPU accounting and meaningful local/Windows limits. Final-head CI is newly approved and pending; this review is automated and preserves the original human author declarations.
Summary
Fixes #3490.
extract_artifactcan extract exact inventory occurrences into a caller-selected, absent absolute destination. CLI adds--output-rootand repeatable--occurrence-id; MCP usesoutput_rootandoccurrence_ids. Omitting both keeps all-file extraction into a fresh temporary directory. Published files persist after session close.Selection uses occurrence identity, including independently selectable identical-content entries. The active reader's complete inventory remains separate from the requested output: unknown/duplicate/empty IDs, nested-reader members, links, unsafe paths and selected destination collisions are refused before publication. Full source-integrity checks, hashes, exclusive output ownership and rollback remain in force. Output inside a source directory, including symlink aliases, is refused.
Implementation and integration
ArtifactExtractionSelectionowns reader membership and selection;ArtifactExtractionverifies and materializes it;SafeOutputTreeowns destination admission and cleanup. CLI/MCP share these owners and named contracts.output_rootuses the shared absolute-local-path schema, including after SDK conversion. No provider, dependency, target execution, instrumentation or protection-recovery expansion; writes are ordinary extraction output within existing authority.Head
9ccb372a5includes main808491685. The previous CI shard 8 found one PR-owned defect: adaptingoutput_rootwithunwrap().optional()discarded the owning contract's description. The CLI adapter now preserves that metadata; the existing whole-CLI help regression failed before and passes after. No duplicate description, test waiver or unrelated repair was added. Automatic review also confirmed that the runtime-only uniqueness refinement was absent from the advertised input schema. The canonical array now carriesuniqueItems: true, following the managed selection contract. A full-profile public SDK schema regression failed before this correction and passes after: one/two distinct IDs are valid, repeated IDs fail theuniqueItemskeyword, and runtime duplicate-ID calls leave no output directory. The sibling occurrence option already had its repeatable-flag description. Obsolete failed-head CI was cancelled after its failure log was retained.Executed validation
Linux x64, Node 24.22.1 / npm 11.16.0:
git diff --checkpassed.npm run docs:checkpassed after the fix and latest-main sync, including 9 README tests. The last sync added only main's evaluation docs/scripts; extraction runtime source did not change after these checks./usr/share/java/commons-cli.jar(SHA-256f990941be47ddb0895a3e4b0532bca9e1338db28a075119485efb15b6b59b973): inspect summary → exact-path/field-projected occurrence → selected extraction. The 7,026-byteCommandLine.classmatched Python's independent ZIP reader (982cb7617cfc22a99c97b18db981de2bc522a8c2234ead14239f4f19281e12dd). CLI/MCP artifact lists and selection manifests matched, the file survivedclose_binary, and the input digest remained unchanged. Neither Java classes nor target applications were executed. This real workflow was repeated after the help fix.The final selected/all CLI controls returned 1/32 files, 3,521/13,441 JSON bytes, in 1.719/1.867s. Full input inventory/integrity is still checked. These warm-cache illustrative runs do not establish a speedup or model-token saving. The complete final SDK+MCP+CLI workflow took 10.842s, with 11.695/1.037s task-process user/system CPU delta and 1.28 GiB sampled family RSS (200ms samples, shared pages counted per process; short peaks can be missed). SDK first-view schema preparation remains part of that cost.
CPU accounting was corrected to subtract initial
RUSAGE_CHILDRENcounters: a shell can exec-replace its last command and pass earlier child CPU into the profiler process. A control with preceding CPU work and/bin/truereproduced the nonzero baseline and near-zero task delta. This final rerun started with 78.312/7.093s inherited CPU, which was subtracted. Earlier raw CPU totals in the review history are not attributable task deltas; their elapsed/RSS observations are unaffected. CPU here excludes profiler overhead.Local checks used two-CPU affinity and a 4-GiB sampled family RSS guard; no extraction verification hit it. Build/public-boundary peak was 1.78 GiB. Full local lint was not completed: earlier full-repository attempts exceeded the guard; focused lint is not a full gate. Local hooks were disabled for the synchronized push after the explicit checks above. Final-head CI 42089893879 passed, including all 8 test shards,
Static checks,Portable testsandCI required; normal squash merge completed atad518cff65cc71564f678b26bcae4a3862689ad4without bypass. Real Windows filesystem behavior, the original third-party APK and other providers were not newly verified. Earlier PR-history checks belong to their pinned revisions. Existing human declarations below are preserved.Author readiness
Human owner: @jsk1004ha