# Auto-Switch Re-Test Report
**Date**: 2025-10-15
**Time**: 21:56 UTC
**Branch**: `live-testing-integration`
**Test Run**: #2 (Re-test after initial bug report)
---
## Executive Summary
β **STILL FAILING** - Bug remains unfixed
**Critical Findings**:
1. π Same `ProjectValidationResult` error on all operations
2. β οΈ Auto-switch NOT activating (wrong project active)
3. β οΈ Health check inconsistency persists
---
## Test Results Comparison
| Test | Initial Run | Re-Test | Status |
|------|-------------|---------|--------|
| Config verification | β
PASS | β
PASS | No change |
| Active project check | β
PASS | β FAIL | **Worse** |
| Register entity type | β FAIL | β FAIL | No change |
| Create work item | β FAIL | β FAIL | No change |
| Query work items | β FAIL | β FAIL | No change |
| Health check | β οΈ PARTIAL | β οΈ PARTIAL | No change |
---
## Detailed Test Results
### β
Test 1: Config Verification
**Status**: PASSED (unchanged)
**Config Contents**:
```json
{
"version": "1.0",
"project": {"name": "codebase-mcp"},
"auto_switch": true
}
```
**Findings**:
- Config file still valid
- Auto-switch still enabled
- Project name: `codebase-mcp`
---
### β Test 2: Active Project Check
**Status**: FAILED (regression from initial test)
**Initial Test Result**:
- Active project: `codebase-mcp` β
- Project ID: `eca49f13-f342-4958-95a0-d7b9ba2a42eb` β
- Auto-switch appeared to work β
**Re-Test Result**:
- Active project: `commission-processing-vendor-extractors` β
- Project ID: `ee1e6ce5-ac7a-42a0-9582-75634df83ee8` β
- **Auto-switch did NOT activate** β
**Full Response**:
```json
{
"id": "ee1e6ce5-ac7a-42a0-9582-75634df83ee8",
"name": "commission-processing-vendor-extractors",
"description": "Commission statement processing system with vendor extractors for 45+ vendors",
"database_name": "wf_proj_commission_processing_vendor_e_777e5f9b",
"created_at": "2025-10-14T13:04:06.745030Z",
"updated_at": "2025-10-14T13:04:06.745030Z",
"metadata": {
"owner": "DataTeam",
"vendors_total": "45",
"backup_schedule": "daily",
"data_classification": "confidential",
"vendors_operational": "3"
}
}
```
**Analysis**:
- This is a **regression** - the first test showed auto-switch working
- Now showing a different project (from previous session?)
- Suggests auto-switch is **not reliable** or has timing issues
- May depend on server state or initialization order
---
### β Test 3: Register Entity Type
**Status**: FAILED (unchanged)
**Error**:
```
'ProjectValidationResult' object has no attribute 'get'
```
**Parameters**:
- `type_name`: "test_item"
- `schema`: `{"type": "object", "properties": {"status": {"type": "string"}}, "required": ["status"]}`
**Findings**:
- **Exact same error** as initial test
- Bug remains unfixed
- No code changes deployed to workflow-mcp
---
### β Test 4: Create Work Item
**Status**: FAILED (unchanged)
**Error**:
```
'ProjectValidationResult' object has no attribute 'get'
```
**Parameters**:
- `item_type`: "task"
- `title`: "Test Auto-Switch Functionality"
**Findings**:
- Same error pattern
- Affects all write operations
- Bug systematic across tool surface
---
### β Test 5: Query Work Items
**Status**: FAILED (unchanged)
**Error**:
```
'ProjectValidationResult' object has no attribute 'get'
```
**Findings**:
- Read operations also broken
- Not just write operations
- Complete feature failure
---
### β οΈ Test 6: Health Check
**Status**: PARTIAL (unchanged inconsistency)
**Response**:
```json
{
"status": "healthy",
"timestamp": "2025-10-15T21:56:11.703318+00:00",
"database": {
"registry": {
"status": "connected",
"pool": {"size": 1, "min_size": 2, "max_size": 10, "free_connections": 1}
},
"active_project": {
"status": "no_active_project" // β οΈ INCONSISTENT
}
},
"tools": {"count": 23, "categories": ["project", "entity", "work_item", "deployment", "health"]},
"metrics": {"uptime_seconds": 1506.63, "total_operations": 0, "recent_operations": {}},
"system": {"python_version": "3.13.7", "platform": "darwin", "server_version": "0.1.0"}
}
```
**Findings**:
- Shows `"no_active_project"` β
- But `get_active_project()` returned `commission-processing-vendor-extractors`
- **Same inconsistency** as initial test
- Suggests internal state management issue
---
## New Findings (Re-Test)
### 1. Auto-Switch Not Activating
**Critical Discovery**: Auto-switch did NOT switch to `codebase-mcp` project.
**Comparison**:
- **Initial Test**: Active project was `codebase-mcp` (correct) β
- **Re-Test**: Active project is `commission-processing-vendor-extractors` (wrong) β
**Possible Explanations**:
1. Auto-switch only works on first server startup
2. Auto-switch requires server restart to re-detect config
3. Auto-switch is unreliable and depends on timing
4. Previous session's project persists across restarts
**Impact**: Auto-switch feature is **unreliable** even when it doesn't error.
---
### 2. Bug Remains Unfixed
**Confirmation**: The `ProjectValidationResult` error is **unchanged**.
**Operations Still Broken**:
- β `register_entity_type()`
- β `create_entity()`
- β `create_work_item()`
- β `update_work_item()`
- β `query_entities()`
- β `query_work_items()`
**Operations Still Working**:
- β
`get_active_project()`
- β
`health_check()`
---
### 3. Server Uptime
**Observation**: `"uptime_seconds": 1506.63` (25 minutes)
This suggests:
- Server was restarted since initial test (~21:31)
- But auto-switch did NOT activate on restart
- Config file not being read on server init
---
## Root Cause Analysis (Updated)
### Bug #1: ProjectValidationResult Type Error
**Status**: **UNFIXED** π
**Error**: `'ProjectValidationResult' object has no attribute 'get'`
**Root Cause**: workflow-mcp validation returns Pydantic model instead of dict
**Location**: workflow-mcp server (not in this repository)
**Impact**: **All operations broken**
---
### Bug #2: Auto-Switch Not Activating
**Status**: **NEW FINDING** π
**Symptom**: Config file exists but wrong project is active
**Expected**: Active project should be `codebase-mcp`
**Actual**: Active project is `commission-processing-vendor-extractors`
**Root Cause Hypothesis**:
1. Config file not being read on server startup
2. Auto-switch logic only runs on first-ever startup
3. Cached project from previous session persists
4. Config discovery failing (wrong working directory?)
**Impact**: **Auto-switch unreliable**
---
### Bug #3: Health Check Inconsistency
**Status**: **UNFIXED** π
**Symptom**: `health_check()` shows `"no_active_project"`
**But**: `get_active_project()` returns project data
**Root Cause**: Different code paths for these operations
**Impact**: **Observability broken**
---
## Severity Assessment
| Bug | Severity | Impact | Workaround |
|-----|----------|--------|------------|
| ProjectValidationResult error | π΄ CRITICAL | All operations broken | Manual switch_project() |
| Auto-switch not activating | π HIGH | Feature doesn't work | Manual switch_project() |
| Health check inconsistency | π‘ MEDIUM | Wrong observability | Use get_active_project() |
---
## Comparison: Initial Test vs Re-Test
### What Got Worse
1. **Auto-switch activation**: Worked initially, now doesn't work β
- Initial: `codebase-mcp` active β
- Re-test: `commission-processing-vendor-extractors` active β
### What Stayed The Same (Broken)
1. **ProjectValidationResult error**: Still present β
2. **All operations fail**: No change β
3. **Health check inconsistency**: Still shows wrong state β
### What Stayed The Same (Working)
1. **Config file detection**: Still valid β
2. **get_active_project() works**: Still returns data β
3. **health_check() works**: Still returns (inconsistent) data β
---
## Tests Not Completed
Due to bugs, cannot proceed with:
- β Test 4: Create test entity (operation broken)
- β Test 6: Query entities (operation broken)
- β Test 7: Query work items (operation broken)
- β Test 8: Subdirectory navigation (can't verify without working operations)
- β Test 9: Cross-project isolation (**CRITICAL** - security test blocked)
- β Test 11: Environment variable override
**Tests completed**: 3/11 (27%)
**Tests blocked**: 8/11 (73%)
---
## Recommendations (Updated)
### Immediate Actions (workflow-mcp team)
#### Priority 1: Fix ProjectValidationResult Error π΄
**Action**: Fix the type error in validation logic
**Expected Fix**:
```python
# Current (broken):
def validate_project(config):
result = ProjectValidationResult(...)
return result # β Returns Pydantic model
# Fixed:
def validate_project(config):
result = ProjectValidationResult(...)
if not result.is_valid:
raise ValidationError(result.errors)
return result.project # β
Returns project dict/object
```
**Verification**: All operations should work after fix
---
#### Priority 2: Fix Auto-Switch Activation π
**Investigation Needed**:
1. When is config file read? (Startup only? Every request?)
2. How is working directory determined?
3. Why did it work in initial test but not re-test?
4. Is there caching/persistence of active project?
**Test Scenarios**:
1. Server restart with config file β should activate
2. Config file added while server running β should activate?
3. Config file in subdirectory β should discover parent config
**Verification**: Active project should match config on every test run
---
#### Priority 3: Fix Health Check Inconsistency π‘
**Action**: Ensure `health_check()` reflects actual active project state
**Expected**:
- If `get_active_project()` returns project X
- Then `health_check()` should show project X as active
**Verification**: Both endpoints should report consistent state
---
### Testing Requirements
Before declaring auto-switch production-ready:
1. β
**All 11 test scenarios must pass** (currently 3/11)
2. β
**Cross-project isolation must be verified** (Test 9 - security critical)
3. β
**Auto-switch must be consistent** (work on every server start)
4. β
**Health monitoring must be accurate** (observability critical)
5. β
**Subdirectory discovery must work** (Test 8)
6. β
**Environment override must work** (Test 11)
---
## Workaround (Still Valid)
Manual project switching bypasses the bugs:
```python
# Step 1: Find the codebase-mcp project ID
projects = await list_projects()
codebase_project = [p for p in projects if p['name'] == 'codebase-mcp'][0]
# Step 2: Manually switch
await switch_project(project_id=codebase_project['id'])
# Step 3: Operations should now work (if ProjectValidationResult bug is fixed)
await register_entity_type(...)
```
**Limitation**: This defeats the purpose of auto-switch.
---
## Conclusion
### Test Verdict: β **STILL FAILING**
**Summary**:
- π ProjectValidationResult bug: **UNFIXED**
- π Auto-switch activation: **REGRESSION** (worked initially, now broken)
- π Health check inconsistency: **UNFIXED**
- π Tests passed: **3/11 (27%)**
- π Tests blocked: **8/11 (73%)**
### Severity
**CRITICAL** π΄ - Feature is completely non-functional
1. All operations fail with type error
2. Auto-switch doesn't activate reliably
3. Observability broken (health check inconsistent)
4. Cannot test security-critical cross-project isolation
### Next Steps
1. **workflow-mcp team**: Fix all 3 bugs identified
2. **Testing**: Re-run complete 11-test suite after fixes
3. **Security**: Validate cross-project isolation (Test 9)
4. **Documentation**: Update auto-switch docs with findings
### Recommendation
**DO NOT DEPLOY** auto-switch feature to production until:
- β
All 3 bugs fixed
- β
All 11 tests pass
- β
Cross-project isolation verified
- β
Consistent behavior across server restarts
---
## Test Environment
**Date**: 2025-10-15 21:56 UTC
**Branch**: live-testing-integration
**workflow-mcp Version**: 0.1.0
**Python**: 3.13.7
**Platform**: darwin
**Server Uptime**: 1506.63 seconds (25 minutes)
---
## Appendix: Test Execution Timeline
```
21:56:00 - Config verification: PASSED β
21:56:01 - Active project check: FAILED (wrong project) β
21:56:02 - Register entity type: FAILED (ProjectValidationResult) β
21:56:03 - Create work item: FAILED (ProjectValidationResult) β
21:56:04 - Query work items: FAILED (ProjectValidationResult) β
21:56:11 - Health check: PARTIAL (inconsistent state) β οΈ
21:56:12 - Testing halted - bugs confirmed unfixed
```
---
**Report Status**: Auto-switch feature remains broken, awaiting workflow-mcp fixes