From 21ad799557450d5007ab8f231fd867a1f129469a Mon Sep 17 00:00:00 2001 From: zibo-yang <75760207+zibo-yang@users.noreply.github.com> Date: Mon, 5 Oct 2026 12:56:41 +0000 Subject: [PATCH] Remove code that nothing calls or reads Four render helpers, the ClaimBoard.gc alias, the REPL config field mem_interval_check and the pool constant DEFAULT_PORT have no caller or reader on main or on the execution branch. Two of the render helpers were near-copies of live functions (_inject_after_lead and _demote_headings). Also drop an empty f"" fragment in the progress overview and nine surplus blank lines in render.py. The rendered site for the example blueprint is identical before and after apart from the embedded commit SHA, and the audit output is byte-identical. Fixes #113 Co-Authored-By: Claude Opus 5.5 --- autoform_cli/claims.py | 4 ---- autoform_cli/render.py | 52 ------------------------------------------ servers/repl/core.py | 1 - servers/repl/pool.py | 1 - 4 files changed, 58 deletions(-) diff --git a/autoform_cli/claims.py b/autoform_cli/claims.py index 09901325..4b5c727c 100644 --- a/autoform_cli/claims.py +++ b/autoform_cli/claims.py @@ -343,10 +343,6 @@ def cleanup(self) -> int: removed += 1 return removed - def gc(self) -> int: - """Compatibility alias for :meth:`cleanup`.""" - return self.cleanup() - def heartbeat( self, key: str, diff --git a/autoform_cli/render.py b/autoform_cli/render.py index 0a8cf60c..6d68cc0b 100644 --- a/autoform_cli/render.py +++ b/autoform_cli/render.py @@ -715,12 +715,6 @@ def collect(line: str) -> str: return ordered - - - - - - def _append_book_navigation(pages: list[Path]) -> None: """Add previous/next links to the bottom of Blueprint pages, never global nav.""" if len(pages) < 2: @@ -777,26 +771,6 @@ def _book_navigation_link( ) -def _inject_after_title(text: str, block: str) -> str: - """Place a generated overview immediately after the document's first H1.""" - lines = text.splitlines() - fence: tuple[str, int] | None = None - for index, line in enumerate(lines): - fence_match = _FENCE.match(line) - if fence_match: - marker = fence_match.group(1) - if fence is None: - fence = (marker[0], len(marker)) - elif marker[0] == fence[0] and len(marker) >= fence[1]: - fence = None - continue - heading = _HEADING.match(line) if fence is None else None - if heading is not None and len(heading.group(1)) == 1: - merged = [*lines[: index + 1], "", block.rstrip(), "", *lines[index + 1 :]] - return "\n".join(merged) + ("\n" if text.endswith("\n") else "") - return text.rstrip() + "\n\n" + block.rstrip() + "\n" - - def _inject_after_lead(text: str, block: str) -> str: """Place chapter metadata after its opening prose and before the first section.""" lines = text.splitlines() @@ -823,7 +797,6 @@ def _inject_after_lead(text: str, block: str) -> str: return text.rstrip() + "\n\n" + block.rstrip() + "\n" - def _next_target( graph: Graph, statuses: dict[str, status.NodeStatus], @@ -899,7 +872,6 @@ def _next_target( return "" - STRUCTURE_PAGE = "structure.md" @@ -1332,23 +1304,10 @@ def _render_overview_summary( '
Formalization progress
' f'
{item_summary}
' f'
{states}
' - f"" "" ) - -def _status_phrase(node_statuses: Iterable[status.NodeStatus]) -> str: - counts = {state.key: 0 for state in status.STATES} - for node_status in node_statuses: - counts[node_status.key] += 1 - return " ยท ".join(f"{counts[state.key]} {state.label}" for state in status.STATES if counts[state.key]) - - -def _markdown_table_cell(text: str) -> str: - return text.replace("\\", "\\\\").replace("|", "\\|").replace("[", "\\[").replace("]", "\\]") - - def _first_h1(text: str) -> str | None: for line in text.splitlines(): heading = _HEADING.match(line) @@ -1378,17 +1337,6 @@ def _document_body(text: str) -> str: return "\n".join(kept).strip() -def _shift_headings(text: str, levels: int) -> str: - def shift(line: str) -> str: - heading = _HEADING.match(line) - if heading is None: - return line - level = min(len(heading.group(1)) + levels, 6) - return f"{'#' * level} {heading.group(2)}" - - return _outside_fences(text, shift) - - def _anchor(node_id: str, group: str) -> str: """A stable in-page anchor for a node, unique within its chapter.""" prefix = f"{group}/" if group else "" diff --git a/servers/repl/core.py b/servers/repl/core.py index 7d188017..90944494 100644 --- a/servers/repl/core.py +++ b/servers/repl/core.py @@ -331,7 +331,6 @@ class LeanReplConfig: chunk_size: int = 4096 instance_mem_limit_gb: int = 16 - mem_interval_check: float = 1.0 max_retries: int = 1 allowed_imports: frozenset[str] = ALLOWED_IMPORTS diff --git a/servers/repl/pool.py b/servers/repl/pool.py index ff543a5f..0988b8b2 100644 --- a/servers/repl/pool.py +++ b/servers/repl/pool.py @@ -13,7 +13,6 @@ logger = getLogger(__name__) -DEFAULT_PORT = 8990 DEFAULT_RAM_FRACTION = 0.5 DEFAULT_STARTUP_STAGGER_SECONDS = 2.0