Fresh debt audit: delete six unreferenced exports - #958
Merged
Conversation
Pure deletion, no behavior change. Every symbol was verified with a repo-wide grep covering e2e/, bin/, scripts/, tests, config, and markdown. - observability/service-resources.ts: isSubsystemDegraded — zero callers - agents/telemetry.ts: AgentHistoryResult, and AgentHistoryEntry which it orphaned (no history function lives in this module) - applied-migrations-store.ts: the APPLIED_MIGRATIONS_STORE_PATH_FN re-export alias — zero importers; appliedStorePath stays, used in-file - templates/store.ts: the unused arg-parser value/type import block and the ParsedArg re-export — zero importers. The line-14 `export ... from` stays; both of its names have importers. - web use-jobs.ts: JobRunTriggerSource - web use-release-stream.ts: AssistedRequiredCheck and the RequiredCheckName type-only import it orphaned Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First broad tech-debt audit since 2026-07-21 (PR #807). Scoped per the Brain's
standing guidance to two categories — unreferenced exports and duplicated
helpers / name collisions — skipping the TODO/FIXME,
any-cast, andunused-dependency sweeps, which four consecutive audits have found empty.
What this PR changes
Pure deletion: +0 / -61 across 6 files, no behavior change. Every symbol was
verified against a repo-wide identifier-frequency map built over all tracked
files (so
e2e/,bin/,scripts/, tests, config, and markdown are covered),then spot-checked with a direct grep.
apps/server/src/observability/service-resources.tsisSubsystemDegradedapps/server/src/agents/telemetry.tsAgentHistoryResult,AgentHistoryEntryAgentHistoryResultwas dead; its only consumer-of-AgentHistoryEntrystatus made that type dead too (orphan chain). No history function lives in this module — the siblingActivitySummaryResult/FeedbackSummaryResulttypes are return types and stay.apps/server/src/applied-migrations-store.tsexport { appliedStorePath as APPLIED_MIGRATIONS_STORE_PATH_FN }appliedStorePathitself stays — used twice in-file.apps/server/src/templates/store.tsarg-parserimport block,export type { … as ParsedArg }parseTemplateArgs,substituteArgs, norParsedArgwas referenced in the file body, andParsedArghas zero importers.apps/web/src/hooks/use-jobs.tsJobRunTriggerSourceapps/web/src/hooks/use-release-stream.tsAssistedRequiredCheck+ theRequiredCheckNametype-only importWhy this qualifies as tech debt
Dead exports are load-bearing-looking code: they make a module's public surface
read wider than it is, they survive greps, and they keep otherwise-removable
types alive behind them (the
AgentHistoryEntrychain here). Deletion-only PRsare the safest way to clear them — nothing can regress behavior.
Deliberate exclusions (do not re-litigate)
Several things the scan flagged are not debt and were left alone:
templates/store.ts:14—export { parseTemplateArgs, substituteArgs } from "./arg-parser.js"stays. Both names have real importers throughstore.js(routes/templates.ts,jobs/service.ts). Only the redundant local import and theParsedArgalias went.formatBytesinapps/web/src/components/app/service-resources-format.tsvsshared/lib/format-bytes.ts— a name collision, not a duplicate. The web copy takesnumber | null(→"—"), has a TB tier, and switches precision at ≥10 ("10 KB"vs"1.0 KB"). Both have tests asserting their own outputs. Rename candidate later; merging would change rendered output.mergeElementsinserver/mcp-whiteboard-handlers.tsvsweb/whiteboard-tab.tsx— same name, genuinely different behavior (server merges with delete-ids and change tracking; web unions local/remote). Both file-private.toWriteAckinshared/mcp/brain-tools.tsvscrud-tools.ts— different shapes (typed brain-object ack vs duck-typed CRUD ack). Both file-private.resolveRepoRoot×3 —shared/git/git-context.tsexports a genuinely different common-dir resolver; theworktree.tsandpr.tscopies are near-identical but throw different domain error classes. Backlogged, not swept here.DialogTrigger,DialogClose,SelectGroup,SelectLabel,SelectSeparator) — settled policy from PR Settle the dead design-system surface policy #944, kept on purpose and annotated in-file.Validation
pnpm run check·pnpm run finalize:web·pnpm run test:e2e(180 passed) ·server Vitest (2733 passed) · web Vitest (875 passed) — all green.
Queued for the next run
The audit's headline finding is a third copy of the icon-color palette:
VALID_ICON_COLORS(apps/server/src/server/static-theme.ts:7),ICON_COLORS(apps/web/src/hooks/use-icon-color.ts:4), and the hex table inscripts/generate-icon-colors.ts— three places to edit to add one colour, withICON_COLOR_OPTIONSre-typing the same hexes web-side. That is next.Behind it, a fresh cluster of server↔web wire-type duplication: service-resources
(~120 mirrored lines), the three-way reviews types, brain store, agent history,
agent diff, release info, and messages.
🤖 Generated with Claude Code