Skip to content

test(learning): cover reachability_prerequisites#61

Merged
anormang1992 merged 1 commit intomainfrom
test/reachability-prerequisites
May 8, 2026
Merged

test(learning): cover reachability_prerequisites#61
anormang1992 merged 1 commit intomainfrom
test/reachability-prerequisites

Conversation

@anormang1992
Copy link
Copy Markdown
Owner

Summary

Adds test coverage for `LearningEngine.reachability_prerequisites()`, which was added in #60 but didn't ship with dedicated tests.

Nine cases:

  • Empty list when both sides have required depths
  • DepthGap returned for missing source depth
  • DepthGap returned for missing target depth
  • Both DepthGaps when both sides are missing
  • `current_depth` reflects contiguous-max, not highest level (D0+D1+D3 → D1)
  • Works when the gap primitive is the edge target (reverse direction)
  • Candidate validation runs first (missing `source_name` raises before repo lookups)
  • Gap-primitive match validation runs first (edge between unrelated nodes raises)
  • Unresolvable name raises `CandidateValidationError`

Test plan

  • `pytest tests/vre/test_learning.py` — 53 pass (was 44; +9 new)
  • `pytest tests/` — full suite green
  • `ruff check` clean

🤖 Generated with Claude Code

Adds nine cases for the new LearningEngine.reachability_prerequisites():

- empty list when both sides have required depths
- DepthGap returned for missing source depth
- DepthGap returned for missing target depth
- both DepthGaps returned when both sides are missing
- current_depth reflects contiguous-max, not highest level (D0+D1+D3 -> D1)
- works when the gap primitive is the edge target (reverse direction)
- candidate validation runs first (missing source_name raises before lookups)
- gap-primitive match validation runs first (edge between unrelated nodes raises)
- unresolvable name raises CandidateValidationError

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@anormang1992 anormang1992 merged commit 8085b23 into main May 8, 2026
2 checks passed
@anormang1992 anormang1992 deleted the test/reachability-prerequisites branch May 8, 2026 17:22
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