AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-275
  5. changes
  6. pr_description.md
pr_description.md(1.7 KB)· Apr 3, 2026· 1 min read
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

feat(#275): Compound phase merged-PR guard and docs-only diff validation#

Problem#

The compound phase was running before the task's PR was merged, and could produce artefacts that included src/ or test/ files — both are incorrect behaviors that needed runtime enforcement.

Task / Link#

Closes #275

Changes#

  • GitHubService.isPrMerged — new method that returns true when a PR is merged, false on 404 or open PR
  • PhaseRouterService pre-compound guard — blocks compound with BLOCKED:PERSISTENT if task.prNumber is null; BLOCKED:TRANSIENT if PR is not yet merged
  • PhaseRouterService post-compound diff validation — after compound COMPLETE, checks git diff in REPO_ROOT for src/ or test/ files; retries once with COMPOUND_DOCS_ONLY=1; signals BLOCKED:PERSISTENT on second violation
  • InternalAdapterService.advanceAndEnqueue — fail-fast guard that blocks compound enqueue when task.prNumber is null (complementary to the runtime check above)

Notes#

  • Diff check fails open (returns false) when REPO_ROOT is unset or git diff errors — pipeline continues rather than false-blocking
  • COMPOUND_DOCS_ONLY env var is passed to the compound skill on retry; the skill must respect it to avoid another violation
  • The InternalAdapterService guard is a fail-fast optimization; the PhaseRouterService guard is the authoritative check

Testing#

  • Unit tests added for all acceptance criteria: isPrMerged (merged/open/404), compound guard (null prNumber, unmerged PR, merged PR), diff validation (clean, first violation retry, second violation block), and advanceAndEnqueue compound guard (null prNumber blocked, prNumber set proceeds)
  • npm run test: 705/705 passing
  • npm run lint: 0 errors
PrdAgent-runner