Skip to content

feat: agent-learner v2 Phase 1 — core implementation#3

Merged
cafitac merged 3 commits intomainfrom
feature/agent-learner-v2-core
Apr 27, 2026
Merged

feat: agent-learner v2 Phase 1 — core implementation#3
cafitac merged 3 commits intomainfrom
feature/agent-learner-v2-core

Conversation

@cafitac
Copy link
Copy Markdown
Owner

@cafitac cafitac commented Apr 26, 2026

Summary

  • Add ModelPerf dataclass + v2 performance tracking fields to LearningRule (success_count, fail_count, needs_review, verify_cmd, model_performance, harness)
  • Add LearnerLLM protocol + ConfiguredLearnerLLM with config loading and timeout enforcement
  • Add AutoLearningPipeline: session processing, model-aware performance tracking, auto-promote, auto-deprecation
  • Add fanout.py: agent-learned.md generation + inject_dirs fan-out with thread lock and skip-on-identical
  • Add adapter/harness filter to RetrievalRequest + retrieve_rules

Test plan

  • 47 new tests added across 5 test files
  • 126 total tests passing (79 original + 47 new)
  • No regressions

Next

Phase 2: adapter rewrite (Hermit/Claude/Codex Stop hook installation + bootstrap CLI)

🤖 Generated with Claude Code

cafitac and others added 3 commits April 27, 2026 01:01
- Add ModelPerf dataclass + v2 fields to LearningRule (success_count,
  fail_count, needs_review, verify_cmd, model_performance, harness)
- Add LearnerLLM protocol + ConfiguredLearnerLLM with timeout enforcement
- Add AutoLearningPipeline: session processing, model-aware performance
  tracking, auto-promote, auto-deprecation
- Add fanout.py: agent-learned.md generation + inject_dirs fan-out
  with thread lock and skip-on-identical
- Add adapter/harness filter to RetrievalRequest + retrieve_rules
- 47 new tests, 126 total passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iew, verify_cmd) in lifecycle.py

Without this, rules lose harness tagging after index rebuild, causing
adapter-filtered retrieval to silently fall back to universal for all rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Inline _fanout_inner into fanout_agent_learned (single call site)
- Remove unused asdict import in pipeline_auto.py
- Remove redundant Path() wrapping in llm.py (already Path)
- Fix type annotations: should_inject_rule/score_rule accept RuleIndexEntry
- Simplify _build_prompt failure branch (direct string concat)
- Fix PEP 8 blank line spacing in retrieval.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cafitac cafitac merged commit 65264ad into main Apr 27, 2026
6 checks passed
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