Bläddra i källkod

测试(脚本构建): 对齐动态 Phase2 策略不变量

移除旧版七步固定教程的逐字断言,改为验证唯一 Portfolio、动态任务顺序、Direction Goal 约束、候选闭包和分层写权限。

测试继续保证 Phase1 与 Phase2 边界互不泄漏,但不再要求已经删除的操作脚本文案。
SamLee 12 timmar sedan
förälder
incheckning
8b032adac9
1 ändrade filer med 12 tillägg och 10 borttagningar
  1. 12 10
      script_build_host/tests/test_mission_factory.py

+ 12 - 10
script_build_host/tests/test_mission_factory.py

@@ -78,20 +78,22 @@ def test_factory_reads_nested_real_topic_and_does_not_double_prefix_digest() ->
     assert config.enable_research_flow is False
 
 
-def test_common_planner_prompt_does_not_leak_phase_two_boundary() -> None:
+def test_phase_prompts_isolate_boundaries_and_expose_dynamic_phase_two_invariants() -> None:
     factory = ScriptMissionFactory()
     assert "PHASE_TWO_CANDIDATE_PORTFOLIO_READY" not in PLANNER_PROMPT
     assert "using the returned Direction Task ID as `parent_task_id`" in PLANNER_PROMPT
     assert "`PHASE_ONE_CAPABILITY_BOUNDARY` with no additional text" in PLANNER_PROMPT
     phase_two = factory.build_phase_two_policy(_snapshot())
     assert "PHASE_TWO_CANDIDATE_PORTFOLIO_READY" in phase_two
-    assert "CandidatePortfolio and Compose must use the exact parent" in phase_two
-    assert "script-build://writes/paragraphs/<stable-selector>" in phase_two
-    assert "script-build://writes/elements/<stable-selector>" in phase_two
-    assert "Never copy scope_ref into write_scope" in phase_two
-    assert "whole Structure accepted_decision_ref" in phase_two
-    assert "whole artifact_ref unchanged into base_artifact_ref" in phase_two
-    assert "must also include and adopt its covering" in phase_two
-    assert "must partition that complete candidate list" in phase_two
-    assert "candidate_decision_ids, adopted_decision_ids, and compose_order" in phase_two
+    assert "Create exactly one CandidatePortfolio as Root's Phase2 child" in phase_two
+    assert "Plan any number and order" in phase_two
+    assert "Every Phase2 contract has nonempty goal_ids" in phase_two
+    assert "pins the exact accepted Direction DecisionRef" in phase_two
+    assert "carry all Direction Goal IDs" in phase_two
+    assert "Paragraph-first exploration may use a null base" in phase_two
+    assert "only with a Structure covering its scope" in phase_two
+    assert "partitions their complete accepted candidate closure" in phase_two
+    assert "CandidatePortfolio and Compose write only script-build://writes" in phase_two
+    assert "paragraph writers stay below script-build://writes/paragraphs" in phase_two
+    assert "element writers below script-build://writes/elements" in phase_two
     assert "derive a strategy reference" in PARAGRAPH_WORKER_PROMPT