M2-PR3: LogicalPlan verifier (structural invariants)
Parent: #1139
Objective
Add M2 structural verifier coverage for LogicalPlan and wire invariant checks into planner outputs.
Deliverables
- Add
graphistry/compute/gfql/ir/verifier.py with:
verify(plan: LogicalPlan) -> list[CompilerError]
- Implement core invariants from milestone spec:
- dangling reference detection
- output schema consistency checks
- predicate scope checks (especially
PatternMatch)
- optional-arm nullability contract checks
op_id uniqueness checks
- Add focused positive/negative verifier tests.
Acceptance Criteria
- Verifier catches intentionally malformed fixtures with stable error classes/messages.
- Scope checks validate true variable visibility, not placeholder/non-empty-string checks.
- Verification traversal is cycle-safe for malformed plans (no unbounded recursion).
- Verifier passes on planner-emitted plans for covered query shapes.
- CI green.
Non-goals
- No cost-based optimization logic.
- No physical planning/executor routing.
References
plans/compiler-refactor/milestone-M2.md (verify(plan) section)
plans/compiler-refactor/research-tracks/d4-verifier.md
M2-PR3: LogicalPlan verifier (structural invariants)
Parent: #1139
Objective
Add M2 structural verifier coverage for
LogicalPlanand wire invariant checks into planner outputs.Deliverables
graphistry/compute/gfql/ir/verifier.pywith:verify(plan: LogicalPlan) -> list[CompilerError]PatternMatch)op_iduniqueness checksAcceptance Criteria
Non-goals
References
plans/compiler-refactor/milestone-M2.md(verify(plan)section)plans/compiler-refactor/research-tracks/d4-verifier.md