Skip to content

refactor(learning): VRE as knowledge linter; integrators own the loop#60

Merged
anormang1992 merged 2 commits intomainfrom
feat/learning-loop-refactor
May 8, 2026
Merged

refactor(learning): VRE as knowledge linter; integrators own the loop#60
anormang1992 merged 2 commits intomainfrom
feat/learning-loop-refactor

Conversation

@anormang1992
Copy link
Copy Markdown
Owner

Summary

Removes VRE's auto-learning loop orchestration. VRE now identifies gaps and persists validated fills; loop control, decision tracking, and metrics are the integrator's responsibility. The langchain demo's new `learn_gaps` tool is the reference implementation.

  • Core API shrinks: `learn_all`, `on_learn`, `LearningCallback`, `CandidateDecision`, `LearningResult`, learning metrics, and the invisible `_learn_missing_depths` nested-callback are all gone
  • Engine validates and persists: `LearningEngine.learn_gap(gap, candidate, source=LEARNED)` replaces callback-driven `learn_at`; field-presence and gap-relationship validation moves onto candidate models via `validate_for_gap`
  • Reachability prerequisites are explicit: `reachability_prerequisites()` returns `DepthGap` objects the integrator must fill before edge placement (replaces the silent nested callback). `ReachabilityCandidate` gains an explicit `source_name` so the integrator can place edges in either direction; at least one side must match the gap primitive
  • `contiguous_max_depth` is a property on `Primitive` — shared by grounding and learning engines (was duplicated)
  • Demo update: new `learn_gaps` tool with integrator-owned loop, system prompt rewritten to be explicit about the block→learn→retry pattern, learner uses `think=False` for clean structured output on thinking models

Test plan

  • `ruff check` clean
  • 239 tests pass; coverage 74% (above 70% threshold)
  • Manual end-to-end: `create test.txt` exercised depth + reachability + cascading relational gap fills via the agent and learner
  • Manual end-to-end: `delete test.txt` exercised reachability prerequisites flow (depth gaps surfaced before edge placement)

🤖 Generated with Claude Code

anormang1992 and others added 2 commits May 8, 2026 12:45
Removes VRE's auto-learning orchestration. The engine identifies gaps
and persists validated fills; loop control, decision tracking, and
metrics are the integrator's responsibility. The langchain demo's new
learn_gaps tool is the reference implementation.

Core changes:
- Remove VRE.learn_all, on_learn from vre_guard, learning metrics,
  CandidateDecision, LearningResult, LearningCallback ABC
- LearningEngine.learn_gap(gap, candidate, source=LEARNED) replaces
  callback-driven learn_at
- Validation moves from engine persist methods onto candidate models
  via validate_for_gap
- ReachabilityCandidate gains explicit source_name; either side may
  match the gap primitive
- New reachability_prerequisites() returns DepthGaps that must be
  filled before edge placement, replacing the invisible
  _learn_missing_depths nested callback
- contiguous_max_depth becomes a property on Primitive, shared by
  grounding and learning engines

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…dge-linter paradigm

- pyproject: 0.5.0 -> 0.6.0
- README: replace Auto-Learning section with integrator-owned Learning;
  drop on_learn from guard parameters and execution flow; update project
  structure for the new learning module layout; refresh wiring example
- docs/index.html: rewrite LEARNING section around the integrator-owned
  loop (check / fill / persist / re-check) and reachability prerequisites;
  drop on_learn from vre_guard parameter list; fix stale depth claim
  ("Planning requires D2 / Execution requires D3") to reflect that depth
  requirements are graph-derived with min_depth as an optional override

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@anormang1992 anormang1992 merged commit edd8912 into main May 8, 2026
2 checks passed
@anormang1992 anormang1992 deleted the feat/learning-loop-refactor branch May 8, 2026 17: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.

1 participant