feat(guards): swarm pipeline guardrails for INT-2388 dogfooding defects#204
Merged
Conversation
Behavioral + deterministic guardrails against the systematic swarm defects surfaced reviewing autonomous PRs #201-207 (approve 3 / request-changes 3 / reject 1). Prompt rules (worker Rules + reviewer criteria, en + ko): - #1 on import/SDK failure, fix the env — never re-author a third-party package or spoof its __version__ - #2 cite the counterparty's real producer/consumer code for cross-service contracts; no self-referential tests - #4 don't delete "verified" statements without counter-evidence; include a before/after distribution for score/gate/metric changes - reviewer criteria: contract integrity, evidence & wiring, scope Deterministic guards (pipelineGuards, non-blocking): - deadModuleCheck (#5): flag newly-added source modules nothing imports/calls - reformatCheck (#6): flag reformat-only files and oversized diffs - getWorkingDiffDetail (gitTracker): per-file numstat + new/whitespace-only flags - surface non-blocking guard warnings to the reviewer (previously log-only) Wired via PipelineGuardsConfig (deadModuleCheck/reformatCheck) + config.example. Out of scope, tracked as follow-up: canonical-package registry (#1), deterministic contract verification (#2), orchestrator file-overlap serialization + PR-overlap report (#3).
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.
What
Behavioral + deterministic guardrails against the systematic swarm orchestrator defects surfaced while reviewing autonomous PRs #201–207 (approve 3 / request-changes 3 / reject 1). Tracks INT-2388.
Scope agreed for this PR: all 6 defects' prompt-side behavior + the two highest-leverage deterministic guards (#5, #6). The heavier greenfield items are split out as follow-ups (see below).
Changes
Prompt rules — worker
## Rules+ reviewer criteria (en + ko)__version__.Deterministic guards —
pipelineGuards.ts(non-blocking, warning → reviewer)deadModuleCheck(Guardrail integration for safe delegation #5): flags a newly-added source module that nothing imports/calls (git-grep by basename, skips tests + generic names). Catches "created but never wired" scaffolding.reformatCheck(refactor(tui): simplify pipeline event rendering logic #6): flags reformat-only files (diff vanishes undergit diff -w) and oversized diffs (scope creep).getWorkingDiffDetail(gitTracker): per-file numstat + new-file / whitespace-only flags. The working tree is the source of truth (worker edits aren't committed until reviewer-approve).ReviewerOptions.guardWarnings→ worker report), instead of dying in a log line.Wiring
PipelineGuardsConfig.deadModuleCheck/.reformatCheck(types + zod schema), enabled inconfig.example.yaml.Tests
pipelineGuards.test.ts(new): dead-module flag / no-flag-when-imported / ignore-tests / skip-generic; reformat-only / semantic / oversized; disabled path.gitTracker.test.ts:getWorkingDiffDetailadded/deleted, isNew, whitespaceOnly, non-git dir.prompts.test.ts: asserts the new worker rules + reviewer criteria (en + ko mirror).Out of scope — follow-up issues to file
autonomousRunner/conflictDetector/worktreeManager) — separate subsystem.🤖 Generated with Claude Code