Files
Gitea-Tools/tests/test_workflow_commit_path_docs.py
T
sysadminandClaude Opus 4.8 2f4672218c docs: forbid improvised commit fallbacks when MCP commit exists (#260)
Document MCP-native gitea_commit_files as the only approved commit path when
gitea.repo.commit is allowed; ban WebFetch, Playwright, and manual base64
workarounds in runbooks and safety model. Add doc tests.

Closes #260.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-06 14:44:41 -04:00

33 lines
1.1 KiB
Python

"""Documentation checks for MCP-native commit path rules (#260)."""
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
RUNBOOK = REPO_ROOT / "docs" / "llm-workflow-runbooks.md"
SAFETY = REPO_ROOT / "docs" / "safety-model.md"
def test_runbook_requires_mcp_native_commit_path():
text = RUNBOOK.read_text(encoding="utf-8")
assert "MCP-native commit path" in text
assert "gitea_commit_files" in text
assert "gitea.repo.commit" in text
assert "only" in text.lower() and "approved" in text.lower()
lower = text.lower()
for forbidden in ("webfetch", "playwright", "manual llm-generated base64"):
assert forbidden in lower
def test_runbook_forbids_fallback_loops():
lower = RUNBOOK.read_text(encoding="utf-8").lower()
assert "retry shell encoding" in lower
assert "loop" in lower
assert "recovery report" in lower
def test_safety_model_documents_commit_fallback_ban():
text = SAFETY.read_text(encoding="utf-8")
assert "Agent Commit Path" in text
assert "gitea_commit_files" in text
assert "WebFetch" in text
assert "Playwright" in text
assert "llm-workflow-runbooks.md" in text