Skip to content

Harden JetBrains inspection skill against false-green route and session states #388

Description

@cbusillo

Summary

The jetbrains-inspection skill and helper guidance should be hardened so agents cannot confidently treat ambiguous JetBrains inspection runs as clean readiness evidence.

A quick red-lane test on 2026-06-20 reproduced two relevant problems:

  1. The maintained WebStorm red-lane smoke in cbusillo/jetbrains-inspection-api failed to confirm RED for an intentionally broken fixture.
  2. Manual helper invocation can still produce GREEN/0 findings in a setup where the fixture is intentionally broken, depending on route/profile/scope selection.

Implementation issue filed in the plugin/helper repo:

Why This Matters

The skill is used during readiness/closeout flows. If route, worktree, session, profile, or scope ambiguity can resolve to GREEN, agents may report false confidence while inspecting the wrong project, stale project, parent git worktree, or a default profile that does not exercise expected findings.

The user concern was specifically that worktrees and session setup allow false greens. The quick test supports that concern.

Evidence

WebStorm red-lane smoke failed to confirm RED

From /Users/cbusillo/Developer/jetbrains-inspection-api:

./scripts/dogfood-red-lane-smoke.sh --product webstorm --json-out tmp/dogfood-red-lane-webstorm-quick.json

Observed:

status=failed bucket=red_not_confirmed verdict=UNKNOWN total=0 cleanup=closed

Key fields:

{
  "product": "webstorm",
  "verdict": "UNKNOWN",
  "verdict_reason": "inspection_trigger_empty_model",
  "total_problems": 0,
  "profile_resolved_name": "RedLane",
  "suspicious_empty_model": true
}

IntelliJ red-lane smoke confirmed RED

./scripts/dogfood-red-lane-smoke.sh --product intellij --json-out tmp/dogfood-red-lane-intellij-quick.json

Observed:

status=ok bucket=red_confirmed verdict=RED total=1 cleanup=closed

So RED is possible in the helper ecosystem; the issue is not just that all inspections are clean.

Manual false-green hazard

Manual invocation against the WebStorm fixture without --profile RedLane returned GREEN:

uv run /Users/cbusillo/Developer/codex-skills/jetbrains-inspection/scripts/jb-inspect.py \
  inspect-closeout \
  --repo /Users/cbusillo/Developer/jetbrains-inspection-api/test-fixtures/inspection-red-lane-webstorm \
  --ide WebStorm \
  --project-path /Users/cbusillo/Developer/jetbrains-inspection-api/test-fixtures/inspection-red-lane-webstorm \
  --worktree-path /Users/cbusillo/Developer/jetbrains-inspection-api/test-fixtures/inspection-red-lane-webstorm \
  --no-worktree-check \
  --scope all \
  --timeout-ms 120000 \
  --prepare-timeout-ms 60000

Observed:

STATUS: clean
VERDICT: GREEN reason=no_matching_findings
SUMMARY: clean=True total_problems=0 problems_shown=0

The fixture contains an intentional duplicate JSON property, so this is at minimum a warning that default profile/scope invocations can be misleading for proof-lane tests.

Route/worktree inference hazard

When targeting the nested fixture by repo path, the helper normalized the target to the parent git worktree:

target_worktree=/Users/cbusillo/Developer/jetbrains-inspection-api

while the actual open WebStorm project was:

base_path=/Users/cbusillo/Developer/jetbrains-inspection-api/test-fixtures/inspection-red-lane-webstorm

This required explicit --project-path, --worktree-path, and --no-worktree-check to target the fixture. The skill should warn agents away from trusting inferred route results in nested worktree/project situations.

Desired Skill / Helper Guidance Changes

  • Strengthen the skill text around GREEN evidence:
    • GREEN is valid only when the exact worktree/project route, scope, and profile are known and fresh.
    • If helper route diagnostics mention parent worktree normalization, unmatched open projects, stale session, missing profile, or inspection_trigger_empty_model, the result is UNKNOWN and not readiness evidence.
  • Make red-lane smoke a recommended health check before relying on JetBrains inspection for high-confidence readiness, especially after helper/plugin changes.
  • Add explicit guidance for nested projects and linked worktrees:
    • pass --project-path / --worktree-path when inspecting a nested project or non-root fixture;
    • do not use --no-worktree-check for normal repo readiness unless intentionally proving a nested fixture or documented exception;
    • do not report GREEN if the helper had to fall back to a parent worktree or another open project.
  • Consider adding a skill command or documented recipe for red-lane verification across products:
    • IntelliJ: ./scripts/dogfood-red-lane-smoke.sh --product intellij
    • WebStorm: ./scripts/dogfood-red-lane-smoke.sh --product webstorm
    • PyCharm if relevant.
  • Consider requiring agents to include inspection route evidence in closeout summaries when JB inspection is used:
    • IDE/product/version
    • project key/base path
    • scope/profile
    • verdict reason
    • stale/session status

Acceptance Criteria

  • The skill documentation makes it much harder for agents to convert UNKNOWN or ambiguous route/session state into GREEN.
  • The skill includes a concise red-lane verification workflow or points to the maintained jetbrains-inspection-api smoke script.
  • Guidance explicitly addresses worktrees, nested projects, and session setup as false-green risks.
  • The skill links to the implementation issue WebStorm red-lane proof fails to confirm RED and exposes false-green route risk jetbrains-inspection-api#113 as the current known WebStorm red-lane failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions