Recognize develop todos as mutations
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
aa40a8bbded4a530916374ecfb53f9a348ead186- Parents
-
ef7bc99 - Tree
de7a758
aa40a8b
aa40a8bbded4a530916374ecfb53f9a348ead186ef7bc99
de7a758| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/runtime/tool_batches.py
|
22 | 5 |
| M |
tests/test_tool_batches.py
|
6 | 2 |
src/loader/runtime/tool_batches.pymodified@@ -62,6 +62,12 @@ _TODO_NUDGE_EXCLUDED_ITEMS = { | ||
| 62 | 62 | _MUTATION_TODO_HINTS = ( |
| 63 | 63 | "create", |
| 64 | 64 | "creating", |
| 65 | + "develop", | |
| 66 | + "developing", | |
| 67 | + "populate", | |
| 68 | + "populating", | |
| 69 | + "build", | |
| 70 | + "building", | |
| 65 | 71 | "update", |
| 66 | 72 | "updating", |
| 67 | 73 | "edit", |
@@ -1113,11 +1119,6 @@ class ToolBatchRunner: | ||
| 1113 | 1119 | dod, |
| 1114 | 1120 | project_root=self.context.project_root, |
| 1115 | 1121 | ) |
| 1116 | - if ( | |
| 1117 | - not has_file_artifact_progress | |
| 1118 | - and _is_pure_directory_creation_tool_call(tool_call) | |
| 1119 | - ): | |
| 1120 | - return | |
| 1121 | 1122 | resume_target = _preferred_resume_target_path( |
| 1122 | 1123 | dod, |
| 1123 | 1124 | next_pending=next_pending, |
@@ -1132,6 +1133,22 @@ class ToolBatchRunner: | ||
| 1132 | 1133 | project_root=self.context.project_root, |
| 1133 | 1134 | messages=list(getattr(self.context.session, "messages", []) or []), |
| 1134 | 1135 | ) |
| 1136 | + if ( | |
| 1137 | + not has_file_artifact_progress | |
| 1138 | + and _is_pure_directory_creation_tool_call(tool_call) | |
| 1139 | + ): | |
| 1140 | + if ( | |
| 1141 | + next_pending | |
| 1142 | + and _todo_is_mutation_step(next_pending) | |
| 1143 | + and resume_target is not None | |
| 1144 | + and resume_target.suffix | |
| 1145 | + ): | |
| 1146 | + self.context.queue_steering_message( | |
| 1147 | + f"Directory setup is complete. Continue with the next pending item: `{next_pending}`." | |
| 1148 | + + resume_suffix | |
| 1149 | + + " Do not reread older reference files before that mutation." | |
| 1150 | + ) | |
| 1151 | + return | |
| 1135 | 1152 | use_persistent_handoff = _should_use_persistent_missing_artifact_handoff( |
| 1136 | 1153 | dod, |
| 1137 | 1154 | project_root=self.context.project_root, |
tests/test_tool_batches.pymodified@@ -2145,7 +2145,7 @@ async def test_tool_batch_runner_discovery_completion_handoff_stays_persistent( | ||
| 2145 | 2145 | |
| 2146 | 2146 | |
| 2147 | 2147 | @pytest.mark.asyncio |
| 2148 | -async def test_tool_batch_runner_missing_artifact_nudge_stays_quiet_after_setup_mkdir( | |
| 2148 | +async def test_tool_batch_runner_missing_artifact_nudge_names_next_file_after_setup_mkdir( | |
| 2149 | 2149 | temp_dir: Path, |
| 2150 | 2150 | ) -> None: |
| 2151 | 2151 | async def assess_confidence( |
@@ -2240,7 +2240,11 @@ async def test_tool_batch_runner_missing_artifact_nudge_stays_quiet_after_setup_ | ||
| 2240 | 2240 | consecutive_errors=0, |
| 2241 | 2241 | ) |
| 2242 | 2242 | |
| 2243 | - assert persistent_messages == [] | |
| 2243 | + assert persistent_messages | |
| 2244 | + message = persistent_messages[-1] | |
| 2245 | + assert "Directory setup is complete." in message | |
| 2246 | + assert "Continue with the next pending item: `Develop the main index.html file with proper structure`." in message | |
| 2247 | + assert "Resume by creating `index.html` now." in message | |
| 2244 | 2248 | assert ephemeral_messages == [] |
| 2245 | 2249 | |
| 2246 | 2250 | |