Skip to content

Epic: dead code, scripts and dependencies are removed #2542

Closed
7 of 7 issues completed
Closed

Description

@schlessera

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> across packages tests scripts website template evals experiments, excluding the defining file, CHANGELOGs and api-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.ts and docs/decisions/public-export-boundary.md. Removing a public name is a contract change and needs a ruling. Removing an ./internal name or a non-entry export keyword does not.
  • Related existing work: packages: delete internal entry points that no other package uses #1401 deletes whole ./internal entry 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 contract ruling.
  • Out: test-only twins of production components (Epic: tests exercise the code paths production runs #2540 owns those).
  • Out: an exhaustive audit of every src function, every scripts/ 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:

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.

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    type: chore
    area: ui-sdk
    area: ui-server
    area: ui-react
    area: ui-kit
    area: ci
    area: docs
    priority: p3
    epic
    on Oct 21, 2026
  2. added this to the 0.45.0 milestone on Nov 2, 2026
  3. added a commit that references this issue on Nov 3, 2026
  4. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    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.

  5. added a commit that references this issue on Nov 4, 2026
  6. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    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.

  7. added a commit that references this issue on Nov 6, 2026
  8. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    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.

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

    area: ciarea: docsarea: ui-kitarea: ui-reactarea: ui-sdkarea: ui-serverepicpriority: p3type: chore

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions