Skip to content

Remove dead code in render.py, claims.py and the REPL server #113

Closed

Description

@zibo-yang

Problem

Four functions, one config field, one method and one constant have no caller or reader on main. Two of the functions are near-copies of live ones, so a reader has to work out which of each pair is real.

Symbol Location Note
_inject_after_title autoform_cli/render.py:780-797 no callers; near-copy of the live _inject_after_lead at :800
_status_phrase autoform_cli/render.py:1341-1345 no callers
_markdown_table_cell autoform_cli/render.py:1348-1349 no callers
_shift_headings autoform_cli/render.py:1381-1389 no callers; near-copy of the live _demote_headings at :1940
ClaimBoard.gc autoform_cli/claims.py:346-348 compatibility alias for cleanup(); no callers
LeanReplConfig.mem_interval_check servers/repl/core.py:334 never read
DEFAULT_PORT servers/repl/pool.py:16 never read

render.py also has two leftovers from earlier edits:

  • a stray empty f"" inside the returned string at :1335;
  • eight consecutive blank lines at :716-723.

Line numbers are at 0ea4b99.

How this was checked

  • Each symbol was searched for across autoform_cli/, servers/, tests/, skills/ and the Markdown docs on main. The only match for each is its own definition.
  • vulture autoform_cli servers reports the same seven symbols.
  • The same search on the execution branch finds no caller either. ClaimBoard.gc is called only on archived branches, from autoform_worker/cli.py, which does not exist on main or execution.
  • Every LeanReplConfig(...) construction passes keyword arguments, so removing a field does not shift any other argument.

Proposed change

Delete the seven symbols, the stray f"" and the extra blank lines. No behaviour or output changes.

A removal of the four render.py functions, the f"" and the blank lines, together with mem_interval_check, was tried in a working copy at an earlier commit: lint and the test suite passed, make check-example passed, and the rendered site and audit output for the example blueprint were byte-identical.

Not dead

ClaimBoard.holds, ClaimBoard.heartbeat and Heartbeat look unused from autoform_cli/ alone, but tests/test_claims.py exercises them and the execution branch's scheduler calls heartbeat. They should stay.

Overlap with open pull requests

Out of scope

  • Code that only tests call, such as DeclarationSkeleton.defines and LeanLspProjects. Removing those changes a public surface and is a separate decision.
  • Duplicated helpers that are still in use.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions