tenseleyflow/loader / e37a372

Browse files

Soften post-file handoffs

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
e37a372135114fc280bfb9442e78bb858793039b
Parents
4a5feaf
Tree
7b9f23f

2 changed files

StatusFile+-
M src/loader/runtime/tool_batches.py 2 6
M tests/test_tool_batches.py 11 14
src/loader/runtime/tool_batches.pymodified
@@ -1163,11 +1163,7 @@ class ToolBatchRunner:
11631163
             if use_persistent_handoff
11641164
             else self.context.queue_ephemeral_steering_message
11651165
         )
1166
-        if (
1167
-            use_persistent_handoff
1168
-            and resume_target is not None
1169
-            and resume_target.suffix
1170
-        ):
1166
+        if resume_target is not None and resume_target.suffix:
11711167
             compact_resume = _compact_missing_artifact_handoff(
11721168
                 (resume_target, False),
11731169
                 project_root=self.context.project_root,
@@ -1657,7 +1653,7 @@ def _should_use_persistent_missing_artifact_handoff(
16571653
     return _confirmed_file_artifact_count(
16581654
         dod,
16591655
         project_root=project_root,
1660
-    ) < 2
1656
+    ) == 0
16611657
 
16621658
 
16631659
 def _next_missing_planned_file_within_directory(
tests/test_tool_batches.pymodified
@@ -2249,7 +2249,7 @@ async def test_tool_batch_runner_missing_artifact_nudge_names_next_file_after_se
22492249
 
22502250
 
22512251
 @pytest.mark.asyncio
2252
-async def test_tool_batch_runner_first_file_handoff_stays_persistent(
2252
+async def test_tool_batch_runner_first_chapter_handoff_becomes_ephemeral_after_first_file(
22532253
     temp_dir: Path,
22542254
 ) -> None:
22552255
     async def assess_confidence(
@@ -2351,8 +2351,9 @@ async def test_tool_batch_runner_first_file_handoff_stays_persistent(
23512351
         consecutive_errors=0,
23522352
     )
23532353
 
2354
-    assert persistent_messages
2355
-    message = persistent_messages[-1]
2354
+    assert persistent_messages == []
2355
+    assert ephemeral_messages
2356
+    message = ephemeral_messages[-1]
23562357
     assert "Confirmed progress:" in message
23572358
     assert "Next step: create `01-introduction.html`." in message
23582359
     assert (
@@ -2360,7 +2361,6 @@ async def test_tool_batch_runner_first_file_handoff_stays_persistent(
23602361
         in message
23612362
     )
23622363
     assert "Do not reread reference material or spend the next turn on bookkeeping." in message
2363
-    assert ephemeral_messages == []
23642364
 
23652365
 
23662366
 @pytest.mark.asyncio
@@ -2477,7 +2477,7 @@ async def test_tool_batch_runner_softens_first_file_handoff_after_recovery_promp
24772477
     assert persistent_messages == []
24782478
     assert ephemeral_messages
24792479
     message = ephemeral_messages[-1]
2480
-    assert "Resume by creating `01-introduction.html` now." in message
2480
+    assert "Next step: create `01-introduction.html`." in message
24812481
 
24822482
 
24832483
 @pytest.mark.asyncio
@@ -2932,13 +2932,10 @@ async def test_tool_batch_runner_mutation_handoff_points_at_next_missing_artifac
29322932
         consecutive_errors=0,
29332933
     )
29342934
 
2935
-    assert persistent_messages
2936
-    message = persistent_messages[-1]
2935
+    assert persistent_messages == []
2936
+    assert ephemeral_messages
2937
+    message = ephemeral_messages[-1]
29372938
     assert "Next step: create `01-getting-started.html`." in message
2938
-    assert (
2939
-        f"Prefer one `write(file_path=..., content=...)` call for `{chapter_one.resolve(strict=False)}` now."
2940
-        in message
2941
-    )
29422939
     assert "refresh `TodoWrite`" not in message
29432940
     assert "Do not reread reference material or spend the next turn on bookkeeping." in message
29442941
 
@@ -3062,7 +3059,7 @@ async def test_tool_batch_runner_large_plan_does_not_claim_completion_early(
30623059
     )
30633060
 
30643061
     assert any(
3065
-        "Resume by creating `06-performance-tuning.html` now." in message
3062
+        "Next step: create `06-performance-tuning.html`." in message
30663063
         for message in ephemeral_messages
30673064
     )
30683065
     assert not any(
@@ -3188,8 +3185,8 @@ async def test_tool_batch_runner_uses_compact_missing_artifact_nudge_after_subst
31883185
 
31893186
     assert ephemeral_messages
31903187
     message = ephemeral_messages[-1]
3191
-    assert "Resume by creating `05-advanced-features.html` now." in message
3192
-    assert "No TodoWrite, no verification, no rereads until that artifact exists." in message
3188
+    assert "Next step: create `05-advanced-features.html`." in message
3189
+    assert "Do not reread reference material or spend the next turn on bookkeeping." in message
31933190
     assert "refresh `TodoWrite`" not in message
31943191
 
31953192