Skip to content

core: implement Gated trait and state machine (T0.3) - #2

Merged
alejandro-nexcade merged 1 commit into
alejandro/t0.2-domain-modelfrom
alejandro/t0.3-gated-trait
Jun 28, 2026
Merged

core: implement Gated trait and state machine (T0.3)#2
alejandro-nexcade merged 1 commit into
alejandro/t0.2-domain-modelfrom
alejandro/t0.3-gated-trait

Conversation

@alejandro-nexcade

Copy link
Copy Markdown
Collaborator

Summary

  • Implements gate.rs with the shared Gated trait — one loop, written once (Invariant 3)
  • Pure state transitions as default methods: open, request_changes, approve, mark_reworked, mark_agent_failed
  • Both Review and ProjectPlan implement the same trait; stale flag logic on Review only

Test plan

  • 34 tests: every legal transition (6), every illegal transition (19), edge cases (comments cleared on reworked, preserved on agent failure, full cycle, retry), stale flag
  • cargo fmt, cargo clippy -- -D warnings, cargo test --all green

🤖 Generated with Claude Code

Add gate.rs with the shared review loop trait. Pure state transitions
(open, request_changes, approve, mark_reworked, mark_agent_failed) are
default methods enforcing SPEC.md §7. Both Review and ProjectPlan
implement the same trait — one loop, no forking. Stale flag logic is
Review-specific. 34 new tests cover every legal and illegal transition,
failure edges, comment clearing, and the stale flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alejandro-nexcade
alejandro-nexcade merged commit d0543d7 into alejandro/t0.2-domain-model Jun 28, 2026
1 check 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