Skip to content

Add case-mcp: persistent case store with evidence-gated finding lifecycle - #45

Merged
ankitsingh015 merged 2 commits into
mainfrom
claude/case-store-mcp
Aug 26, 2026
Merged

Add case-mcp: persistent case store with evidence-gated finding lifecycle#45
ankitsingh015 merged 2 commits into
mainfrom
claude/case-store-mcp

Conversation

@ankitsingh015

Copy link
Copy Markdown
Owner

Summary

First implementation slice of the persistent-state layer identified in a full codebase audit (see Batch 8 in the working fix-plan): HuntMCP's recon→scan→exploit→report pipeline, scope/budget/dedupe/audit/chain-templates/multi-target isolation are all real and already implemented, but nothing tracked a hypothesis, gated a CONFIRMED verdict on evidence, or scored finding confidence from named signals instead of LLM self-rating.

  • New mcp-servers/case_store.py (shared module, same pattern as budget_guard.py/dedupe_check.py) + mcp-servers/case-mcp/server.py (FastMCP wrapper).
  • One SQLite file per engagement (data/engagements/<slug>/case.db), resolved via the existing engagement_paths.py — reuses already-audited multi-target isolation, no new isolation logic.
  • Tables: hypotheses (NEW→TESTING→SUPPORTED/REFUTED/INCONCLUSIVE/CONFIRMED), findings (DISCOVERED→...→REPORTED, plus FALSE_POSITIVE/DUPLICATE/INCONCLUSIVE), evidence (content-addressed, SHA-256), experiments (dedup identical tests), root_causes.
  • update_finding_status() is a real enforcement point: rejects CONFIRMED/IMPACT_PROVEN transitions with zero linked evidence.
  • suggest_next_action()/suggest_root_cause() are heuristic v1s (finish what's in flight; group findings sharing a vuln_class+endpoint signature) — deliberately not an invented expected_value/information_gain formula, since there's no real cost/gain instrumentation yet to score against.
  • Wired into exploit-agent.md and huntbrain.md in both harnesses (Claude Code tools: + OpenCode prose), plus opencode.jsonc/.mcp.json registration and ARCHITECTURE.md/README.md count updates.

Test plan

  • 29 new tests (tests/test_case_store.py) — evidence gate, content-addressing dedup, confidence banding, experiment dedup, root-cause grouping/suggestion, next-action priority ordering
  • Full suite: 202 tests pass
  • ruff check clean on new files
  • opencode.jsonc/.mcp.json JSON validity, all 4 touched agent files' YAML frontmatter validity
  • Manual smoke test of the full flow (hypothesis → evidence → gated confirm → confidence score → experiment dedup → root cause) via the Python API directly

…ycle

Adds hypotheses/evidence/findings/experiments/root_causes tables (one
SQLite file per engagement, reused via engagement_paths.py) so a finding
can no longer be marked CONFIRMED with zero linked evidence, and repeated
tests can be checked against an experiment log instead of re-run blindly.
suggest_next_action()/suggest_root_cause() are heuristic v1s scoped to the
data actually available today, not an invented scoring formula.

Wired into exploit-agent.md and huntbrain.md in both harnesses.
…gnal values

Independent review flagged that a bad signals dict (e.g. a string value)
parsed fine as JSON but then crashed sum() with an unhandled TypeError --
FastMCP would surface that as a raw traceback instead of a clean error.
@ankitsingh015
ankitsingh015 merged commit b6fb4d6 into main Aug 26, 2026
7 checks passed
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