@@ -442,6 +442,13 @@ class ResponseRepairer: |
| 442 | 442 | ) |
| 443 | 443 | if reference_cues_line: |
| 444 | 444 | lines.append(reference_cues_line) |
| 445 | + html_starter_line = self._known_html_starter_shape_line( |
| 446 | + concrete_target, |
| 447 | + require_first_substantive_output=True, |
| 448 | + retry_number=retry_number, |
| 449 | + ) |
| 450 | + if html_starter_line: |
| 451 | + lines.append(html_starter_line) |
| 445 | 452 | if _should_encourage_initial_version( |
| 446 | 453 | target=concrete_target, |
| 447 | 454 | has_confirmed_output_file_progress=True, |
@@ -924,6 +931,16 @@ class ResponseRepairer: |
| 924 | 931 | ) |
| 925 | 932 | if reference_cues_line: |
| 926 | 933 | lines.append(reference_cues_line) |
| 934 | + html_starter_line = self._known_html_starter_shape_line( |
| 935 | + concrete_target, |
| 936 | + require_first_substantive_output=( |
| 937 | + has_confirmed_output_file_progress |
| 938 | + and not has_confirmed_substantive_output_file_progress |
| 939 | + ), |
| 940 | + retry_number=retry_number, |
| 941 | + ) |
| 942 | + if html_starter_line: |
| 943 | + lines.append(html_starter_line) |
| 927 | 944 | if _should_encourage_initial_version( |
| 928 | 945 | target=concrete_target, |
| 929 | 946 | has_confirmed_output_file_progress=has_confirmed_output_file_progress, |
@@ -1008,6 +1025,16 @@ class ResponseRepairer: |
| 1008 | 1025 | ) |
| 1009 | 1026 | if reference_cues_line: |
| 1010 | 1027 | lines.append(reference_cues_line) |
| 1028 | + html_starter_line = self._known_html_starter_shape_line( |
| 1029 | + inferred_pending_target, |
| 1030 | + require_first_substantive_output=( |
| 1031 | + has_confirmed_output_file_progress |
| 1032 | + and not has_confirmed_substantive_output_file_progress |
| 1033 | + ), |
| 1034 | + retry_number=retry_number, |
| 1035 | + ) |
| 1036 | + if html_starter_line: |
| 1037 | + lines.append(html_starter_line) |
| 1011 | 1038 | if todo_describes_aggregate_mutation(next_pending): |
| 1012 | 1039 | lines.insert( |
| 1013 | 1040 | 1, |
@@ -1127,6 +1154,16 @@ class ResponseRepairer: |
| 1127 | 1154 | ) |
| 1128 | 1155 | if reference_cues_line: |
| 1129 | 1156 | lines.append(reference_cues_line) |
| 1157 | + html_starter_line = self._known_html_starter_shape_line( |
| 1158 | + next_output_file, |
| 1159 | + require_first_substantive_output=( |
| 1160 | + has_confirmed_output_file_progress |
| 1161 | + and not has_confirmed_substantive_output_file_progress |
| 1162 | + ), |
| 1163 | + retry_number=retry_number, |
| 1164 | + ) |
| 1165 | + if html_starter_line: |
| 1166 | + lines.append(html_starter_line) |
| 1130 | 1167 | if _should_encourage_initial_version( |
| 1131 | 1168 | target=next_output_file, |
| 1132 | 1169 | has_confirmed_output_file_progress=has_confirmed_output_file_progress, |
@@ -1442,6 +1479,23 @@ class ResponseRepairer: |
| 1442 | 1479 | return None |
| 1443 | 1480 | return f"Reference cues from `{display_runtime_path(reference)}`: {cues}" |
| 1444 | 1481 | |
| 1482 | + def _known_html_starter_shape_line( |
| 1483 | + self, |
| 1484 | + target: Path, |
| 1485 | + *, |
| 1486 | + require_first_substantive_output: bool, |
| 1487 | + retry_number: int, |
| 1488 | + ) -> str | None: |
| 1489 | + if not require_first_substantive_output or retry_number < 2: |
| 1490 | + return None |
| 1491 | + if target.suffix.lower() not in {".html", ".htm"}: |
| 1492 | + return None |
| 1493 | + return ( |
| 1494 | + "For this first HTML content file, a minimal acceptable starter is: " |
| 1495 | + "matching `<title>` and `<h1>`, one introductory paragraph, a few section " |
| 1496 | + "blocks, and a back link to `../index.html`." |
| 1497 | + ) |
| 1498 | + |
| 1445 | 1499 | def _best_known_reference_path(self, target: Path) -> Path | None: |
| 1446 | 1500 | normalized_target = target.expanduser().resolve(strict=False) |
| 1447 | 1501 | target_tokens = { |