Skip to content

Commit 0e04659

Browse files
GeneAIclaude
authored andcommitted
feat: Release v3.3.3 - Reliability Improvements & Config Fixes
## Reliability Improvements - Structured error taxonomy in WorkflowResult (error_type, transient fields) - Auto-classification of errors: timeout, config, provider, validation, runtime - Configuration architecture documentation ## Refactor Advisor Enhancements (VSCode Extension v1.1.0) - Backend health indicator showing connection status - Cancellation mechanism for in-flight analysis - Pre-flight validation (Python and API key check) - Cancel button during analysis with proper cleanup ## Bug Fixes - EmpathyConfig.from_yaml() and from_json() now gracefully ignore unknown fields - Fixes TypeError: got an unexpected keyword argument 'provider' - Model ID test assertions updated to match registry (claude-sonnet-4-5-20250514) - Updated model_router docstrings to reflect current model IDs ## Tests - 5 new tests for EmpathyConfig unknown field filtering - 5 new tests for WorkflowResult error taxonomy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent bd62458 commit 0e04659

File tree

31 files changed

+5307
-34
lines changed

31 files changed

+5307
-34
lines changed

.claude/CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Empathy Framework - Production Security Configuration
22
# Location: ./.claude/CLAUDE.md
3-
# Project: empathy-framework v3.3.1
3+
# Project: empathy-framework v3.3.3
44
# Classification: INTERNAL
55

66
# Import pattern library summary (auto-generated)
@@ -405,5 +405,5 @@ By working on this project, I confirm:
405405
---
406406
407407
*This configuration enforces enterprise security while enabling the five-level empathy system.*
408-
*Last updated: 2025-12-27*
409-
*Empathy Framework v3.3.1*
408+
*Last updated: 2025-12-28*
409+
*Empathy Framework v3.3.3*

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
---
11+
12+
## [3.3.3] - 2025-12-28
13+
14+
### Added
15+
16+
**Reliability Improvements**
17+
- Structured error taxonomy in `WorkflowResult`:
18+
- New `error_type` field: `"config"` | `"runtime"` | `"provider"` | `"timeout"` | `"validation"`
19+
- New `transient` boolean field to indicate if retry is reasonable
20+
- Auto-classification of errors in `BaseWorkflow.execute()`
21+
- Configuration architecture documentation (`docs/configuration-architecture.md`)
22+
- Documents schema separation between `EmpathyConfig` and `WorkflowConfig`
23+
- Identifies `WorkflowConfig` naming collision between two modules
24+
- Best practices for config loading
25+
26+
**Refactor Advisor Enhancements** (VSCode Extension)
27+
- Backend health indicator showing connection status
28+
- Cancellation mechanism for in-flight analysis
29+
- Pre-flight validation (Python and API key check before analysis)
30+
- Cancel button during analysis with proper cleanup
31+
32+
### Fixed
33+
34+
- `EmpathyConfig.from_yaml()` and `from_json()` now gracefully ignore unknown fields
35+
- Fixes `TypeError: got an unexpected keyword argument 'provider'`
36+
- Allows config files to contain settings for other components
37+
- Model ID test assertions updated to match registry (`claude-sonnet-4-5-20250514`)
38+
- Updated model_router docstrings to reflect current model IDs
39+
40+
### Tests
41+
42+
- Added 5 tests for `EmpathyConfig` unknown field filtering
43+
- Added 5 tests for `WorkflowResult` error taxonomy (`error_type`, `transient`)
44+
45+
---
46+
47+
## [3.3.2] - 2025-12-27
48+
1049
### Added
1150

1251
**Windows Compatibility**

backend/api/wizard_api.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,35 @@
5858
from empathy_llm_toolkit.wizards.retail_wizard import RetailWizard # noqa: E402
5959
from empathy_llm_toolkit.wizards.sales_wizard import SalesWizard # noqa: E402
6060
from empathy_llm_toolkit.wizards.technology_wizard import TechnologyWizard # noqa: E402
61-
from empathy_software_plugin.wizards.advanced_debugging_wizard import (
61+
from empathy_software_plugin.wizards.advanced_debugging_wizard import ( # noqa: E402
6262
AdvancedDebuggingWizard,
63-
) # noqa: E402
64-
from empathy_software_plugin.wizards.agent_orchestration_wizard import (
63+
)
64+
from empathy_software_plugin.wizards.agent_orchestration_wizard import ( # noqa: E402
6565
AgentOrchestrationWizard,
66-
) # noqa: E402
67-
from empathy_software_plugin.wizards.ai_collaboration_wizard import (
66+
)
67+
from empathy_software_plugin.wizards.ai_collaboration_wizard import ( # noqa: E402
6868
AICollaborationWizard,
69-
) # noqa: E402
69+
)
7070
from empathy_software_plugin.wizards.ai_context_wizard import AIContextWindowWizard # noqa: E402
71-
from empathy_software_plugin.wizards.ai_documentation_wizard import (
71+
from empathy_software_plugin.wizards.ai_documentation_wizard import ( # noqa: E402
7272
AIDocumentationWizard,
73-
) # noqa: E402
74-
from empathy_software_plugin.wizards.enhanced_testing_wizard import (
73+
)
74+
from empathy_software_plugin.wizards.enhanced_testing_wizard import ( # noqa: E402
7575
EnhancedTestingWizard,
76-
) # noqa: E402
76+
)
7777

