mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1496] [Feature]: Complete Knip unused-code triage for refactor parity #747
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#747
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 @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1496
Originally assigned to: @Xelvanis on GitHub.
What problem does this solve?
Knip's unused-code report on the refactor branch mixes real cleanup candidates with files that are present because refactor wiring is incomplete. Treating the report as a deletion queue would risk removing intended product behavior, prompts, source-of-truth contracts, or tooling dependencies.
Current local triage baseline after merging
origin/refactorat377836b7:package.jsonandpnpm-lock.yamlremain unchanged in the current triage branch.Proposed behavior
Track the Knip report as a refactor parity/cleanup effort:
@tauri-apps/cliandtailwindcss.Current add-back progress:
src/engine/modes/chat/commands/impersonate-prompt.tsnow feeds impersonate generation with the same prompt template previewed in settings.src/engine/generation-core/lorebooks/game-lorebook-scope.tsnow excludes generated game lorebook-keeper books from normal lore injection when the keeper is disabled.src/shared/lib/chat-attachment-images.tsnow backs image/GIF attachment prep in both chat input surfaces.src/engine/modes/game/state/session-summary-normalization.tsnow dedupes repeated game session summary facts before save.src/engine/modes/game/prompts/party-prompts.tsnow backs structured party-turn prompts.src/engine/modes/game/assets/npc-avatar-utils.tsnow guards non-Mari NPCs from inheriting the built-in Mari portrait.src/engine/modes/game/mechanics/perception.service.tsnow fills the GM prompt's passive perception hint slot.src/engine/agents-runtime/knowledge/knowledge-retrieval.ts,src/engine/agents-runtime/knowledge/knowledge-router.ts, andsrc/engine/generation-core/lorebooks/embeddings.tsnow run through the active agent runtime for selected lorebook sources.Remaining work includes:
src/engine/modes/game/world/map.service.tsshould replace or stay separate from the current deterministic map API.src/engine/modes/roleplay/scene/scene-analyzer.tsandsrc/engine/modes/roleplay/scene/scene-postprocess.tsbefore wiring; inspection found they contain Game Mode scene-analysis behavior under a roleplay path.chat-modes.tsshould become active runtime/source-of-truth validation.sourceFileIds, not only selected lorebook sources.Expected owner or impact area
Refactor branch considerations
knowledgeSourcesApifrom engine code.Alternatives considered
src/features/modes/game-assets/components/encode-asset-path.ts: deferred because the activeshared/api/local-file-api.tspath already handles remote runtime and absolute Tauri paths.Additional context
Verification already run on the current triage branch:
pnpm typecheckpassed.pnpm check:architecturepassed.pnpm lint:eslintpassed.pnpm buildpassed with the existing large-chunk warning.cargo check --manifest-path src-tauri/Cargo.tomlpassed after merging the latest refactor storage changes.graphify update .passed.pnpm exec knip --reporter compact --no-exit-code --no-config-hintscurrently reports 32 unused files.git diff -- package.json pnpm-lock.yamlis empty.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Xelvanis commented on GitHub (May 29, 2026):
Progress update after opening this issue:
src/engine/core/clock.tsandsrc/engine/core/ids.tsintosrc/engine/generation/runtime-records.ts.newIdnow delegates tocreateId;nowIsodelegates tosystemClock.nowIso.pnpm exec vitest run src/engine/generation/agent-runner.test.ts src/engine/generation/connected-commands.test.ts src/engine/generation/main-tool-loop.test.tspassed (50 tests).pnpm typecheckpassed.pnpm check:architecturepassed.pnpm lint:eslintpassed.pnpm buildpassed with the existing large-chunk warning.graphify update .passed.Remaining newly confirmed point:
src/engine/core/result.tsis the only remaining unused core primitive.@Xelvanis commented on GitHub (May 29, 2026):
Progress update:
src/shared/hooks/use-page-activity.tsintoConversationViewso the periodic conversation status refresh loop pauses while Marinara is hidden or unfocused and refreshes again when active.pnpm typecheckpassed.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 29 unused files.Remaining confirmed point: the mode tracker wrappers are real but need a mode-owned consumer decision before wiring; I left them untouched for now instead of adding a no-op import.
@Xelvanis commented on GitHub (May 29, 2026):
Progress update:
agent.schema.tschat-preset.schema.tschat.schema.tsconnection.schema.tscustom-tool.schema.tsregex.schema.tspnpm typecheckpassed.pnpm exec vitest run src/features/catalog/chat-presets/hooks/use-chat-presets.test.ts src/features/catalog/chats/hooks/use-chats.test.tspassed: 1 test file, 1 test.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 22 unused files.Remaining confirmed schema point:
app-settings.schema.tsandcharacter.schema.tsneed row-shape reconciliation before safe wiring.@Xelvanis commented on GitHub (May 29, 2026):
Progress update:
origin/refactorcommit7a6bb285and regenerated Graphify after resolving generated-output conflicts.src/features/modes/game/hooks/use-party-turn.tsback into the active Game Mode party-address flow:[party-turn]marker consistently.GameNarrationnow ignores separate party-turn messages when choosing the latest GM narration, so party banter does not replace the scene text.pnpm typecheckpassed.pnpm exec vitest run src/features/modes/game/api/game-api.test.tspassed: 8 tests.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 18 unused files.Remaining file list is increasingly product/UI ownership work rather than obvious missing imports. I am continuing to avoid deleting or force-wiring files without a clear current owner path.
@Xelvanis commented on GitHub (May 29, 2026):
Verified checkpoint after syncing to latest
origin/refactor:origin/refactorat7a6bb285.src/features/modes/game/hooks/use-party-turn.tsis now wired back into the active Game Mode "Talk to Party" path.[party-turn]marker, return the stored message id, restore after reload, and no longer replace the latest GM narration inGameNarration.use-party-turn.tsis no longer in the unused-file list.Validation run:
pnpm typecheckpassed.pnpm lint:eslintpassed.pnpm check:architecturepassed.pnpm buildpassed with the existing large-chunk warning.pnpm exec vitest run src/engine/generation/start-generation.test.ts src/engine/generation/prompt-assembly.test.ts src/engine/generation/agent-runner.test.ts src/features/modes/game/stores/game-mode.store.test.ts src/features/modes/game/api/game-api.test.tspassed: 5 files, 122 tests.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 18 unused files.graphify update .passed. Graphify skippedgraph.htmlbecause the graph exceeds the configured viz limit, but updatedgraph.jsonandGRAPH_REPORT.md.git diff -- package.json pnpm-lock.yamlis empty.git diff --checkpassed with line-ending warnings only.Remaining work still looks like product/UI ownership decisions, not safe-delete cleanup: old game UI slices, runtime visual panels, agent review UI slices, mode tracker wrappers, VN DTOs, and architecture primitives remain in the unused list until their intended owner path is decided.
@Xelvanis commented on GitHub (May 29, 2026):
Progress update after continuing the add-back pass:
src/engine/modes/roleplay/scene/scene-analyzer.ts->src/engine/modes/game/scene/scene-analyzer.tssrc/engine/modes/roleplay/scene/scene-postprocess.ts->src/engine/modes/game/scene/scene-postprocess.tsanalyzeGameSceneservice through the richer game scene analyzer prompt and post-processing helper, without introducing a game -> roleplay dependency.Validation since this add-back:
pnpm typecheckpassed.pnpm lint:eslintpassed.pnpm check:architecturepassed.pnpm buildpassed with the existing large-chunk warning.pnpm exec vitest run src/engine/modes/game/scene/game-scene-analysis.service.test.tspassed: 1 test.pnpm exec vitest run src/engine/generation/start-generation.test.ts src/engine/generation/prompt-assembly.test.ts src/engine/generation/agent-runner.test.ts src/engine/modes/game/scene/game-scene-analysis.service.test.ts src/features/modes/game/stores/game-mode.store.test.ts src/features/modes/game/api/game-api.test.tspassed: 6 files, 123 tests.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 16 unused files.graphify update .passed. Graphify skippedgraph.htmlbecause the graph exceeds the configured viz limit, but updatedgraph.jsonandGRAPH_REPORT.md.Remaining files still look like owner/product decisions rather than safe add-backs: old game UI surfaces, runtime sprite sidebars, agent UI review widgets, mode tracker wrappers, VN DTOs,
result.ts,entity-repository.ts, and the map generation prompt helper.@Xelvanis commented on GitHub (May 29, 2026):
PR opened for the current Knip triage/add-back slice: #1499 — https://github.com/Pasta-Devs/Marinara-Engine/pull/1499
This PR reduces the Knip unused-file list to 16 and leaves the remaining entries tracked here for follow-up owner/product decisions rather than closing the issue.
@Xelvanis commented on GitHub (May 29, 2026):
Remaining Knip unused files after PR #1499:
@Xelvanis commented on GitHub (May 29, 2026):
Progress update after PR #1510 merged: https://github.com/Pasta-Devs/Marinara-Engine/pull/1510
id;setMaps(...);Validation for this slice:
pnpm exec vitest run src/features/modes/game/api/game-api.test.tspassed.pnpm typecheckpassed.pnpm lint:eslintpassed.pnpm check:architecturepassed.pnpm buildpassed with the existing Vite large-chunk warning.pnpm exec knip --reporter compact --no-exit-code --no-config-hintspassed and reports 13 unused files.graphify update .passed.pnpm check:graphify-scopepassed.Remaining Knip unused files after PR #1510:
Remaining work still looks like owner/product decisions rather than safe-delete cleanup: old game UI slices, runtime visual panels, agent review UI slices, VN DTOs,
result.ts,entity-repository.ts, and the game asset path helper remain to classify or wire intentionally.@Xelvanis commented on GitHub (May 29, 2026):
Finished status update:
pnpm exec knip --reporter compact --no-exit-code --no-config-hintshas noUnused filessection.Next step: restore
check:unusedto strict/failing mode by removing the temporary--no-exit-codeflag.@Xelvanis commented on GitHub (May 29, 2026):
Closing as complete for this issue's tracked scope: the Knip unused-file inventory is resolved on refactor. The remaining Knip dependency/export reports are separate follow-up work from this source-file triage.