Skip to content

P1-10: Decompose complex guard gates into independently testable predicates #143

Description

Backlog metadata


Summary

From the 20 September 2026 Violin dev duplication/library review, baseline 5ca0d9d6767b91fe809b2e4996c85ac65ba9e962. Priority: P1. Source locations and measurements describe the review baseline.

Scope

Refactor handlers/ptt_gates.py::_validate_phase_exit into table-driven predicates and a typed gate context; gates/hypothesis_gate.py::check_hypothesis_freshness into timestamp, receipt, target and semantic-progress checks; gates/command.py::check_command into an explicitly ordered gate pipeline.

Acceptance criteria

  • Characterize current decisions, denial messages and short-circuit ordering before changing structure.
  • Test each security decision independently plus representative combined failures.
  • Preserve fail-closed behavior; complexity reduction alone is not acceptance.
  • Keep each gate migration in a small PR; scope/target, hypothesis write and benchmark decomposition belong to their linked issues.

Dependencies / related work

Sequence after #134, #135.

#123 owns methodology skeletons and write-time obligation validation; #83 skill agreement; #124 completeness wording. These feature fixes are excluded.

Verification

Working branch: codex/review-gate-predicates, based on dev. Future PRs target dev; follow AGENTS.md and preserve fail-closed policy. Rebase dependent branches onto updated dev before implementation.

Implementation must pass uv run pytest, uv run ruff check ., uv run ruff format --check . and uv run python scripts/violin_guard.py check-release, plus the focused checks above. No implementation or test rerun is claimed by this tracking issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions