Skip to content

feat(studio): L11a draft auto-review pass and routine/gated field classes - #1074

Merged
LinuxDevil merged 1 commit into
mainfrom
fb-l11a
Nov 12, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fb-l11a

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • server/lifecycle/draftFields.ts: routine/gated classification for every SpecChange (fail-closed table — unlisted keys like name, limits, output, flow are gated), classifyDraft, and draftFingerprint (sha256 of stable-JSON {patch, reason, baseVersion}).
  • server/passes/draftReview.ts: the ticket's byte-stable DRAFT_REVIEW_SYSTEM_PROMPT, truncating draftReviewOutputSchema, buildDraftReviewInput with the 100k/400k budget guard, and attachDraftReviews — classifies, stamps classes, enqueues draft_review keyed ${draft.id}:${fingerprint}, and writes the verdict only while the fingerprint still matches.
  • DraftStore: classes field, onDraftWritten listener seam, update (restates patch/reason and clears autoReview), setReviewInput, conditional setAutoReview.
  • Wired once per workspace in createWorkspaceContext (workspace-local drafts/repo/events, global PassRunner/secrets/settings).
  • Wire types: DraftConcern, reshaped DraftAutoReview (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 coverage
  • npm run test:server --workspace apps/agent-forge — 1467 tests green
  • npm run typecheck[:server] --workspace apps/agent-forge — clean
  • npx fallow dead-code / dupes / health --complexity — clean

Generated with Devin

…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>
@LinuxDevil
LinuxDevil merged commit 67e0979 into main Nov 12, 2026
6 checks passed
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