Workspace search beyond entry-module's directory #14

Closed
opened 2026-05-20 13:21:58 +02:00 by Brummel · 1 comment
Owner

load_workspace only finds sibling .ail.json files in the same directory as the entry module, so any consumer of prelude/std in a subdirectory has no way to resolve cross-module imports. Add either a --workspace-root flag on ail check / ail build / ail run, or upward-search from the entry module's directory. Alternatively ratify the flat-workspace assumption in DESIGN.md if intentional.

context: fieldtest 2026-05-11 — fieldtest fixtures could not be placed under examples/fieldtest/ because of this; predates the canonical-type-names milestone but surfaces every time.

`load_workspace` only finds sibling `.ail.json` files in the same directory as the entry module, so any consumer of prelude/std in a subdirectory has no way to resolve cross-module imports. Add either a `--workspace-root` flag on `ail check` / `ail build` / `ail run`, or upward-search from the entry module's directory. Alternatively ratify the flat-workspace assumption in DESIGN.md if intentional. **context:** fieldtest 2026-05-11 — fieldtest fixtures could not be placed under `examples/fieldtest/` because of this; predates the canonical-type-names milestone but surfaces every time.
Author
Owner

Closing as subsumed by #34, which tracks the same root cause (the workspace loader resolves imports only against the entry module's directory) with a concrete repro, the fieldtest symlink workaround, and the companion unfound-module diagnostic fix. The flat-workspace "ratify in design if intentional" alternative is preserved there. Verified still-open behaviour 2026-06-02: load_modules_with resolves root_dir.join("<name>.ail") against the entry's parent directory only; no --workspace-root flag exists.

Closing as subsumed by #34, which tracks the same root cause (the workspace loader resolves imports only against the entry module's directory) with a concrete repro, the fieldtest symlink workaround, and the companion unfound-module diagnostic fix. The flat-workspace "ratify in design if intentional" alternative is preserved there. Verified still-open behaviour 2026-06-02: `load_modules_with` resolves `root_dir.join("<name>.ail")` against the entry's parent directory only; no `--workspace-root` flag exists.
Sign in to join this conversation.