tenseleyflow/loader / 107215b

Browse files

Prefer bounded quality repairs

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
107215b6ef65c51984a310dd34c5391323e12cc7
Parents
d06c639
Tree
9e2bd7f

2 changed files

StatusFile+-
M src/loader/runtime/finalization.py 8 8
M tests/test_finalization.py 2 1
src/loader/runtime/finalization.pymodified
@@ -1362,9 +1362,9 @@ def _html_quality_repair_strategy_lines() -> list[str]:
13621362
         "exceed the expected text-character floor; if it says insufficient "
13631363
         "structured content, add enough real sections, lists, code, tables, or "
13641364
         "other content blocks to exceed the block floor.",
1365
-        "- Prefer a complete `write` or a `patch`/`edit` anchored to exact current "
1366
-        "on-disk text; do not use remembered minimal `old_string` snippets for "
1367
-        "generated-document expansion.",
1365
+        "- Prefer a bounded append-style `patch` or exact-current `edit` that adds "
1366
+        "missing body blocks before the existing back link, footer, or closing body; "
1367
+        "avoid whole-file rewrites unless the file is tiny or malformed.",
13681368
         "- Treat structured content as substantive page body material, not table-of-"
13691369
         "contents inflation: do not add duplicate navigation entries, relabel links "
13701370
         "to existing pages as new chapters, or introduce new missing page links just "
@@ -1454,13 +1454,13 @@ def _build_verification_failure_recovery_nudge(
14541454
         return (
14551455
             "Verification now identifies generated artifact content quality issues. "
14561456
             "Do not restart discovery or keep auditing unrelated files. "
1457
-            "Your next response should be one concrete `write`, `patch`, or exact-current "
1458
-            "`edit` tool "
1457
+            "Your next response should be one concrete append-style `patch` or "
1458
+            "exact-current `edit` tool "
14591459
             f"call that expands `{primary_target.artifact_path}` to address: "
14601460
             f"{primary_target.issue}. Make a substantial change that clears the stated "
1461
-            "threshold, not a small incremental edit. Do not use remembered minimal "
1462
-            "`old_string` snippets; anchor edits to current on-disk text or rewrite the "
1463
-            "file completely. Do not summarize completion "
1461
+            "threshold, not a small incremental edit. Add the missing body blocks before "
1462
+            "the existing back link, footer, or closing body; avoid a whole-file rewrite "
1463
+            "unless the file is tiny or malformed. Do not summarize completion "
14641464
             f"after only one target is touched.{remaining_hint}"
14651465
         )
14661466
 
tests/test_finalization.pymodified
@@ -489,7 +489,8 @@ def test_verification_repair_guidance_keeps_multi_file_quality_worklist(
489489
     assert f"Improve `{chapter_paths[0]}`: thin content" in guidance
490490
     assert f"Improve `{chapter_paths[-1]}`: thin content" in guidance
491491
     assert "add enough concrete prose" in guidance
492
-    assert "exact current on-disk text" in guidance
492
+    assert "bounded append-style" in guidance
493
+    assert "avoid whole-file rewrites" in guidance
493494
     assert "not table-of-contents inflation" in guidance
494495
     assert "do not add duplicate navigation entries" in guidance
495496
     assert "do not stop after touching only the first file" in guidance