mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
24e30e0584
Multi-model routing layer with circuit breaking, PII redaction, and domain-specific prompts for the Queen coordinator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
139 lines
9.9 KiB
JSON
139 lines
9.9 KiB
JSON
{
|
|
"adr": "ADR-092",
|
|
"phase": "phase-0-value-proof",
|
|
"fixture_repo": "https://github.com/ruvnet/RuView",
|
|
"fixture_sha": "2a05378bd229df07eff3e309d414d65510ce507c",
|
|
"timestamp": "2026-04-11T17:32:32Z",
|
|
"trials": 10,
|
|
"failures": 0,
|
|
"total_cost_usd": 0.035873,
|
|
"avg_cost_usd": 0.0035873,
|
|
"total_tokens_in": 30953,
|
|
"total_tokens_out": 1640,
|
|
"avg_tokens_in": 3095,
|
|
"avg_tokens_out": 164,
|
|
"avg_latency_ms": 1436,
|
|
"results": [
|
|
{
|
|
"file": "v1/src/main.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 116,
|
|
"tokens_in": 1293,
|
|
"tokens_out": 131,
|
|
"cost_usd": 0.001686,
|
|
"latency_ms": 1308,
|
|
"wall_ms": 6057,
|
|
"advice_hash": "1016192a5a5f",
|
|
"advice": "1. Read the file content first with read_file tool - you haven't actually read it yet\n2. Identify all imports that need mocking: settings, logging, app, orchestrator, cli, uvicorn, asyncio, signal\n3. Map all execution paths: CLI mode vs server mode, production vs development, with/without config issues\n4. Create test structure: test_setup_signal_handlers, test_main_success_paths, test_main_error_paths, test_run\n5. Focus on branch coverage: settings validation branches, CLI vs server mode, exception handling"
|
|
},
|
|
{
|
|
"file": "v1/src/sensing/classifier.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 201,
|
|
"tokens_in": 2187,
|
|
"tokens_out": 145,
|
|
"cost_usd": 0.002622,
|
|
"latency_ms": 1396,
|
|
"wall_ms": 7452,
|
|
"advice_hash": "57fce8d75ef4",
|
|
"advice": "1. Create test file with imports: pytest, unittest.mock, and all classes from classifier.py\n2. Mock RssiFeatures dataclass - create fixtures with various variance/energy combinations\n3. Test PresenceClassifier.__init__ with different threshold values\n4. Test classify() with 9 scenarios: absent (low variance), present_still (high variance, low motion), active (high variance, high motion), edge cases at thresholds, with/without other_receiver_results\n5. Test _compute_confidence() directly for all 3 motion levels with varying inputs\n6. Test property getters\n7. Mock logger if needed"
|
|
},
|
|
{
|
|
"file": "v1/src/hardware/router_interface.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 240,
|
|
"tokens_in": 2531,
|
|
"tokens_out": 177,
|
|
"cost_usd": 0.0030619999999999996,
|
|
"latency_ms": 1431,
|
|
"wall_ms": 6933,
|
|
"advice_hash": "d488d58200a3",
|
|
"advice": "1. Create test file with imports: pytest, asyncio, unittest.mock, asyncssh\n2. Mock asyncssh.connect and SSHClientConnection methods\n3. Test groups in order:\n - __init__ validation (valid/invalid configs)\n - connect/disconnect (success/failure paths)\n - execute_command (connected/disconnected, retries, timeouts)\n - get_csi_data (exception handling)\n - get_router_status (parsing)\n - configure_csi_monitoring (valid/invalid channels)\n - health_check (success/failure)\n4. Use pytest.mark.asyncio for async tests\n5. Mock logger to verify log calls\n6. Parametrize edge cases for config validation and channel ranges"
|
|
},
|
|
{
|
|
"file": "v1/src/models/densepose_head.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 278,
|
|
"tokens_in": 3381,
|
|
"tokens_out": 146,
|
|
"cost_usd": 0.003819,
|
|
"latency_ms": 1404,
|
|
"wall_ms": 6399,
|
|
"advice_hash": "a3f0b7aa28a4",
|
|
"advice": "1. Create test file structure with imports, fixtures for config variations (valid, invalid, edge cases)\n2. Test `__init__`: valid config, missing fields, invalid values, optional parameters\n3. Test `forward`: correct output shape, input validation, FPN branch\n4. Test loss functions: `compute_segmentation_loss`, `compute_uv_loss`, `compute_total_loss` with various inputs\n5. Test `get_prediction_confidence` and `post_process_predictions` with mock tensors\n6. Mock all torch.nn modules in fixtures to avoid GPU dependencies\n7. Use parametrize for config variations and edge cases"
|
|
},
|
|
{
|
|
"file": "v1/src/api/middleware/auth.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 306,
|
|
"tokens_in": 3109,
|
|
"tokens_out": 187,
|
|
"cost_usd": 0.0036699999999999997,
|
|
"latency_ms": 1586,
|
|
"wall_ms": 8270,
|
|
"advice_hash": "331329681d32",
|
|
"advice": "1. Create test file with imports: pytest, unittest.mock, freezegun, jose.jwt\n2. Mock get_settings() to return test JWT config (secret_key, jwt_algorithm)\n3. Create fixtures: mock_request, mock_response, mock_call_next, auth_middleware instance\n4. Test dispatch() paths: public paths (skip auth), protected paths (require auth), other paths (optional auth)\n5. Test token extraction: Bearer header, query param, cookie, none found\n6. Test token verification: valid token, expired token, blacklisted token, invalid JWT, missing user ID\n7. Test TokenBlacklist: add/check tokens, cleanup logic with time mocking\n8. Test SecurityHeaders.add_security_headers() \n9. Test APIKeyAuth: verify, add, revoke operations"
|
|
},
|
|
{
|
|
"file": "v1/src/config.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 309,
|
|
"tokens_in": 3173,
|
|
"tokens_out": 171,
|
|
"cost_usd": 0.003686,
|
|
"latency_ms": 1564,
|
|
"wall_ms": 7875,
|
|
"advice_hash": "8da338dab6d1",
|
|
"advice": "1. Create test file structure: `test_config.py` with imports for pytest, unittest.mock, and necessary mocks\n2. Mock external dependencies: `get_settings()`, `get_domain_config()`, `validate_settings()`, and `Path.mkdir()`\n3. Test ConfigManager initialization and lazy loading of settings/domain_config properties\n4. Test all getter methods with mocked return values from settings/domain_config\n5. Test environment override methods (set/get/clear) with os.environ assertions\n6. Test reload methods to ensure cache clearing\n7. Test validate_configuration() with various exception scenarios\n8. Test get_full_config() to ensure all sub-configs are included\n9. Test global functions with mocked ConfigManager instance"
|
|
},
|
|
{
|
|
"file": "v1/src/api/middleware/rate_limit.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 325,
|
|
"tokens_in": 3572,
|
|
"tokens_out": 160,
|
|
"cost_usd": 0.004052,
|
|
"latency_ms": 1479,
|
|
"wall_ms": 7619,
|
|
"advice_hash": "7783ceea0799",
|
|
"advice": "1. Create test file with imports: pytest, unittest.mock, time, datetime, collections.deque\n2. Mock get_settings() to return test configuration with all rate limit values\n3. Create fixture for middleware instance with fresh state per test\n4. Test groups in order:\n - Exempt paths (health, metrics)\n - Client ID extraction (user/IP/user-agent)\n - Rate limit checking (general/path-specific/sliding window)\n - Client blocking/unblocking\n - Response headers\n - Edge cases: no client, empty deques, cleanup\n5. Use time.time() mocking for consistent timestamps\n6. Test both allowed and exceeded scenarios for each limit type"
|
|
},
|
|
{
|
|
"file": "v1/src/core/phase_sanitizer.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 346,
|
|
"tokens_in": 3898,
|
|
"tokens_out": 172,
|
|
"cost_usd": 0.0044139999999999995,
|
|
"latency_ms": 1284,
|
|
"wall_ms": 7146,
|
|
"advice_hash": "b7e85accc1f6",
|
|
"advice": "1. Create test file with imports: pytest, numpy, unittest.mock, scipy.signal\n2. Test PhaseSanitizer.__init__: valid config, missing fields, invalid unwrapping method, negative thresholds\n3. Test unwrap_phase: all three methods (numpy/scipy/custom), empty array handling, exception cases\n4. Test remove_outliers: enabled/disabled, outlier detection, interpolation edge cases\n5. Test smooth_phase: enabled/disabled, even/odd window sizes, boundary handling\n6. Test filter_noise: enabled/disabled, small array handling (<18 length)\n7. Test sanitize_phase: full pipeline, validation failures, statistics tracking\n8. Mock scipy.signal.butter and filtfilt for filter tests"
|
|
},
|
|
{
|
|
"file": "v1/src/services/orchestrator.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 394,
|
|
"tokens_in": 3706,
|
|
"tokens_out": 188,
|
|
"cost_usd": 0.00427,
|
|
"latency_ms": 1501,
|
|
"wall_ms": 7354,
|
|
"advice_hash": "bafb45fd0bbe",
|
|
"advice": "1. Create test file with imports for pytest, asyncio, unittest.mock\n2. Mock all external dependencies: Settings, HealthCheckService, MetricsService, get_hardware_service, get_pose_service, get_stream_service, connection_manager, PoseStreamHandler\n3. Test ServiceOrchestrator.__init__ with settings mock\n4. Test initialize() - success path, already initialized, and exception handling\n5. Test start() - success path, not initialized, already started, and exception handling\n6. Test shutdown() - normal shutdown and error cases\n7. Test background loops (_health_check_loop, _metrics_collection_loop) with cancellation\n8. Test restart_service, reset_services, get_service_status, get_service_metrics, get_service_info\n9. Test service_context manager"
|
|
},
|
|
{
|
|
"file": "v1/src/api/routers/health.py",
|
|
"model": "anthropic/claude-4-opus-20250522",
|
|
"line_count": 420,
|
|
"tokens_in": 4103,
|
|
"tokens_out": 163,
|
|
"cost_usd": 0.004592,
|
|
"latency_ms": 1413,
|
|
"wall_ms": 7853,
|
|
"advice_hash": "bfda7076aaff",
|
|
"advice": "1. Create test file: `test_health.py` in appropriate test directory\n2. Import required modules: pytest, unittest.mock, datetime, freezegun for time mocking\n3. Mock external dependencies: psutil functions, logger, request.app.state services\n4. Test each endpoint systematically: health_check, readiness_check, liveness_check, metrics, version\n5. Cover error paths: service exceptions, missing services, psutil failures\n6. Test helper functions: get_system_metrics, get_detailed_metrics, check_memory_availability, check_disk_space\n7. Use parametrize for multiple service status combinations in health_check\n8. Mock get_current_user for authenticated metrics endpoint"
|
|
}
|
|
]
|
|
}
|