[GH-ISSUE #3490] [Issue]: Code sweep: confusing, misplaced, or wrong-pointer comments #1887

Closed
opened 2026-10-21 05:43:32 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Jul 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3490

Originally assigned to: @kolacheee on GitHub.

Summary

Comments that are not false so much as misplaced, incomplete, or pointing at the wrong thing.

Why this is a problem: these do not assert wrong facts, but they route readers to the wrong place or hide a condition that matters. They cost debugging time and produce wrong mental models.
What it negatively affects: navigation and comprehension for contributors and agents, especially in large files where section banners are the primary map.

Expected behavior

Section banners sit above the code they name; docblocks state the conditions that change behavior; pointers reference the right lines.

Actual behavior

  • client/.../characters/CharacterEditor.tsx:2032 — a ── Sprites Tab ── banner sits above ~1000 lines of Gallery code; the real Sprites section starts at :3056.
  • server/.../services/prompt/merger.ts:10 — docblock says messages merge on "exact same role"; canMerge (:29-34) also requires matching characterId and compatible contextKind, so same-role group-chat turns from different characters do not merge. Undocumented.
  • client/.../chat/LocalMusicPlayer.tsx:111 / stores/ui.store.ts:613 — JSDoc says "Mobile Spotify widget collapsed/position", but spotifyMobileWidget* state is shared by SpotifyMiniPlayer, YouTubePlayer, and LocalMusicPlayer; editing it changes all three.
  • custom_components/marinara_engine/button.py:57 — "all 21 HA tool definitions"; const.py defines 23, and defaults exclude locks + generic_service, so 20 sync by default.
  • custom_components/marinara_engine/coordinator.py:188 — sync_tools docstring omits that it also PATCHes enabled: false for deselected tools, reusing the updated counter.
  • server/.../db/migrate.ts:1221 — header presents runMigrations as the startup schema repair with no scoping; app.ts:92 gates it behind !isFileStorageBackend(), so it never runs on the default file-native backend. Misleads by omission.
  • server/.../middleware/basic-auth.ts:30 — the Notes block lists 3 auth-bypass paths but omits the 4th (isTrustedInterfaceRequest / BYPASS_AUTH_TAILSCALE / BYPASS_AUTH_DOCKER) used in the same file (:317, :342).
  • server/.../services/agents/agent-pipeline.ts:394 — says "Call runPreGeneration"; the returned object's method is preGenerate.
  • server/.../services/storage/chat-folders.storage.ts:72 — cites chats.storage.ts:449 for the libSQL Windows use-after-free note; the note lives at chats.storage.ts:984-986.
  • server/.../routes/bot-browser-janny.routes.ts:313 — "Proxy JannyAI avatar images" header sits above the character scraper; the actual avatar proxy (:456) has no header.
  • shared/.../schemas/character.schema.ts:135 — orphaned JSDoc describing generateAboutMeSchema (13 lines below) sits above the unrelated DEFAULT_ABOUT_ME_SOURCES const.
  • client/.../bot-browser/BotBrowserView.tsx:795 — // Strategy 2 labels the 3rd of 4 sequential fallbacks; there is no "Strategy 1" comment.
  • client/.../bot-browser/BotBrowserView.tsx:3135 — // Definition Section banner with no code beneath it; DefSection is defined 130 lines later at :3269.
  • client/.../game/GameSurface.tsx:11385 — two adjacent JSX comments with no code between them: a "Party rail" header plus a "REMOVED: old sidebar" note. Orphaned changelog clutter that could invite restoring removed code.

Steps to reproduce

Open any entry's file/line and compare the comment with the surrounding code.

Environment

  • Marinara Engine version: 2.2.0 (staging @ 45b650de9)
  • Install type: source
  • OS + version: N/A — verified by reading the code
  • Browser or app shell: N/A

Logs, screenshots, or video

N/A.

Additional context

Found by a repo-wide read-only sweep; adversarially re-verified before filing (subjective style complaints were dropped). 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:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Jul 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3490 Originally assigned to: @kolacheee on GitHub. ## Summary Comments that are not false so much as misplaced, incomplete, or pointing at the wrong thing. **Why this is a problem:** these do not assert wrong facts, but they route readers to the wrong place or hide a condition that matters. They cost debugging time and produce wrong mental models. **What it negatively affects:** navigation and comprehension for contributors and agents, especially in large files where section banners are the primary map. ## Expected behavior Section banners sit above the code they name; docblocks state the conditions that change behavior; pointers reference the right lines. ## Actual behavior - [ ] `client/.../characters/CharacterEditor.tsx:2032` — a `── Sprites Tab ──` banner sits above ~1000 lines of Gallery code; the real Sprites section starts at :3056. - [ ] `server/.../services/prompt/merger.ts:10` — docblock says messages merge on "exact same role"; `canMerge` (:29-34) also requires matching `characterId` and compatible `contextKind`, so same-role group-chat turns from different characters do not merge. Undocumented. - [ ] `client/.../chat/LocalMusicPlayer.tsx:111` / `stores/ui.store.ts:613` — JSDoc says "Mobile Spotify widget collapsed/position", but `spotifyMobileWidget*` state is shared by `SpotifyMiniPlayer`, `YouTubePlayer`, and `LocalMusicPlayer`; editing it changes all three. - [ ] `custom_components/marinara_engine/button.py:57` — "all 21 HA tool definitions"; `const.py` defines 23, and defaults exclude locks + generic_service, so 20 sync by default. - [ ] `custom_components/marinara_engine/coordinator.py:188` — `sync_tools` docstring omits that it also PATCHes `enabled: false` for deselected tools, reusing the `updated` counter. - [ ] `server/.../db/migrate.ts:1221` — header presents `runMigrations` as the startup schema repair with no scoping; `app.ts:92` gates it behind `!isFileStorageBackend()`, so it never runs on the default file-native backend. Misleads by omission. - [ ] `server/.../middleware/basic-auth.ts:30` — the Notes block lists 3 auth-bypass paths but omits the 4th (`isTrustedInterfaceRequest` / BYPASS_AUTH_TAILSCALE / BYPASS_AUTH_DOCKER) used in the same file (:317, :342). - [ ] `server/.../services/agents/agent-pipeline.ts:394` — says "Call `runPreGeneration`"; the returned object's method is `preGenerate`. - [ ] `server/.../services/storage/chat-folders.storage.ts:72` — cites `chats.storage.ts:449` for the libSQL Windows use-after-free note; the note lives at `chats.storage.ts:984-986`. - [ ] `server/.../routes/bot-browser-janny.routes.ts:313` — "Proxy JannyAI avatar images" header sits above the character scraper; the actual avatar proxy (:456) has no header. - [ ] `shared/.../schemas/character.schema.ts:135` — orphaned JSDoc describing `generateAboutMeSchema` (13 lines below) sits above the unrelated `DEFAULT_ABOUT_ME_SOURCES` const. - [ ] `client/.../bot-browser/BotBrowserView.tsx:795` — `// Strategy 2` labels the 3rd of 4 sequential fallbacks; there is no "Strategy 1" comment. - [ ] `client/.../bot-browser/BotBrowserView.tsx:3135` — `// Definition Section` banner with no code beneath it; `DefSection` is defined 130 lines later at :3269. - [ ] `client/.../game/GameSurface.tsx:11385` — two adjacent JSX comments with no code between them: a "Party rail" header plus a "REMOVED: old sidebar" note. Orphaned changelog clutter that could invite restoring removed code. ## Steps to reproduce Open any entry's file/line and compare the comment with the surrounding code. ## Environment - Marinara Engine version: 2.2.0 (staging @ 45b650de9) - Install type: source - OS + version: N/A — verified by reading the code - Browser or app shell: N/A ## Logs, screenshots, or video N/A. ## Additional context Found by a repo-wide read-only sweep; adversarially re-verified before filing (subjective style complaints were dropped). 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: - [ ] I DID NOT read this template and provide the requested details.
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#1887
No description provided.