Repository navigation
fix(vsix): gate the packaged VSIX inventory against workspace build output (port from ripr#1774) - #4218
Conversation
Since #1690 the `cargo xtask` alias builds into a cwd-relative `target/xtask-driver` with `build.build-dir='target'`. `npm run compile` runs `cargo xtask vscode-compile` from editors/vscode, so a clean checkout ends up with editors/vscode/target/, and both `npm run package` and publish-extension.yml's `vsce package` pack it. Measured on the 0.11.0 trial join: 725 MB VSIX with 2805 files (2.3 GB of debug build output) before, 781 KB with 412 files after. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE (cherry picked from commit c07935dc8300c3e68d93d9e09f9fb37d774d42a9)
…utput Port of the ripr#1774 gate (ripr 0fead8036), adapted to swarm's `vscode_package`, which has no package receipt: after `vsce package`, xtask reads the real archive entries and fails when any entry is workspace build output (extension/target/, Cargo .fingerprint or incremental state, .rlib/.rmeta) or when the package exceeds 1,500 entries or 64 MiB unpacked. It prints the entry count and unpacked size. Local proof: the real package passes (409 entries, 2.9 MB unpacked); dropping the `target/**` rule with an editors/vscode/target sentinel present fails packaging and names the sentinel. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
Tests that spawn the binary resolve a pre-built target/debug/ripr, and cargo llvm-cov builds into its own target directory, so the documented local coverage sequences need `cargo build -p ripr` first, matching .github/workflows/coverage.yml. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE (cherry picked from commit f0108c62dc3d6e835152b102cf9d5cd6cf1573ca)
… gate Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This reverts commit 017e431.
The .vscodeignore target/** rule lands through ripr-swarm#4219. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
#4218 owns the VSIX build-output exclusion and its gate; carrying the same line here would conflict when both land. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW
|
Update: the fix is #4222 (client only, green Generated by Claude Code |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ackages Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
vscode_package now calls verify_packaged_vsix_inventory, which the sentinel test exercises on the clean and polluted archives. Skipping the bounds check inside it fails that test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE
Since #3938 the server anchors `> file` redirect targets at the resolved `--root`, so for `--root .` the packet, brief, after-snapshot and verify commands end in `> <cwd>/<artifact>`. Add `redirectTargetMatches`, which mirrors the server's `shell_arg` quoting and accepts only the legacy relative artifact or that artifact under a given root, plus a controller test that feeds the anchored form. The controller is not wired to the helper yet, so the anchored test fails on this commit by design. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdEuTL3iZySyG5F2FGAfzY (cherry picked from commit 02ada14)
The packet, brief, after-snapshot and verify contracts required the fixed text `> target/ripr/...`, so after #3938 anchored the redirect at the server's cwd every copy was refused. Those contracts now check the redirect tail with `redirectTargetMatches` against the session workspace root and its realpath (the server reads its cwd back from the OS, which resolves symlinks), and run the `includes` checks on the part before the redirect. A different root, file, `..` segment or trailing token is still refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdEuTL3iZySyG5F2FGAfzY (cherry picked from commit f6c275f)
`validatedAgentLoopCommand` split at the last ` > `, so `... --json > other > <root>/<artifact>` passed and would truncate `other`. Refuse any `>` before the checked redirect, and add that case to the anchored controller test's negatives. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdEuTL3iZySyG5F2FGAfzY (cherry picked from commit 25e7a50)
There was a problem hiding this comment.
Exact-head review (author self-review, so COMMENT).
reviewed_head_sha: 924ea0631d64e266cbf3a976c6912cbaf98e1cb9
integration_basis: main e4da2d4fc (#4222 merged). Read-only trial merge (git merge-tree) is clean, tree d9f51695a. The squash result differs from main only in CHANGELOG.md, docs/CI.md, docs/ci/coverage.md, xtask/src/main.rs and xtask/src/tests.rs. The ported #4222 commits match main byte for byte and drop out, so no base merge is needed.
claim_boundary: `cargo xtask vscode-package` rejects a VSIX that carries workspace build output or exceeds 1,500 entries or 64 MiB unpacked. Coverage docs match coverage.yml. Non-claims: published marketplace bytes (#1646), the ignore rule (#4219), Windows packaging (ripr#1775 control 4).
changed_surfaces_and_semantic_owners_inspected: vscode_package (the only owner; `npm run package` and the ci.yml `vscode` job call it), verify_packaged_vsix_inventory, read_vsix_inventory, check_vsix_inventory, is_workspace_build_output, the bounds, 4 tests; CHANGELOG Unreleased/Fixed; docs/CI.md and docs/ci/coverage.md against .github/workflows/coverage.yml (`cargo build -p ripr` before llvm-cov, matching).
blocking_findings: none.
non_blocking_suggestions:
1. The doc comment on check_vsix_inventory says the `cargo xtask` alias builds into a cwd-relative target dir. That is source-repo behaviour (ripr#1690), which reaches swarm only through J. Today it describes the post-J state. It is accurate once J lands, so it stays as is.
2. `sum::<u64>()` over member sizes could overflow in a debug build on a crafted zip64 archive. The input is the VSIX this command just built, so this is not reachable in practice.
refuted_or_stale_findings: ripr#1774's closing note says the gate "depends on source-only packaging code". The call site in this PR shows otherwise.
proof_and_ci_observed:
- hosted `vscode` job (run 36300423688) green, printing `VSIX inventory: 409 entries, 2945576 bytes unpacked` after `npm run compile` + `npm run package`, then e2e passing with the #4222 fix;
- Rust gates, Ripr Rust Small Result, rust-tests-junit, rust-coverage, codecov/patch 93.15% (target 89.06%), msrv, future-clippy, Perl and release proof, cargo-deny, dependency-review, ub-review, GitGuardian all green on this head.
- Local: 4 vsix_inventory tests pass. Mutation: skipping the bounds check inside verify_packaged_vsix_inventory fails the sentinel test ("vscode-package must reject the polluted VSIX"). Real package with editors/vscode/target sentinel and no ignore rule exits 1 naming the sentinel. clippy -D warnings and precommit exit 0.
proof_or_review_missing: windows-advisory still running (advisory; the code is platform-neutral zip reading). External review missing: CodeRabbit skipped (bot author), droid skipped, no Codex review on a draft.
affected_currentness_dimensions: all bound to 924ea0631.
residual_assumptions_and_non_claims: the bounds assume the 0.11 package size (409 entries, about 3 MB). A legitimate growth past 1,500 entries or 64 MiB would fail packaging and need the bound raised on purpose.
disposition: REVIEW_READY
Generated by Claude Code
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- xtask/src/main.rs:1456 — check_vsix_inventory's build-output filter matches any path segment named
.fingerprintorincremental, so a legitimate dependency directory such asextension/node_modules/some-pkg/incremental/cachewould be rejected if it ever shipped. The 0.11 inventory contains no such node_modules subdir, but the heuristic could over-fire once a dep adds one.
Verification questions
- Confirm is_workspace_build_output has no negative test for a path that only contains 'target' as a non-leading segment (e.g. extension/targets/x.js or node_modules/@scope/target/lib.js). Current tests cover extension/target/, .fingerprint, incremental, .rlib, .rmeta, and a node_modules/dep/target/ allow, but not a bare 'targets' sibling.
- Confirm extension.test.ts anchored redirect test only asserts on clipboardWrites equality; it does not cover a redirect whose path uses a realpath that diverges from fs.realpath(workspaceRoot) but matches one of the contract roots — i.e. the symlink-resolved branch of agentLoopRedirectRoots is asserted in redirectTargetMatches unit, not in the integration assertion.
Refuted
- Test suite doesn't distinguish old from new behavior because vscode-package didn't have inventory checking before, so no prior test could have caught the #1775 defect.; refuted because: False premise: xtask tests.rs has 4 new named tests (vsix_inventory_rejects_workspace_build_output_sentinel, _rejects_cargo_artifacts_outside_target, _fails_closed_on_missing_or_non_zip_package, _bounds_entry_count_and_unpacked_size) that target the new functions directly. The sentinel test reproduces the exact failure mode (extension/target/) and asserts both red (rejected) and green (clean accepted with production summary format) outcomes, which is precisely the old-vs-new distinction.
- Published marketplace bytes could be gated by this PR; refuted because: publish-extension.yml uses raw
npx @vscode/vsce packageoutside xtask vscode_package; PR body and claim boundary explicitly disclaim #1646. Scope matches stated non-claim. - vsix_inventory_fails_closed_on_missing_or_non_zip_package test is dishonest —
by_index_rawwould have failed earlier on archive open, so the member-0 path is unreachable in practice; refuted because: False premise. The test deliberately constructs a corrupt-member archive by writing a valid zip then overwriting bytes[0..2] withXX, which keeps the central directory parseable onZipArchive::newbut breaks the local file header read atby_index_raw(0). That exercises thefailed to read {} member {index}error path exactly. The hypothesis that the path is unreachable ignores the local-header-vs-central-directory divergence.
Parked follow-ups
- codecov[bot] reports 5 missing lines in xtask/src/main.rs on this PR; the added vsix_inventory_* tests exercise read_vsix_inventory + check_vsix_inventory + verify_packaged_vsix_inventory, and is_workspace_build_output is the only branch in the new code that may not be fully covered (single positive + four targeted negatives cover the predicates, but the order of checks inside check_vsix_inventory is not branching past the build-output short-circuit). Acceptable as a non-blocking coverage-watch item, not a red/green gap.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…join runbook (#3921) (#4241) * docs(0.11): record path A non-claims in release notes, checklist and join runbook (#3921) Release notes: eleven visible non-claims, each tied to its owner and a removal trigger. The loudest is new: the repair transaction runs no project tests, and a receipt can say improved for a test that fails cargo test (#3797 Stage A, control 6). Cut checklist: a path A ledger (0.6) with dates and eighteen deferral rows, section notes where path A reduces or skips a stage, and the post-J list of pre-publication copy to flip. Join runbook: the 2026-09-27 trial (53 paths), the 2026-10-01 deadline, and how to resolve the publication workflows without re-applying #4218/#4219. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYyUnjaq9zD4WsBujWEUpk * docs(0.11): move the ledger to path A+ with rc.1 on 09-28 (#3921) Steven's 07:04Z target, RC-ready by 2026-09-28, puts one RC before stable: freeze Monday 06:00Z, J and rc.1 Monday, stable Wednesday. Weekdays were off by one. Adds the #3926 observed-runtime record, marks the project-tests row conditional on its fix thread, and documents later syncs (J2, J3). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYyUnjaq9zD4WsBujWEUpk * docs(0.11): rewrap release-notes comment lines (#3921) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYyUnjaq9zD4WsBujWEUpk --------- Co-authored-by: Claude <noreply@anthropic.com>
…tch (#4219) * ci(release): publish the extension only by explicit per-channel dispatch A pushed v* tag in the source repository starts publish-extension.yml, which then published to both marketplaces by default and could create or --clobber the GitHub Release in parallel with the server workflow. The release authority (docs/RELEASE_TRANSACTION.md) already creates the Release first and dispatches each channel explicitly, twice for the two marketplaces. This lands in swarm so it reaches source through the 0.11 join rather than as a source-only PR. - Drop the `push: tags: v*` trigger from publish-extension.yml. - Marketplace inputs default to "false"; each job runs only on 'true'. - Attach the VSIX to the existing Release only: never create it and never replace an attached asset, so the second marketplace dispatch keeps the first VSIX. - .vscodeignore excludes target/** so Cargo output under the extension (ripr's cwd-relative xtask target dir, ripr#1690) is never packaged. - docs/RELEASE.md: pushing the tag publishes nothing by itself. - xtask test release_workflows_publish_only_by_explicit_dispatch pins the trigger, defaults, gating and no-clobber rules for both release workflows; main's publish-extension.yml fails it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW * fix(release): leave .vscodeignore to ripr-swarm#4218 #4218 owns the VSIX build-output exclusion and its gate; carrying the same line here would conflict when both land. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW * fix(release): pass the release ref through env and tighten the dispatch test Applies the four CodeRabbit findings raised on the identical ripr#1776: - attach step reads the tag from RELEASE_REF instead of expanding github.ref_name into the script (zizmor template-injection); - RELEASE.md recovery command dispatches on the tag with one marketplace input set, since both now default to false; - the test parses the on: block and requires exactly workflow_dispatch, so inline 'on: push' or an added push/schedule trigger fails; - each input's default is read from its own mapping only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW * fix(vsix): restore .vscodeignore target/** exclusion ripr-swarm#4218 dropped the same line to avoid a rival at the same time this PR did; #4219 is its only carrier. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW * fix(release): admit exactly one channel and attach by version, not ref Codex review on #4219: - admit-dispatch fails closed unless exactly one marketplace input is true and version is a release version; package, server-assets-ready and attach-release-asset need it, so zero or two channels touch nothing; - attach-release-asset names the Release as v<version> from the version input instead of the execution ref, so a fix-forward dispatch from a branch still attaches to the original Release; - RELEASE.md recovery command passes both inputs and explains --ref main for a repaired workflow; - the dispatch test asserts the XOR admission and the needs edges. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ui933un54X4MJRygfjwdjW --------- Co-authored-by: Claude <noreply@anthropic.com>
Before: nothing in packaging checks what the built VSIX actually contains. On the 0.11.0 trial join, Cargo output under
editors/vscode/target/was packed into a 725 MB VSIX, and the only defence is an ignore rule. The documented local coverage commands also fail from a clean checkout.After:
cargo xtask vscode-package(whichnpm run packageand thevscodeCI job run) reads the built VSIX and fails if it carries workspace build output or exceeds 1,500 entries or 64 MiB unpacked. The coverage docs runcargo build -p riprbeforecargo llvm-cov, matching the workflow.These changes were written first on ripr#1774, which is now closed under Steven's ruling that nothing lands on ripr before the J merge sync. J carries them to ripr from here. The closing note on ripr#1774 says the gate "depends on source-only packaging code". That is true of ripr's call site,
vscode_package_admittedwith its package receipt, but not of the check itself. This PR re-applies the same helpers and tests at swarm'svscode_package, aftervsce package.The
.vscodeignoretarget/**rule is not in this PR. It lands through ripr-swarm#4219. On swarm today,cargo xtaskdoes not leavetarget/under the extension, so the gate passes without the rule (409 entries). After J brings source's cwd-relative target dir (ripr#1690), the rule from #4219 keeps packaging clean. If that rule were missing, this gate fails packaging instead of shipping the output.How: the gate from ripr 0fead8036 is re-applied (identical
VsixEntry,read_vsix_inventory,check_vsix_inventory,is_workspace_build_output, bounds and tests).vscode_packagecalls a newverify_packaged_vsix_inventory, which the sentinel test exercises on the clean and polluted archives. Fail-closed tests cover a missing, non-zip or corrupt-member archive. ripr f0108c62d (coverage docs) is cherry-picked. There is a CHANGELOG entry under Unreleased → Fixed.Swarm / Source Boundary
ripr-swarmThis moves no publishing, signing or release surface.
publish-extension.ymlpackages with rawnpx @vscode/vsce package, which bypasses this gate. #1646 owns that, and it stays a non-claim here.Source-of-truth Links
Governing issue or accepted claim: ripr#1775 (VSIX build-output leak), release graph #3921 / #2766.
Acceptance delta (one sentence):
cargo xtask vscode-packagecan no longer produce a VSIX that carries workspace build output.Candidate Relationships
Candidate branch:
claude/release-0-11-flltxt.Related: ripr#1774 (closed; this is its swarm landing for the gate and docs), ripr-swarm#4219 (carries the
.vscodeignorerule; no file overlap with this PR after db88496).Ported fix: ripr-swarm#4222 (#4220), cherry-picked unchanged as c46cbab..924ea06, so this PR's
full-civscodejob can go green.mainhas been red on that job since #3938. Once #4222 merges first, the port does nothing.Scope Classification
Non-goals: the ignore rule (#4219), the publish workflow's own packaging (#1646), Windows packaging (ripr#1775 control 4).
Proof
full-ciis set, so the hostedvscodejob runs the gate afternpm run compile. It has printedVSIX inventory: 409 entrieson every head. External review has not run yet: CodeRabbit skips bot PRs.Claim Boundary
May claim:
cargo xtask vscode-packagerejects workspace build output and oversize packages. Must not claim: that published marketplace bytes are gated (#1646).Rollback
Revert the squash commit. There is no schema, config or workflow change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SCLHojRNzusvMU8VPyfnAE