Repository navigation
Remove dead code in render.py, claims.py and the REPL server #113
Description
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:
Line numbers are at 0ea4b99.
How this was checked
- Each symbol was searched for across
autoform_cli/,servers/,tests/,skills/and the Markdown docs onmain. The only match for each is its own definition. vulture autoform_cli serversreports the same seven symbols.- The same search on the
executionbranch finds no caller either.ClaimBoard.gcis called only on archived branches, fromautoform_worker/cli.py, which does not exist onmainorexecution. - 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
- Replace custom Lean servers with managed Lean Beam #76 replaces the custom Lean servers and already deletes
mem_interval_checkandDEFAULT_PORT. If Replace custom Lean servers with managed Lean Beam #76 is expected to land soon, the twoservers/repllines can be left to it. - Isolate and validate public REPL calls #105 and Validate REPL imports with the selected Lean toolchain #106 edit
servers/repl/core.py(Isolate and validate public REPL calls #105 alsopool.py), Add session-fenced collaborative claims #72 editsclaims.py, and Publish blueprint sites transactionally #73, Add verified statement-review bundles #75, Scale roadmap inventories and the full DAG explorer #90 and Bind Lean source snapshots to filesystem generations #95 editrender.py. None of them removes the code listed here, so a cleanup may need a rebase against whichever lands first. The deletions are small and local, so conflicts should be easy to resolve.
Out of scope
- Code that only tests call, such as
DeclarationSkeleton.definesandLeanLspProjects. Removing those changes a public surface and is a separate decision. - Duplicated helpers that are still in use.
Activity