Skip to content

Fail fast with an actionable error when a local registry, dependency, template, or policy path does not exist#1598

Open
ANcpLua wants to merge 1 commit into
open-telemetry:mainfrom
ANcpLua:fix/vdir-not-found-diagnostics
Open

Fail fast with an actionable error when a local registry, dependency, template, or policy path does not exist#1598
ANcpLua wants to merge 1 commit into
open-telemetry:mainfrom
ANcpLua:fix/vdir-not-found-diagnostics

Conversation

@ANcpLua

@ANcpLua ANcpLua commented Jul 17, 2026

Copy link
Copy Markdown

Problem

A relative registry_path in a registry manifest dependency resolves against the process working directory. Running weaver from any other directory fails late in resolution with a bare

× The following error occurred during the processing of semantic convention
│ file: IO error for operation on ./dep-model: No such file or directory (os error 2)

— no mention of which base directory the path was resolved against, or that the CWD is what matters. Hit in practice consuming semantic-conventions-genai (multi-registry manifest with registry_path: ./.build/sc-upstream-filtered) from an external codegen pipeline: the main registry resolves fine via -r, then the dependency dies with the message above.

Change

VirtualDirectory now rejects a nonexistent LocalFolder eagerly. The error names the path as written, the absolute path it resolved to against the current working directory, and explains the resolution semantics:

× Virtual directory `./dep-model` is invalid: local path does not exist
│ (resolved to `/home/user/somewhere/dep-model` against the current working
│ directory). Relative paths — including `registry_path` entries in a
│ registry manifest — resolve against the current working directory, not the
│ location of the file that declares them; run weaver from the directory the
│ path is relative to, or use an absolute path

Absolute paths get a plain "local path does not exist". No behavior change for existing paths. Because the check lives in the shared VirtualDirectory layer, it also covers the main -r registry path, template and policy paths, and the case where a mistyped URL parses as a LocalFolder.

Non-goal

This does not change resolution semantics. Whether a dependency registry_path should (also) resolve relative to the manifest location is a separate design discussion — happy to open an issue laying out the options (resolution fallback order, opt-in field, breaking switch) if there is interest.

Testing

  • New unit test covering both branches (relative path with CWD hint, absolute path without).
  • Full workspace test suite passes.
  • Manually verified end-to-end: a minimal registry with a ./dep-model dependency fails with the new message from the wrong CWD and resolves unchanged from the correct one.

A relative dependency registry_path in a registry manifest resolves
against the process working directory. Running weaver from any other
directory failed late with a bare "IO error … No such file or directory"
that named neither the base directory used nor the file that declared
the path.

VirtualDirectory now rejects a nonexistent LocalFolder eagerly: the
error names the path as written, the absolute path it resolved to
against the current working directory, and explains the resolution
semantics. Absolute paths get a plain "does not exist". No behavior
change for existing paths.
@ANcpLua
ANcpLua force-pushed the fix/vdir-not-found-diagnostics branch from f4698eb to 1eb4ba1 Compare July 17, 2026 07:08
@ANcpLua
ANcpLua marked this pull request as ready for review July 17, 2026 07:12
@ANcpLua
ANcpLua requested a review from a team as a code owner July 17, 2026 07:12
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.2%. Comparing base (2ff9817) to head (1eb4ba1).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1598   +/-   ##
=====================================
  Coverage   81.2%   81.2%           
=====================================
  Files        130     130           
  Lines      11463   11476   +13     
=====================================
+ Hits        9308    9319   +11     
- Misses      2155    2157    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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