Files
Gitea-Tools/tests/test_llm_workflow_split.py
T
sysadminandClaude Opus 4.8 c05b2f4c05 docs(skill): load canonical review-merge prompt into workflow file
Replace summary workflow with full §0–§38 canonical PR review/merge rules.
Align review-merge-final-report schema with §37 controller handoff fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-07 03:37:42 -04:00

51 lines
2.0 KiB
Python

"""Doc-contract checks for task-specific LLM workflow split (#333, #334)."""
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
SKILL_DIR = REPO_ROOT / "skills" / "llm-project-workflow"
def test_review_merge_workflow_file_exists():
path = SKILL_DIR / "workflows" / "review-merge-pr.md"
text = path.read_text(encoding="utf-8")
assert "canonical: true" in text
assert "review-merge-pr" in text
assert "## 0. Load the canonical workflow first" in text
assert "## 26A. Terminal review mutation hard-stop" in text
assert "## 37. Controller handoff schema" in text
assert "INVENTORY_PAGINATION_UNPROVEN" in text
assert "ALREADY_LANDED_RECONCILE_REQUIRED" in text
def test_review_merge_final_report_schema_exists():
path = SKILL_DIR / "schemas" / "review-merge-final-report.md"
text = path.read_text(encoding="utf-8")
assert "Controller Handoff" in text
assert "Candidate head SHA:" in text
assert "Terminal review mutation:" in text
assert "Workspace mutations" in text # documented as rejected
def test_skill_router_points_to_review_merge_workflow():
skill = (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8")
assert "## Task mode router" in skill
assert "workflows/review-merge-pr.md" in skill
assert "schemas/review-merge-final-report.md" in skill
assert "Identify task mode before any mutation" in skill
def test_skill_still_declares_controller_handoff_contract():
skill = (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8")
assert "## Controller Handoff" in skill
assert "assess_controller_handoff" in skill
assert "## Global LLM Worktree Rule" in skill
def test_review_pr_template_references_extracted_workflow():
text = (SKILL_DIR / "templates" / "review-pr.md").read_text(encoding="utf-8")
assert "workflows/review-merge-pr.md" in text
def test_merge_pr_template_references_extracted_workflow():
text = (SKILL_DIR / "templates" / "merge-pr.md").read_text(encoding="utf-8")
assert "workflows/review-merge-pr.md" in text