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]>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""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
|
||||
Reference in New Issue
Block a user