[GH-ISSUE #1566] [Feature]: Track remaining practical Knip restore follow-ups #807

Closed
opened 2026-10-21 05:21:24 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1566

Originally assigned to: @cha1latte, @Xelvanis on GitHub.

What problem does this solve?

The original Knip refactor-parity tracker (#1496) is closed, and the first post-close restore slice (#1563) has merged. We still need a public progress issue for the remaining full Knip report so the work stays restore-first instead of drifting into blind deletion.

Current state as of 2026-05-29:

  • #1496 completed the original unused-file restore/delete triage and was closed.
  • #1563 restored practical @tauri-apps/plugin-opener wiring for Settings and Spotify external links; it merged on 2026-05-29.
  • pnpm check:unused now guards the strict unused-file bucket with knip --files --no-config-hints.
  • A full Knip report still has non-file buckets that need owner-by-owner classification before removal or ignores.

The goal is to restore where practical, keep intended behavior wired through the correct owners, and only delete or ignore entries after the owner decision is clear.

Proposed behavior

Track the remaining Knip follow-up work as a restore/classification queue:

  • Classify every remaining dependency, devDependency, duplicate export, unused export, and unused exported type as one of: restore, delete, ignore/configure, or keep as public contract.
  • Prefer restoring intended behavior or public contracts where practical.
  • Do not remove dependencies that are used by Rust, native plugins, build tooling, generated output, or config paths invisible to Knip without a targeted proof pass.
  • Keep each restore slice narrow enough to review and verify independently.
  • Update this issue as slices land so future cleanup work has a current source of truth.

Current full-Knip buckets to track:

  • Dependencies: @tauri-apps/plugin-window-state, class-variance-authority.
  • Dev dependencies: @eslint/js, @rollup/wasm-node, autoprefixer.
  • Duplicate exports: tracker portrait constants that may be semantic aliases rather than dead exports.
  • Unused exports and exported types: broad engine, feature, shared API, shared lib, and store surface area that needs owner-by-owner review.

Known status from local triage:

  • @tauri-apps/plugin-window-state appears likely to be Rust/native-side usage rather than removable frontend dead weight.
  • @eslint/js needs care because switching ESLint config shape previously surfaced broad existing lint noise.
  • Tracker duplicate aliases look semantically meaningful and should not be deleted just because Knip reports duplicate export values.
  • class-variance-authority, @rollup/wasm-node, autoprefixer, and the export/type buckets still need focused classification.

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

  • Keep engine code React-free and host-independent.
  • Feature restores should call focused shared API wrappers rather than raw Tauri or raw remote-runtime calls.
  • Chat, roleplay, and game owners stay separate; do not wire behavior through the wrong mode just to satisfy Knip.
  • Native/plugin/tooling dependencies require direct proof from Tauri config, Rust manifests, scripts, or build config before delete decisions.
  • For public contract exports, decide whether they should stay exported, move to a private owner module, or gain real runtime/test usage.

Alternatives considered

  • Close this work with #1496: rejected because #1496 finished the unused-file pass, but the full Knip report still contains practical restore/delete decisions.
  • Delete all remaining report entries: rejected because several entries may be native-side/tooling usage, semantic aliases, or intended public contracts.
  • Ignore the entire full Knip report: rejected because the report is still useful once each bucket is classified carefully.

Additional context

Recent related work:

  • #1496 closed the original broad Knip restore tracker.
  • #1563 restored Tauri opener link wiring and removed @tauri-apps/plugin-opener from the full Knip dependency report.

Current local verification baseline before filing this issue:

  • pnpm exec knip --reporter compact --no-exit-code --no-config-hints still reports the buckets listed above.
  • pnpm check:unused passes for the strict unused-file guard.

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/1566 Originally assigned to: @cha1latte, @Xelvanis on GitHub. ## What problem does this solve? The original Knip refactor-parity tracker (#1496) is closed, and the first post-close restore slice (#1563) has merged. We still need a public progress issue for the remaining full Knip report so the work stays restore-first instead of drifting into blind deletion. Current state as of 2026-05-29: - #1496 completed the original unused-file restore/delete triage and was closed. - #1563 restored practical `@tauri-apps/plugin-opener` wiring for Settings and Spotify external links; it merged on 2026-05-29. - `pnpm check:unused` now guards the strict unused-file bucket with `knip --files --no-config-hints`. - A full Knip report still has non-file buckets that need owner-by-owner classification before removal or ignores. The goal is to restore where practical, keep intended behavior wired through the correct owners, and only delete or ignore entries after the owner decision is clear. ## Proposed behavior Track the remaining Knip follow-up work as a restore/classification queue: - Classify every remaining dependency, devDependency, duplicate export, unused export, and unused exported type as one of: restore, delete, ignore/configure, or keep as public contract. - Prefer restoring intended behavior or public contracts where practical. - Do not remove dependencies that are used by Rust, native plugins, build tooling, generated output, or config paths invisible to Knip without a targeted proof pass. - Keep each restore slice narrow enough to review and verify independently. - Update this issue as slices land so future cleanup work has a current source of truth. Current full-Knip buckets to track: - Dependencies: `@tauri-apps/plugin-window-state`, `class-variance-authority`. - Dev dependencies: `@eslint/js`, `@rollup/wasm-node`, `autoprefixer`. - Duplicate exports: tracker portrait constants that may be semantic aliases rather than dead exports. - Unused exports and exported types: broad engine, feature, shared API, shared lib, and store surface area that needs owner-by-owner review. Known status from local triage: - `@tauri-apps/plugin-window-state` appears likely to be Rust/native-side usage rather than removable frontend dead weight. - `@eslint/js` needs care because switching ESLint config shape previously surfaced broad existing lint noise. - Tracker duplicate aliases look semantically meaningful and should not be deleted just because Knip reports duplicate export values. - `class-variance-authority`, `@rollup/wasm-node`, `autoprefixer`, and the export/type buckets still need focused classification. ## 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 - [x] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [x] Docs, contributor workflow, or templates ## Refactor branch considerations - Keep engine code React-free and host-independent. - Feature restores should call focused shared API wrappers rather than raw Tauri or raw remote-runtime calls. - Chat, roleplay, and game owners stay separate; do not wire behavior through the wrong mode just to satisfy Knip. - Native/plugin/tooling dependencies require direct proof from Tauri config, Rust manifests, scripts, or build config before delete decisions. - For public contract exports, decide whether they should stay exported, move to a private owner module, or gain real runtime/test usage. ## Alternatives considered - Close this work with #1496: rejected because #1496 finished the unused-file pass, but the full Knip report still contains practical restore/delete decisions. - Delete all remaining report entries: rejected because several entries may be native-side/tooling usage, semantic aliases, or intended public contracts. - Ignore the entire full Knip report: rejected because the report is still useful once each bucket is classified carefully. ## Additional context Recent related work: - #1496 closed the original broad Knip restore tracker. - #1563 restored Tauri opener link wiring and removed `@tauri-apps/plugin-opener` from the full Knip dependency report. Current local verification baseline before filing this issue: - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` still reports the buckets listed above. - `pnpm check:unused` passes for the strict unused-file guard. ## 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 as of 2026-05-30:

Landed on refactor:

  • de822fdb removed the remaining Knip-reported package dependency/devDependency entries after validation. Full Knip no longer has dependency or devDependency buckets.
  • ab8af081 classified the tracker portrait duplicate export aliases as intentional semantic aliases with a narrow ignoreIssues entry for the owning constants file. Full Knip no longer has a duplicate-export bucket.

Prepared locally on restore/knip-export-contracts:

  • 8e661ea8 restores the Remote Runtime JSON profile import path through the existing profile_import command, while native/local import continues to use the JSON/ZIP profile_import_file path.
  • The direct helper functions in src/shared/api/profile-api.ts are now private behind the exported profileApi / backupApi facades, so full Knip no longer reports profile-api.ts as unused exported surface.

Current full-Knip shape after the local slice:

  • Unused exports (126)
  • Unused exported types (80)

Validation run for the local profile-import slice:

  • pnpm typecheck
  • pnpm check:architecture
  • pnpm check:unused
  • full Knip spot-check
  • pnpm lint:eslint
  • pnpm build
  • git diff --check

Remaining gap: I have not manually exercised profile import in a running Tauri app or against a live remote runtime yet. Next slice should continue owner-by-owner export/type classification, preferring restore or public-contract classification before delete/ignore decisions.

<!-- gh-comment-id:4576308859 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update as of 2026-05-30: Landed on `refactor`: - `de822fdb` removed the remaining Knip-reported package dependency/devDependency entries after validation. Full Knip no longer has dependency or devDependency buckets. - `ab8af081` classified the tracker portrait duplicate export aliases as intentional semantic aliases with a narrow `ignoreIssues` entry for the owning constants file. Full Knip no longer has a duplicate-export bucket. Prepared locally on `restore/knip-export-contracts`: - `8e661ea8` restores the Remote Runtime JSON profile import path through the existing `profile_import` command, while native/local import continues to use the JSON/ZIP `profile_import_file` path. - The direct helper functions in `src/shared/api/profile-api.ts` are now private behind the exported `profileApi` / `backupApi` facades, so full Knip no longer reports `profile-api.ts` as unused exported surface. Current full-Knip shape after the local slice: - `Unused exports (126)` - `Unused exported types (80)` Validation run for the local profile-import slice: - `pnpm typecheck` - `pnpm check:architecture` - `pnpm check:unused` - full Knip spot-check - `pnpm lint:eslint` - `pnpm build` - `git diff --check` Remaining gap: I have not manually exercised profile import in a running Tauri app or against a live remote runtime yet. Next slice should continue owner-by-owner export/type classification, preferring restore or public-contract classification before delete/ignore decisions.
Author
Owner

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

Progress update as of 2026-05-30:

Opened PR #1579: https://github.com/Pasta-Devs/Marinara-Engine/pull/1579

This PR packages the next practical restore/narrowing slice on restore/knip-export-contracts:

  • Restored Remote Runtime JSON profile import through the existing profile_import path; native/local profile import still uses the JSON/ZIP profile_import_file path.
  • Added a guard so an invalid Remote Runtime URL no longer crashes the profile import section during render, plus JSON-only copy for remote profile parse errors.
  • Restored real shared-helper call sites for chat macro input resolution, attachment blob/data URL conversion, sprite frame cropping, tracker metadata normalization, lorebook entry detection, quote format options, and agent retry failure toasts.
  • Narrowed implementation-only exports in local asset helpers, tracker card colors, TTS dialogue helpers, connection filters, local notifications, TTS cache, and related shared utility modules.
  • Removed the unused generic asset gateway facade while keeping the focused gameAssetsApi and visual asset APIs.

Validation run after rebasing onto current origin/refactor:

  • pnpm test src/features/shell/settings/components/ProfileImportSection.test.tsx --run
  • pnpm test src/shared/lib/chat-macros.test.ts --run
  • pnpm test src/shared/lib/url-blob.test.ts --run
  • pnpm typecheck
  • pnpm check:architecture
  • pnpm lint:eslint
  • pnpm check:unused
  • pnpm build passed with the existing large-chunk warning
  • git diff --check
  • pnpm exec knip --exports --no-config-hints for the export-surface snapshot; targeted restored/narrowed helpers were not reported

Current PR/CI state at the time of this issue update:

  • PR is open and ready for review, targeting refactor.
  • Auto-label passed; CodeRabbit skipped/passed.
  • Frontend/Architecture, Rust Capability, and Browser Smoke/Performance jobs are still in progress.

Remaining proof gaps:

  • Native Tauri file-dialog profile import was not manually exercised.
  • Remote Runtime profile import smoke was not manually exercised.
  • The umbrella issue should stay open after this PR; next slices should continue owner-by-owner classification, with promising candidates including slash command metadata, LabelWithHelp, TTS mask export cleanup, and remaining UI store duplicate constants.
<!-- gh-comment-id:4577073263 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update as of 2026-05-30: Opened PR #1579: https://github.com/Pasta-Devs/Marinara-Engine/pull/1579 This PR packages the next practical restore/narrowing slice on `restore/knip-export-contracts`: - Restored Remote Runtime JSON profile import through the existing `profile_import` path; native/local profile import still uses the JSON/ZIP `profile_import_file` path. - Added a guard so an invalid Remote Runtime URL no longer crashes the profile import section during render, plus JSON-only copy for remote profile parse errors. - Restored real shared-helper call sites for chat macro input resolution, attachment blob/data URL conversion, sprite frame cropping, tracker metadata normalization, lorebook entry detection, quote format options, and agent retry failure toasts. - Narrowed implementation-only exports in local asset helpers, tracker card colors, TTS dialogue helpers, connection filters, local notifications, TTS cache, and related shared utility modules. - Removed the unused generic asset gateway facade while keeping the focused `gameAssetsApi` and visual asset APIs. Validation run after rebasing onto current `origin/refactor`: - `pnpm test src/features/shell/settings/components/ProfileImportSection.test.tsx --run` - `pnpm test src/shared/lib/chat-macros.test.ts --run` - `pnpm test src/shared/lib/url-blob.test.ts --run` - `pnpm typecheck` - `pnpm check:architecture` - `pnpm lint:eslint` - `pnpm check:unused` - `pnpm build` passed with the existing large-chunk warning - `git diff --check` - `pnpm exec knip --exports --no-config-hints` for the export-surface snapshot; targeted restored/narrowed helpers were not reported Current PR/CI state at the time of this issue update: - PR is open and ready for review, targeting `refactor`. - Auto-label passed; CodeRabbit skipped/passed. - Frontend/Architecture, Rust Capability, and Browser Smoke/Performance jobs are still in progress. Remaining proof gaps: - Native Tauri file-dialog profile import was not manually exercised. - Remote Runtime profile import smoke was not manually exercised. - The umbrella issue should stay open after this PR; next slices should continue owner-by-owner classification, with promising candidates including slash command metadata, `LabelWithHelp`, TTS mask export cleanup, and remaining UI store duplicate constants.
Author
Owner

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

Progress update as of 2026-05-30:

Opened PR #1591: https://github.com/Pasta-Devs/Marinara-Engine/pull/1591

This packages the next practical Knip restore/contract slice on restore/knip-game-asset-mime-maps:

  • Restored active use of the game asset MIME maps by deriving Settings game-asset accept strings and audio preview hints from the shared contracts.
  • Added Opus to the game asset audio extension/MIME contract.
  • Aligned Rust managed game asset upload validation with the advertised client support for WebM audio, Opus audio, AVIF backgrounds, and SVG sprites while keeping SVG rejected for backgrounds.
  • Tightened the shared image upload dropzone so default drag/drop accepts only the known raster image MIME/extension set instead of arbitrary image/*.
  • Added focused TS/Rust tests for MIME-map coverage, WebM/Opus hints, advertised upload extensions, and SVG-background rejection.

Recently landed since the last update:

  • PR #1587 restored practical Knip helper wiring.
  • PR #1588 restored haptic controls.
  • PR #1589 restored upload size constant wiring.

Validation for #1591:

  • pnpm test -- src/engine/contracts/constants/game-assets.test.ts
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-assets
  • pnpm build passed with the existing large-chunk warning.
  • pnpm check:architecture
  • pnpm check:unused
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • Bunny pass found no confirmed findings.

Current PR/CI state:

  • #1591 is open, ready for review, and cleanly mergeable into refactor.
  • GitHub checks are green: Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke/Performance, and Auto-label.
  • CodeRabbit reported pass/review skipped.

Remaining proof gaps:

  • Native Tauri upload and audio playback were not manually exercised.
  • This slice does not resolve the separate byte-content validation issue for image uploads; it only aligns advertised file-type contracts and UI/native extension gates.
  • The umbrella issue should stay open after #1591; next slices should continue owner-by-owner export/type classification, prioritizing restore/public-contract decisions before deletion or ignores.
<!-- gh-comment-id:4578209478 --> @Xelvanis commented on GitHub (May 29, 2026): Progress update as of 2026-05-30: Opened PR #1591: https://github.com/Pasta-Devs/Marinara-Engine/pull/1591 This packages the next practical Knip restore/contract slice on `restore/knip-game-asset-mime-maps`: - Restored active use of the game asset MIME maps by deriving Settings game-asset accept strings and audio preview hints from the shared contracts. - Added Opus to the game asset audio extension/MIME contract. - Aligned Rust managed game asset upload validation with the advertised client support for WebM audio, Opus audio, AVIF backgrounds, and SVG sprites while keeping SVG rejected for backgrounds. - Tightened the shared image upload dropzone so default drag/drop accepts only the known raster image MIME/extension set instead of arbitrary `image/*`. - Added focused TS/Rust tests for MIME-map coverage, WebM/Opus hints, advertised upload extensions, and SVG-background rejection. Recently landed since the last update: - PR #1587 restored practical Knip helper wiring. - PR #1588 restored haptic controls. - PR #1589 restored upload size constant wiring. Validation for #1591: - `pnpm test -- src/engine/contracts/constants/game-assets.test.ts` - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-assets` - `pnpm build` passed with the existing large-chunk warning. - `pnpm check:architecture` - `pnpm check:unused` - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` - Bunny pass found no confirmed findings. Current PR/CI state: - #1591 is open, ready for review, and cleanly mergeable into `refactor`. - GitHub checks are green: Frontend/Architecture/Organization, Rust Capability Layer, Browser Smoke/Performance, and Auto-label. - CodeRabbit reported pass/review skipped. Remaining proof gaps: - Native Tauri upload and audio playback were not manually exercised. - This slice does not resolve the separate byte-content validation issue for image uploads; it only aligns advertised file-type contracts and UI/native extension gates. - The umbrella issue should stay open after #1591; next slices should continue owner-by-owner export/type classification, prioritizing restore/public-contract decisions before deletion or ignores.
Author
Owner

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

Triage note: labeling this as scope-risk because remaining Knip work can either restore real public contracts or accidentally delete latent integration surface.

A good next step is to keep the work owner-by-owner, with restore/delete decisions and validation recorded per slice.

<!-- gh-comment-id:4578271038 --> @cha1latte commented on GitHub (May 29, 2026): Triage note: labeling this as `scope-risk` because remaining Knip work can either restore real public contracts or accidentally delete latent integration surface. A good next step is to keep the work owner-by-owner, with restore/delete decisions and validation recorded per slice.
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#807
No description provided.