Skip to content

lint: warn on orphan nodes with no edges#17

Merged
gmoon merged 1 commit intomainfrom
feat/lint-orphan-nodes
Mar 15, 2026
Merged

lint: warn on orphan nodes with no edges#17
gmoon merged 1 commit intomainfrom
feat/lint-orphan-nodes

Conversation

@gmoon
Copy link
Contributor

@gmoon gmoon commented Mar 15, 2026

Summary

  • lattice lint now warns on nodes with zero edges (no inbound or outbound connections)
  • Refactored lint to build the node index once, shared across edge reference and orphan checks (was building it twice)

Changes

  • Added check_orphan_nodes() to src/lint.rs — collects all nodes participating in edges, flags the rest as orphans
  • Refactored check_edge_references() to accept &NodeIndex instead of rebuilding it
  • Added REQ-LINT-001 requirement to lattice
  • 2 new unit tests: orphan detection + connected-node negative test

Test plan

  • cargo test test_lint — all 9 lint tests pass
  • cargo run -- lint on self-hosted lattice — no orphans (clean graph)
  • make pre-commit passes (fmt + clippy)

Closes #16

🤖 Generated with Claude Code

Warns on nodes with no inbound or outbound edges, indicating incomplete
graph wiring. Also refactors lint to build the node index once and share
it across cross-node checks (edge references + orphan detection).

Closes #16
Implements REQ-LINT-001

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gmoon gmoon merged commit b7b1397 into main Mar 15, 2026
5 checks passed
@gmoon gmoon deleted the feat/lint-orphan-nodes branch March 15, 2026 01:07
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.

lint: warn on orphan nodes with no edges

1 participant