Move starter cues earlier
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
99fb65a1a953117d088ea3f73b3cf56fdab307ec- Parents
-
56f1959 - Tree
43bca0c
99fb65a
99fb65a1a953117d088ea3f73b3cf56fdab307ec56f1959
43bca0c| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/runtime/repair.py
|
1 | 1 |
| M |
tests/test_repair.py
|
6 | 0 |
src/loader/runtime/repair.pymodified@@ -1486,7 +1486,7 @@ class ResponseRepairer: | ||
| 1486 | 1486 | require_first_substantive_output: bool, |
| 1487 | 1487 | retry_number: int, |
| 1488 | 1488 | ) -> str | None: |
| 1489 | - if not require_first_substantive_output or retry_number < 2: | |
| 1489 | + if not require_first_substantive_output or retry_number < 1: | |
| 1490 | 1490 | return None |
| 1491 | 1491 | if target.suffix.lower() not in {".html", ".htm"}: |
| 1492 | 1492 | return None |
tests/test_repair.pymodified@@ -1253,6 +1253,12 @@ def test_empty_response_retry_reuses_known_reference_structure_for_first_substan | ||
| 1253 | 1253 | "as the starting pattern for this new file, then adapt the content to the current target." |
| 1254 | 1254 | in decision.retry_message |
| 1255 | 1255 | ) |
| 1256 | + assert ( | |
| 1257 | + "For this first HTML content file, a minimal acceptable starter is: " | |
| 1258 | + "matching `<title>` and `<h1>`, one introductory paragraph, a few section " | |
| 1259 | + "blocks, and a back link to `../index.html`." | |
| 1260 | + in decision.retry_message | |
| 1261 | + ) | |
| 1256 | 1262 | |
| 1257 | 1263 | |
| 1258 | 1264 | def test_compact_first_substantive_retry_reuses_known_reference_structure( |