Skip to main content

Module cxpak

Module cxpak 

Source
Expand description

cxpak MCP client. trait CxpakClient abstracts transport; RecordedCxpakClient replays committed recordings (tests); RmcpCxpakClient (Task 4.5) is live. Typed DTOs with #[serde(default)] handle absent or null fields without manual fallback logic.

Structs§

ArchModule
Per-module architectural data from cxpak_architecture (cxpak 2.3.0 real shape).
Architecture
cxpak_architecture response. Top-level circular_deps + per-module arrays. The old plan had top-level boundary_violations/god_files — WRONG (Task 4.2 §9 fix).
CallGraph
DeadCode
DeadSymbol
Health
Predict
cxpak_predict response. cxpak 3.0.0 (ADR-0174) restructured this from a single risk_score (+ test_predictions) into per-file impact lists plus a confidence_summary string — verified against a live 3.0.0 MCP response. Both shapes are captured here; confidence_summary.is_some() discriminates 3.0.0 (whose risk_score is absent → would default to 0.0 and silently pass).
RecordedCxpakClient
Test double: replays a name→response map. Async but never awaits real I/O.
RmcpCxpakClient
Live MCP client: lazy-spawns cxpak serve --mcp <work_dir>, performs the MCP initialize handshake via rmcp, then issues tools/call with a 10 s timeout.
SecuritySurface
cxpak_security_surface response using cxpak 2.3.0 field names. Legacy names .secrets/.sql_injection are absent in real responses; secret_patterns/sql_injection_surface are the correct fields (0 findings in the golden fixture either way).
SpawnBackoff
Tracks consecutive child-spawn failures. When strikes() >= max, may_spawn() returns false and callers degrade to Observation::Skipped rather than retrying.
Verify
Violation

Traits§

CxpakClient
One MCP tool call. None = tool unavailable / errored / degraded — callers map None to Observation::Skipped (spec §5.6). Never panics on the caller.