Skip to content

Add compact inspection proof contract#115

Merged
cbusillo merged 1 commit into
mainfrom
fix/inspection-proof-contract
Jun 21, 2026
Merged

Add compact inspection proof contract#115
cbusillo merged 1 commit into
mainfrom
fix/inspection-proof-contract

Conversation

@cbusillo

Copy link
Copy Markdown
Owner

Summary

Adds a compact inspection proof contract to JetBrains inspection HTTP responses and hardens MCP output so ambiguous or contradictory inspection states do not look like clean readiness evidence.

What changed

  • Adds inspection_proof and proof_failures to plugin/API verdict-bearing responses.
  • Makes proof failures block GREEN inside the plugin verdict path.
  • Carries current run state into /api/inspection/problems so an older clean snapshot cannot be reported green while a newer inspection run is active.
  • Keeps specific UNKNOWN reasons such as timeout, stale_results, capture_incomplete, and inspection_still_running ahead of generic proof-failure messaging.
  • Changes MCP inspection outputs to put verdict guidance before JSON.
  • Sanitizes MCP UNKNOWN payloads by removing misleading zero-result fields, while preserving explicit include_stale=true cached diagnostics.
  • Keeps verbose capture_diagnostic in raw HTTP responses, but removes it from normal MCP text output to reduce agent-context noise.

Validation

Commit hook / local validation passed:

JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew test :mcp-server-jvm:test --tests com.shiny.inspectionmcp.InspectionSnapshotStateTest --tests com.shiny.inspectionmcp.InspectionHandlerTest --tests com.shiny.inspectionmcp.mcpserver.McpServerTest
# BUILD SUCCESSFUL

JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :test
# BUILD SUCCESSFUL

JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :inspection-core:test
# BUILD SUCCESSFUL

JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :mcp-server-jvm:test
# BUILD SUCCESSFUL

JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew buildPlugin
# BUILD SUCCESSFUL

Review Notes

A review-agent pass found real issues before this PR was opened. This branch includes fixes for them:

  • /problems now includes current run state before proof/verdict calculation.
  • MCP specific UNKNOWN reasons take precedence over generic inspection_proof_failed.
  • include_stale=true keeps requested cached findings visible for explicit diagnostics.

Refs #113
Refs #114
Refs cbusillo/codex-skills#388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant