Repository navigation
fix: make workspace-preservation fixtures pass on macOS - #4806
Merged
Merged
Conversation
🔍 PR Review Bot
Automated review — CI workflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mechanic
A temporary directory can have a lexical path different from its canonical path. The fixtures used the lexical root to construct persisted recovery intent data, while the CLI used the canonical destination. Recovery then refused an otherwise matching intent with
Artifact recovery conflicts with its persisted target or selection.An aliased temporary ancestor reproduces this through the compiled CLI and persisted database on Linux. This isolates a path mismatch without relaxing lifecycle guards.
What changed
Verification
File:
tests/workspace-preservation-cli-real-path.test.ts. All runs remove the ambient worker, API, spectator and packaged-mode variables and setNODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192.Red, with the aliased ancestor and before canonicalizing the root:
Green, native Linux process visibility, both CI unset and
CI=true:Command:
npx --no-install vitest run tests/workspace-preservation-cli-real-path.test.ts --reporter=verbose.The native run matters: an isolated command sandbox emitted an incomplete native process-snapshot warning. The production guard correctly refused cleanup in that environment. That result is separate from the path mismatch above.
Required pre-push gates passed:
NODE_OPTIONS=--max-old-space-size=8192 npx tsc --noEmit,npm run typecheck:fast, touched tests in both environments, touched-file lint, rule check, andnpm run test:classify.Full
npm testgreen:The workflow policy check first rejected the new trigger, then passed all 8 cases after requiring the two exact allowed paths in
tests/workflow-policy.test.ts.Native macOS receipt from the resource run:
The six-file aggregate also reported one failure in
src/lib/workspace/exact-directory-purge.test.ts, before this fixture executed. The preservation fixture itself passed all 15 cases.Post-merge workflow refinement: commit 94e04e61c scopes PR runs to the preservation fixture while retaining the complete scheduled/manual suite. Its policy check went from 1 failed / 7 passed to 8 passed; all pre-push checks and the full 9,165-test suite passed. This pull request was merged externally before that refinement was pushed, so the refinement remains unmerged on the same branch.
Fixes #4148