tenseleyflow/loader / 3fb23b2

Browse files

Keep review todos off reads

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
3fb23b20f0984397c7e82f7417b6bae4df78dbec
Parents
7aafd0b
Tree
66ed7a2

2 changed files

StatusFile+-
M src/loader/runtime/workflow.py 11 0
M tests/test_workflow.py 56 0
src/loader/runtime/workflow.pymodified
@@ -1318,6 +1318,17 @@ def _todo_progress_score(item: str, tool_call: ToolCall) -> int:
13181318
         )
13191319
     ):
13201320
         return 0
1321
+    if (
1322
+        is_discovery_tool
1323
+        and _contains_any(text, _ARTIFACT_SET_COMPLETION_HINTS)
1324
+        and not (
1325
+            _contains_any(text, _READ_STEP_HINTS)
1326
+            or _contains_any(text, _SEARCH_STEP_HINTS)
1327
+            or _contains_any(text, _PARSE_STEP_HINTS)
1328
+            or _contains_any(text, _VERIFY_STEP_HINTS)
1329
+        )
1330
+    ):
1331
+        return 0
13211332
 
13221333
     if basename and basename in text:
13231334
         score += 3
tests/test_workflow.pymodified
@@ -1295,6 +1295,62 @@ def test_advance_todos_from_tool_call_does_not_complete_aggregate_style_step_fro
12951295
     )
12961296
 
12971297
 
1298
+def test_advance_todos_from_tool_call_does_not_complete_consistency_style_step_from_reference_read() -> None:
1299
+    dod = create_definition_of_done("Create a multi-file nginx guide.")
1300
+    sync_todos_to_definition_of_done(
1301
+        dod,
1302
+        [
1303
+            {
1304
+                "content": "First, examine the existing fortran guide structure to understand the format",
1305
+                "active_form": "Working on: First, examine the existing fortran guide structure to understand the format",
1306
+                "status": "pending",
1307
+            },
1308
+            {
1309
+                "content": "Ensure consistency with fortran guide style and structure",
1310
+                "active_form": "Working on: Ensure consistency with fortran guide style and structure",
1311
+                "status": "pending",
1312
+            },
1313
+        ],
1314
+    )
1315
+
1316
+    assert (
1317
+        advance_todos_from_tool_call(
1318
+            dod,
1319
+            ToolCall(
1320
+                id="read-reference-index",
1321
+                name="read",
1322
+                arguments={"file_path": "~/Loader/guides/fortran/index.html"},
1323
+            ),
1324
+        )
1325
+        is False
1326
+    )
1327
+    assert (
1328
+        "First, examine the existing fortran guide structure to understand the format"
1329
+        in dod.pending_items
1330
+    )
1331
+    assert (
1332
+        "Ensure consistency with fortran guide style and structure"
1333
+        in dod.pending_items
1334
+    )
1335
+
1336
+    assert advance_todos_from_tool_call(
1337
+        dod,
1338
+        ToolCall(
1339
+            id="read-reference-chapter",
1340
+            name="read",
1341
+            arguments={"file_path": "~/Loader/guides/fortran/chapters/01-introduction.html"},
1342
+        ),
1343
+    )
1344
+    assert (
1345
+        "First, examine the existing fortran guide structure to understand the format"
1346
+        in dod.completed_items
1347
+    )
1348
+    assert (
1349
+        "Ensure consistency with fortran guide style and structure"
1350
+        in dod.pending_items
1351
+    )
1352
+
1353
+
12981354
 def test_sync_todos_to_definition_of_done_keeps_linking_step_pending_while_artifacts_missing(
12991355
     temp_dir: Path,
13001356
 ) -> None: