This project evolved from a single-call test generator into a robust two-stage generation and execution pipeline:
- OpenAPI parsing and normalization
- Planner LLM generates structured test plan drafts
- Per-test executor LLM materializes HTTP tests with controlled concurrency
- Deterministic fallback keeps tests valid even when executor calls fail
- Tests are executed and tracked with run-level and dashboard summaries
This milestone adds a backend debug artifact trail and retrieval APIs to make failures easier to diagnose.
- Added strict planner schemas (test drafts, suite drafts, load drafts) with validation rules.
- Enforced endpoint normalization, status validation, and duplicate ID checks.
- Added structured repair flow when planner/executor outputs are invalid.
- Split generation into:
- Planner stage for intent and structure
- Executor stage for concrete test implementation
- Added queue-based per-test executor flow for HTTP tests with bounded concurrency.
- Added deterministic fallback policy on per-case failures.
- Preserved existing
/api/parse,/api/generate, and/api/executeworkflows. - Added additive
generation_metadiagnostics without breaking frontend contracts. - Improved error semantics:
422for structured-output validation failures502/503for upstream model failures
- Default execution/listing flows now target the latest generated batch when explicit IDs are not provided.
- Reduced accidental cross-batch mixing.
- Added persistent generation artifacts in SQLite (
generation_artifactstable). - Added
generation_idin/api/generateresponse for traceability. - Captured high-signal generation internals:
- Validated planner plan
- Per-case executor outcomes (success/failure, fallback used, error message)
- Final materialized suites and load scenarios
- Generation metadata and queue counters
- Added optional raw LLM output capture with redaction:
GEN_CAPTURE_RAW_LLM=falseby default- Sensitive fields (
authorization,token,api_key,password,cookie, etc.) are redacted before persistence
- Added debug retrieval APIs:
GET /api/generationsGET /api/generations/{generation_id}?include_raw=false
- Added structured backend logs for parse/generate/execute/loadtest lifecycles.
- Parse: OpenAPI source is parsed into normalized
ParsedAPI. - Generate:
- Planner creates a strict
PlannerTestPlan - HTTP drafts become executor jobs in an async worker queue
- Per-case failures fall back to deterministic draft conversion
- Generated artifacts and diagnostics are persisted
- Planner creates a strict
- Execute: Generated suites are executed (latest batch by default) and results persisted.
- Observe:
- Dashboard summarizes latest run
- Suites/results endpoints provide execution details
- Generations endpoints provide generation internals for debugging
From project root:
source .venv/bin/activate
set -a; source .env; set +a
export GEN_DEBUG_ARTIFACTS=true
export GEN_CAPTURE_RAW_LLM=false
export LOG_LEVEL=INFO
cd backend
uvicorn main:app --reload --port 8000Notes:
- Restart backend after changing env flags.
GEN_CAPTURE_RAW_LLM=falseis the safe default.
- Open Dashboard in frontend.
- Enter OpenAPI spec URL/path.
- Click
Parse. - Click
Generate Tests.
/api/generate now returns a generation_id for trace lookup.
# List recent generations
curl -s http://localhost:8000/api/generations | jq
# Inspect one generation artifact
GEN_ID="<generation_id>"
curl -s "http://localhost:8000/api/generations/$GEN_ID" | jqThis payload includes:
planner_planexecutor_case_outcomesfallback_case_idssuitesload_scenariosgeneration_meta
Enable raw capture:
export GEN_CAPTURE_RAW_LLM=trueThen restart backend, generate again, and call:
curl -s "http://localhost:8000/api/generations/$GEN_ID?include_raw=true" | jqBackend logs now include lifecycle events:
parse.start/parse.completegenerate.start/generate.completeexecute.start/execute.completeloadtest.start/loadtest.complete
These logs are the fastest way to diagnose where a run failed.
- Public demo APIs (e.g., Petstore) can be unstable and produce frequent 5xx responses.
- Full auth/stateful workflow compatibility is still limited.
- Artifact retention is currently indefinite (no cleanup policy yet).
- Debug UI integration is deferred; debug data is currently available via backend APIs.
- Add frontend debug view for generation artifacts and case-level lineage.
- Add retention/cleanup policy for generation artifacts and raw outputs.
- Introduce retry/backoff and flakiness classification for unstable targets.
- Add auth plugins and stateful dependency handling for broader API compatibility.
- Add optional strict response mode (full-body validation) for stable environments.