Skip to content

feat(guards): swarm pipeline guardrails for INT-2388 dogfooding defects#204

Merged
unohee merged 1 commit into
mainfrom
feat/int-2388-swarm-guardrails
Jul 2, 2026
Merged

feat(guards): swarm pipeline guardrails for INT-2388 dogfooding defects#204
unohee merged 1 commit into
mainfrom
feat/int-2388-swarm-guardrails

Conversation

@unohee

@unohee unohee commented Jul 2, 2026

Copy link
Copy Markdown
Owner

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)

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 under git 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).
  • Non-blocking guard warnings are now surfaced to the reviewer (ReviewerOptions.guardWarnings → worker report), instead of dying in a log line.

Wiring

  • PipelineGuardsConfig.deadModuleCheck / .reformatCheck (types + zod schema), enabled in config.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: getWorkingDiffDetail added/deleted, isNew, whitespaceOnly, non-git dir.
  • prompts.test.ts: asserts the new worker rules + reviewer criteria (en + ko mirror).
  • Full suite green: 1439 tests, 130 files. lint + typecheck + build clean.

Out of scope — follow-up issues to file

🤖 Generated with Claude Code

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).
@unohee unohee merged commit 17bdb91 into main Jul 2, 2026
9 checks passed
@unohee unohee deleted the feat/int-2388-swarm-guardrails branch July 2, 2026 14:33
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