Skip to content

fix: pds check <file> resolves the workspace root (refs #67) - #72

Merged
starscream-bot[bot] merged 1 commit into
mainfrom
starscream/issue-67
Jun 23, 2026
Merged

fix: pds check <file> resolves the workspace root (refs #67)#72
starscream-bot[bot] merged 1 commit into
mainfrom
starscream/issue-67

Conversation

@starscream-bot

Copy link
Copy Markdown
Contributor

Problem

pds check main.pds exits 1 with walking ``` IO error; only pds check

` worked (refs #67).

Cause

find_root walked the ancestors of a relative path. The chain bottoms out at the empty path ""; "".join("pds.toml") resolves against the cwd, so the probe matched and "" was returned as the root — then handed to WalkDir, which fails on an empty path. Affected any relative .pds argument; a relative root above the cwd was also unreachable.

Fix

Absolutise start (lexically, no disk access) before the ancestor walk. The walk now climbs the real tree to the filesystem root; no empty-path ancestor.

Verified

  • pds check main.pds, pds check pkg/svc.pds, pds check . — all exit 0 from inside a workspace.
  • Unit: find_root over a root-level file, a nested file, and a no-manifest tree.
  • Feature: pds check <bare-name> from the workspace cwd (the exact repro).
  • cargo test (pseudoscript, pseudoscript-project), clippy, rustfmt, model_conformance — green.

🤖 Generated with Claude Code

…efs #67)

A relative file argument bottomed out at the empty path during the
ancestor walk, whose `pds.toml` probe resolved against the cwd and was
then handed to WalkDir — `walking ``` IO error. Absolutise `start` first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pseudoscript-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cfd1dc
Status: ✅  Deploy successful!
Preview URL: https://ec2a937f.pseudoscript-landing.pages.dev
Branch Preview URL: https://starscream-issue-67.pseudoscript-landing.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pseudoscript-ide with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cfd1dc
Status: ✅  Deploy successful!
Preview URL: https://81f62e81.pseudoscript-ide.pages.dev
Branch Preview URL: https://starscream-issue-67.pseudoscript-ide.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pseudoscript-model with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cfd1dc
Status: ✅  Deploy successful!
Preview URL: https://7eea5c9e.pseudoscript-model.pages.dev
Branch Preview URL: https://starscream-issue-67.pseudoscript-model.pages.dev

View logs

@shockwave-bot

shockwave-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Shockwave — verification pass

Scope: 3 files, +71/−5. Fix measured correct.

Confirmed

  • std::path::absolute lexical, rooted at / — no empty-path ancestor. Edition 2024 (≥1.85) ⇒ absolute (stable 1.79) available. No MSRV break.
  • FQN derivation unaffected — load_modules strips root prefix lexically (fs.rs:62); absolute root does not perturb module names.
  • 9 find_root callers (main.rs ×5, deps.rs ×4) consume root via .join(...) — absolute root valid for every site. None assumed a relative root.
  • Tests sound — tempdir inputs already absolute, absolute() lexical ⇒ no symlink//private/var flake.

Finding (low, non-blocking)

  • crates/pseudoscript/src/main.rs:393 (check_one_workspace) — diagnostic prefix {root.display()}: … changes relative→absolute. pds check . / pds check <reldir> previously printed ./relative dir; now absolute. Not test-covered (check.feature:13 asserts contains <message>, not prefix), unmentioned in PR. Cosmetic CLI output change, no functional defect.

Verdict: PASS on correctness. Regression covered by 3 unit tests + bare-name repro scenario. One untested output-format change — flagged for awareness, non-blocking.

@starscream-bot
starscream-bot Bot merged commit e5be4f8 into main Jun 23, 2026
6 checks passed
@JonathanTurnock
JonathanTurnock deleted the starscream/issue-67 branch June 23, 2026 22:18
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.

2 participants