feat: v1.1.0 — test coverage 80%+, OpenAPI docs, OpenAI adapter, CLI benchmarks#18
Merged
pixelstrade-dev merged 8 commits intomainfrom Apr 6, 2026
Merged
Conversation
Coverage results: - Statements: 73% → 96.5% - Branches: 48% → 82.1% - Functions: 57% → 91.5% - Lines: 75% → 96.7% New test files: - logger.test.ts: dev/prod output modes, all 4 log levels, data formatting - agents.test.ts: agent definitions, getAgentById, getAgentsByIds Extended test files: - composite.test.ts: parseThreshold env validation, getWeightsFromEnv edge cases - rate-limit.test.ts: getRateLimitHeaders, independent tracking, default config - api-routes-errors.test.ts: debate orchestrator logic, IP fallback, score happy path https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
- OpenAPI 3.1.0 spec covering all 6 API routes (9 operations) - /api/openapi.json serves the machine-readable spec - /api/docs serves interactive Swagger UI with dark theme - 14 tests validating spec completeness and $ref integrity - Documents all request/response schemas, error codes, rate limits - Describes 5 KPIs (CQ/AQ/CFI/EQ/SQ), debate formats, agent IDs Total: 113 tests, 8 suites https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
- New OpenAIAdapter (lib/adapters/openai.ts) with fetch-based API calls, retry/backoff, timeout, and custom base URL support (OPENAI_BASE_URL) - Adapter factory (lib/adapters/index.ts) selects provider via CAIMS_LLM_PROVIDER env var (anthropic | openai, default: anthropic) - Replaced all 4 getAnthropicAdapter() calls with getAdapter(): chat/route.ts, debate/[id]/route.ts, orchestrator.ts, scoring-engine.ts - Updated .env.example with new provider configuration - 19 new tests: adapter factory (8) + OpenAI adapter (11) - Updated existing test mocks to use new factory import Total: 132 tests, 10 suites https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
- cli/benchmark.ts: standalone CLI for scoring LLM interactions - Single interaction mode: --question + --response - Dataset mode: --file benchmarks/sample.json - Output: table (default) or JSON (--format json) - Results export: --output results.json - Parallel scoring: --concurrency 1-10 - Pass/fail thresholds via expected.minComposite/maxComposite - Exit code 1 if any items fail expectations (CI-friendly) - benchmarks/sample.json: 5-item reference dataset covering high-consciousness, aligned, context-drift, epistemic, mechanical - npm script: npm run benchmark - 7 new tests validating dataset schema and coverage Usage: npm run benchmark -- -f benchmarks/sample.json Total: 139 tests, 11 suites https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
- api-routes-errors.test.ts: mock scores now match CQDetails interface (phi_proxy/gwt_proxy/hot_proxy instead of integration/emergence) - logger.test.ts: cast process.env for NODE_ENV assignment (read-only in strict) - spec.test.ts: type op.responses as Record<string, unknown> for Object.keys() https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
…sness-framework-2EOiI
After merging origin/main, the ETHICIST agent was added to CAIMS_DEFAULT_AGENTS. Updated test assertions from 5 to 6 agents and added agt-ethicist to expected IDs. https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
4 améliorations Tier 1 issues #13, #11, #4, #5 :
/api/docs, spec JSON à/api/openapi.jsonCAIMS_LLM_PROVIDER=openai, factorygetAdapter(), retry/backoff,OPENAI_BASE_URLconfigurable, rétrocompatibilité totalenpm run benchmark -- -f benchmarks/sample.json, output table/JSON, pass/fail thresholds, concurrency, CI-friendly (exit code 1 on failure)Fichiers créés
lib/adapters/openai.ts— OpenAI adapter completlib/adapters/index.ts— Factory multi-providerlib/openapi/spec.ts— Spec OpenAPI 3.1.0app/api/docs/route.ts— Swagger UI dark themeapp/api/openapi.json/route.ts— Spec endpointcli/benchmark.ts— CLI scoring benchmarksbenchmarks/sample.json— 5 interactions de référenceFichiers modifiés
getAnthropicAdapter()→getAdapter().env.example— config multi-provider documentéedocs/OPEN_SOURCE_LAUNCH_STRATEGY.md— supprimé (doc interne confidentiel)Test plan
--helpvalidé)https://claude.ai/code/session_01Y7wiMwFa2D4P8zD9RhCgsv