[PR #3509] [MERGED] chore: remove dead exports, unreachable branches, and parked locals #5972

Closed
opened 2026-10-23 04:05:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3509
Author: @kolacheee
Created: 7/12/2026
Status: ✅ Merged
Merged: 7/12/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/3488-dead-code-remainder


📝 Commits (4)

  • 1da967b chore: remove dead exports, unreachable branches, and parked locals (#3488)
  • 066bb93 chore: drop orphaned pi-coding-agent dependency and dangling TypingIndicator JSDoc
  • aac7160 Merge remote-tracking branch 'origin/staging' into integrate-pr-3509
  • f3d16f0 test: follow text rewrite helper rename

📊 Changes

32 files changed (+57 additions, -834 deletions)

View changed files

📝 docs/development/frontend.md (+1 -2)
📝 packages/client/.instructions.md (+1 -1)
📝 packages/client/src/components/agents/AgentEditor.tsx (+0 -1)
📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+0 -50)
📝 packages/client/src/components/chat/ChatArea.tsx (+0 -21)
📝 packages/client/src/components/chat/ChatInput.tsx (+0 -1)
📝 packages/client/src/components/chat/ChatMessage.tsx (+0 -1)
📝 packages/client/src/components/game/GameSurface.tsx (+0 -5)
📝 packages/client/src/components/layout/ModalRenderer.tsx (+0 -7)
➖ packages/client/src/components/modals/EditAgentModal.tsx (+0 -218)
📝 packages/client/src/components/onboarding/OnboardingTutorial.tsx (+0 -21)
📝 packages/client/src/components/panels/LorebooksPanel.tsx (+2 -5)
📝 packages/client/src/components/ui/AppDialogRenderer.tsx (+1 -14)
📝 packages/client/src/hooks/use-game.ts (+0 -19)
📝 packages/client/src/hooks/use-generate.ts (+1 -12)
📝 packages/client/src/hooks/use-touch-folder-drag.ts (+1 -3)
📝 packages/client/src/lib/app-dialogs.ts (+2 -22)
📝 packages/client/src/stores/dialog.store.ts (+0 -2)
📝 packages/server/package.json (+0 -1)
📝 packages/server/src/routes/chats.routes.ts (+0 -4)

...and 12 more files

📄 Description

Linked issue

Closes #3488 (together with already-open PR #3500, which covers the catalogue's dead-files section — this PR covers the dead exports/branches and dead-locals sections).

Why this change

Dead code is where agents go wrong quietly: they edit files that never run, copy superseded patterns, and two entries here were wrong-import magnets (a dead local colliding with a live resolver's name; docs advertising a never-called utility as THE way to do XML wrapping). This PR removes the remainder of the #3488 catalogue. Every entry was re-verified against current staging with repo-wide consumer searches (including dynamic/string-key dispatch) and git-history intent tracing; per-item reasoning is in the commit message.

What changed

  • wrapInXml/stripXmlTags deleted — never called in the repo's entire history; real wrapping is format-engine.ts. nameToXmlTag in the same file stays (5 live server consumers) — the catalogue's whole-file-deletion suggestion was wrong on the current tree. The two doc lines advertising wrapInXml() now point at real utilities.
  • resolveLorebookGenerationTriggers (local, chats.routes.ts) deleted — its only-ever caller was deliberately replaced with previewOnly: true; the name collided with the live 2-arg resolver used by generate.routes.
  • Confirm-checkbox dialog slice (showConfirmWithCheckbox, store field, renderer branch) deleted — the maintainer removed its only consumer the day after it shipped (822a3d506); it has been unreachable end-to-end since.
  • loadPiSkills + idFromSkillFile deleted (superseded by list() → buildSkillsPrompt in f11e67aeb) — and with them the last import of @earendil-works/pi-coding-agent, so that dependency and its lockfile subtree are removed too. (@earendil-works/pi-ai was already unimported before this PR — left alone, flagged below.)
  • buildAssetTagList deleted (born unused; GM prompts read getAssetManifest() directly).
  • buildDeterministicSummary deleted — it was wired only on the abandoned refactor lineage; staging's conclude path deliberately uses the interactive json_repair flow instead, so wiring it here would be a design change, not a restoration.
  • resolveProviderTopK collapsed — a regression fix made the google branch identical to the default; the now-inert provider param dropped at all three call sites.
  • Empty placeholder if in generate.routes deleted (the per-character injection it pointed at already exists downstream).
  • formatRetryAgentActivityBubble unreachable !result.success branch deleted — the sole caller gates on success since e95914489; failure UX lives in showAgentFailuresError.
  • Small client bits: moveCancelThresholdPx (never-passed back-compat alias), LorebookRow.personaName (only caller hardcodes undefined; persona names are pre-merged into characterName), _buildClipPath, _isRP, _displayPrompt, _messageOrderIndexById (an O(n) map rebuilt on every messages change — small perf win), local TypingIndicator + its now-unused PendingTypingDots import (the component itself stays, 5 other consumers), _modelName.
  • Bot-browser provider interface: getAvatarUrl/getExternalUrl/importCard removed from the interface and all six providers — every importCard was an empty stub since the file's first commit; live paths are card.avatarUrl/card.externalUrl and the shared handleImport.
  • EditAgentModal deleted (file + ModalRenderer wiring + two doc references) — born dead in the founding commit; nothing has ever called openModal("edit-agent"), and AgentEditor is a strict superset with better connection validation. The .instructions.md openModal example now uses the real docs-viewer modal.
  • GameSurface/game hooks: never-called _rollEncounter/_journalEntry and their useRollEncounter/useJournalEntry hooks deleted (the invalidation they would add targets a query key with zero subscribers; the journal UI re-fetches on mount), duplicate new Set() reset deduped. The used-despite-underscore _advanceTime/_updateReputation stay.
  • gm-prompts: orphaned normalizedLanguage computation deleted (the language directive was relocated to buildGmFormatReminder in b3fce6c85, which is untouched).

Follow-up candidates surfaced by this work, deliberately NOT changed here (API-surface decisions): POST /game/encounter/roll now has zero client consumers; useGameJournal was already zero-reference before this PR; @earendil-works/pi-ai is a declared-but-unimported server dependency; shared ConversationCallParticipantState is zero-reference; the lorebook ?cascade=true server plumbing is unreachable from the UI since 822a3d506.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Validation performed: per-item re-verification against current staging by a read-only verification pass (repo-wide consumer searches including dynamic dispatch, plus git-history intent tracing), exact-match scripted edits with assertions, pnpm check per batch, pnpm install after the dependency removal, and a 6-lens adversarial review of the final diff whose findings (orphaned dependency, dangling JSDoc) were fixed in the second commit.

Manual checks still worth doing in a browser:

  • Manually verify the bot browser: avatars render, external links open, and imports work across a couple of sources.
  • Manually verify agent editing via the Agents panel opens the full-page AgentEditor and saves.
  • Manually verify folder delete confirms still appear (plain confirm) in the Lorebooks panel.
  • Manually verify a generation with topK set on a Google connection still sends top-k (behavior is expression-identical, but this is the one signature that touched generation plumbing).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

(Two developer-doc lines — docs/development/frontend.md and packages/client/.instructions.md — were corrected as part of the removals themselves; no README/CHANGELOG impact.)

UI evidence (if applicable)

No visual changes — everything removed was unreachable or write-only.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/3509 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 7/12/2026 **Status:** ✅ Merged **Merged:** 7/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/3488-dead-code-remainder` --- ### 📝 Commits (4) - [`1da967b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1da967bb7f383d95cc905efad7570ac3710305d4) chore: remove dead exports, unreachable branches, and parked locals (#3488) - [`066bb93`](https://github.com/Pasta-Devs/Marinara-Engine/commit/066bb935ba7e8e195e107ce7362549110878f708) chore: drop orphaned pi-coding-agent dependency and dangling TypingIndicator JSDoc - [`aac7160`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aac71606b22cba0c800ab5666940c01f82ac67c6) Merge remote-tracking branch 'origin/staging' into integrate-pr-3509 - [`f3d16f0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f3d16f07cd212ed8114d95c463f7855bcc7d03cc) test: follow text rewrite helper rename ### 📊 Changes **32 files changed** (+57 additions, -834 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/frontend.md` (+1 -2) 📝 `packages/client/.instructions.md` (+1 -1) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+0 -1) 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+0 -50) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+0 -21) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+0 -1) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+0 -1) 📝 `packages/client/src/components/game/GameSurface.tsx` (+0 -5) 📝 `packages/client/src/components/layout/ModalRenderer.tsx` (+0 -7) ➖ `packages/client/src/components/modals/EditAgentModal.tsx` (+0 -218) 📝 `packages/client/src/components/onboarding/OnboardingTutorial.tsx` (+0 -21) 📝 `packages/client/src/components/panels/LorebooksPanel.tsx` (+2 -5) 📝 `packages/client/src/components/ui/AppDialogRenderer.tsx` (+1 -14) 📝 `packages/client/src/hooks/use-game.ts` (+0 -19) 📝 `packages/client/src/hooks/use-generate.ts` (+1 -12) 📝 `packages/client/src/hooks/use-touch-folder-drag.ts` (+1 -3) 📝 `packages/client/src/lib/app-dialogs.ts` (+2 -22) 📝 `packages/client/src/stores/dialog.store.ts` (+0 -2) 📝 `packages/server/package.json` (+0 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+0 -4) _...and 12 more files_ </details> ### 📄 Description ## Linked issue Closes #3488 (together with already-open PR #3500, which covers the catalogue's dead-files section — this PR covers the dead exports/branches and dead-locals sections). ## Why this change Dead code is where agents go wrong quietly: they edit files that never run, copy superseded patterns, and two entries here were wrong-import magnets (a dead local colliding with a live resolver's name; docs advertising a never-called utility as THE way to do XML wrapping). This PR removes the remainder of the #3488 catalogue. Every entry was re-verified against current staging with repo-wide consumer searches (including dynamic/string-key dispatch) and git-history intent tracing; per-item reasoning is in the commit message. ## What changed - **`wrapInXml`/`stripXmlTags`** deleted — never called in the repo's entire history; real wrapping is `format-engine.ts`. **`nameToXmlTag` in the same file stays** (5 live server consumers) — the catalogue's whole-file-deletion suggestion was wrong on the current tree. The two doc lines advertising `wrapInXml()` now point at real utilities. - **`resolveLorebookGenerationTriggers` (local, chats.routes.ts)** deleted — its only-ever caller was deliberately replaced with `previewOnly: true`; the name collided with the live 2-arg resolver used by generate.routes. - **Confirm-checkbox dialog slice** (`showConfirmWithCheckbox`, store field, renderer branch) deleted — the maintainer removed its only consumer the day after it shipped (822a3d506); it has been unreachable end-to-end since. - **`loadPiSkills` + `idFromSkillFile`** deleted (superseded by `list()` → `buildSkillsPrompt` in f11e67aeb) — and with them the last import of `@earendil-works/pi-coding-agent`, so that dependency and its lockfile subtree are removed too. (`@earendil-works/pi-ai` was already unimported before this PR — left alone, flagged below.) - **`buildAssetTagList`** deleted (born unused; GM prompts read `getAssetManifest()` directly). - **`buildDeterministicSummary`** deleted — it was wired only on the abandoned refactor lineage; staging's conclude path deliberately uses the interactive `json_repair` flow instead, so wiring it here would be a design change, not a restoration. - **`resolveProviderTopK`** collapsed — a regression fix made the google branch identical to the default; the now-inert `provider` param dropped at all three call sites. - **Empty placeholder `if`** in generate.routes deleted (the per-character injection it pointed at already exists downstream). - **`formatRetryAgentActivityBubble`** unreachable `!result.success` branch deleted — the sole caller gates on success since e95914489; failure UX lives in `showAgentFailuresError`. - **Small client bits**: `moveCancelThresholdPx` (never-passed back-compat alias), `LorebookRow.personaName` (only caller hardcodes `undefined`; persona names are pre-merged into `characterName`), `_buildClipPath`, `_isRP`, `_displayPrompt`, `_messageOrderIndexById` (an O(n) map rebuilt on every messages change — small perf win), local `TypingIndicator` + its now-unused `PendingTypingDots` import (the component itself stays, 5 other consumers), `_modelName`. - **Bot-browser provider interface**: `getAvatarUrl`/`getExternalUrl`/`importCard` removed from the interface and all six providers — every `importCard` was an empty stub since the file's first commit; live paths are `card.avatarUrl`/`card.externalUrl` and the shared `handleImport`. - **`EditAgentModal`** deleted (file + ModalRenderer wiring + two doc references) — born dead in the founding commit; nothing has ever called `openModal("edit-agent")`, and `AgentEditor` is a strict superset with better connection validation. The `.instructions.md` `openModal` example now uses the real `docs-viewer` modal. - **GameSurface/game hooks**: never-called `_rollEncounter`/`_journalEntry` and their `useRollEncounter`/`useJournalEntry` hooks deleted (the invalidation they would add targets a query key with zero subscribers; the journal UI re-fetches on mount), duplicate `new Set()` reset deduped. The used-despite-underscore `_advanceTime`/`_updateReputation` stay. - **gm-prompts**: orphaned `normalizedLanguage` computation deleted (the language directive was relocated to `buildGmFormatReminder` in b3fce6c85, which is untouched). Follow-up candidates surfaced by this work, deliberately NOT changed here (API-surface decisions): `POST /game/encounter/roll` now has zero client consumers; `useGameJournal` was already zero-reference before this PR; `@earendil-works/pi-ai` is a declared-but-unimported server dependency; shared `ConversationCallParticipantState` is zero-reference; the lorebook `?cascade=true` server plumbing is unreachable from the UI since 822a3d506. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Validation performed: per-item re-verification against current staging by a read-only verification pass (repo-wide consumer searches including dynamic dispatch, plus git-history intent tracing), exact-match scripted edits with assertions, `pnpm check` per batch, `pnpm install` after the dependency removal, and a 6-lens adversarial review of the final diff whose findings (orphaned dependency, dangling JSDoc) were fixed in the second commit. Manual checks still worth doing in a browser: - Manually verify the bot browser: avatars render, external links open, and imports work across a couple of sources. - Manually verify agent editing via the Agents panel opens the full-page AgentEditor and saves. - Manually verify folder delete confirms still appear (plain confirm) in the Lorebooks panel. - Manually verify a generation with topK set on a Google connection still sends top-k (behavior is expression-identical, but this is the one signature that touched generation plumbing). ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) (Two developer-doc lines — `docs/development/frontend.md` and `packages/client/.instructions.md` — were corrected as part of the removals themselves; no README/CHANGELOG impact.) ## UI evidence (if applicable) No visual changes — everything removed was unreachable or write-only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:05:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5972
No description provided.