Repository navigation
feat(studio): L11a draft auto-review pass and routine/gated field classes - #1074
Merged
Merged
Conversation
…sses
Every created or restated ChangeDraft now gets its changed SpecChange
fields classified routine/gated (fail-closed table in
server/lifecycle/draftFields.ts), a sha256 fingerprint over
{patch, reason, baseVersion}, and a background draft_review pass that
stores an advisory DraftAutoReview on the draft and announces it with
draft.changed. Approval still always needs the user's click.
The review is fail-closed: missing key/refusal/failure/disabled settle
as 'unavailable' with fixed rationales, a >100k single value or >400k
assembled input escalates without a model call, and a restated draft's
old-fingerprint verdict is dropped by setAutoReview's conditional
write. DraftStore gains onDraftWritten, update (restates), setReviewInput
and setAutoReview; attachDraftReviews is wired once per workspace in
createWorkspaceContext.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
server/lifecycle/draftFields.ts: routine/gated classification for everySpecChange(fail-closed table — unlisted keys likename,limits,output,floware gated),classifyDraft, anddraftFingerprint(sha256 of stable-JSON{patch, reason, baseVersion}).server/passes/draftReview.ts: the ticket's byte-stableDRAFT_REVIEW_SYSTEM_PROMPT, truncatingdraftReviewOutputSchema,buildDraftReviewInputwith the 100k/400k budget guard, andattachDraftReviews— classifies, stampsclasses, enqueuesdraft_reviewkeyed${draft.id}:${fingerprint}, and writes the verdict only while the fingerprint still matches.DraftStore:classesfield,onDraftWrittenlistener seam,update(restates patch/reason and clearsautoReview),setReviewInput, conditionalsetAutoReview.createWorkspaceContext(workspace-local drafts/repo/events, global PassRunner/secrets/settings).DraftConcern, reshapedDraftAutoReview(clear|escalated|unavailable,safe: boolean|null),DraftFieldClasses,ChangeDraft.classes.Test plan
draftFields.test.ts— every class-table row, fingerprint key-order stability (39 tests)draftReview.test.ts— input sections/caps, schema truncation, verdict rule, outcome mapping, stale-fingerprint drop, budget guard, prompt snapshot (20 tests)draftStore.test.ts— update/listener/setReviewInput/setAutoReview coveragenpm run test:server --workspace apps/agent-forge— 1467 tests greennpm run typecheck[:server] --workspace apps/agent-forge— cleannpx fallow dead-code/dupes/health --complexity— cleanGenerated with Devin