Repository navigation
Description
Outcome
The dead code, scripts, exports, documents and dependencies found by the 2026-10-22 repository review are removed, and a gate keeps unused exports in ui-server, ui-kit and ui-react from coming back. This epic is bounded to that audited inventory — the seven children below — and does not promise an exhaustive audit of every function, script or dependency in the tree. A wider inventory, if wanted, is a new issue with its own method and evidence.
Why now
A repository review on 2026-10-22 (main dcf5341aa) found dead weight in most packages. Examples include unused ./internal re-exports, default-root wrappers left behind by the public-export cut, hundreds of export keywords on module-private names, measurement scripts for migrations that have shipped, and a second pinned copy of a large SDK installed in every checkout. Each costs something on every change. It adds api-report rows to review, rename work, install time and CI minutes, and it makes "is this used?" a question with no cheap answer. This epic closes #2509, #2510, #2511, #2512, #2534, #2535, #2536.
Shared context
- Reference counts. The review counted references with whole-word
git grep -lw <name>acrosspackages tests scripts website template evals experiments, excluding the defining file, CHANGELOGs andapi-report/. Docs mentions do not make code live, but a doc that names a deleted function must be updated in the same PR. - Entry-point exports are governed by
tests/api-surface.test.tsanddocs/decisions/public-export-boundary.md. Removing a public name is acontractchange and needs a ruling. Removing an./internalname or a non-entryexportkeyword does not. - Related existing work: packages: delete internal entry points that no other package uses #1401 deletes whole
./internalentry points nobody imports. The children here remove individual names and leave entries that are still used. - A type reachable from a public signature is public with it (
docs/decisions/public-export-boundary.md:75-76). A declaration recorded in an api-report is not dead even if no file names it.
Constraints and non-goals
- Delete only what is proven unused at the PR's base, with the reference-count command and its output in the PR.
- Gated or not-yet-enabled features that a decision record or open issue says are coming are not dead code. They may be isolated or documented, not deleted, without a ruling on their issue.
- Do not remove a published export, bin or package entry under this epic without a
contractruling. - Out: test-only twins of production components (Epic: tests exercise the code paths production runs #2540 owns those).
- Out: an exhaustive audit of every
srcfunction, everyscripts/file or every declared dependency beyond what the children name. ci: three root scripts have no consumer after their driving issues closed #2510, for example, deliberately covers three scripts only.
Breakdown
Original independent inventory (native child states remain authoritative). Delivered on main: #2509, #2510, #2534, #2535 and #2536; their branch-only handoffs are historical. #2534 landed through #3413 / batch #3570 (merge 3ef7c51b2e03468c9a20ffe0dde5dacc1a076b1b, a verified ancestor of inspected main). All seven native children are now closed. #2511/#2512 reached main through #3400, and #3651 removes the subsequently resurrected navigation-recovery plan. Both merge commits are ancestors of inspected main. The two original evidence files remain absent and their archived SHA-256 inventory is recorded at (**Path:**, docs/decisions/measurement-archive.md:205-211). Parent completion still requires the bounded reference-count and export-gate definition of done, rather than a new exhaustive cleanup audit.
Independent children, any order:
- ci: the root still installs the unused
claude-agent-sdk-research-292Agent SDK alias #2509 — the unusedclaude-agent-sdk-research-292Agent SDK alias at the root - ci: three root scripts have no consumer after their driving issues closed #2510 — three root scripts with no consumer after their driving issues closed
- docs: docs/plans keeps six plans for shipped work and two executable experiments, against its own README rule #2511 — shipped plans and executable experiments under
docs/plans(exceptindex-query-api.md, which docs: retire direct brain.db SQL guarantees after query migration #701 retires) - docs: two evidence files in docs/process/evidence are referenced by nothing #2512 — two unreferenced evidence files in
docs/process/evidence - ui-sdk: 71 internal entry names have no consumer outside the package #2534 — 68 + 3 consumer-less names in ui-sdk's
./internaland./internal/client - ui-react: default-root wrappers left by the export cut have no caller or only test callers #2535 — ui-react default-root wrappers with no caller
- ci: no gate catches an export that no other file imports #2536 (delivered) — a lint gate for exports no other file imports in ui-server, ui-kit and ui-react, plus the clean-up it reports (including ui-react's five own-file exports)
Definition of done
- All seven children are closed, each PR carrying the reference-count command and output that proved its removals unused at its base.
- The unused-export gate from ci: no gate catches an export that no other file imports #2536 is part of
bun run lint, enforces ui-server, ui-kit and ui-react, and passes with no unexplained allowlist entries. - The names, scripts, documents and dependency each child lists are gone, or the child records why one stays. Tooling such as a CLI used through a script, or a type-only dependency, counts as used when the PR shows the use; a source import is not required (the source guard already distinguishes declared dependencies from their uses,
tests/dependency-edges.test.ts:147-163).
Found by a repository review on 2026-10-22.
2026-10-24: bounded the outcome and definition of done to the audited inventory owned by the seven children plus the export gate; the exhaustive function/script/dependency audit the body previously promised had no owner.
2026-11-04 triage at main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36: Reconciled the native inventory and delivered lint gate without declaring the remaining document/export cleanup complete. No new runtime qualification or implementation is claimed.
Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Reconciled the final documentation/evidence children with #3400 and #3651 on main; inspected current plan/evidence paths and archive inventory. Preserve p3, 0.45.0 and original seven-child scope. Full-epic completion is not inferred from closure alone.
Activity
claude-agent-sdk-research-292Agent SDK alias #2509chore(ci): map the four review epics to their project tracks (#2543)
schlessera commentedon Nov 3, 2026
Epic state — 2026-11-03 (first state note)
This epic runs an integration branch,
epic/2542-dead-code. Children merged there stay open until a lane PR lands the batch on main; none exists yet.claude-agent-sdk-research-292Agent SDK alias #2509 (chore(deps): drop the unused claude-agent-sdk-research-292 alias #3320), ci: three root scripts have no consumer after their driving issues closed #2510 (chore(ci): remove three root scripts with no consumer #3317), ui-react: default-root wrappers left by the export cut have no caller or only test callers #2535 (chore(ui-react): delete default-root wrappers left by the export cut (#2535) #3411).All seven children remain independent.
Merge pull request #3512 from schlessera/epic/2542-dead-code
schlessera commentedon Nov 4, 2026
Epic state — 2026-11-04 (inspected main
53b862123d7b8e4c9d039859fabdc9fc6ad4cd36)Delivered: #2509, #2510, #2535 and #2536, including the unused-export gate now present in the lint chain. Their former integration-branch-only handoff is superseded at the inspected main. Open: #2511, #2512 and #2534; the remaining document/evidence/export cleanup still owns its original acceptance and reference-count proof. The epic is not complete.
The epic remains outside
agent-ready; work continues through its native children.Merge pull request #3570 from schlessera/epic/2542-dead-code
schlessera commentedon Nov 5, 2026
Epic state — 2026-11-05 (inspected main
35217d283b849b5ef81700d5d4c2ec7486405d12)#2534 is delivered by #3413 / batch #3570 on main. Five of seven native children are closed; #2511 and #2512 remain open. The delivered cleanup retains types required by emitted public signatures and imports, so an absence of direct source callers is still insufficient to remove a public type.
No new runtime or full-epic completion proof is claimed.
Merge pull request #3654 from schlessera/epic/2542-dead-code
schlessera commentedon Nov 8, 2026
Epic state — 2026-11-08 (main
1619741f291f525d17cde4970a5ada40644117c1)All seven native children are closed. #3400 (
b29668b2925e72af60f95fce759c1c32dac1f625) and #3651 (72bcf9a8543fa04fd2505f5861a024b20b57ea61) are on main. The latter removes the reintroduced navigation-recovery plan; the original evidence files are absent with archive checksums recorded. Preserve the bounded reference-count/export-gate completion audit and 0.45.0 attribution. This is a closure candidate, not a new runtime or exhaustive-tree audit.