Skip to content

Share the reachable-only triage policy; add whitebox --reachable-only - #168

Merged
dmdhrumilmistry merged 1 commit into
devfrom
feat/unify-reachable-triage
Oct 20, 2026
Merged

dmdhrumilmistry merged 1 commit into
devfrom
feat/unify-reachable-triage

Conversation

@dmdhrumilmistry

Copy link
Copy Markdown
Collaborator

Summary

Answers "why does gray-box have a different flow?" by removing the last real divergence.

Since the code-graph work, gray-box and white-box already share the engine (both call offat_wb.cpg.analyze + merge_with_patterns). The only thing left that differed was gray-box's reachable-only triage policy: spend AI tokens only on findings an exposed endpoint can reach, and triage the rest offline capped at inconclusive.

This lifts that policy into one shared helper — offat_triage.reachable_triage — so both pipelines use the same implementation instead of a gray-box-only copy:

  • graybox.analyze now delegates to it (keeping the gray-box system prompt and reachability-aware finding block).
  • offat-whitebox gains --reachable-only: the same token-discipline policy on the SAST pass.

The flows now converge to: shared engine + a reachability policy flag. Gray-box is white-box with --reachable-only on, plus the full endpoint inventory (endpoints.json).

Test plan

  • New triager/tests/test_reachable.py covers the shared policy (reachable → triaged, unreachable → capped + annotated)
  • All six suites pass (triager 7, graybox 11, whitebox 17)
  • offat-whitebox --reachable-only on the fixture: 18/19 reachable, 1 capped to inconclusive
  • Docs updated (whitebox flag table, source-modes); docs site builds

🤖 Generated with Claude Code

…le-only

Gray-box and white-box already share the code-graph engine; the only remaining
divergence was gray-box's reachable-only triage policy (spend AI tokens only on
findings an endpoint reaches, cap the rest offline). Lift that policy into one
shared helper, `offat_triage.reachable_triage`, so both pipelines use the same
implementation:

- graybox.analyze now delegates to it (keeping its gray-box prompt/block).
- whitebox gains `--reachable-only`, the same token-discipline policy on the
  SAST pass, so the flows converge to: shared engine + a reachability policy
  flag (gray-box additionally emits the full endpoint inventory).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 12:32

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.

@dmdhrumilmistry
dmdhrumilmistry merged commit 1154426 into dev Oct 20, 2026
14 checks passed
@dmdhrumilmistry
dmdhrumilmistry deleted the feat/unify-reachable-triage branch October 21, 2026 10:18
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.

2 participants