fix(backend): fix per-block comparison in check_docs_in_sync

The regex captured content up to but excluding --- separator, while
expected_block_content includes ---. This caused all blocks to be
falsely flagged as mismatched. Now includes --- in the capture.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-01-16 17:44:28 -06:00
parent eeec79c0e5
commit 5ed3647be1

View File

@@ -663,8 +663,9 @@ def check_docs_in_sync(output_dir: Path, blocks: list[BlockDoc]) -> bool:
content_parts.append(expected_block_content)
# Check if this specific block's section exists and matches
# Include the --- separator to match generate_block_markdown output
block_pattern = (
rf"(?:^|\n)(##? {re.escape(block.name)}\s*\n.*?)(?=\n---|\Z)"
rf"(?:^|\n)(##? {re.escape(block.name)}\s*\n.*?\n---\n)"
)
block_match = re.search(block_pattern, existing_content, re.DOTALL)
if not block_match: