Skip to content

Implement phase gate enforcement in state manager#25

Merged
sigent-ai-dev merged 1 commit into
mainfrom
feature/7-phase-gates
May 21, 2026
Merged

Implement phase gate enforcement in state manager#25
sigent-ai-dev merged 1 commit into
mainfrom
feature/7-phase-gates

Conversation

@sigent-ai-dev

Copy link
Copy Markdown
Owner

Summary

Adds phase gate enforcement to the state manager — can_advance() validates prior phase artefacts exist before allowing progression, advance_phase() atomically increments the phase counter. Ratchet gate additionally blocks on open CLR-NNN clarifications.

Changes

  • src/adm_cli/gates.py — gate logic with template frontmatter parsing
  • tests/test_gates.py — 12 tests covering all gate conditions
  • pyproject.toml — added pyyaml dependency
  • specs/007-phase-gates/spec.md — feature spec

Linked Issues

Closes #7

Test Plan

  • 59 tests pass
  • Blocks when prior phase artefacts missing
  • Blocks phase skipping (non-sequential)
  • Blocks beyond phase 7
  • Ratchet gate blocks on open CLRs
  • Ratchet gate passes when all resolved
  • advance_phase increments and saves atomically
  • Rejects nonexistent domain

Checklist

  • Spec followed: specs/007-phase-gates/spec.md
  • No secrets or credentials committed
  • Self-review completed

Adds gates.py with:
- can_advance(domain, target_phase) -> (bool, reason)
- advance_phase(domain) — increment + atomic save
- Validates prior phase artefacts exist (from template frontmatter)
- Ratchet gate: blocks on open CLR-NNN clarifications
- Rejects phase skipping and advancement beyond phase 7

Added pyyaml dependency for template frontmatter parsing.
59 tests pass (12 new for gates).

Closes #7
@sigent-ai-dev
sigent-ai-dev merged commit a6c91ff into main May 21, 2026
2 checks passed
@sigent-ai-dev
sigent-ai-dev deleted the feature/7-phase-gates branch May 21, 2026 00:19
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.

Implement phase gate enforcement in state manager

1 participant