tenseleyflow/loader / 2e86586

Browse files

Require deeper guide study

Authored by espadonne
SHA
2e86586507e8d491dbe9753fa4fc9f12785763d9
Parents
65ebf4a
Tree
4afb13f

2 changed files

StatusFile+-
M src/loader/runtime/workflow.py 31 0
M tests/test_workflow.py 36 0
src/loader/runtime/workflow.pymodified
@@ -194,6 +194,17 @@ _CONTENT_EVIDENCE_HINTS = (
194194
     "thorough",
195195
     "thoroughness",
196196
 )
197
+_DEEP_CONTENT_EVIDENCE_HINTS = (
198
+    "organization",
199
+    "cadence",
200
+    "depth",
201
+    "writing style",
202
+    "thorough",
203
+    "thoroughness",
204
+    "same structure",
205
+    "same style",
206
+    "same pattern",
207
+)
197208
 _BROAD_SETUP_HINTS = (
198209
     "directory structure",
199210
     "directories",
@@ -1282,6 +1293,10 @@ def _todo_progress_score(item: str, tool_call: ToolCall) -> int:
12821293
         score += 1
12831294
 
12841295
     if name == "read":
1296
+        if _todo_requires_deep_content_evidence(text) and _is_summary_artifact_name(
1297
+            basename
1298
+        ):
1299
+            return 0
12851300
         if _contains_any(text, _READ_STEP_HINTS):
12861301
             score += 2
12871302
         if _contains_any(text, _PARSE_STEP_HINTS) and ".html" in combined:
@@ -1335,6 +1350,22 @@ def _todo_requires_content_level_evidence(text: str) -> bool:
13351350
     return _contains_any(text, _CONTENT_EVIDENCE_HINTS)
13361351
 
13371352
 
1353
+def _todo_requires_deep_content_evidence(text: str) -> bool:
1354
+    return _contains_any(text, _DEEP_CONTENT_EVIDENCE_HINTS)
1355
+
1356
+
1357
+def _is_summary_artifact_name(name: str) -> bool:
1358
+    normalized = name.lower()
1359
+    return normalized in {
1360
+        "index.html",
1361
+        "index.htm",
1362
+        "readme",
1363
+        "readme.md",
1364
+        "readme.rst",
1365
+        "readme.txt",
1366
+    }
1367
+
1368
+
13381369
 def _todo_describes_aggregate_mutation(text: str) -> bool:
13391370
     return (
13401371
         _contains_any(text, _AGGREGATE_TODO_HINTS)
tests/test_workflow.pymodified
@@ -1043,6 +1043,42 @@ def test_advance_todos_from_tool_call_does_not_complete_content_examination_from
10431043
     assert "Develop the main index.html file for the nginx guide" in dod.pending_items
10441044
 
10451045
 
1046
+def test_advance_todos_from_tool_call_does_not_complete_deep_guide_study_from_root_index_read() -> None:
1047
+    dod = create_definition_of_done("Create a multi-file nginx guide.")
1048
+    sync_todos_to_definition_of_done(
1049
+        dod,
1050
+        [
1051
+            {
1052
+                "content": "First, examine the existing fortran guide structure to understand the content organization and cadence",
1053
+                "active_form": "Working on: First, examine the existing fortran guide structure to understand the content organization and cadence",
1054
+                "status": "pending",
1055
+            },
1056
+            {
1057
+                "content": "Develop the main index.html file for the nginx guide",
1058
+                "active_form": "Working on: Develop the main index.html file for the nginx guide",
1059
+                "status": "pending",
1060
+            },
1061
+        ],
1062
+    )
1063
+
1064
+    assert (
1065
+        advance_todos_from_tool_call(
1066
+            dod,
1067
+            ToolCall(
1068
+                id="read-reference-index",
1069
+                name="read",
1070
+                arguments={"file_path": "~/Loader/guides/fortran/index.html"},
1071
+            ),
1072
+        )
1073
+        is False
1074
+    )
1075
+    assert (
1076
+        "First, examine the existing fortran guide structure to understand the content organization and cadence"
1077
+        in dod.pending_items
1078
+    )
1079
+    assert "Develop the main index.html file for the nginx guide" in dod.pending_items
1080
+
1081
+
10461082
 def test_advance_todos_from_tool_call_does_not_complete_populate_step_from_reference_read() -> None:
10471083
     dod = create_definition_of_done("Create a multi-file nginx guide.")
10481084
     sync_todos_to_definition_of_done(