Skip to content

feat: a second agent checks the P1 and P2 drafts before the reviewer sees them - #99

Merged
fiddur merged 3 commits into
developfrom
feat/93-validate-pass
Sep 7, 2026
Merged

feat: a second agent checks the P1 and P2 drafts before the reviewer sees them#99
fiddur merged 3 commits into
developfrom
feat/93-validate-pass

Conversation

@fiddur

@fiddur fiddur commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Names a model in a new validate block and a second agent checks the draft before the reviewer sees it.

What. After the drafting pass says PREPARED, preparePr reads the session's threads (agent list --json) and keeps the open, non-general ones whose first comment opens P1, P2 or [must-fix]. None → nothing runs. Otherwise the checking model gets those findings as data — thread id, comment id, file, lines, body indented — and is told to leave, agent amend or agent dismiss each one, to add a finding only where checking revealed another, and to amend the general summary when its counts no longer stand. No review skill in its system prompt, the same deny list and stripped credentials as the drafting pass, and its own log beside it.

Why. Nearly half the measured prepares draft a P1 or P2, and those are the findings that cost the reviewer most when they are wrong. Checking them is a cheap second pass on the few that matter, decided by what was found rather than by diff size.

How. The draft is never lost to the check: a timeout, a missing VALIDATED line, a budget, a session limit or an unreadable listing exports the draft anyway, and the card reads 1 P1 · unchecked. The check's rate limit is not a pause — the review is done. Both runs go in the run log (phase validate, outcome validated/timeout/failed with the reason as the note), the hover lists them per phase, and with a checking model set a live answer uses it too. validate.model/timeoutMinutes/maxBudgetUsd are in the config file, the Settings panel and the README.

Verified. 1170 tests pass (552 in the CLI), typecheck clean, version 0.10.25. New: threadsToValidate, parseThreadList, composeValidatePrompt, validateVerdictOf, the five preparePr outcomes, the tick recording and its log line, the attendant's model, config/settings parsing, page fields, and a spawn test of listThreads against dist/index.js over a real diffity session.

Part of #93

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w

fiddur and others added 3 commits September 7, 2026 20:36
…sees them

Name a model in the new `validate` block and, after the drafting pass says
PREPARED, the daemon reads the session's threads and runs that model over the
findings that would hold up a merge: it leaves, amends or dismisses each one
against the code, and amends the general summary when its counts no longer
stand. No P1 or P2 means no second run at all.

Whatever the check comes to, the draft is kept: a timeout, a missing VALIDATED
line, a budget or a session limit exports the draft anyway and the card reads
"1 P1 · unchecked". Both runs land in the run log, and with a checking model set
a live answer uses it too — a question is about a finding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
…nce keeps the check

`summarizeFindings` tallied every thread in the bundle whatever its status. Until
this branch nothing dismissed a thread during preparation; now a wrong P1 the
checking pass drops would still read "1 P1" on the card. It counts open threads
only.

`validateVerdictOf` took VALIDATED only as the very last non-empty line; it now
reads from the end the way the drafting verdict does, so a sentence after the
verdict does not lose the check.

Also settles the CI failure the branch introduced: the spawn test of listThreads
waited for no one, and its temp root was removed while the diffity server it
started was still writing to it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
@fiddur
fiddur marked this pull request as ready for review September 7, 2026 18:47
@fiddur
fiddur merged commit 192297c into develop Sep 7, 2026
2 checks passed
@fiddur
fiddur deleted the feat/93-validate-pass branch September 7, 2026 18:47
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