Files
OpenJarvis/tests/learning/test_learning_taxonomy.py
T
Jon Saad-FalconandClaude Opus 4.6 852259f18b Restructure codebase into 5-pillar architecture with MCP tool management, composition layer, and structured learning
Phase 1: Move RoutingContext to core/types.py, add RouterPolicy and QueryAnalyzer ABCs to intelligence/_stubs.py
Phase 2: Move memory backends to tools/storage/, convert memory/ to backward-compat shims
Phase 3: Add MCPToolAdapter, storage MCP tools, upgrade MCP server to spec 2025-11-25
Phase 4: Add SystemBuilder + JarvisSystem composition layer (system.py)
Phase 5: Add InstrumentedEngine for opt-in telemetry, simplify all agents
Phase 6: Add LearningPolicy ABC taxonomy with SFTPolicy, AgentAdvisorPolicy, ICLUpdaterPolicy
Phase 7: Update config schema (ToolsConfig, MCPConfig, TracesConfig, per-pillar learning policies)

Also: update all docs, README (DSPy-inspired), CLAUDE.md, and add logo assets.
1391 tests pass, 32 skipped. Zero new lint errors. Full backward compatibility via shims.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 05:57:13 +00:00

45 lines
1.2 KiB
Python

"""Tests for the learning policy ABC taxonomy."""
from __future__ import annotations
import pytest
from openjarvis.learning._stubs import (
AgentLearningPolicy,
IntelligenceLearningPolicy,
LearningPolicy,
ToolLearningPolicy,
)
class TestLearningPolicyABC:
def test_cannot_instantiate_base(self):
with pytest.raises(TypeError):
LearningPolicy()
def test_cannot_instantiate_intelligence(self):
with pytest.raises(TypeError):
IntelligenceLearningPolicy()
def test_cannot_instantiate_agent(self):
with pytest.raises(TypeError):
AgentLearningPolicy()
def test_cannot_instantiate_tools(self):
with pytest.raises(TypeError):
ToolLearningPolicy()
def test_target_intelligence(self):
assert IntelligenceLearningPolicy.target == "intelligence"
def test_target_agent(self):
assert AgentLearningPolicy.target == "agent"
def test_target_tools(self):
assert ToolLearningPolicy.target == "tools"
def test_hierarchy(self):
assert issubclass(IntelligenceLearningPolicy, LearningPolicy)
assert issubclass(AgentLearningPolicy, LearningPolicy)
assert issubclass(ToolLearningPolicy, LearningPolicy)