Skip to content

test: cover unavailable cwd after successful lookup#70

Merged
hyfdev merged 1 commit into
mainfrom
agent/test-unix-cwd-unavailable
Jul 18, 2026
Merged

test: cover unavailable cwd after successful lookup#70
hyfdev merged 1 commit into
mainfrom
agent/test-unix-cwd-unavailable

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a Unix child-process test that successfully initializes ambient cwd state, removes the real cwd, and distinguishes default lookup errors from the cached_current_dir snapshot
  • compare dependent Path, str, and String failures with the direct current_dir error, and prove explicit absolutization remains independent of ambient cwd
  • require the lifecycle test in Linux and macOS CI under both cwd configurations and record the covered contract

Why

Existing tests covered an unavailable cwd before the first successful lookup, retry after that failure, and cwd changes between valid directories. They did not detect a cached provider that re-read or revalidated the real cwd after a successful cache initialization.

A controlled mutation that calls current_dir() on a cache hit survives the previous cwd tests but fails the new lifecycle test after the directory is removed.

Impact

This is a test-only contract change. Production code, dependencies, benchmarks, and allocation baselines are unchanged.

Validation

  • cargo fmt --all --check
  • SUGAR_PATH_EXPECT_CACHED_CURRENT_DIR=0 cargo test --locked -p sugar_path
  • SUGAR_PATH_EXPECT_CACHED_CURRENT_DIR=1 cargo test --locked --workspace --all-features
  • targeted default and cached_current_dir runs for all affected integration tests
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --all-features --no-deps
  • default/cached test registration and ignored-test checks
  • independent adversarial review with no findings

@hyfdev
hyfdev marked this pull request as ready for review July 18, 2026 18:16
@hyfdev
hyfdev merged commit ea40847 into main Jul 18, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant