Impact Report
The Impact Report is the output of swax plan. It's a Markdown document
echoed to stdout, summarizing the testing impact of API endpoint changes.
Report sections
The report has six sections, in this order:
- Summary — one-line human-readable summary.
- Risk — overall risk level:
HIGH,MEDIUM, orLOW. - Modified Endpoints — endpoint paths that changed.
- Affected Endpoints — endpoint paths transitively affected via the traceability graph.
- Requirements — testing requirements derived from the changes.
- Checklist — actionable verification items.
How plan builds it
- Reads
.swax/config.ymland loads the traceability graph. - Parses the local baseline specs.
- Shallow-clones the spec repository fresh.
- Per matching spec file pair, computes a structural diff and classifies endpoint changes (added / removed / modified).
- Merges everything into a single
EndpointDiff. - No changes → builds a
LOW-risk"No changes detected"report and skips the LLM. - Otherwise maps the changed paths onto the graph via
find_affected_endpoints, builds the system + user prompts, and runs a singleLLMClient.askcall. - Defensively parses the LLM's JSON into an
ImpactReport: - Strips prose and code fences around the JSON payload.
- Validates the JSON shape against the contract.
- Validates
riskagainst{HIGH, MEDIUM, LOW}— an invalid value falls back toMEDIUMwith aWARNINGlog. - Renders the report via
render_impact_reportand returns the Markdown.
Diff classification
EndpointDiff aggregates:
added: list[str]— endpoints in the current spec but not in the baseline.removed: list[str]— endpoints in the baseline but not in the current spec.modified: dict[str, list[str]]— path → list of change descriptions.
Helpers:
has_changes()→Truewhen any endpoint was added, removed, or modified.changed_paths()→ sorted, deduplicated union of added, removed, and modified paths.
The diff sees methods/parameters/schemas for analysis only — classified changes surface as paths with descriptions, never as method/schema-level entries.
Preconditions
.swax/config.ymlmust exist (initmust have been run)..swax/traceability.ymlmust exist (discovermust have been run) — otherwiseTraceabilityGraphMissingErroris raised.- LLM credentials must be present (
require_vars).
Errors
| Exception | Message |
|---|---|
MissingEnvironmentVariablesError |
Missing env vars: ... |
SpecParseError |
Failed to parse <path>: <reason> |
RepositoryCloneError |
Failed to clone <url>: <reason> |
SpecsNotFoundError |
Specs directory not found at <path> |
TraceabilityGraphMissingError |
Traceability graph not found at <path> — run \swax discover` first` |
LLMRateLimitedError |
LLM rate limited; retry later |
LLMCallError |
LLM call failed: <reason> |
UnsupportedLLMProtocolError |
Unsupported LLM protocol: <protocol> |
LLMResponseParseError |
LLM response parse failed: <reason> |
See also
- Traceability graph — how affected endpoints are computed.
- Commands / plan — CLI surface.
- Architecture / applications cell
— internal API (
run_plan,ImpactReport,render_impact_report).