Skip to content

fix: make workspace-preservation fixtures pass on macOS - #4806

Merged
hurttlocker merged 1 commit into
mainfrom
fix/workspace-preservation-macos
Oct 26, 2026
Merged

hurttlocker merged 1 commit into
mainfrom
fix/workspace-preservation-macos

Conversation

@hurttlocker

@hurttlocker hurttlocker commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Resolve the fixture root before deriving database, session, repository, worktree and recovery paths.
  • Always allocate the fixture through an aliased temporary ancestor so the regression runs on every host.
  • Keep all 15 ownership, binary/ignored artifact, retention, replay and database-reopen cases.
  • Run this file in the macOS resource workflow, including pull requests touching the fixture or workflow.

Verification

File: tests/workspace-preservation-cli-real-path.test.ts. All runs remove the ambient worker, API, spectator and packaged-mode variables and set NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192.

Red, with the aliased ancestor and before canonicalizing the root:

artifact_recovery_refused
Artifact recovery conflicts with its persisted target or selection.
Test Files  1 failed (1)
     Tests  1 failed | 14 passed (15)

Green, native Linux process visibility, both CI unset and CI=true:

Test Files  1 passed (1)
     Tests  15 passed (15)

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, and npm run test:classify.

Full npm test green:

Test Files  1251 passed | 3 skipped (1254)
     Tests  9165 passed | 5 skipped (9170)

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:

[integration-gate] 6/6 PASS tests/workspace-preservation-cli-real-path.test.ts · 15/15 passed · 82.0s

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

@github-actions github-actions Bot added the size/S Pull request with S diff size label Oct 26, 2026
@github-actions

Copy link
Copy Markdown

🔍 PR Review Bot

Metric Value
Files changed 3
Additions +25
Deletions -5
New files 0

Automated review — CI workflow

@hurttlocker
hurttlocker marked this pull request as ready for review October 26, 2026 03:24
@hurttlocker
hurttlocker added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 4c524b0 Oct 26, 2026
25 of 26 checks passed
@hurttlocker
hurttlocker deleted the fix/workspace-preservation-macos branch October 26, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Pull request with S diff size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS workspace-preservation CLI fixtures fail on unchanged main

1 participant