feat: a second agent checks the P1 and P2 drafts before the reviewer sees them - #99
Merged
Conversation
…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
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
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.
Names a model in a new
validateblock and a second agent checks the draft before the reviewer sees it.What. After the drafting pass says PREPARED,
preparePrreads 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 amendoragent dismisseach 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
VALIDATEDline, a budget, a session limit or an unreadable listing exports the draft anyway, and the card reads1 P1 · unchecked. The check's rate limit is not a pause — the review is done. Both runs go in the run log (phasevalidate, outcomevalidated/timeout/failedwith 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/maxBudgetUsdare 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 fiveprepareProutcomes, the tick recording and its log line, the attendant's model, config/settings parsing, page fields, and a spawn test oflistThreadsagainstdist/index.jsover a real diffity session.Part of #93
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w