Add case-mcp: persistent case store with evidence-gated finding lifecycle - #45
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
mcp-servers/case_store.py(shared module, same pattern asbudget_guard.py/dedupe_check.py) +mcp-servers/case-mcp/server.py(FastMCP wrapper).data/engagements/<slug>/case.db), resolved via the existingengagement_paths.py— reuses already-audited multi-target isolation, no new isolation logic.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.exploit-agent.mdandhuntbrain.mdin both harnesses (Claude Codetools:+ OpenCode prose), plusopencode.jsonc/.mcp.jsonregistration andARCHITECTURE.md/README.mdcount updates.Test plan
tests/test_case_store.py) — evidence gate, content-addressing dedup, confidence banding, experiment dedup, root-cause grouping/suggestion, next-action priority orderingruff checkclean on new filesopencode.jsonc/.mcp.jsonJSON validity, all 4 touched agent files' YAML frontmatter validity