Skip to content

feat(task): done-evidence gate — block move→done when PR not merged#250

Merged
garfieldstoun merged 2 commits into
mainfrom
linus/done-evidence-gate
Jun 12, 2026
Merged

feat(task): done-evidence gate — block move→done when PR not merged#250
garfieldstoun merged 2 commits into
mainfrom
linus/done-evidence-gate

Conversation

@howard-eridani

Copy link
Copy Markdown
Member

Summary

  • service.MoveTask now checks VCS link state when an agent transitions a task to done
  • If any linked PR is still open (not merged or closed) → 422 done_evidence_required with the PR title in the message
  • Tasks with no VCS links fall back to the review-gate standard: at least one artifact or comment required
  • System actors (auto_transition, subtask cascades) are fully exempt
  • Handler maps DoneEvidenceError{"code":"done_evidence_required","message":"..."} (same pattern as review-gate)

Test plan

  • TestTaskService_MoveTask_DoneGate_BlockedWhenPROpen — open PR → 422
  • TestTaskService_MoveTask_DoneGate_PassesWhenPRMerged — merged PR → pass
  • TestTaskService_MoveTask_DoneGate_PassesWhenPRClosed — closed PR → pass
  • TestTaskService_MoveTask_DoneGate_CommitLinkDoesNotBlock — commit link → pass (only PR-type gated)
  • TestTaskService_MoveTask_DoneGate_SystemActorExempt — system actor + open PR → pass
  • TestTaskService_MoveTask_DoneGate_NoVCSLinks_BlockedWhenNoEvidence — no VCS, no artifact, no comment → 422
  • TestTaskService_MoveTask_DoneGate_NoVCSLinks_PassesWithArtifact — artifact → pass
  • TestTaskService_MoveTask_DoneGate_NoVCSLinks_PassesWithComment — comment → pass

All pre-push checks green (full suite).

garfieldstoun and others added 2 commits June 12, 2026 23:30
When a task has VCS links and an agent moves it to done, MoveTask now
verifies that every linked PR is either merged or closed. An open PR
blocks with 422 done_evidence_required + message naming the PR.

If the task has no VCS links at all, falls back to the same standard
check as the review-gate: at least one artifact or comment is required.

System actors (auto_transition) are fully exempt so subtask cascades
are unaffected.

Changes:
- internal/service/task_service.go: vcsLinkRepo field + WithVCSLinkRepoTask
  option + done-gate block in MoveTask + DoneEvidenceError type
- internal/handler/task_handler.go: map DoneEvidenceError → 422 done_evidence_required
- cmd/api/main.go: wire WithVCSLinkRepoTask(vcsLinkRepo)
- internal/service/mock_repos_test.go: MockVCSLinkRepository
- internal/service/task_service_test.go: 8 done-gate tests (all pass)

Resolves: #2697392d — scope-extension from Riker comment on #381a8d25

Co-Authored-By: Garfield Stoun <garfieldstoun@users.noreply.github.com>
@garfieldstoun garfieldstoun merged commit fa3469c into main Jun 12, 2026
8 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.

2 participants