Skip to content

Point analyze_misses diagnostic at vulnhunt/phases - #49

Open
adityaanikam wants to merge 1 commit into
capitalone:mainfrom
adityaanikam:fix-47-analyze-misses-phases-path
Open

adityaanikam wants to merge 1 commit into
capitalone:mainfrom
adityaanikam:fix-47-analyze-misses-phases-path

Conversation

@adityaanikam

Copy link
Copy Markdown

Fixes #47.

analyze_misses pointed the diagnostic at REPO_ROOT/skill/phases. REPO_ROOT is harness/ (local_harness/config.py), so that resolves to harness/skill/phases, which does not exist. The phase prompts are in vulnhunt/phases/. Since #10 the diagnostic session only has Read/Grep/Glob inside its --add-dir roots, so it could not read the prompts it is asked to fix, and claude accepts the missing --add-dir without an error.

Change

In harness/local_harness/benchmark/analyze_misses.py:

  • New PROJECT_ROOT (the parent of REPO_ROOT) and PROMPTS_DIR (vulnhunt/phases).
  • PHASE_TO_PROMPT lists vulnhunt/phases/... paths, resolved from PROJECT_ROOT. These are also the paths shown in MISS_ANALYSIS.md.
  • The diagnostic prompt, the system prompt, and the --add-dir use the same location.

I pointed it at the repository copy rather than the installed skill (PHASES_DIR in config.py), because the diagnostic suggests edits to these prompt files and the report then names files that exist in the repo. If you would rather it read the installed copy that the scan ran with, that is a small change.

Tests

Two tests in harness/tests/test_analyze_misses.py:

  • test_phase_prompt_files_exist: every file in PHASE_TO_PROMPT exists under the repository root.
  • test_invoke_diagnostic_add_dirs_exist: every --add-dir passed to claude is an existing directory.

Both fail on main, listing the skill/phases/... files and the harness/skill/phases directory, and pass with this change. The full harness suite passes on Linux (WSL, Python 3.12): pytest tests/ --cov=local_harness gives 214 passed, with coverage unchanged at 95%. I did not run a real diagnostic against claude.

analyze_misses resolved the phase prompts under REPO_ROOT/skill/phases.
REPO_ROOT is the harness/ directory, so that path does not exist; the
prompts live in vulnhunt/phases at the top of the repository. Since the
diagnostic session was limited to Read/Grep/Glob inside its --add-dir
roots, it could not read the prompts it is asked to fix, and claude
accepts the missing --add-dir without an error.

Resolve the prompts from the repository root in PHASE_TO_PROMPT, the
diagnostic prompt, the system prompt and the --add-dir, and add tests
that every prompt file and every --add-dir root exists.

Fixes capitalone#47
Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:25
@adityaanikam
adityaanikam requested a review from a team as a code owner October 8, 2026 10:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

harness: analyze_misses diagnostic can't read phase prompts (--add-dir points at nonexistent harness/skill/phases)

2 participants