🗑️ remove(progress): drop workflow state tracking
Use plan-status as the only machine state source for plan queueing, claiming, and finishing. Route record-plan through queue insertion and update templates/prompts to match the single-state model. BREAKING CHANGE: playbook.py -record-spec and main_loop.py record are removed.
This commit is contained in:
@@ -33,7 +33,7 @@ class PlaybookCliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("Usage:", result.stdout + result.stderr)
|
||||
|
||||
def test_record_spec_updates_progress_workflow_state(self):
|
||||
def test_record_spec_is_removed(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -47,12 +47,13 @@ class PlaybookCliTests(unittest.TestCase):
|
||||
str(progress),
|
||||
)
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
|
||||
self.assertEqual(result.returncode, 2)
|
||||
self.assertIn("-record-spec has been removed", result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: planning", text)
|
||||
self.assertIn("spec: docs/superpowers/specs/2026-05-18-demo-design.md", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertNotIn("2026-05-18-demo-design.md", text)
|
||||
|
||||
def test_record_plan_updates_progress_workflow_state(self):
|
||||
def test_record_plan_appends_pending_plan_status(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -62,12 +63,10 @@ class PlaybookCliTests(unittest.TestCase):
|
||||
[
|
||||
"# 当前进展",
|
||||
"",
|
||||
"## Workflow State",
|
||||
"## Plan Status",
|
||||
"",
|
||||
"<!-- workflow-state:start -->",
|
||||
"phase: planning",
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md",
|
||||
"<!-- workflow-state:end -->",
|
||||
"<!-- plan-status:start -->",
|
||||
"<!-- plan-status:end -->",
|
||||
]
|
||||
)
|
||||
+ "\n",
|
||||
@@ -83,13 +82,44 @@ class PlaybookCliTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: planning", text)
|
||||
self.assertIn("spec: docs/superpowers/specs/2026-05-18-demo-design.md", text)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-05-18-demo.md", text)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("- [ ] `2026-05-18-demo.md` pending", text)
|
||||
|
||||
def test_record_plan_appends_pending_plan_status_after_existing_entries(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
progress.parent.mkdir(parents=True)
|
||||
progress.write_text(
|
||||
"\n".join(
|
||||
[
|
||||
"# 当前进展",
|
||||
"",
|
||||
"## Plan Status",
|
||||
"",
|
||||
"<!-- plan-status:start -->",
|
||||
"- [ ] `2026-05-18-first.md` pending",
|
||||
"<!-- plan-status:end -->",
|
||||
]
|
||||
)
|
||||
+ "\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = run_cli(
|
||||
"-record-plan",
|
||||
"docs/superpowers/plans/2026-05-18-second.md",
|
||||
"-progress",
|
||||
str(progress),
|
||||
)
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stdout + result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("- [ ] `2026-05-18-first.md` pending", text)
|
||||
self.assertIn("- [ ] `2026-05-18-second.md` pending", text)
|
||||
self.assertLess(
|
||||
text.index("`2026-05-18-first.md`"),
|
||||
text.index("`2026-05-18-second.md`"),
|
||||
)
|
||||
|
||||
def test_missing_config_is_error(self):
|
||||
|
||||
+114
-147
@@ -11,6 +11,7 @@ from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SCRIPT = ROOT / "scripts" / "main_loop.py"
|
||||
PLAYBOOK_SCRIPT = ROOT / "scripts" / "playbook.py"
|
||||
|
||||
_SPEC = importlib.util.spec_from_file_location("playbook_main_loop", SCRIPT)
|
||||
assert _SPEC and _SPEC.loader
|
||||
@@ -82,15 +83,65 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("<!-- workflow-state:start -->", text)
|
||||
self.assertIn("<!-- workflow-state:end -->", text)
|
||||
self.assertIn("phase: executing", text)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-01-01-old.md", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("<!-- plan-status:start -->", text)
|
||||
self.assertIn("<!-- plan-status:end -->", text)
|
||||
self.assertIn("`2026-01-01-old.md` in-progress", text)
|
||||
self.assertIn("claimed_by:", text)
|
||||
self.assertIn("claimed_at:", text)
|
||||
self.assertIn("`2026-01-02-new.md` pending", text)
|
||||
|
||||
def test_claim_uses_plan_status_order_before_filename_order(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
plans_dir = root / "docs" / "superpowers" / "plans"
|
||||
plans_dir.mkdir(parents=True)
|
||||
(plans_dir / "2026-01-01-alpha.md").write_text(
|
||||
valid_plan_text("alpha"), encoding="utf-8"
|
||||
)
|
||||
(plans_dir / "2026-01-02-beta.md").write_text(
|
||||
valid_plan_text("beta"), encoding="utf-8"
|
||||
)
|
||||
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
progress.parent.mkdir(parents=True)
|
||||
progress.write_text(
|
||||
"\n".join(
|
||||
[
|
||||
"# 当前进展",
|
||||
"",
|
||||
"## Plan Status",
|
||||
"",
|
||||
"<!-- plan-status:start -->",
|
||||
"- [ ] `2026-01-02-beta.md` pending",
|
||||
"- [ ] `2026-01-01-alpha.md` pending",
|
||||
"<!-- plan-status:end -->",
|
||||
"",
|
||||
]
|
||||
)
|
||||
+ "\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = run_cli(
|
||||
"claim",
|
||||
"-plans",
|
||||
"docs/superpowers/plans",
|
||||
"-progress",
|
||||
"memory-bank/progress.md",
|
||||
cwd=root,
|
||||
)
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
self.assertEqual(
|
||||
result.stdout.strip(),
|
||||
"PLAN=docs/superpowers/plans/2026-01-02-beta.md",
|
||||
)
|
||||
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("- [ ] `2026-01-02-beta.md` in-progress", text)
|
||||
self.assertIn("- [ ] `2026-01-01-alpha.md` pending", text)
|
||||
|
||||
def test_claim_preserves_human_progress_sections_when_plan_block_missing(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
@@ -134,7 +185,7 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("- keep-this-focus", text)
|
||||
self.assertIn("- keep-this-change", text)
|
||||
self.assertIn("<!-- workflow-state:start -->", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("<!-- plan-status:start -->", text)
|
||||
self.assertIn("`2026-01-01-demo.md` in-progress", text)
|
||||
|
||||
@@ -198,10 +249,6 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
[
|
||||
"# Plan 状态",
|
||||
"",
|
||||
"<!-- workflow-state:start -->",
|
||||
"phase: planning",
|
||||
"<!-- workflow-state:end -->",
|
||||
"",
|
||||
"<!-- plan-status:start -->",
|
||||
"- [ ] `2026-01-01-deleted.md` pending",
|
||||
"- [ ] `2026-01-02-live.md` pending",
|
||||
@@ -351,7 +398,7 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
self.assertIn("missing required Plan Meta", result.stderr)
|
||||
self.assertIn("2026-01-01-invalid.md", result.stderr)
|
||||
|
||||
def test_claim_records_claim_metadata_in_workflow_state(self):
|
||||
def test_claim_records_claim_metadata_in_plan_status(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
plans_dir = root / "docs" / "superpowers" / "plans"
|
||||
@@ -375,10 +422,13 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
text = (root / "memory-bank" / "progress.md").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
self.assertIn("claimed_by: codex-test", text)
|
||||
self.assertIn(
|
||||
"- [ ] `2026-01-01-demo.md` in-progress: claimed_by: codex-test; ",
|
||||
text,
|
||||
)
|
||||
self.assertRegex(text, r"claimed_at: \d{4}-\d{2}-\d{2}T")
|
||||
|
||||
def test_claim_clears_stale_verification_from_workflow_state(self):
|
||||
def test_claim_removes_legacy_workflow_state(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
plans_dir = root / "docs" / "superpowers" / "plans"
|
||||
@@ -420,6 +470,7 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertNotIn("verification: old evidence", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
|
||||
def test_finish_updates_line(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
@@ -469,11 +520,6 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
[
|
||||
"# Plan 状态",
|
||||
"",
|
||||
"<!-- workflow-state:start -->",
|
||||
"phase: executing",
|
||||
"plan: docs/superpowers/plans/2026-01-03-demo.md",
|
||||
"<!-- workflow-state:end -->",
|
||||
"",
|
||||
"<!-- plan-status:start -->",
|
||||
"- [ ] `2026-01-03-demo.md` in-progress",
|
||||
"<!-- plan-status:end -->",
|
||||
@@ -503,12 +549,9 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
"verified: python -m unittest tests.test_main_loop_cli",
|
||||
text,
|
||||
)
|
||||
self.assertIn(
|
||||
"verification: python -m unittest tests.test_main_loop_cli",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
|
||||
def test_finish_without_verified_clears_stale_verification(self):
|
||||
def test_finish_without_verified_removes_legacy_workflow_state(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -549,9 +592,13 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertNotIn("verification: old evidence", text)
|
||||
self.assertIn("phase: blocked", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn(
|
||||
"- [ ] `2026-01-03-demo.md` blocked: needs confirmation",
|
||||
text,
|
||||
)
|
||||
|
||||
def test_finish_updates_workflow_phase_and_preserves_metadata(self):
|
||||
def test_finish_removes_legacy_workflow_state_and_updates_plan_line(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -596,17 +643,11 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: done", text)
|
||||
self.assertIn(
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md", text
|
||||
)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertNotIn("2026-05-18-demo-design.md", text)
|
||||
self.assertIn("- [x] `2026-05-18-demo.md` done", text)
|
||||
|
||||
def test_finish_skipped_updates_workflow_phase_to_skipped(self):
|
||||
def test_finish_skipped_updates_plan_line_only(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -650,10 +691,10 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: skipped", text)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("- [ ] `2026-05-18-demo.md` skipped: obsolete", text)
|
||||
|
||||
def test_record_updates_workflow_state_block(self):
|
||||
def test_record_mode_is_removed(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -691,21 +732,12 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
cwd=root,
|
||||
)
|
||||
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
self.assertEqual(result.returncode, 2)
|
||||
self.assertIn("unknown mode: record", result.stderr)
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("<!-- workflow-state:start -->", text)
|
||||
self.assertIn("phase: planning", text)
|
||||
self.assertIn(
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md", text
|
||||
)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-05-18-demo.md", text)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
|
||||
def test_record_claim_finish_workflow_chain(self):
|
||||
def test_record_plan_claim_finish_queue_chain(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
plans_dir = root / "docs" / "superpowers" / "plans"
|
||||
@@ -717,35 +749,10 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
progress.parent.mkdir(parents=True)
|
||||
|
||||
result = run_cli(
|
||||
"record",
|
||||
"-progress",
|
||||
"memory-bank/progress.md",
|
||||
"-phase",
|
||||
"planning",
|
||||
"-spec",
|
||||
"docs/superpowers/specs/2026-05-18-demo-design.md",
|
||||
cwd=root,
|
||||
code, message = MAIN_LOOP.record_plan(
|
||||
progress, "docs/superpowers/plans/2026-05-18-demo.md"
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
|
||||
result = run_cli(
|
||||
"record",
|
||||
"-progress",
|
||||
"memory-bank/progress.md",
|
||||
"-phase",
|
||||
"planning",
|
||||
"-spec",
|
||||
"docs/superpowers/specs/2026-05-18-demo-design.md",
|
||||
"-plan",
|
||||
"docs/superpowers/plans/2026-05-18-demo.md",
|
||||
"-executor",
|
||||
"executing-plans",
|
||||
"-constraints",
|
||||
"karpathy-guidelines,.agents,AGENT_RULES",
|
||||
cwd=root,
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
self.assertEqual(code, 0, msg=message)
|
||||
|
||||
result = run_cli(
|
||||
"claim",
|
||||
@@ -770,19 +777,10 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: done", text)
|
||||
self.assertIn(
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md", text
|
||||
)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-05-18-demo.md", text)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("- [x] `2026-05-18-demo.md` done", text)
|
||||
|
||||
def test_status_reports_counts_and_current_workflow_state(self):
|
||||
def test_status_reports_counts_from_plan_status(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
plans_dir = root / "docs" / "superpowers" / "plans"
|
||||
@@ -836,14 +834,9 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
"STATUS total=5 pending=1 in-progress=1 done=1 blocked=1 skipped=1",
|
||||
result.stdout,
|
||||
)
|
||||
self.assertIn(
|
||||
"CURRENT phase=executing "
|
||||
"plan=docs/superpowers/plans/2026-01-02-b.md "
|
||||
"claimed_by=codex-test",
|
||||
result.stdout,
|
||||
)
|
||||
self.assertNotIn("CURRENT ", result.stdout)
|
||||
|
||||
def test_concurrent_record_preserves_spec_and_plan_metadata(self):
|
||||
def test_concurrent_record_plan_preserves_queue_entries(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -865,25 +858,17 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
try:
|
||||
threads = [
|
||||
threading.Thread(
|
||||
target=MAIN_LOOP.record_workflow_state,
|
||||
target=MAIN_LOOP.record_plan,
|
||||
args=(
|
||||
progress,
|
||||
"planning",
|
||||
"docs/superpowers/specs/2026-05-18-demo-design.md",
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
"docs/superpowers/plans/2026-05-18-first.md",
|
||||
),
|
||||
),
|
||||
threading.Thread(
|
||||
target=MAIN_LOOP.record_workflow_state,
|
||||
target=MAIN_LOOP.record_plan,
|
||||
args=(
|
||||
progress,
|
||||
"planning",
|
||||
None,
|
||||
"docs/superpowers/plans/2026-05-18-demo.md",
|
||||
"executing-plans",
|
||||
"karpathy-guidelines,.agents,AGENT_RULES",
|
||||
"docs/superpowers/plans/2026-05-18-second.md",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -896,18 +881,11 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
MAIN_LOOP.load_progress_lines = original_load
|
||||
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: planning", text)
|
||||
self.assertIn(
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md", text
|
||||
)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-05-18-demo.md", text)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("- [ ] `2026-05-18-first.md` pending", text)
|
||||
self.assertIn("- [ ] `2026-05-18-second.md` pending", text)
|
||||
|
||||
def test_cross_process_record_lock_preserves_spec_and_plan_metadata(self):
|
||||
def test_cross_process_record_plan_lock_preserves_queue_entries(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
root = Path(tmp_dir)
|
||||
progress = root / "memory-bank" / "progress.md"
|
||||
@@ -919,14 +897,11 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
proc = subprocess.Popen(
|
||||
[
|
||||
sys.executable,
|
||||
str(SCRIPT),
|
||||
"record",
|
||||
str(PLAYBOOK_SCRIPT),
|
||||
"-record-plan",
|
||||
"docs/superpowers/plans/2026-05-18-first.md",
|
||||
"-progress",
|
||||
"memory-bank/progress.md",
|
||||
"-phase",
|
||||
"planning",
|
||||
"-spec",
|
||||
"docs/superpowers/specs/2026-05-18-demo-design.md",
|
||||
str(progress),
|
||||
],
|
||||
cwd=root,
|
||||
env=slow_env,
|
||||
@@ -936,18 +911,17 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
time.sleep(0.05)
|
||||
result = run_cli(
|
||||
"record",
|
||||
"-progress",
|
||||
"memory-bank/progress.md",
|
||||
"-phase",
|
||||
"planning",
|
||||
"-plan",
|
||||
"docs/superpowers/plans/2026-05-18-demo.md",
|
||||
"-executor",
|
||||
"executing-plans",
|
||||
"-constraints",
|
||||
"karpathy-guidelines,.agents,AGENT_RULES",
|
||||
result = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
str(PLAYBOOK_SCRIPT),
|
||||
"-record-plan",
|
||||
"docs/superpowers/plans/2026-05-18-second.md",
|
||||
"-progress",
|
||||
str(progress),
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd=root,
|
||||
)
|
||||
|
||||
@@ -956,16 +930,9 @@ class MainLoopCliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, msg=result.stderr)
|
||||
|
||||
text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("phase: planning", text)
|
||||
self.assertIn(
|
||||
"spec: docs/superpowers/specs/2026-05-18-demo-design.md", text
|
||||
)
|
||||
self.assertIn("plan: docs/superpowers/plans/2026-05-18-demo.md", text)
|
||||
self.assertIn("executor: executing-plans", text)
|
||||
self.assertIn(
|
||||
"constraints: karpathy-guidelines,.agents,AGENT_RULES",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("workflow-state", text)
|
||||
self.assertIn("- [ ] `2026-05-18-first.md` pending", text)
|
||||
self.assertIn("- [ ] `2026-05-18-second.md` pending", text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -85,7 +85,7 @@ class SyncTemplatesPlaceholdersTests(unittest.TestCase):
|
||||
update_memory_template = (
|
||||
ROOT / "templates" / "prompts" / "coding" / "update-memory.template.md"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("workflow-state", update_memory_template)
|
||||
self.assertNotIn("workflow-state", update_memory_template)
|
||||
self.assertIn("plan-status", update_memory_template)
|
||||
self.assertIn("## Updated Files", update_memory_template)
|
||||
self.assertIn("## New Context", update_memory_template)
|
||||
@@ -106,7 +106,7 @@ class SyncTemplatesPlaceholdersTests(unittest.TestCase):
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("main_loop.py finish", close_task_template)
|
||||
self.assertIn("如本轮来自 `main_loop.py claim`", close_task_template)
|
||||
self.assertIn("workflow-state.phase", close_task_template)
|
||||
self.assertNotIn("workflow-state", close_task_template)
|
||||
self.assertIn("未归档不得声明 Plan 完成", close_task_template)
|
||||
self.assertIn("按项目归档机制只归档", close_task_template)
|
||||
self.assertIn("状态已写回,交付未完成", close_task_template)
|
||||
@@ -120,7 +120,7 @@ class SyncTemplatesPlaceholdersTests(unittest.TestCase):
|
||||
ROOT / "templates" / "prompts" / "coding" / "verify-change.template.md"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("如本轮来自 `main_loop.py claim`", verify_change_template)
|
||||
self.assertIn("workflow-state.phase", verify_change_template)
|
||||
self.assertNotIn("workflow-state", verify_change_template)
|
||||
self.assertIn("plan-status", verify_change_template)
|
||||
self.assertIn("验证通过不等于 Plan 完成", verify_change_template)
|
||||
self.assertIn(
|
||||
@@ -269,9 +269,9 @@ langs = [\"cpp\", \"tsl\"]
|
||||
)
|
||||
self.assertIn("docs/superpowers/plans", rules_text)
|
||||
self.assertNotIn("plan_progress.py", rules_text)
|
||||
self.assertIn("记录 `phase=planning` 与 `spec=<path>`", rules_text)
|
||||
self.assertNotIn("record-spec", rules_text)
|
||||
self.assertIn(
|
||||
"记录 `plan=<path>`、`executor=executing-plans`、",
|
||||
"追加到 `memory-bank/progress.md` 的",
|
||||
rules_text,
|
||||
)
|
||||
self.assertIn("领取前不得进入 `$executing-plans`", rules_text)
|
||||
@@ -356,10 +356,9 @@ project_name = "MyProject"
|
||||
progress_text = progress.read_text(encoding="utf-8")
|
||||
self.assertIn("## Current Focus", progress_text)
|
||||
self.assertIn("## 状态块示例", progress_text)
|
||||
self.assertIn("phase: planning", progress_text)
|
||||
self.assertIn("executor: executing-plans", progress_text)
|
||||
self.assertIn("<!-- workflow-state:start -->", progress_text)
|
||||
self.assertIn("<!-- workflow-state:end -->", progress_text)
|
||||
self.assertNotIn("phase: planning", progress_text)
|
||||
self.assertNotIn("executor: executing-plans", progress_text)
|
||||
self.assertNotIn("workflow-state", progress_text)
|
||||
self.assertIn("## Plan Status", progress_text)
|
||||
self.assertIn("<!-- plan-status:start -->", progress_text)
|
||||
self.assertIn("<!-- plan-status:end -->", progress_text)
|
||||
|
||||
Reference in New Issue
Block a user