mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3488] [Issue]: Code sweep: dead code catalogue (unreferenced components, exports, unreachable branches) #1886
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1886
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jul 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3488
Originally assigned to: @kolacheee on GitHub.
Summary
A verified catalogue of dead code: whole components with zero importers, exported functions nothing calls, and branches that can never run.
Why this is a problem: dead code is where agents go wrong quietly. They edit files that never run (a concrete example below), copy superseded patterns, and in two cases here the dead name collides with a live one, inviting the wrong import.
What it negatively affects: agent and contributor productivity, code search quality, and refactor safety. No user-facing behavior — that is the point.
Verification method: every entry was checked with repo-wide reference searches including barrel re-exports, lazy/dynamic imports, codegen registries, and string-keyed dispatch. Visual-Novel-related dead code (including
shared/src/types/vn.ts, fully dead) is deliberately excluded here — it is catalogued under #3456.Expected behavior
Code in the repo is reachable, or it is deleted.
Actual behavior
Dead files (zero importers; delete candidates)
client/.../components/game/GameSessionBanner.tsx— superseded byGameSurface.handleConcludeSession/useConcludeSessionclient/.../components/game/GameStateIndicator.tsx— itsSTATE_CONFIGis a byte-duplicate of the live one inGameMap.tsxclient/.../components/chat/ExpressionPanel.tsx(and itsExpressionSprite)client/.../components/chat/SpriteSidebar.tsx— live path isSpriteOverlay.tsxclient/.../components/modals/BotBrowserModal.tsx— Chub-only modal superseded byBotBrowserPanel(wired inRightPanel.tsx:26,50)client/.../components/game/GamePartySidebar.tsx—GameSurface.tsx:11386says "REMOVED: Old sidebar replaced by compact GamePartyBar"client/.../components/game/GameCheckpoints.tsx— checkpoint browse/restore UI; server checkpoints have no UI entry pointclient/.../components/game/GameDialogueOverlay.tsxclient/.../components/game/GameNpcTracker.tsxclient/.../features/chat-settings/sections/ManualRepliesSection.tsx—ChatSettingsDrawerimports every sibling section except this oneclient/.../hooks/use-party-turn.ts— party turns flow through the main SSE/generatepipelineserver/src/types/better-sqlite3.d.tsandsql-js.d.ts— ambient decls for packagescreateDB()refuses to load (libsql-only since v1.5.7)scripts/import-genshin-music.sh— personal one-off with hardcoded/Users/marysia/...paths, wired to nothingDead exports / branches
shared/.../utils/xml-wrapper.ts:25—wrapInXml/stripXmlTags: zero call sites (real wrapping isformat-engine.ts). Note:packages/client/.instructions.md:314advertiseswrapInXml()as THE XML util, actively steering agents to dead code (doc fix tracked in the meta-file issue).server/.../routes/chats.routes.ts:301— localresolveLorebookGenerationTriggers(mode): zero in-file callers, and the name collides with the live 2-arg resolver inlorebook-generation-runtime.tsused bygenerate.routes.ts. High hazard: wrong-import magnet.client/.../lib/app-dialogs.ts:84—showConfirmWithCheckboxand the whole checkbox-dialog feature behind it (store field + UI) is unreachable end-to-end.server/.../services/professor-mari/workspace-skills.service.ts:258—loadPiSkills: zero callers; live path islist()→buildSkillsPrompt.server/.../services/game/journal.service.ts:384—buildDeterministicSummary: zero callers; comment implies it can replace the LLM conclude path. Delete or wire up (maintainer decision).server/.../routes/generate/generate-route-utils.ts:343—resolveProviderTopKgoogle branch returns the identical expression as the default; implies provider-specific top-K that does not exist.server/.../services/game/asset-manifest.service.ts:276—buildAssetTagList: zero callers.client/.../hooks/use-touch-folder-drag.ts:27—moveCancelThresholdPx: back-compat alias of the renamedmoveActivateThresholdPx, zero callers, name now lies.client/.../components/panels/LorebooksPanel.tsx:624—LorebookRow.personaNameprop/branch: the only caller hardcodesundefined.client/.../components/bot-browser/BotBrowserView.tsx:112— provider interface methodsgetAvatarUrl/getExternalUrl/importCard: implemented by all 6 providers, called by nothing.client/.../components/modals/EditAgentModal.tsx+ModalRenderer.tsx:100edit-agentcase — nothing callsopenModal("edit-agent"); live editor isAgentEditor(maintainer decision).client/.../components/onboarding/OnboardingTutorial.tsx:236—_buildClipPath: zero callers.Dead locals / unreachable branches (smaller, batched)
client/.../components/chat/ConversationCallSurface.tsx:633— thekind==="command"formatting switch inmessageContentis unreachable:visibleCallMessages(:1347) filters command messages out before the only call site (:2743). High hazard: an agent editing call-message formatting edits dead code.client/.../components/game/GameSurface.tsx:3523—_rollEncounter/_journalEntrymutations never called; journal writes instead go through 6 ad-hocapi.post('/game/journal/entry')calls that skip the mutation's cache invalidation.ChatInput.tsx:1374_isRP;AgentEditor.tsx:931_displayPrompt;ChatArea.tsx:736_messageOrderIndexById(O(n) map rebuilt every render, unused) and:3112TypingIndicator;ChatMessage.tsx:1349_modelName.gm-prompts.ts:414normalizedLanguageunused;world-state-display.ts:331/:403keyword branches return the same value as their fallback;generate.routes.ts:2859empty if-body;GameSurface.tsx:9070-9071duplicatenew Set()reset;use-generate.ts:3206dead!result.successbranch.Steps to reproduce
For any entry: repo-wide search for the symbol/file name; the only hits are the definition and (where noted) a misleading doc reference.
Environment
45b650de9)Logs, screenshots, or video
N/A.
Additional context
Found by a repo-wide read-only sweep; every entry survived adversarial verification specifically hunting for dynamic/lazy/registry references before being listed. No deletions started. Part of a coordinated set of sweep catalogue issues filed together.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@kolacheee commented on GitHub (Jul 11, 2026):
Taking the remaining sections (dead exports/branches and dead locals). The dead-files section is already covered by open PR #3500. Each entry is being re-verified against current staging before deletion; judgment-call items (EditAgentModal, buildDeterministicSummary, etc.) will have the wire-up-vs-remove reasoning documented in the PR for review. — @kolacheee