7878
# AI wizards (12 total)
7979
from empathy_software_plugin.wizards.multi_model_wizard import MultiModelWizard # noqa: E402
80-
from empathy_software_plugin.wizards.performance_profiling_wizard import (
80+
from empathy_software_plugin.wizards.performance_profiling_wizard import ( # noqa: E402
8181
PerformanceProfilingWizard as AIPerformanceWizard,
82-
) # noqa: E402
83-
from empathy_software_plugin.wizards.prompt_engineering_wizard import (
82+
)
83+
from empathy_software_plugin.wizards.prompt_engineering_wizard import ( # noqa: E402
8484
PromptEngineeringWizard,
85-
) # noqa: E402
85+
)
8686
from empathy_software_plugin.wizards.rag_pattern_wizard import RAGPatternWizard # noqa: E402
87-
from empathy_software_plugin.wizards.security_analysis_wizard import (
87+
from empathy_software_plugin.wizards.security_analysis_wizard import ( # noqa: E402
8888
SecurityAnalysisWizard,
89-
) # noqa: E402
89+
)
9090

9191
logging.basicConfig(level=logging.INFO)
9292
logger = logging.getLogger(__name__)

docs/configuration-architecture.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Configuration Architecture
2+
3+
This document explains the configuration schema separation in the Empathy Framework.
4+
5+
## Overview
6+
7+
The framework uses **two distinct configuration classes** for different concerns:
8+
9+
| Config Class | Location | Purpose |
10+
|-------------|----------|---------|
11+
| `EmpathyConfig` | `src/empathy_os/config.py` | Core empathy-level settings |
12+
| `WorkflowConfig` | `src/empathy_os/workflows/config.py` | Model routing and workflow settings |
13+
14+
## EmpathyConfig
15+
16+
Handles core empathy framework settings that control the five-level empathy system.
17+
18+
### Fields
19+
20+
```python
21+
@dataclass
22+
class EmpathyConfig:
23+
# Core settings
24+
user_id: str = "default_user"
25+
target_level: int = 3 # Empathy level 1-5
26+
confidence_threshold: float = 0.75
27+
28+
# Trust settings
29+
trust_building_rate: float = 0.05
30+
trust_erosion_rate: float = 0.10
31+
32+
# Persistence settings
33+
persistence_enabled: bool = True
34+
persistence_backend: str = "sqlite" # "sqlite", "json", "none"
35+
persistence_path: str = "./empathy_data"
36+
37+
# State management
38+
state_persistence: bool = True
39+
state_path: str = "./empathy_state"
40+
41+
# Metrics settings
42+
metrics_enabled: bool = True
43+
metrics_path: str = "./metrics.db"
44+
45+
# Logging settings
46+
log_level: str = "INFO"
47+
log_file: str | None = None
48+
structured_logging: bool = True
49+
50+
# Pattern library settings
51+
pattern_library_enabled: bool = True
52+
pattern_sharing: bool = True
53+
pattern_confidence_threshold: float = 0.3
54+
55+
# Advanced settings
56+
async_enabled: bool = True
57+
feedback_loop_monitoring: bool = True
58+
leverage_point_analysis: bool = True
59+
60+
# Custom metadata
61+
metadata: dict[str, Any] = field(default_factory=dict)
62+
```
63+
64+
### Loading
65+
66+
```python
67+
from empathy_os.config import EmpathyConfig, load_config
68+
69+
# Direct instantiation
70+
config = EmpathyConfig(user_id="alice", target_level=4)
71+
72+
# From file (auto-detects .yml or .json)
73+
config = EmpathyConfig.from_file("empathy.config.yml")
74+
75+
# With environment variable overrides
76+
config = load_config(use_env=True)
77+
```
78+
79+
### Unknown Fields
80+
81+
As of v3.3.3, `EmpathyConfig.from_yaml()` and `from_json()` **gracefully ignore unknown fields**. This allows config files to contain settings for other components (like `provider`, `model_preferences`) without breaking `EmpathyConfig` loading.
82+
83+
## WorkflowConfig
84+
85+
Handles model routing and workflow-specific settings.
86+
87+
### Fields
88+
89+
```python
90+
@dataclass
91+
class WorkflowConfig:
92+
# Default provider for all workflows
93+
default_provider: str = "anthropic"
94+
95+
# Per-workflow provider overrides
96+
workflow_providers: dict[str, str] = field(default_factory=dict)
97+
98+
# Custom model mappings (provider -> tier -> model)
99+
custom_models: dict[str, dict[str, str]] = field(default_factory=dict)
100+
101+
# Model pricing overrides
102+
pricing_overrides: dict[str, dict[str, float]] = field(default_factory=dict)
103+
104+
# XML prompt configuration
105+
xml_prompt_defaults: dict[str, Any] = field(default_factory=dict)
106+
workflow_xml_configs: dict[str, dict[str, Any]] = field(default_factory=dict)
107+
```
108+
109+
### Loading
110+
111+
```python
112+
from empathy_os.workflows.config import WorkflowConfig
113+
114+
# Load from default locations
115+
config = WorkflowConfig.load()
116+
117+
# Load from specific path
118+
config = WorkflowConfig.load(".empathy/workflows.yaml")
119+
```
120+
121+
## Config File Structure
122+
123+
The `empathy.config.yml` file can contain settings for **both** config classes:
124+
125+
```yaml
126+
# empathy.config.yml
127+
128+
# ===== WorkflowConfig fields =====
129+
provider: anthropic
130+
model_preferences:
131+
cheap: claude-3-5-haiku-20241022
132+
capable: claude-sonnet-4-5-20250514
133+
premium: claude-opus-4-5-20251101
134+
135+
workflows:
136+
max_cost_per_run: 5.00
137+
xml_enhanced: true
138+
139+
# ===== EmpathyConfig fields =====
140+
user_id: default_user
141+
target_level: 3
142+
confidence_threshold: 0.75
143+
persistence_enabled: true
144+
145+
# ===== Other component settings =====
146+
memory:
147+
enabled: true
148+
redis_url: redis://localhost:6379
149+
150+
telemetry:
151+
enabled: true
152+
storage: jsonl
153+
```
154+
155+
## Best Practices
156+
157+
1. **Use the right config class** for each context:
158+
- Building an EmpathyOS instance → `EmpathyConfig`
159+
- Running workflows → `WorkflowConfig`
160+
161+
2. **Environment variables** follow different prefixes:
162+
- `EMPATHY_*` → EmpathyConfig (e.g., `EMPATHY_USER_ID`)
163+
- `EMPATHY_WORKFLOW_*` → WorkflowConfig (e.g., `EMPATHY_WORKFLOW_PROVIDER`)
164+
165+
3. **Don't duplicate fields** between config classes. Each class owns its domain.
166+
167+
## Migration Notes
168+
169+
If you encounter `TypeError: EmpathyConfig.__init__() got an unexpected keyword argument`:
170+
171+
1. Ensure you're using v3.3.3+ which filters unknown fields
172+
2. Or manually filter the config data before passing to the constructor
173+
3. Consider using the appropriate config class for your use case
174+
175+
## WorkflowConfig Naming Collision
176+
177+
**Important:** There are two classes named `WorkflowConfig` in the codebase:
178+
179+
| Class | Location | Purpose |
180+
|-------|----------|---------|
181+
| `WorkflowConfig` | `src/empathy_os/workflows/config.py` | Model routing settings (provider, tiers) |
182+
| `WorkflowConfig` | `empathy_llm_toolkit/config/unified.py` | Agent workflow execution settings |
183+
184+
These are **completely different classes** with different fields:
185+
186+
```python
187+
# empathy_os.workflows.config.WorkflowConfig (dataclass)
188+
# Used for: Model routing and provider selection
189+
WorkflowConfig(
190+
default_provider="anthropic",
191+
workflow_providers={"code_review": "openai"},
192+
custom_models={...}
193+
)
194+
195+
# empathy_llm_toolkit.config.unified.WorkflowConfig (Pydantic)
196+
# Used for: Agent workflow execution configuration
197+
WorkflowConfig(
198+
name="my_workflow",
199+
mode="sequential",
200+
max_iterations=10,
201+
timeout_seconds=300
202+
)
203+
```
204+
205+
**Recommendation:** When importing, use explicit module paths:
206+
```python
207+
from empathy_os.workflows.config import WorkflowConfig as ModelRoutingConfig
208+
from empathy_llm_toolkit.config.unified import WorkflowConfig as AgentWorkflowConfig
209+
```
210+
211+
## Related Files
212+
213+
- `src/empathy_os/config.py` - EmpathyConfig implementation
214+
- `src/empathy_os/workflows/config.py` - WorkflowConfig (model routing)
215+
- `empathy_llm_toolkit/config/unified.py` - WorkflowConfig (agent workflows)
216+
- `src/empathy_os/models/registry.py` - Model registry (source of model IDs)
217+
- `empathy.config.yml` - Main configuration file

0 commit comments

Comments
 (0)