mirror of
https://github.com/OthmanAdi/planning-with-files.git
synced 2026-09-14 16:09:40 +08:00
adbdc8e13a
Add an explicit /plan-execute approval command for the Pi extension so task_plan.md can be drafted and reviewed without activating plan injection, pre-tool recitations, post-write reminders, or auto-continue. Scope approval to the current session and plan path, reset it on session lifecycle events, and document the passive review flow with focused runtime and docs coverage.
46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
"""Documentation contract for Pi hook adaptation.
|
|
|
|
After full adaptation, Pi docs must no longer state that hooks are unsupported.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
|
PI_DOC = REPO_ROOT / "docs" / "pi-agent.md"
|
|
PI_SKILL_README = REPO_ROOT / ".pi" / "skills" / "planning-with-files" / "README.md"
|
|
|
|
|
|
UNSUPPORTED_SENTENCE = (
|
|
"Hooks (PreToolUse, PostToolUse, Stop) are **Claude Code specific** and are not currently supported in Pi Agent."
|
|
)
|
|
|
|
|
|
class PiDocsHookSupportTests(unittest.TestCase):
|
|
def test_docs_pi_agent_no_longer_claims_hooks_unsupported(self) -> None:
|
|
text = PI_DOC.read_text(encoding="utf-8")
|
|
self.assertNotIn(UNSUPPORTED_SENTENCE, text)
|
|
|
|
def test_pi_skill_readme_no_longer_claims_hooks_unsupported(self) -> None:
|
|
text = PI_SKILL_README.read_text(encoding="utf-8")
|
|
self.assertNotIn(UNSUPPORTED_SENTENCE, text)
|
|
|
|
def test_docs_describe_mode_based_behavior(self) -> None:
|
|
text = PI_DOC.read_text(encoding="utf-8")
|
|
self.assertIn("cache-safe", text)
|
|
self.assertIn("parity", text)
|
|
|
|
def test_docs_describe_plan_execute_confirmation(self) -> None:
|
|
text = PI_DOC.read_text(encoding="utf-8")
|
|
readme = PI_SKILL_README.read_text(encoding="utf-8")
|
|
self.assertIn("/plan-execute", text)
|
|
self.assertIn("/plan-execute", readme)
|
|
self.assertIn("passive", text)
|
|
self.assertIn("passive", readme)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|