Skip to content

feat(sdk): Add finding verification pass#290

Merged
dcramer merged 12 commits intomainfrom
feat/finding-verification
May 5, 2026
Merged

feat(sdk): Add finding verification pass#290
dcramer merged 12 commits intomainfrom
feat/finding-verification

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 5, 2026

Add a default-on second pass that verifies candidate findings before they are reported. The verifier runs through the existing runtime abstraction with the auxiliary model, can keep/revise/reject findings, and can be disabled with [defaults.verification] enabled = false.

This also pulls duplicated prompt-section construction into shared helpers and moves SDK/CLI post-analysis work into one postProcessFindings pipeline so dedupe, verification, merge, and fix-gate behavior stay aligned. High-verbosity output now logs processing events such as dedupe drops, verification revisions/rejections, cross-location merges, and stripped suggested fixes.

Validated with pnpm lint, pnpm run typecheck, pnpm build, pnpm test -- --maxWorkers=1, and pnpm test:evals.

Run candidate findings through a shared post-processing pipeline that deduplicates, verifies, merges, and gates suggested fixes before reporting.

Add shared prompt-section helpers so agent prompts use the same tagged structure, and emit debug finding-processing events for dropped, revised, merged, and stripped findings.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/sdk/verify.ts Outdated
Comment thread src/sdk/verify.ts Outdated
Comment thread src/sdk/verify.ts
Scan balanced JSON objects in verifier output and accept the first object matching the verdict schema. This keeps valid reject and revise decisions when the model emits reason before verdict.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Propagate authentication and subprocess failures from finding verification so runs do not silently succeed with unverified findings.

Keep verifier revisions anchored to the original validated finding location and fix payload, while still allowing severity and explanation changes.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/config/loader.ts
Use the existing defaults merge when resolving repo-defined skills in layered configs so base defaults apply unless the repo layer overrides them.

This preserves the base verification setting for repo-local skills when the repo config omits its own verification defaults.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/config/loader.ts
Comment thread src/sdk/verify.ts
Inherit only the layered defaults that repo-defined skills intentionally share from the base config.

Keep base verification inheritance without leaking unrelated defaults, and allow verifier reject responses to include finding = null.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
@dcramer dcramer marked this pull request as ready for review May 5, 2026 21:52
Include auxiliary usage when rendering skill costs in the Ink progress display and completed skill summary.

Verification now contributes to the displayed total cost once the run has reported auxiliary usage.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/cli/output/ink-runner.tsx
Comment thread src/cli/output/tasks.ts
Include auxiliary usage in CLI summaries, saved run listings, and GitHub core check skill rows so displayed costs match the full run cost.

Keep the usage contract unchanged by centralizing primary plus auxiliary cost formatting in the renderer helper layer.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/sdk/post-process.ts
Trigger fail-fast from final skill reports instead of per-file candidate findings so verification and other post-processing can reject false positives first.

Preserve skipped Ink skill state when skipped skills emit completion for JSONL streaming.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/cli/output/ink-runner.tsx
Comment thread src/sdk/post-process.ts
Comment thread src/sdk/verify.ts Outdated
Run verifier sessions with bounded internal concurrency so multiple candidate findings do not serialize every second-pass trace.

Preserve verifier authentication diagnostics and keep quiet fail-fast tied to final skill reports instead of file-level candidates.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Comment thread src/sdk/verify.ts Outdated
Pass the skill tool configuration into the verification runtime so the second-pass agent has the same read-only context the skill requested.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5fb055b. Configure here.

Comment thread src/sdk/verify.ts Outdated
Treat near-immediate duplicate SIGINT delivery as the same user interrupt so pnpm-wrapped runs can finish graceful shutdown instead of force-exiting after one Ctrl+C.

Preserve the later second Ctrl+C force-exit path.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Discard findings that never receive a verifier verdict when verification is aborted. This keeps interrupted and fail-fast-adjacent runs from surfacing unverified candidates as accepted findings.

Log the discard through the existing finding-processing debug path.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
@dcramer dcramer merged commit f42038b into main May 5, 2026
15 checks passed
@dcramer dcramer deleted the feat/finding-verification branch May 5, 2026 23:37
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