Repository navigation
test(vscode): copy the host log directory only when contained under the artifact root - #11994
Conversation
…nder the artifact root (#11826) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoTceRbARsa5PtgeVZ
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
|
Generated by Claude Code |
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 0231fd6): REVIEW_INCOMPLETE
Inspected:
- Semantic owner:
retainHostDiagnosticsineditors/vscode/test/hostDiagnostics.ts:91-156; the changed guard iseditors/vscode/test/hostDiagnostics.ts:117; the new helperisContainedDirectoryiseditors/vscode/test/hostDiagnostics.ts:248-267. The parity reference the helper claims to copy isretainMatrixReceiptateditors/vscode/test/hostDiagnostics.ts:269-307, which resolves, rejects../absolute relatives, andlstats 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 callereditors/vscode/test/runTest.ts:199-349.artifactRootisRIPR_TEST_ARTIFACT_ROOTor<repo>/target/ripr(runTest.ts:200-203);userDataPath = resolveUserDataDir(artifactRoot)(runTest.ts:204, helper athostDiagnostics.ts:57-59) is thereforeartifactRoot/vscode-test-user-data; the matrix profile ismatrixUserData = path.join(userDataPath, 'multiroot')(runTest.ts:301) and is passed through asmatrix.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 athost_diagnostics.test.ts:362-395andhost_diagnostics.test.ts:34-43that constrain the same helper. - Governing claim: issue #11826 (
fix:clause: "add a defined containment helper (resolve,path.relative, reject.., absolute, and symlinked components, asretainMatrixReceiptdoes) 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.mdfollowsdocs/CHANGELOG_POLICY.md(<!-- section: Fixed -->,-bullet,#Nreference, 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 —vscodejob 124702867702 success,msrvsuccess,Rust-only feature lanesuccess,Perl and release proofstill in progress at review time. Merge-ready run 41257226175 —Ripr Rust Small on GitHub Hosted / Rust gatesjob 124703027320 failure. - Base comparison for the red lane: base main run 41257069953 (event
push, branchmain, head_shac5fa19fd9051f00a9195b37af9c78e5028b6982f) job 124702518162 fails at the identical step with the identical message.
Blocking:
- None found in source, oracle, or contract.
Non-blocking:
- The PR body's "Not established" item — "Whether the matrix
userDataDircan ever point outsideartifactRoot(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:204derivesuserDataPathfromartifactRootitself, andrunTest.ts:301derivesmatrixUserDatafromuserDataPath, 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". - 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
vscodeonubuntu-latest(.github/workflows/ci.yml:294), andfs.symlinkSync(target, link, 'junction')athost_diagnostics.test.ts:464creates a POSIX symlink off Windows because Node ignores thejunctiontype there. I verified the claim natively on this win32 host with a local Node probe of the same algorithm:fs.lstatSync(junction).isSymbolicLink() === trueandisDirectory() === false, whilefs.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. isContainedDirectoryperforms one redundant syscall. The component loop alreadylstats the last component, andcurrentends aspath.join(root, ...parts), which equalstargetexactly (the earlier guard rejects..and absolute relatives), so thefs.lstatSync(target)athostDiagnostics.ts:263repeats the loop's finallstat.docs/LEARNINGS.md:551-554records the repo's own rule for this shape ("Classify withmetadata/symlink_metadataonce and reuse the result for evidence"). The cost is one extralstaton a failure-only path — negligible — but the repo rule already exists.- 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 leakedfalse, junction leakedfalse,copied_files: []. Reverted to the oldexistsSync/statSyncpair — contained copiedtrue, 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.
isContainedDirectoryis called once perretainHostDiagnosticscall — the failure-only path, invoked once per host run atrunTest.ts:340— and it replaces two syscalls (existsSyncplusstatSync) with O(path depth)lstatcalls (2-3 for the production shape) plus the one redundant call noted above. No new scan is introduced inside the existinglistRelativeFilesrecursion (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;listRelativeFilesandcopyTextSliceare untouched. Thepath.joinaccumulation 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-policyand the diagnosticcrates/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 onlychangelog.d/andeditors/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 isREVIEW_INCOMPLETErather thanREVIEW_READY— with the attribution stated.
Not run:
- The Rust toolchain on this host is not on
PATH. I did not build, test, lint, or runcargo xtask precommit,check-changelog-fragments,check-process-policy, orverdict-corpus. Every Rust-level statement above is sourced from hosted job logs at the exact head or from reading source at0231fd67. - The
Perl and release proofjob of CI run 41257226321 was stillin_progresswhen 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:e2eneeds the packaged extension and a Rustriprbinary); the hostedvscodejob 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.
|
Generated by Claude Code |
There was a problem hiding this comment.
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.
…ent (#11826) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoTceRbARsa5PtgeVZ
|
Addressed the advisory review's verification questions in 143d471: the test now also covers a symlink in an intermediate component ( Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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...143d471freports 2 files, 1 commit. The production fileeditors/vscode/test/hostDiagnostics.tsis 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 at0231fd67. Nothing in the delta changesisContainedDirectory,retainHostDiagnosticsorfinalizeHostRun.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:
- The new case is a real strengthening, not a duplicate of the leaf case.
host_diagnostics.test.ts:470-488puts a junction at an intermediate component (root/linked-parent->outside, with the real logs atoutside/user-data/logs) and asserts the nestednested-secret.logis 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 reachinguser-dataorlogs. 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. - The second assertion at
:482-488is 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. - The fixture teardown is safe.
rootis amkdtempSyncdirectory removed by the suiteteardown()withfs.rmSync(root, { force: true, recursive: true })(host_diagnostics.test.ts:27,:31), and Node's recursive removal unlinks a junction rather than following it, soroot/linked-parentcannot cause the removal to reach outside the temp tree. Minor hygiene note only: thefinallyat:489takes outoutsidebefore the suite teardown detachesroot/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. - 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 samelstatrule 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 awindows-latestrunner (vscoderuns onubuntu-latest,.github/workflows/ci.yml:294), so the junction case rests on the sharedlstatrule plus the native check I ran on this win32 host, wherefs.lstatSync(junction).isSymbolicLink()istrueandfs.statSync(junction).isDirectory()istrue. The fragment now says that instead of implying native coverage. - The PR body at this head also closes my earlier finding about the matrix
userDataDirquestion: the new "Production path is unaffected" section states thatrunTest.ts:204derivesuserDataPathfromartifactRootandrunTest.ts:301derives the matrix profile fromuserDataPath, 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 inrunTest.ts. The issue's open question is now closed on the record. - Still open from the earlier review and unaffected by this delta:
isContainedDirectorylstats the last component inside its loop and then lstats the same path again in the finalreturn fs.lstatSync(target).isDirectory()(hostDiagnostics.ts:263), which is one redundant syscall per check.docs/LEARNINGS.md:551-554records 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 nomerge-readyevent 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
vscodejob passed at the previous head0231fd67(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 thevscodelane runs on143d471f.
Efficiency:
- The delta is test-only plus one changelog line, so there is no production cost change to assess:
hostDiagnostics.tsis unchanged, and the guard's cost profile (one O(path-depth) walk oflstatcalls 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
retainHostDiagnosticscall 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,rustupare absent fromPATH), and this PR is TypeScript-only, so no Rust statement is at issue. I did not runtsc -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.tsalgorithm, 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
vscodelane 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.
There was a problem hiding this comment.
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.
|
|
There was a problem hiding this comment.
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 to0231fd675dca97f036895f051e343f2369dcc917, so this is a delta review against that head. - The delta
0231fd67 -> 143d471fis two paths:changelog.d/11826-hostdiag-log-containment.md(one line reworded) andeditors/vscode/test/suite/host_diagnostics.test.ts(+20). The production fileeditors/vscode/test/hostDiagnostics.tsis not in the delta, and I confirmed it is byte-identical across the two heads (blobd0cee73cb6cdfa98380d0c9c7b13c08c12ee2d97), so no guard behaviour changed here. - The candidate's contribution against merge base
c5fa19fd9051f00a9195b37af9c78e5028b6982fis still 3 paths (+75/-1): the changelog fragment,editors/vscode/test/hostDiagnostics.ts(+28/-1) andeditors/vscode/test/suite/host_diagnostics.test.ts(+46). - Semantic owner and consumers, read at this head:
retainHostDiagnosticsateditors/vscode/test/hostDiagnostics.ts:91-156, the guard call at:117, the new helperisContainedDirectoryat:248-267, and the parity referenceretainMatrixReceiptat:269-307. The real consumers arefinalizeHostRun(:158-189) and its only production callereditors/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-203resolvesartifactRoot,:204setsuserDataPath = resolveUserDataDir(artifactRoot), and:302setsmatrixUserData = path.join(userDataPath, 'multiroot'). Both the primary and the matrix log directories are therefore structurally underartifactRoot, 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, asretainMatrixReceiptdoes) 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#11826reference thatdocs/CHANGELOG_POLICY.mdrequires. - Duplicate claim: swept the open PR set for
11826; only this PR claims it. Thecheck-process-policyorphan foruse std::process::Commandincrates/ripr/src/output/first_pr/run_chain.rsis a known base-side red with repair carrier #11975, and this diff touches onlychangelog.d/andeditors/vscode/test/.
Blocking:
- None. I found no defect in the candidate's source, oracle, or contract at this head.
Non-blocking:
- Earlier-finding ledger against my review at
0231fd67. REPAIRED: the body's "Not established" item - whether the matrixuserDataDircan ever point outsideartifactRoot- 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 samelstatrule but not exercised natively", which matches what is proven. STILL HOLDS: the redundantfs.lstatSync(target)athostDiagnostics.ts:263, because the production file is unchanged in this delta. STALE: the earlier hosted-evidence item, which attributed a redRust gateslane at the previous head to the inheritedcheck-process-policyorphan; at this head no Rust lane ran at all. editors/vscode/test/hostDiagnostics.ts:263-isContainedDirectoryrepeats one syscall. The component loop at:257-262alreadylstats the last component, and after the loopcurrentequalstargetexactly, becausepath.relativeat:251-254has already rejected..and absolute relatives, sofs.lstatSync(target)re-stats a path the loop just statted.docs/LEARNINGS.md:551-554records the repository's own rule for this shape (classify withmetadata/symlink_metadataonce and reuse the result). The cost is one extralstatper retained host run - not a hot path - but the rule already exists.- The PR body cites
runTest.ts:301for the matrix derivation; at this head that statement is atrunTest.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. - The new assertion at
host_diagnostics.test.ts:483-488is written asexistsSync(logs) ? readdirSync(logs) : []compared against[]. When the guard refuses, nologsdirectory 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:481assertion. - 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 atoutside/user-data/logs), which the final-component check alone would not catch. Against the pre-PRexistsSyncplusstatSync(...).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.relativerejects../absolute at:252, the per-componentlstatat:259rejects the link. - Windows junction behaviour is still exercised by no hosted lane. The
vscodelane runs onubuntu-latest, and Node ignores thejunctiontype off Windows, so thefs.symlinkSync(..., 'junction')calls at:464and:475create POSIX symlinks there. The junction claim rests on the sharedlstatrule 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.
isContainedDirectoryis called once perretainHostDiagnosticscall - the failure-only retention path, invoked once per host run atrunTest.ts:340- and it replaces two syscalls (existsSyncplusstatSync) with O(path depth)lstatcalls, 2-3 in the production shape, plus the one redundant call noted above. No new scan sits inside the existinglistRelativeFilesrecursion (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 extraretainHostDiagnosticsinvocation 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 anycargo xtaskgate. Every Rust-level statement above comes from hosted job logs or from reading source at143d471f. -
I did not run the repository's Node test suite or the VS Code extension host (
npm run test:e2eneeds the packaged extension and a Rustriprbinary). The hostedvscodejob is the only end-to-end proof of these tests, and it did not run at this head. -
Hosted at head
143d471f: the required checkRipr Rust Small Resultis 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) reportsskipped, as does thevscodelane - a missing check, not a failing one. The cause is mechanical:routed-rust.ymltriggers onpull_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 noRipr Rust Small Resultcheck 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 inheritedcheck-process-policyorphan, 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
vscoderun 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Governing issue or accepted claim: #11826
Acceptance delta (one sentence):
retainHostDiagnosticscopies 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.tscopied the log directory afterexistsSyncandstatSync(...).isDirectory(), which follow symlinks and do not require the path to sit underartifactRoot. The matrix receipt path already had containment; the log path did not (theownedSourcehelper #11627 referenced never existed, see #11805/#11807).Change
isContainedDirectory(artifactRoot, directory): resolve,path.relativerejects empty,..and absolute,lstatevery component below the root for symlinks/junctions, finalisDirectory. Same rules asretainMatrixReceipt.userDataDiroutside the root and alogsdirectory that is a symlink to an outside directory are not, andcopied_filesis empty.Production path is unaffected
runTest.ts:204derivesuserDataPath = resolveUserDataDir(artifactRoot)andrunTest.ts:301derives the matrix profile aspath.join(userDataPath, 'multiroot'), so both the primary and the matrix log directories sit structurally underartifactRoot. The guard cannot refuse the real CI failure path; this closes the issue's open question (credit: independent review of 0231fd6).Proof
tsc -p ./ --noEmitclean. Compiledhost_diagnostics.testunder 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 hostedvscodejob is the proof in the real lane. HostedRust gatesis red on main'scheck-process-policybreak (#11975), not on this diff.Not established
Windows junction behaviour: the
vscodelane runs on ubuntu, where the test's'junction'argument creates a POSIX symlink, so the junction claim rests on the sharedlstatrule, not a native run.Rollback
Revert the commit.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SvmPmoTceRbARsa5PtgeVZ