Skip to content

Swe Diagnostics

SWE Diagnostics — mvp.swe_diagnostics

Cluster: Uncategorised | Type: component | MCP Tools: 6

Overview

Developer-facing diagnostic tools for understanding and debugging codebases. Wraps proven SWE-bench tooling (repo scanning, test analysis, build environment detection, code summarization, patch validation) as a standard G6 component.

Public API

SweDiagnosticsDecisionError(ValueError)

The LLM did not produce a usable, validated review-severity decision.

ReviewSeverityDecision

Validated review-severity verdict for a diagnostic-review decision.

Field Type Default
severity str required
baseline_severity str required
review_required bool False
degraded bool False
llm_used bool False
findings tuple[str, ...] ()
rationale str ''
raw_response str ''

Methods:

agentic_evidence() -> dict[str, Any]

to_dict() -> dict[str, Any]

SweDiagnosticsPlanner

Runtime-first facade with deterministic fallback + one-way review-severity clamp.

Field Type Default
runtime SweDiagnosticsRuntime \| None None
last_decision ReviewSeverityDecision \| None field(default=None, init=False)
last_llm_used bool field(default=False, init=False)
last_fallback_reason str field(default='', init=False)

Methods:

decide(op: str, data: Any, review_required: bool = False, warnings: Any = ()) -> ReviewSeverityDecision

SweDiagnosticsPatternRuntime

Stateless executable mechanisms for swe_diagnostics' applied patterns.

Methods:

tighten(severity: Any, baseline_severity: Any = '', review_required: bool = False, degraded: bool = False, patch_invalid: bool = False, high_config_issue: bool = False) -> SweDiagnosticsPatternReview

One-way diagnostic-review guard (hook-based-safety-guard-rails).

DiagnosticInput

Input for SWE diagnostic operations.

Field Type Default
op str required
path str ''
source str ''

DiagnosticOutput

Output from SWE diagnostic operations.

Field Type Default
op str required
data dict field(default_factory=dict)
warnings list[str] field(default_factory=list)
confidence float \| None None
coverage_notes list[str] field(default_factory=list)
review_required bool False
severity str \| None None
degraded bool False
llm_used bool False
agentic_evidence dict \| None None
completion_state str 'qualified-draft'
warning_card dict field(default_factory=dict)
evidence dict field(default_factory=dict)
request_id str ''
task_id str ''
run_id str ''

SweDiagnosticsSkillCatalog

Maps each applied pattern slug to a diagnostic-review skill record.

Methods:

list_skills() -> list[SweDiagnosticsSkill]

executable_skills() -> list[SweDiagnosticsSkill]

get(slug: str) -> SweDiagnosticsSkill | None

SweDiagnosticsBlock(AIBlock[DiagnosticInput, DiagnosticOutput, None])

Field Type Default
name str 'swe_diagnostics'
state None None

Methods:

infer(input: DiagnosticInput) -> Result[DiagnosticOutput]

Functions

deterministic_diagnostic_review(op: str, data: Any, review_required: bool = False, warnings: Any = ()) -> ReviewSeverityDecision

Demoted-real STRUCTURAL review floor (the zero-LLM baseline).

apply_review_floor(baseline: Any, candidate: Any) -> ReviewSeverityDecision

One-way review-severity safety clamp (stricter-of, ESCALATE only).

swe_diagnostics_pattern_guard(decision: ReviewSeverityDecision, signals: DiagnosticSignals | None = None) -> tuple[ReviewSeverityDecision, Any]

Apply the always-on one-way (escalate-only) structural guard to a decision.

grounded_diagnostic_review(op: str, data: Any, review_required: bool = False, warnings: Any = (), planner: SweDiagnosticsPlanner | None = None) -> ReviewSeverityDecision

The ONE shared grounded chokepoint for EVERY swe_diagnostics review decision.

applied_agentic_patterns() -> list[dict[str, Any]]

Return compact metadata for swe_diagnostics-applied vendored patterns.

get_skill_catalog() -> SweDiagnosticsSkillCatalog

MCP Tools

Operation Source
ops swe_diagnostics_mcp
help swe_diagnostics_mcp
assess swe_diagnostics_mcp
diagnose swe_diagnostics_mcp
list_patterns swe_diagnostics_mcp
source_health swe_diagnostics_mcp