feat(xatu): construct lexical scope graphs #93

Closed
alexion wants to merge 2 commits from feat/xatu-scope-graph-construction into feat/xatu-debug
Owner

Summary

  • Construct lexical scope graphs from rnix syntax alongside the lowered rule AST.
  • Keep rnix dependencies in parser.rs and store the graph in ast::ParsedFile.
  • Extend both Nix fixtures and regenerate expected debug JSON to test graph construction.
  • Keep clean.nix ordered for the future rule and lint_findings.nix deliberately unordered.
  • Document the supported subset and omitted constructs.

Construction follows the lexical subset of Néron et al., A Theory of Name Resolution (2015).
Initial coverage targets src/dotfiles/registry.nix.
This PR adds no resolver, dependency analysis, ordering rule, or automatic reordering.

Stack

Depends on #92, which adds debug output and the black-box CLI tests.
The base is feat/xatu-debug so this diff contains only scope-graph changes.
Merge #92 first, then retarget this PR to main.
This PR replaces the scope-graph portion of #91.

Validation

  • bazel test //src/xatu:all — all three targets pass.
  • cargo clippy -p xatu -- -D warnings — passes.
  • nix run .#fix — passes.
  • xatu --debug src/dotfiles/registry.nix — succeeds without parse errors.

Validation uses the restored vendor build files described in #92.

## Summary - Construct lexical scope graphs from rnix syntax alongside the lowered rule AST. - Keep rnix dependencies in `parser.rs` and store the graph in `ast::ParsedFile`. - Extend both Nix fixtures and regenerate expected debug JSON to test graph construction. - Keep `clean.nix` ordered for the future rule and `lint_findings.nix` deliberately unordered. - Document the supported subset and omitted constructs. Construction follows the lexical subset of Néron et al., *A Theory of Name Resolution* (2015). Initial coverage targets `src/dotfiles/registry.nix`. This PR adds no resolver, dependency analysis, ordering rule, or automatic reordering. ## Stack Depends on #92, which adds debug output and the black-box CLI tests. The base is `feat/xatu-debug` so this diff contains only scope-graph changes. Merge #92 first, then retarget this PR to `main`. This PR replaces the scope-graph portion of #91. ## Validation - `bazel test //src/xatu:all` — all three targets pass. - `cargo clippy -p xatu -- -D warnings` — passes. - `nix run .#fix` — passes. - `xatu --debug src/dotfiles/registry.nix` — succeeds without parse errors. Validation uses the restored vendor build files described in #92.
alexion added 1 commit 2026-09-24 22:53:09 -04:00
alexion added 1 commit 2026-09-24 23:01:51 -04:00
alexion closed this pull request 2026-09-24 23:05:21 -04:00
Author
Owner

Closing at the operator’s request.

Closing at the operator’s request.

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexion/dev#93