Skip to content

test(vscode): copy the host log directory only when contained under the artifact root - #11994

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/fix-hostdiag-log-containment
Nov 1, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/fix-hostdiag-log-containment

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #11826
Acceptance delta (one sentence): retainHostDiagnostics copies the primary host log directory only when it is a real directory under the artifact root with no symlink or junction component, and a test shows an outside or symlinked log directory is not copied.

Diagnosis

hostDiagnostics.ts copied the log directory after existsSync and statSync(...).isDirectory(), which follow symlinks and do not require the path to sit under artifactRoot. The matrix receipt path already had containment; the log path did not (the ownedSource helper #11627 referenced never existed, see #11805/#11807).

Change

  • isContainedDirectory(artifactRoot, directory): resolve, path.relative rejects empty, .. and absolute, lstat every component below the root for symlinks/junctions, final isDirectory. Same rules as retainMatrixReceipt.
  • Test: a contained log directory is still copied (control); a userDataDir outside the root and a logs directory that is a symlink to an outside directory are not, and copied_files is empty.
  • Changelog fragment.

Production path is unaffected

runTest.ts:204 derives userDataPath = resolveUserDataDir(artifactRoot) and runTest.ts:301 derives the matrix profile as path.join(userDataPath, 'multiroot'), so both the primary and the matrix log directories sit structurally under artifactRoot. The guard cannot refuse the real CI failure path; this closes the issue's open question (credit: independent review of 0231fd6).

Proof

tsc -p ./ --noEmit clean. Compiled host_diagnostics.test under mocha: 30 pass; the one failure is a scratch-layout artifact (the harness test looks for runner source relative to the compiled tree) and is unrelated. With the guard reverted, the new test fails (negative control run). The hosted vscode job is the proof in the real lane. Hosted Rust gates is red on main's check-process-policy break (#11975), not on this diff.

Not established

Windows junction behaviour: the vscode lane runs on ubuntu, where the test's 'junction' argument creates a POSIX symlink, so the junction claim rests on the shared lstat rule, not a native run.

Rollback

Revert the commit.


🤖 Generated with Claude Code

https://claude.ai/code/session_01SvmPmoTceRbARsa5PtgeVZ

…nder the artifact root (#11826)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmoTceRbARsa5PtgeVZ
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven added full-ci Run required, advisory, and release-like CI lanes. merge-ready labels Nov 1, 2026 — with Claude
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 150 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 7ee2d91b-850a-4cf6-a8fd-f5bb0019d05a
Commits

Reviewing files that changed from the base of the PR and between 99b2e4d and b252027.

Files selected for processing: 3
  • changelog.d/11826-hostdiag-log-containment.md
  • editors/vscode/test/hostDiagnostics.ts
  • editors/vscode/test/suite/host_diagnostics.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Copy link
Copy Markdown
Member Author

Rust gates (and so Ripr Rust Small Result) failed at "Repository policy preflight": check-process-policy reports the run_chain.rs use std::process::Command allowlist entry as orphaned. This diff touches only editors/vscode/test/* and a changelog fragment, so it is not this PR's: main is red from #11924, and the fix of record is #11975 (open, in CI). I am not opening another fix. Once #11975 merges I will merge main into this branch and request late CI once.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (fresh-context reviewer, head 0231fd6): REVIEW_INCOMPLETE

Inspected:

  • Semantic owner: retainHostDiagnostics in editors/vscode/test/hostDiagnostics.ts:91-156; the changed guard is editors/vscode/test/hostDiagnostics.ts:117; the new helper isContainedDirectory is editors/vscode/test/hostDiagnostics.ts:248-267. The parity reference the helper claims to copy is retainMatrixReceipt at editors/vscode/test/hostDiagnostics.ts:269-307, which resolves, rejects ../absolute relatives, and lstats every component below the root for symlink/junction before the final file check.
  • Real consumers, not the helper in isolation: finalizeHostRun (editors/vscode/test/hostDiagnostics.ts:158-189) and its only production caller editors/vscode/test/runTest.ts:199-349. artifactRoot is RIPR_TEST_ARTIFACT_ROOT or <repo>/target/ripr (runTest.ts:200-203); userDataPath = resolveUserDataDir(artifactRoot) (runTest.ts:204, helper at hostDiagnostics.ts:57-59) is therefore artifactRoot/vscode-test-user-data; the matrix profile is matrixUserData = path.join(userDataPath, 'multiroot') (runTest.ts:301) and is passed through as matrix.userDataDir (runTest.ts:324-325, hostDiagnostics.ts:169).
  • Test stimulus and oracle: the new case editors/vscode/test/suite/host_diagnostics.test.ts:446-470, plus the pre-existing matrix/positive-control cases at host_diagnostics.test.ts:362-395 and host_diagnostics.test.ts:34-43 that constrain the same helper.
  • Governing claim: issue #11826 (fix: clause: "add a defined containment helper (resolve, path.relative, reject .., absolute, and symlinked components, as retainMatrixReceipt does) and use it for the primary log path, with a test that a symlinked or outside log directory is not copied"). The PR implements that clause literally. changelog.d/11826-hostdiag-log-containment.md follows docs/CHANGELOG_POLICY.md (<!-- section: Fixed -->, - bullet, #N reference, kebab-case <issue>-<slug>.md).
  • Duplicate claim: swept all 100 open PRs' titles and bodies for 11826; only this PR claims it.
  • Hosted evidence at head 0231fd675dca97f036895f051e343f2369dcc917, newest run wins: CI run 41257226321 — vscode job 124702867702 success, msrv success, Rust-only feature lane success, Perl and release proof still in progress at review time. Merge-ready run 41257226175 — Ripr Rust Small on GitHub Hosted / Rust gates job 124703027320 failure.
  • Base comparison for the red lane: base main run 41257069953 (event push, branch main, head_sha c5fa19fd9051f00a9195b37af9c78e5028b6982f) job 124702518162 fails at the identical step with the identical message.

Blocking:

  • None found in source, oracle, or contract.

Non-blocking:

  1. The PR body's "Not established" item — "Whether the matrix userDataDir can ever point outside artifactRoot (issue's open question)" — is answerable from the source that ships in this PR, and answering it is the single fact a reviewer of this guard most wants: it decides whether the new guard can silently disable the real CI failure-path log capture. runTest.ts:204 derives userDataPath from artifactRoot itself, and runTest.ts:301 derives matrixUserData from userDataPath, so both the primary and the matrix log directories are structurally under the root and the guard cannot refuse the production path. Recording that two-line derivation would turn the issue's open question into a closed one instead of carrying it forward as "not established".
  2. The changelog fragment asserts "with no symlink or junction component", but no hosted lane exercises a Windows junction. The only lane that runs these tests is vscode on ubuntu-latest (.github/workflows/ci.yml:294), and fs.symlinkSync(target, link, 'junction') at host_diagnostics.test.ts:464 creates a POSIX symlink off Windows because Node ignores the junction type there. I verified the claim natively on this win32 host with a local Node probe of the same algorithm: fs.lstatSync(junction).isSymbolicLink() === true and isDirectory() === false, while fs.statSync(junction).isDirectory() === true — the old check would have followed it. So the wording is true on Windows, but it is true by source reading and my local probe rather than by hosted proof, and a future Windows regression would be silent. Either narrow the fragment wording or give the editor lane a Windows leg.
  3. isContainedDirectory performs one redundant syscall. The component loop already lstats the last component, and current ends as path.join(root, ...parts), which equals target exactly (the earlier guard rejects .. and absolute relatives), so the fs.lstatSync(target) at hostDiagnostics.ts:263 repeats the loop's final lstat. docs/LEARNINGS.md:551-554 records the repo's own rule for this shape ("Classify with metadata/symlink_metadata once and reuse the result for evidence"). The cost is one extra lstat on a failure-only path — negligible — but the repo rule already exists.
  4. Independent negative control (mine, not the author's): I loaded the head module and a reverted-guard copy of the same module under Node 26.5.0 on this win32 host and ran the three scenarios. Head — contained control copied true, outside directory leaked false, junction leaked false, copied_files: []. Reverted to the old existsSync/statSync pair — contained copied true, outside leaked true, junction leaked true, copied_files: ["secret.log"]. The new test is therefore a real discriminator rather than an assertion of the implementation back to itself. I did not rely on the body's claimed negative-control run.

Efficiency:

  • Effectively neutral, and the new work is not in a loop. isContainedDirectory is called once per retainHostDiagnostics call — the failure-only path, invoked once per host run at runTest.ts:340 — and it replaces two syscalls (existsSync plus statSync) with O(path depth) lstat calls (2-3 for the production shape) plus the one redundant call noted above. No new scan is introduced inside the existing listRelativeFiles recursion (hostDiagnostics.ts:392-405), no per-item I/O or subprocess spawning is added, no cache is introduced or invalidated, and no collection grows in memory; listRelativeFiles and copyTextSlice are untouched. The path.join accumulation inside the component loop is O(depth^2) in string length, but depth is 2-3 in every real call, so I do not claim a cost there. The guard also removes work on the refused path, since the old code walked and copied the outside tree.
  • Hosted-evidence note on the red lane, with base comparison: job 124703027320 fails at step "Repository policy preflight" with xtask: check-policy-all: 1 gate(s) failed: check-process-policy and the diagnostic crates/ripr/src/output/first_pr/run_chain.rs allowlist entry for 'use std::process::Command' is orphaned: max_count=1 but pattern not found in any tracked file. The base main run 41257069953 / job 124702518162 fails at the same step with the same orphaned-allowlist diagnostic, so this is inherited main-red, owned by the process-policy repair (#11975, and duplicated by #11995), and it cannot be caused by this PR: this diff touches only changelog.d/ and editors/vscode/test/. Per the repository's own rule, a required lane that is still red is not a pass even when inherited, so the disposition below is REVIEW_INCOMPLETE rather than REVIEW_READY — with the attribution stated.

Not run:

  • The Rust toolchain on this host is not on PATH. I did not build, test, lint, or run cargo xtask precommit, check-changelog-fragments, check-process-policy, or verdict-corpus. Every Rust-level statement above is sourced from hosted job logs at the exact head or from reading source at 0231fd67.
  • The Perl and release proof job of CI run 41257226321 was still in_progress when this review was written, so the hosted lane set for this head is not closed.
  • Windows junction behaviour is exercised by no hosted lane; my only Windows evidence is the local Node probe of the same algorithm described above, not a run of the repository's own test suite on Windows.
  • I did not run the VS Code extension host myself (npm run test:e2e needs the packaged extension and a Rust ripr binary); the hosted vscode job is the only end-to-end proof I relied on. Its log lists the new case "refuses to copy a log directory that is a symlink or sits outside the artifact root" as passing, with 559 passing / 1 pending in the suite.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 0231fd675dca97f036895f051e343f2369dcc917. Not an approval.

Copy link
Copy Markdown
Member Author

rust-tests-junit on 0231fd6 has one failure, lsp::backend::list_actionable_items_tests::list_actionable_items_names_gaps_the_actionable_profile_hides (backend.rs:12892, the withheld-finding order [98, 94] assertion). This PR changes only editors/vscode/test/* and a changelog fragment, so it cannot reach that test, and the same test passed on #11830's head c6896dc a few hours earlier, so it came in with a later main commit. Main's own Rust-only feature lane also failed on a7431a5; I have not confirmed it is the same test. No fix of record that I can find yet; I am reporting it to the coordinator rather than opening another one. Re-run plan after #11975 and that fix land: update branch, request late CI once.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the new test's outside-directory case checks only that secret.log was not copied; it does not assert that the rejected log directory itself was absent from the diagnostics output.
  • Confirm the new test covers an outside userDataDir and a final log-directory junction, but not a junction in an intermediate parent component.

Parked follow-ups

  • The changelog's junction-containment wording is stronger than the demonstrated test evidence.

Evidence gaps

  • The scheduled cargo-test receipt and focused base-plus-tests proof were not present in the supplied packet.
  • The focused test execution and native Windows junction route remain trust-affecting gaps despite the structural scan.
  • Native Windows junction semantics and the scheduled focused cargo-test result are not established by the supplied evidence.
  • The PR's proof claims a focused negative-control run, but the requested base-plus-tests receipt is still absent.

Copy link
Copy Markdown
Member Author

Addressed the advisory review's verification questions in 143d471: the test now also covers a symlink in an intermediate component (root/linked-parent -> outside, logs under outside/user-data/logs) and asserts the refused directory leaves no log copies at all, not only no secret file. The changelog wording now says junctions are covered by the shared lstat rule but not exercised natively (the vscode lane is ubuntu). Local mocha: 30 pass, 1 scratch-layout failure unrelated to this diff. Late CI stays unrequested until main's open fixes land (#11975/#11995, #11982, #11989).


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review — delta at head 143d471 (fresh-context reviewer): REVIEW_INCOMPLETE

Head moved. My earlier review on this PR (database id 5725698435) was bound to head 0231fd675dca97f036895f051e343f2369dcc917. The PR advanced to 143d471f3e5d1b093756be9073ce87021c87b865 ("test(vscode): cover a symlink in an intermediate log-directory component (#11826)") after that review was posted. This review covers the delta from 0231fd67 to 143d471f; the earlier review remains bound to its own head and is not withdrawn.

Inspected in the delta:

  • compare 0231fd67...143d471f reports 2 files, 1 commit. The production file editors/vscode/test/hostDiagnostics.ts is not in the delta, so the source analysis in my earlier review — the containment helper, the guard, the production caller chain and the parse of the guard's component loop — still holds byte-for-byte, and every finding in it stands or falls exactly as it did at 0231fd67. Nothing in the delta changes isContainedDirectory, retainHostDiagnostics or finalizeHostRun.
  • changelog.d/11826-hostdiag-log-containment.md — one line reworded.
  • editors/vscode/test/suite/host_diagnostics.test.ts — one case added, host_diagnostics.test.ts:470-488.

Delta review:

  1. The new case is a real strengthening, not a duplicate of the leaf case. host_diagnostics.test.ts:470-488 puts a junction at an intermediate component (root/linked-parent -> outside, with the real logs at outside/user-data/logs) and asserts the nested nested-secret.log is not copied. The guard's component loop (hostDiagnostics.ts:248-267) lstats each part below the root in order, so it refuses at the first component, root/linked-parent, before ever reaching user-data or logs. This matters because the earlier case only proved the leaf component was checked: a hypothetical implementation that lstat'd only the final path element would have passed the leaf case and would fail this one. Against the pre-change implementation (fs.existsSync(logDir) && fs.statSync(logDir).isDirectory(), both of which follow the junction) the case is discriminating — the copy would land and the first assertion would fail.
  2. The second assertion at :482-488 is stronger than the first and worth keeping: it checks that the refused directory leaves no log directory at all, not merely that one named file is absent. That pins "nothing was collected" rather than "this particular secret was not collected", which is the property the guard actually promises.
  3. The fixture teardown is safe. root is a mkdtempSync directory removed by the suite teardown() with fs.rmSync(root, { force: true, recursive: true }) (host_diagnostics.test.ts:27, :31), and Node's recursive removal unlinks a junction rather than following it, so root/linked-parent cannot cause the removal to reach outside the temp tree. Minor hygiene note only: the finally at :489 takes out outside before the suite teardown detaches root/linked-parent, leaving a dangling junction for a moment; detaching the link first would avoid that intermediate state. It is harmless under Node's removal semantics and I am not asking for a change.
  4. The changelog reword is an improvement and closes my earlier finding. The old text claimed "with no symlink or junction component" without qualification; the new text states the refusal rule precisely ("a .., absolute or symlinked component is refused, matching the matrix receipt containment") and adds the disclosure "Windows junctions are covered by the same lstat rule but not exercised natively". That is exactly the distinction I asked for: the behaviour claim is now scoped to what is actually proven. I keep my earlier point that no hosted lane runs this test on a windows-latest runner (vscode runs on ubuntu-latest, .github/workflows/ci.yml:294), so the junction case rests on the shared lstat rule plus the native check I ran on this win32 host, where fs.lstatSync(junction).isSymbolicLink() is true and fs.statSync(junction).isDirectory() is true. The fragment now says that instead of implying native coverage.
  5. The PR body at this head also closes my earlier finding about the matrix userDataDir question: the new "Production path is unaffected" section states that runTest.ts:204 derives userDataPath from artifactRoot and runTest.ts:301 derives the matrix profile from userDataPath, so both log directories sit structurally under the root and the guard cannot refuse the real CI failure path. That is the derivation I asked for, and it matches what I read independently in runTest.ts. The issue's open question is now closed on the record.
  6. Still open from the earlier review and unaffected by this delta: isContainedDirectory lstats the last component inside its loop and then lstats the same path again in the final return fs.lstatSync(target).isDirectory() (hostDiagnostics.ts:263), which is one redundant syscall per check. docs/LEARNINGS.md:551-554 records the repository's own rule to stat once and reuse the result. The cost is negligible on a failure-only path, and I am not asking for it to change; I am recording that it remains true at this head.

Hosted evidence at head 143d471f3e5d1b093756be9073ce87021c87b865, newest run wins:

  • CI run 41258978168 reports skipped; every Rust lane at this head is unrun because no merge-ready event has fired for it. ub-review (run 41258978075) is still in progress.
  • The consequence is specific and worth stating plainly: the new test case added by this delta has no hosted execution at this head. The vscode job passed at the previous head 0231fd67 (559 passing, 1 pending) and did list the earlier case as passing, but that run predates this commit, so it says nothing about the intermediate-component case. The delta's own claim is therefore unproven by hosted CI until the vscode lane runs on 143d471f.

Efficiency:

  • The delta is test-only plus one changelog line, so there is no production cost change to assess: hostDiagnostics.ts is unchanged, and the guard's cost profile (one O(path-depth) walk of lstat calls per retention attempt on the failure-only path, replacing the two symlink-following calls it used to make) is exactly as described in my earlier review.
  • The added case costs one junction creation, one nested directory with one file, and one extra retainHostDiagnostics call in the test process. It adds no scan inside a loop, no per-entry work, no subprocess, and no growth in any collection beyond one temporary directory.
  • The new case does not widen the guard's cost: it exercises the refusal path, where the guard stops at the first offending component, so the refused path is the cheap one.

Not run:

  • No Rust toolchain on this host (rustc, cargo, rustup are absent from PATH), and this PR is TypeScript-only, so no Rust statement is at issue. I did not run tsc -p ./ --noEmit, the mocha suite, or the VS Code extension host; I did not execute the new case.
  • I did not re-run my Node probe against the new head's test file. The probe result I reported earlier concerns the unchanged hostDiagnostics.ts algorithm, and the new case is a test-file addition, so the algorithm conclusion carries over; the new case's own execution is unverified here.
  • I could not observe the vscode lane at this head, so the delta's new case remains unexecuted by any evidence I hold.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 143d471f3e5d1b093756be9073ce87021c87b865. Not an approval.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parked follow-ups

  • The test creates the 'junction' case with symlinkSync on Ubuntu, so native Windows junction semantics remain unproved.
  • Native Windows junction behavior is documented as governed by lstat but is not exercised by the available Linux test lane.

Evidence gaps

  • Focused base-plus-tests proof is requested but its receipt is absent from the supplied evidence.
  • The requested focused base-plus-tests proof is not present in the supplied evidence.
  • Focused base-plus-tests proof and native Windows junction execution remain unavailable in the supplied evidence.
  • Model proof intent was rejected by deterministic validation.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

merge-ready is set, but no qualification run exists for head 143d471f: it was pushed after the label was applied, or the label event was dropped. Remove and re-apply merge-ready to request it again.

@EffortlessSteven EffortlessSteven left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (fresh-context reviewer, head 143d471): REVIEW_INCOMPLETE

Inspected:

  • Head re-read from the API at session start: 143d471f3e5d1b093756be9073ce87021c87b865, unchanged from the dispatch table. The earlier marker-bearing review (5725698435, REVIEW_INCOMPLETE) is bound to 0231fd675dca97f036895f051e343f2369dcc917, so this is a delta review against that head.
  • The delta 0231fd67 -> 143d471f is two paths: changelog.d/11826-hostdiag-log-containment.md (one line reworded) and editors/vscode/test/suite/host_diagnostics.test.ts (+20). The production file editors/vscode/test/hostDiagnostics.ts is not in the delta, and I confirmed it is byte-identical across the two heads (blob d0cee73cb6cdfa98380d0c9c7b13c08c12ee2d97), so no guard behaviour changed here.
  • The candidate's contribution against merge base c5fa19fd9051f00a9195b37af9c78e5028b6982f is still 3 paths (+75/-1): the changelog fragment, editors/vscode/test/hostDiagnostics.ts (+28/-1) and editors/vscode/test/suite/host_diagnostics.test.ts (+46).
  • Semantic owner and consumers, read at this head: retainHostDiagnostics at editors/vscode/test/hostDiagnostics.ts:91-156, the guard call at :117, the new helper isContainedDirectory at :248-267, and the parity reference retainMatrixReceipt at :269-307. The real consumers are finalizeHostRun (:158-189) and its only production caller editors/vscode/test/runTest.ts:199-349.
  • I verified the production-path claim the PR body now makes, at this head rather than by accepting it: runTest.ts:200-203 resolves artifactRoot, :204 sets userDataPath = resolveUserDataDir(artifactRoot), and :302 sets matrixUserData = path.join(userDataPath, 'multiroot'). Both the primary and the matrix log directories are therefore structurally under artifactRoot, and the new guard cannot refuse the real CI failure path. That closes issue #11826's open question, which the earlier review had flagged as answerable from this PR's own source.
  • Test stimulus and oracle: the new intermediate-component case at editors/vscode/test/suite/host_diagnostics.test.ts:470-488, the pre-existing outside/symlink case at :446-470, and the positive control inside it at :452-455 (a contained log directory is still copied).
  • Governing claim: issue #11826, whose fix clause asks for a defined containment helper (resolve, path.relative, reject .., absolute and symlinked components, as retainMatrixReceipt does) used for the primary log path, with a test that a symlinked or outside log directory is not copied. The PR implements that clause literally, and the changelog fragment keeps the <!-- section: Fixed --> header, the - bullet and the #11826 reference that docs/CHANGELOG_POLICY.md requires.
  • Duplicate claim: swept the open PR set for 11826; only this PR claims it. The check-process-policy orphan for use std::process::Command in crates/ripr/src/output/first_pr/run_chain.rs is a known base-side red with repair carrier #11975, and this diff touches only changelog.d/ and editors/vscode/test/.

Blocking:

  • None. I found no defect in the candidate's source, oracle, or contract at this head.

Non-blocking:

  1. Earlier-finding ledger against my review at 0231fd67. REPAIRED: the body's "Not established" item - whether the matrix userDataDir can ever point outside artifactRoot - is now answered, and I independently confirmed both derivations at this head. REPAIRED: the changelog fragment no longer asserts unqualified "no symlink or junction component"; it now reads "a .., absolute or symlinked component is refused ... Windows junctions are covered by the same lstat rule but not exercised natively", which matches what is proven. STILL HOLDS: the redundant fs.lstatSync(target) at hostDiagnostics.ts:263, because the production file is unchanged in this delta. STALE: the earlier hosted-evidence item, which attributed a red Rust gates lane at the previous head to the inherited check-process-policy orphan; at this head no Rust lane ran at all.
  2. editors/vscode/test/hostDiagnostics.ts:263 - isContainedDirectory repeats one syscall. The component loop at :257-262 already lstats the last component, and after the loop current equals target exactly, because path.relative at :251-254 has already rejected .. and absolute relatives, so fs.lstatSync(target) re-stats a path the loop just statted. docs/LEARNINGS.md:551-554 records the repository's own rule for this shape (classify with metadata/symlink_metadata once and reuse the result). The cost is one extra lstat per retained host run - not a hot path - but the rule already exists.
  3. The PR body cites runTest.ts:301 for the matrix derivation; at this head that statement is at runTest.ts:302 (const matrixUserData = path.join(userDataPath, 'multiroot')). The claim is true - I read it at :302 - but the line citation drifted with the head.
  4. The new assertion at host_diagnostics.test.ts:483-488 is written as existsSync(logs) ? readdirSync(logs) : [] compared against []. When the guard refuses, no logs directory is created, so the assertion passes through its vacuous branch. That is the intended semantic ("no log copies at all"), and the stronger, non-vacuous claim is carried by the :481 assertion.
  5. The new case is a genuine discriminator, not a restatement of the implementation. It exercises the intermediate-component path (root/linked-parent -> outside, with the real logs at outside/user-data/logs), which the final-component check alone would not catch. Against the pre-PR existsSync plus statSync(...).isDirectory() pair, the path resolves through the link and the old code would copy the tree, so the new assertions would fail on the old implementation. The guard's rejection order supports that reading: path.relative rejects ../absolute at :252, the per-component lstat at :259 rejects the link.
  6. Windows junction behaviour is still exercised by no hosted lane. The vscode lane runs on ubuntu-latest, and Node ignores the junction type off Windows, so the fs.symlinkSync(..., 'junction') calls at :464 and :475 create POSIX symlinks there. The junction claim rests on the shared lstat rule and source reading, not a native Windows run.

Efficiency:

  • Effectively neutral. The delta is one changelog line and one test case; the production path is byte-identical to the previously reviewed head. isContainedDirectory is called once per retainHostDiagnostics call - the failure-only retention path, invoked once per host run at runTest.ts:340 - and it replaces two syscalls (existsSync plus statSync) with O(path depth) lstat calls, 2-3 in the production shape, plus the one redundant call noted above. No new scan sits inside the existing listRelativeFiles recursion (hostDiagnostics.ts:392-405), no per-item I/O or subprocess spawning is added, no cache is introduced or invalidated, and no collection grows in memory. The guard also removes work on the refused path, since the old code walked and copied the outside tree. The new test adds a few filesystem calls and one extra retainHostDiagnostics invocation inside a single test body - no loop, no per-item allocation. I found no efficiency regression.
    Not run:

  • The Rust toolchain on this host is not on PATH. I did not build, test, lint, format, or run any cargo xtask gate. Every Rust-level statement above comes from hosted job logs or from reading source at 143d471f.

  • I did not run the repository's Node test suite or the VS Code extension host (npm run test:e2e needs the packaged extension and a Rust ripr binary). The hosted vscode job is the only end-to-end proof of these tests, and it did not run at this head.

  • Hosted at head 143d471f: the required check Ripr Rust Small Result is ABSENT from this head's check set, and every Rust lane context (source-identity, rust-coverage, future-clippy, cargo-deny, rust-tests-junit, Rust-only feature lane, msrv, ci-result) reports skipped, as does the vscode lane - a missing check, not a failing one. The cause is mechanical: routed-rust.yml triggers on pull_request: types: [labeled] only (.github/workflows/routed-rust.yml:5-12), so the head push after the merge-ready request started no new qualification run. The repository's own staleness watchdog confirms this independently: run 41263789168, job 124722232099, at 2026-11-01T02:06:29Z reports that PR #11994 at head 143d471 has no Ripr Rust Small Result check and no queued or in-progress merge-ready run, and instructs that the merge-ready label be re-applied at the new head. The prior merge-ready run 41257226175 ("Merge-ready request 0231fd6...", failure) and CI run 41257226321 (success) are bound to the old head and are superseded here; the earlier red was the inherited check-process-policy orphan, owned by #11975, not a red lane on this head.

  • Consequently the new nested-symlink case has no hosted execution record at this SHA; the vscode run at the previous head covered the older case set only.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 143d471f3e5d1b093756be9073ce87021c87b865. Not an approval.

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EffortlessSteven
EffortlessSteven merged commit 76652b4 into main Nov 1, 2026
50 of 51 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/fix-hostdiag-log-containment branch November 1, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run required, advisory, and release-like CI lanes. merge-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants