[GH-ISSUE #1496] [Feature]: Complete Knip unused-code triage for refactor parity #747

Closed
opened 2026-10-20 17:32:46 +07:00 by bsakaguchi · 11 comments
Owner

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/refactor at 377836b7:

  • Knip unused files are down to 32 after several add-backs.
  • Prettier and Impeccable were install-state false positives; after a frozen install, both resolve and are no longer reported by Knip.
  • package.json and pnpm-lock.yaml remain unchanged in the current triage branch.
  • Runtime dependency reports from Knip still need a separate package/native-tooling audit before any dependency removal.

Proposed behavior

Track the Knip report as a refactor parity/cleanup effort:

  • Keep the Knip config scoped to source files and ignore known tool/CSS false positives such as @tauri-apps/cli and tailwindcss.
  • Add back files that represent intended refactor behavior but are not currently imported.
  • Document owner decisions for files that are superseded, misplaced, or waiting on product direction.
  • Do not delete unclassified files or package dependencies from the Knip report.

Current add-back progress:

  • src/engine/modes/chat/commands/impersonate-prompt.ts now feeds impersonate generation with the same prompt template previewed in settings.
  • src/engine/generation-core/lorebooks/game-lorebook-scope.ts now excludes generated game lorebook-keeper books from normal lore injection when the keeper is disabled.
  • src/shared/lib/chat-attachment-images.ts now backs image/GIF attachment prep in both chat input surfaces.
  • src/engine/modes/game/state/session-summary-normalization.ts now dedupes repeated game session summary facts before save.
  • src/engine/modes/game/prompts/party-prompts.ts now backs structured party-turn prompts.
  • src/engine/modes/game/assets/npc-avatar-utils.ts now guards non-Mari NPCs from inheriting the built-in Mari portrait.
  • src/engine/modes/game/mechanics/perception.service.ts now 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, and src/engine/generation-core/lorebooks/embeddings.ts now run through the active agent runtime for selected lorebook sources.

Remaining work includes:

  • Decide whether src/engine/modes/game/world/map.service.ts should replace or stay separate from the current deterministic map API.
  • Relocate or split src/engine/modes/roleplay/scene/scene-analyzer.ts and src/engine/modes/roleplay/scene/scene-postprocess.ts before wiring; inspection found they contain Game Mode scene-analysis behavior under a roleplay path.
  • Decide whether contract schemas and chat-modes.ts should become active runtime/source-of-truth validation.
  • Decide the fate of generic core/repository primitives.
  • Compare older game/runtime/agent UI slices against current surfaces before deleting.
  • Add an engine-safe text-read capability if Knowledge Retrieval should also include uploaded sourceFileIds, not only selected lorebook sources.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

  • Engine code should stay React-free and must not import shared API/Tauri adapters.
  • Feature code should continue to use focused shared API wrappers.
  • Game, roleplay, and chat mode behavior need separate owners; do not wire Game Mode scene-analysis helpers through a roleplay path.
  • Uploaded knowledge-source file text for agent retrieval likely needs a new engine capability/storage port instead of calling knowledgeSourcesApi from engine code.
  • Package dependency removals should be audited separately from unused-file add-backs because native/tooling entry points can be invisible to Knip.

Alternatives considered

  • Blindly delete all unused files: rejected because the report included live product behavior that had simply not been wired after refactor.
  • Wire src/features/modes/game-assets/components/encode-asset-path.ts: deferred because the active shared/api/local-file-api.ts path already handles remote runtime and absolute Tauri paths.
  • Wire the roleplay scene analyzer/postprocess pair in place: rejected because the files contain Game Mode scene-analysis behavior under a roleplay owner path.

Additional context

Verification already run on the current triage branch:

  • Targeted Vitest suites for generation, prompt assembly, game API/store, storage API, and agent runtime passed.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm lint:eslint passed.
  • pnpm build passed with the existing large-chunk warning.
  • cargo check --manifest-path src-tauri/Cargo.toml passed after merging the latest refactor storage changes.
  • graphify update . passed.
  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints currently reports 32 unused files.
  • git diff -- package.json pnpm-lock.yaml is empty.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
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/refactor` at `377836b7`: - Knip unused files are down to 32 after several add-backs. - Prettier and Impeccable were install-state false positives; after a frozen install, both resolve and are no longer reported by Knip. - `package.json` and `pnpm-lock.yaml` remain unchanged in the current triage branch. - Runtime dependency reports from Knip still need a separate package/native-tooling audit before any dependency removal. ## Proposed behavior Track the Knip report as a refactor parity/cleanup effort: - Keep the Knip config scoped to source files and ignore known tool/CSS false positives such as `@tauri-apps/cli` and `tailwindcss`. - Add back files that represent intended refactor behavior but are not currently imported. - Document owner decisions for files that are superseded, misplaced, or waiting on product direction. - Do not delete unclassified files or package dependencies from the Knip report. Current add-back progress: - `src/engine/modes/chat/commands/impersonate-prompt.ts` now feeds impersonate generation with the same prompt template previewed in settings. - `src/engine/generation-core/lorebooks/game-lorebook-scope.ts` now excludes generated game lorebook-keeper books from normal lore injection when the keeper is disabled. - `src/shared/lib/chat-attachment-images.ts` now backs image/GIF attachment prep in both chat input surfaces. - `src/engine/modes/game/state/session-summary-normalization.ts` now dedupes repeated game session summary facts before save. - `src/engine/modes/game/prompts/party-prompts.ts` now backs structured party-turn prompts. - `src/engine/modes/game/assets/npc-avatar-utils.ts` now guards non-Mari NPCs from inheriting the built-in Mari portrait. - `src/engine/modes/game/mechanics/perception.service.ts` now 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`, and `src/engine/generation-core/lorebooks/embeddings.ts` now run through the active agent runtime for selected lorebook sources. Remaining work includes: - Decide whether `src/engine/modes/game/world/map.service.ts` should replace or stay separate from the current deterministic map API. - Relocate or split `src/engine/modes/roleplay/scene/scene-analyzer.ts` and `src/engine/modes/roleplay/scene/scene-postprocess.ts` before wiring; inspection found they contain Game Mode scene-analysis behavior under a roleplay path. - Decide whether contract schemas and `chat-modes.ts` should become active runtime/source-of-truth validation. - Decide the fate of generic core/repository primitives. - Compare older game/runtime/agent UI slices against current surfaces before deleting. - Add an engine-safe text-read capability if Knowledge Retrieval should also include uploaded `sourceFileIds`, not only selected lorebook sources. ## Expected owner or impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [x] Chat mode - [x] Roleplay mode - [x] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [x] Docs, contributor workflow, or templates ## Refactor branch considerations - Engine code should stay React-free and must not import shared API/Tauri adapters. - Feature code should continue to use focused shared API wrappers. - Game, roleplay, and chat mode behavior need separate owners; do not wire Game Mode scene-analysis helpers through a roleplay path. - Uploaded knowledge-source file text for agent retrieval likely needs a new engine capability/storage port instead of calling `knowledgeSourcesApi` from engine code. - Package dependency removals should be audited separately from unused-file add-backs because native/tooling entry points can be invisible to Knip. ## Alternatives considered - Blindly delete all unused files: rejected because the report included live product behavior that had simply not been wired after refactor. - Wire `src/features/modes/game-assets/components/encode-asset-path.ts`: deferred because the active `shared/api/local-file-api.ts` path already handles remote runtime and absolute Tauri paths. - Wire the roleplay scene analyzer/postprocess pair in place: rejected because the files contain Game Mode scene-analysis behavior under a roleplay owner path. ## Additional context Verification already run on the current triage branch: - Targeted Vitest suites for generation, prompt assembly, game API/store, storage API, and agent runtime passed. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm lint:eslint` passed. - `pnpm build` passed with the existing large-chunk warning. - `cargo check --manifest-path src-tauri/Cargo.toml` passed after merging the latest refactor storage changes. - `graphify update .` passed. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` currently reports 32 unused files. - `git diff -- package.json pnpm-lock.yaml` is empty. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update after opening this issue:

  • Wired src/engine/core/clock.ts and src/engine/core/ids.ts into src/engine/generation/runtime-records.ts.
  • newId now delegates to createId; nowIso delegates to systemClock.nowIso.
  • Knip unused files are now down from 32 to 30.
  • Validation after this add-back:
    • 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.ts passed (50 tests).
    • pnpm typecheck passed.
    • pnpm check:architecture passed.
    • pnpm lint:eslint passed.
    • pnpm build passed with the existing large-chunk warning.
    • graphify update . passed.

Remaining newly confirmed point: src/engine/core/result.ts is the only remaining unused core primitive.

<!-- gh-comment-id:4570978644 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update after opening this issue: - Wired `src/engine/core/clock.ts` and `src/engine/core/ids.ts` into `src/engine/generation/runtime-records.ts`. - `newId` now delegates to `createId`; `nowIso` delegates to `systemClock.nowIso`. - Knip unused files are now down from 32 to 30. - Validation after this add-back: - `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.ts` passed (50 tests). - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm lint:eslint` passed. - `pnpm build` passed with the existing large-chunk warning. - `graphify update .` passed. Remaining newly confirmed point: `src/engine/core/result.ts` is the only remaining unused core primitive.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update:

  • Wired src/shared/hooks/use-page-activity.ts into ConversationView so the periodic conversation status refresh loop pauses while Marinara is hidden or unfocused and refreshes again when active.
  • Knip unused files are now down from 30 to 29.
  • Validation after this add-back:
    • pnpm typecheck passed.
    • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed 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.

<!-- gh-comment-id:4570999942 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update: - Wired `src/shared/hooks/use-page-activity.ts` into `ConversationView` so the periodic conversation status refresh loop pauses while Marinara is hidden or unfocused and refreshes again when active. - Knip unused files are now down from 30 to 29. - Validation after this add-back: - `pnpm typecheck` passed. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed 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.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update:

  • Wired the low-risk contract schemas back into active API/storage mutation boundaries:
    • agent.schema.ts
    • chat-preset.schema.ts
    • chat.schema.ts
    • connection.schema.ts
    • custom-tool.schema.ts
    • regex.schema.ts
  • Covered create/patch-style paths where the schema already matched the current payload shape, and left the riskier update paths alone.
  • Knip unused files are now down from 28 to 22.
  • Validation after this add-back:
    • pnpm typecheck passed.
    • pnpm exec vitest run src/features/catalog/chat-presets/hooks/use-chat-presets.test.ts src/features/catalog/chats/hooks/use-chats.test.ts passed: 1 test file, 1 test.
    • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed and reports 22 unused files.

Remaining confirmed schema point: app-settings.schema.ts and character.schema.ts need row-shape reconciliation before safe wiring.

<!-- gh-comment-id:4571049882 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update: - Wired the low-risk contract schemas back into active API/storage mutation boundaries: - `agent.schema.ts` - `chat-preset.schema.ts` - `chat.schema.ts` - `connection.schema.ts` - `custom-tool.schema.ts` - `regex.schema.ts` - Covered create/patch-style paths where the schema already matched the current payload shape, and left the riskier update paths alone. - Knip unused files are now down from 28 to 22. - Validation after this add-back: - `pnpm typecheck` passed. - `pnpm exec vitest run src/features/catalog/chat-presets/hooks/use-chat-presets.test.ts src/features/catalog/chats/hooks/use-chats.test.ts` passed: 1 test file, 1 test. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed and reports 22 unused files. Remaining confirmed schema point: `app-settings.schema.ts` and `character.schema.ts` need row-shape reconciliation before safe wiring.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update:

  • Synced the branch to the latest origin/refactor commit 7a6bb285 and regenerated Graphify after resolving generated-output conflicts.
  • Wired src/features/modes/game/hooks/use-party-turn.ts back into the active Game Mode party-address flow:
    • "Talk to Party" now creates the player message, calls the structured party-turn API, shows the existing pending party reaction UI, and appends the party dialogue beside the latest GM narration.
    • Party-turn messages now return their stored message id and use the [party-turn] marker consistently.
    • GameNarration now ignores separate party-turn messages when choosing the latest GM narration, so party banter does not replace the scene text.
  • Knip unused files are now down from 19 to 18.
  • Validation:
    • pnpm typecheck passed.
    • pnpm exec vitest run src/features/modes/game/api/game-api.test.ts passed: 8 tests.
    • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed 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.

<!-- gh-comment-id:4571202211 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update: - Synced the branch to the latest `origin/refactor` commit `7a6bb285` and regenerated Graphify after resolving generated-output conflicts. - Wired `src/features/modes/game/hooks/use-party-turn.ts` back into the active Game Mode party-address flow: - "Talk to Party" now creates the player message, calls the structured party-turn API, shows the existing pending party reaction UI, and appends the party dialogue beside the latest GM narration. - Party-turn messages now return their stored message id and use the `[party-turn]` marker consistently. - `GameNarration` now ignores separate party-turn messages when choosing the latest GM narration, so party banter does not replace the scene text. - Knip unused files are now down from 19 to 18. - Validation: - `pnpm typecheck` passed. - `pnpm exec vitest run src/features/modes/game/api/game-api.test.ts` passed: 8 tests. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed 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.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Verified checkpoint after syncing to latest origin/refactor:

  • Branch was fast-forwarded to origin/refactor at 7a6bb285.
  • Graphify was regenerated after the merge/stash recovery.
  • src/features/modes/game/hooks/use-party-turn.ts is now wired back into the active Game Mode "Talk to Party" path.
  • Party-turn messages now persist with a [party-turn] marker, return the stored message id, restore after reload, and no longer replace the latest GM narration in GameNarration.
  • Knip now reports 18 unused files. use-party-turn.ts is no longer in the unused-file list.

Validation run:

  • pnpm typecheck passed.
  • pnpm lint:eslint passed.
  • pnpm check:architecture passed.
  • pnpm build passed 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.ts passed: 5 files, 122 tests.
  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed and reports 18 unused files.
  • graphify update . passed. Graphify skipped graph.html because the graph exceeds the configured viz limit, but updated graph.json and GRAPH_REPORT.md.
  • git diff -- package.json pnpm-lock.yaml is empty.
  • git diff --check passed 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.

<!-- gh-comment-id:4571276747 --> @Xelvanis commented on GitHub (May 29, 2026): Verified checkpoint after syncing to latest `origin/refactor`: - Branch was fast-forwarded to `origin/refactor` at `7a6bb285`. - Graphify was regenerated after the merge/stash recovery. - `src/features/modes/game/hooks/use-party-turn.ts` is now wired back into the active Game Mode "Talk to Party" path. - Party-turn messages now persist with a `[party-turn]` marker, return the stored message id, restore after reload, and no longer replace the latest GM narration in `GameNarration`. - Knip now reports 18 unused files. `use-party-turn.ts` is no longer in the unused-file list. Validation run: - `pnpm typecheck` passed. - `pnpm lint:eslint` passed. - `pnpm check:architecture` passed. - `pnpm build` passed 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.ts` passed: 5 files, 122 tests. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed and reports 18 unused files. - `graphify update .` passed. Graphify skipped `graph.html` because the graph exceeds the configured viz limit, but updated `graph.json` and `GRAPH_REPORT.md`. - `git diff -- package.json pnpm-lock.yaml` is empty. - `git diff --check` passed 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.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update after continuing the add-back pass:

  • Moved the game scene-analysis helper pair out of the roleplay owner and into the game owner:
    • src/engine/modes/roleplay/scene/scene-analyzer.ts -> src/engine/modes/game/scene/scene-analyzer.ts
    • src/engine/modes/roleplay/scene/scene-postprocess.ts -> src/engine/modes/game/scene/scene-postprocess.ts
  • Wired the active analyzeGameScene service through the richer game scene analyzer prompt and post-processing helper, without introducing a game -> roleplay dependency.
  • Added focused coverage for scene connection resolution, prompt construction, background/SFX fuzzy matching, Spotify track validation, weather normalization, and direction filtering.
  • Knip unused files are now down from 18 to 16.

Validation since this add-back:

  • pnpm typecheck passed.
  • pnpm lint:eslint passed.
  • pnpm check:architecture passed.
  • pnpm build passed with the existing large-chunk warning.
  • pnpm exec vitest run src/engine/modes/game/scene/game-scene-analysis.service.test.ts passed: 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.ts passed: 6 files, 123 tests.
  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed and reports 16 unused files.
  • graphify update . passed. Graphify skipped graph.html because the graph exceeds the configured viz limit, but updated graph.json and GRAPH_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.

<!-- gh-comment-id:4571333453 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update after continuing the add-back pass: - Moved the game scene-analysis helper pair out of the roleplay owner and into the game owner: - `src/engine/modes/roleplay/scene/scene-analyzer.ts` -> `src/engine/modes/game/scene/scene-analyzer.ts` - `src/engine/modes/roleplay/scene/scene-postprocess.ts` -> `src/engine/modes/game/scene/scene-postprocess.ts` - Wired the active `analyzeGameScene` service through the richer game scene analyzer prompt and post-processing helper, without introducing a game -> roleplay dependency. - Added focused coverage for scene connection resolution, prompt construction, background/SFX fuzzy matching, Spotify track validation, weather normalization, and direction filtering. - Knip unused files are now down from 18 to 16. Validation since this add-back: - `pnpm typecheck` passed. - `pnpm lint:eslint` passed. - `pnpm check:architecture` passed. - `pnpm build` passed with the existing large-chunk warning. - `pnpm exec vitest run src/engine/modes/game/scene/game-scene-analysis.service.test.ts` passed: 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.ts` passed: 6 files, 123 tests. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed and reports 16 unused files. - `graphify update .` passed. Graphify skipped `graph.html` because the graph exceeds the configured viz limit, but updated `graph.json` and `GRAPH_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.
Author
Owner

@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.

<!-- gh-comment-id:4571379689 --> @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.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Remaining Knip unused files after PR #1499:

src/engine/contracts/types/vn.ts
src/engine/core/result.ts
src/engine/modes/game/world/map.service.ts
src/engine/repositories/entity-repository.ts
src/features/catalog/agents/components/AgentThoughtBubbles.tsx
src/features/catalog/agents/components/ContinuityIssueChecklist.tsx
src/features/modes/game-assets/components/encode-asset-path.ts
src/features/modes/game/api/game-tracker-api.ts
src/features/modes/game/components/GameConversationView.tsx
src/features/modes/game/components/GameDialogueOverlay.tsx
src/features/modes/game/components/GameNpcTracker.tsx
src/features/modes/game/components/GamePartySidebar.tsx
src/features/modes/game/components/GameStateIndicator.tsx
src/features/modes/roleplay/api/roleplay-tracker-api.ts
src/features/runtime/visuals/components/ExpressionPanel.tsx
src/features/runtime/visuals/components/SpriteSidebar.tsx
<!-- gh-comment-id:4573035358 --> @Xelvanis commented on GitHub (May 29, 2026): Remaining Knip unused files after PR #1499: ```text src/engine/contracts/types/vn.ts src/engine/core/result.ts src/engine/modes/game/world/map.service.ts src/engine/repositories/entity-repository.ts src/features/catalog/agents/components/AgentThoughtBubbles.tsx src/features/catalog/agents/components/ContinuityIssueChecklist.tsx src/features/modes/game-assets/components/encode-asset-path.ts src/features/modes/game/api/game-tracker-api.ts src/features/modes/game/components/GameConversationView.tsx src/features/modes/game/components/GameDialogueOverlay.tsx src/features/modes/game/components/GameNpcTracker.tsx src/features/modes/game/components/GamePartySidebar.tsx src/features/modes/game/components/GameStateIndicator.tsx src/features/modes/roleplay/api/roleplay-tracker-api.ts src/features/runtime/visuals/components/ExpressionPanel.tsx src/features/runtime/visuals/components/SpriteSidebar.tsx ```
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Progress update after PR #1510 merged: https://github.com/Pasta-Devs/Marinara-Engine/pull/1510

  • Restored the Knip-reported game map prompt helper into the active Game Mode map-generation path instead of deleting it.
  • Wired the mode-owned game/roleplay tracker API wrappers into active consumers.
  • Addressed the Bunny follow-up findings before merge:
    • generated maps now get stable fallback IDs from their names when model JSON omits id;
    • repaired single-map responses normalize through setMaps(...);
    • stale map-generation failures are ignored after chat switches;
    • stale visible-state fetch completions are ignored after chat switches.
  • Knip unused files are now down from 16 after PR #1499 to 13 after this slice.

Validation for this slice:

  • pnpm exec vitest run src/features/modes/game/api/game-api.test.ts passed.
  • pnpm typecheck passed.
  • pnpm lint:eslint passed.
  • pnpm check:architecture passed.
  • pnpm build passed with the existing Vite large-chunk warning.
  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints passed and reports 13 unused files.
  • graphify update . passed.
  • pnpm check:graphify-scope passed.
  • GitHub CI for #1510 passed before merge.

Remaining Knip unused files after PR #1510:

src/engine/contracts/types/vn.ts
src/engine/core/result.ts
src/engine/repositories/entity-repository.ts
src/features/catalog/agents/components/AgentThoughtBubbles.tsx
src/features/catalog/agents/components/ContinuityIssueChecklist.tsx
src/features/modes/game-assets/components/encode-asset-path.ts
src/features/modes/game/components/GameConversationView.tsx
src/features/modes/game/components/GameDialogueOverlay.tsx
src/features/modes/game/components/GameNpcTracker.tsx
src/features/modes/game/components/GamePartySidebar.tsx
src/features/modes/game/components/GameStateIndicator.tsx
src/features/runtime/visuals/components/ExpressionPanel.tsx
src/features/runtime/visuals/components/SpriteSidebar.tsx

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.

<!-- gh-comment-id:4574121683 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update after PR #1510 merged: https://github.com/Pasta-Devs/Marinara-Engine/pull/1510 - Restored the Knip-reported game map prompt helper into the active Game Mode map-generation path instead of deleting it. - Wired the mode-owned game/roleplay tracker API wrappers into active consumers. - Addressed the Bunny follow-up findings before merge: - generated maps now get stable fallback IDs from their names when model JSON omits `id`; - repaired single-map responses normalize through `setMaps(...)`; - stale map-generation failures are ignored after chat switches; - stale visible-state fetch completions are ignored after chat switches. - Knip unused files are now down from 16 after PR #1499 to 13 after this slice. Validation for this slice: - `pnpm exec vitest run src/features/modes/game/api/game-api.test.ts` passed. - `pnpm typecheck` passed. - `pnpm lint:eslint` passed. - `pnpm check:architecture` passed. - `pnpm build` passed with the existing Vite large-chunk warning. - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` passed and reports 13 unused files. - `graphify update .` passed. - `pnpm check:graphify-scope` passed. - GitHub CI for #1510 passed before merge. Remaining Knip unused files after PR #1510: ```text src/engine/contracts/types/vn.ts src/engine/core/result.ts src/engine/repositories/entity-repository.ts src/features/catalog/agents/components/AgentThoughtBubbles.tsx src/features/catalog/agents/components/ContinuityIssueChecklist.tsx src/features/modes/game-assets/components/encode-asset-path.ts src/features/modes/game/components/GameConversationView.tsx src/features/modes/game/components/GameDialogueOverlay.tsx src/features/modes/game/components/GameNpcTracker.tsx src/features/modes/game/components/GamePartySidebar.tsx src/features/modes/game/components/GameStateIndicator.tsx src/features/runtime/visuals/components/ExpressionPanel.tsx src/features/runtime/visuals/components/SpriteSidebar.tsx ``` 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.
Author
Owner

@Xelvanis commented on GitHub (May 29, 2026):

Finished status update:

  • The Knip unused-file inventory for the refactor branch is resolved.
  • The final cleanup commits removed the remaining unused source files, and the latest local verification of pnpm exec knip --reporter compact --no-exit-code --no-config-hints has no Unused files section.
  • The report still includes separate dependency/export noise, but the source-file triage tracked by this issue is complete.

Next step: restore check:unused to strict/failing mode by removing the temporary --no-exit-code flag.

<!-- gh-comment-id:4575329365 --> @Xelvanis commented on GitHub (May 29, 2026): Finished status update: - The Knip unused-file inventory for the refactor branch is resolved. - The final cleanup commits removed the remaining unused source files, and the latest local verification of `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` has no `Unused files` section. - The report still includes separate dependency/export noise, but the source-file triage tracked by this issue is complete. Next step: restore `check:unused` to strict/failing mode by removing the temporary `--no-exit-code` flag.
Author
Owner

@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.

<!-- gh-comment-id:4575367429 --> @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.
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#747
No description provided.