[GH-ISSUE #3489] [Issue]: Code sweep: comments that make false claims about current behavior (#3348-class agent hazard) #1889

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/3489

Originally assigned to: @kolacheee on GitHub.

Summary

A catalogue of comments that make false claims about current behavior. Each entry quotes the claim, states what the code actually does today (with the proof location), and proposes replacement wording.

Why this is a problem: this is the exact failure class behind #3348, where an agent trusted a stale "folders are flat" comment and shipped code that flattened user data. Agents and contributors treat comments as ground truth; every false claim below is a chance to repeat that incident.
What it negatively affects: the correctness of future PRs (human and agent), onboarding, and debugging time spent trusting wrong documentation.

The two highest-stakes false comments (lorebook "flat folders" and the uninstaller "preserve user data") are filed separately with their code fixes. This issue is the rest.

Expected behavior

Comments describe what the code does today.

Actual behavior

High hazard:

  • client/.../chat/ChatSetupWizard.tsx:1868 — claims "The roleplay wizard doesn't expose a name field, so this stays false / we always auto-rename." The same component's Connection step renders a Name input (:2207) whose blur sets userEditedName (:2215), read at :1946/:1955/:1977 to suppress auto-rename.
  • server/src/lib/logger.ts:8 — claims "The Fastify app reuses this same instance so req.log/reply.log inherit the same level." app.ts:51-59 builds Fastify with its own {level, transport}; env-watcher LOG_LEVEL hot-reload mutates only this singleton, so request logs do not track runtime level changes.
  • server/.../routes/connections.routes.ts:1044 — claims the Claude-subscription diagnostic runs "with fast mode forced off"; line 1076 reads conn.claudeFastMode === "true" and passes it through unchanged.
  • server/.../services/conversation/schedule.service.ts:505 — JSDoc claims getDirectMessageDelay yields shorter idle/dnd delays; the body is identical to getBusyDelay and the shared helper takes no caller argument.
  • server/.../services/game/skill-check.service.ts:36 — claims usedRoll is "Which roll was used (index into rolls)"; it is always the die value (1-20): total = usedRoll + modifier, criticalSuccess = usedRoll === 20.
  • shared/.../utils/music-score.ts:342 — claims scoreMusic "returns null when the current music is already appropriate"; it deliberately excludes currentMusic to rotate. That null contract belongs to scoreAmbient.
  • server/.../services/image/image-generation.ts:31 — claims sharp callers "fall back to passing the original"; prepareNovelAiDirectorReferenceImages (:1363) hard-throws when sharp is missing.
  • server/.../services/prompt-overrides/registry/conversation.ts:16 — documents selfieTagsBlock as conditionally populated; no caller ever sets it (all 3 call sites pass only appearance/charName), so it is always empty at runtime.
  • shared/.../constants/defaults.ts:6 — claims "App version — single source of truth"; root package.json is canonical and scripts/versioning.mjs mechanically overwrites this file (pnpm version:sync).
  • shared/.../features/turn-games/eightball/rng.ts:4 — describes "break scatter, shot success rolls, miss/scratch geometry jitter" from the pre-physics design; post-v2, deterministicRng is used only for bot aim jitter (engine.ts:391), outcomes come from the physics sim.
  • server/.../routes/game.routes.ts:8984 — claims resolveConnection "uses the character connection (or falls back to GM connection)"; no character-connection tier exists (explicit override, chat connection, random pool). The call site's own comment at :9022 is correct.

Medium:

  • client/.../hooks/use-agents.ts:12 — "same key shape SecretPlotPanel uses inline"; SecretPlotPanel now uses the agentKeys.memory() factory (:80).
  • server/.../services/conversation/awareness.service.ts:67 — "plus the default 2h window"; defaultWindow() is 1h and says so.
  • server/.../services/game/morale.service.ts:5 — "Morale affects dice rolls…"; moraleDiceModifier has zero callers.
  • server/.../services/llm/providers/anthropic.provider.ts:515 — "Opus 4.6 / Sonnet 4.6"; the regex /claude-(opus|sonnet)-4-[56]/ also matches 4.5 models.
  • shared/.../features/turn-games/uno/tools.ts:80 — "the engine filters this set per-turn"; toolManifests() is an unfiltered passthrough, legality is enforced post-hoc by applyMove.
  • server/.../db/schema/game-engine-state.ts:5, routes/turn-games.routes.ts:2, and the turn-game schema header — "UNO and future games"; Chess, Poker, and Eight Ball already ship through the same table/route.
  • client/.../agents/AgentEditor.tsx:901 — "…or a legacy YouTube agent"; youtube is retired and filtered out, the path is unreachable.
  • client/.../bot-browser/BotBrowserView.tsx:3 — provider list omits the registered 6th provider (DataCat).
  • client/.../bot-browser/BotBrowserView.tsx:108 — nsfwMode doc describes values ("true/false = normal") that do not exist; type is "free"|"login"|"wyvern", and DataCat reuses "wyvern" semantics without the sort-hint toast.

Low (header/section drift; still misleads a reader scanning file structure):

  • client/.../characters/CharacterEditor.tsx:4 — header lists 4 sections; TABS has 9.
  • client/.../personas/PersonaEditor.tsx:4 — header lists 6; TABS has 8.
  • client/.../game/GameCombatUI.tsx:8 — action menu described as 5 entries; ACTION_MENU has 6.
  • client/.../chat/ChatMessage.tsx:800 — "no class/loading"; the <img> two lines below sets loading="lazy" decoding="async".
  • client/.../chat/ChatMessage.tsx:1621 — "driven by a ref + RAF"; the mechanism is setInterval(..., 2000).
  • server/.../routes/chats.routes.ts:2264 — "(roleplay only)"; the guard also admits legacy visual_novel chats.
  • client/.../hooks/use-generate.ts:3192 — "Returns null…"; every branch returns a string.
  • win/installer/installer.nsi:3 — tracked in the uninstaller issue.

Steps to reproduce

Open any entry's file/line and compare the quoted claim with the referenced 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

Suggested replacement wording per entry is available in the sweep report on request; most fixes are one-line comment edits. Found by a repo-wide read-only sweep; every claim was adversarially re-verified against the code before filing. 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/3489 Originally assigned to: @kolacheee on GitHub. ## Summary A catalogue of comments that make false claims about current behavior. Each entry quotes the claim, states what the code actually does today (with the proof location), and proposes replacement wording. **Why this is a problem:** this is the exact failure class behind #3348, where an agent trusted a stale "folders are flat" comment and shipped code that flattened user data. Agents and contributors treat comments as ground truth; every false claim below is a chance to repeat that incident. **What it negatively affects:** the correctness of future PRs (human and agent), onboarding, and debugging time spent trusting wrong documentation. The two highest-stakes false comments (lorebook "flat folders" and the uninstaller "preserve user data") are filed separately with their code fixes. This issue is the rest. ## Expected behavior Comments describe what the code does today. ## Actual behavior High hazard: - [ ] `client/.../chat/ChatSetupWizard.tsx:1868` — claims "The roleplay wizard doesn't expose a name field, so this stays false / we always auto-rename." The same component's Connection step renders a Name input (:2207) whose blur sets `userEditedName` (:2215), read at :1946/:1955/:1977 to suppress auto-rename. - [ ] `server/src/lib/logger.ts:8` — claims "The Fastify app reuses this same instance so req.log/reply.log inherit the same level." `app.ts:51-59` builds Fastify with its own `{level, transport}`; `env-watcher` LOG_LEVEL hot-reload mutates only this singleton, so request logs do not track runtime level changes. - [ ] `server/.../routes/connections.routes.ts:1044` — claims the Claude-subscription diagnostic runs "with fast mode forced off"; line 1076 reads `conn.claudeFastMode === "true"` and passes it through unchanged. - [ ] `server/.../services/conversation/schedule.service.ts:505` — JSDoc claims `getDirectMessageDelay` yields shorter idle/dnd delays; the body is identical to `getBusyDelay` and the shared helper takes no caller argument. - [ ] `server/.../services/game/skill-check.service.ts:36` — claims `usedRoll` is "Which roll was used (index into rolls)"; it is always the die value (1-20): `total = usedRoll + modifier`, `criticalSuccess = usedRoll === 20`. - [ ] `shared/.../utils/music-score.ts:342` — claims `scoreMusic` "returns null when the current music is already appropriate"; it deliberately excludes `currentMusic` to rotate. That null contract belongs to `scoreAmbient`. - [ ] `server/.../services/image/image-generation.ts:31` — claims sharp callers "fall back to passing the original"; `prepareNovelAiDirectorReferenceImages` (:1363) hard-throws when sharp is missing. - [ ] `server/.../services/prompt-overrides/registry/conversation.ts:16` — documents `selfieTagsBlock` as conditionally populated; no caller ever sets it (all 3 call sites pass only appearance/charName), so it is always empty at runtime. - [ ] `shared/.../constants/defaults.ts:6` — claims "App version — single source of truth"; root `package.json` is canonical and `scripts/versioning.mjs` mechanically overwrites this file (`pnpm version:sync`). - [ ] `shared/.../features/turn-games/eightball/rng.ts:4` — describes "break scatter, shot success rolls, miss/scratch geometry jitter" from the pre-physics design; post-v2, `deterministicRng` is used only for bot aim jitter (`engine.ts:391`), outcomes come from the physics sim. - [ ] `server/.../routes/game.routes.ts:8984` — claims `resolveConnection` "uses the character connection (or falls back to GM connection)"; no character-connection tier exists (explicit override, chat connection, random pool). The call site's own comment at :9022 is correct. Medium: - [ ] `client/.../hooks/use-agents.ts:12` — "same key shape SecretPlotPanel uses inline"; SecretPlotPanel now uses the `agentKeys.memory()` factory (:80). - [ ] `server/.../services/conversation/awareness.service.ts:67` — "plus the default 2h window"; `defaultWindow()` is 1h and says so. - [ ] `server/.../services/game/morale.service.ts:5` — "Morale affects dice rolls…"; `moraleDiceModifier` has zero callers. - [ ] `server/.../services/llm/providers/anthropic.provider.ts:515` — "Opus 4.6 / Sonnet 4.6"; the regex `/claude-(opus|sonnet)-4-[56]/` also matches 4.5 models. - [ ] `shared/.../features/turn-games/uno/tools.ts:80` — "the engine filters this set per-turn"; `toolManifests()` is an unfiltered passthrough, legality is enforced post-hoc by `applyMove`. - [ ] `server/.../db/schema/game-engine-state.ts:5`, `routes/turn-games.routes.ts:2`, and the turn-game schema header — "UNO and future games"; Chess, Poker, and Eight Ball already ship through the same table/route. - [ ] `client/.../agents/AgentEditor.tsx:901` — "…or a legacy YouTube agent"; `youtube` is retired and filtered out, the path is unreachable. - [ ] `client/.../bot-browser/BotBrowserView.tsx:3` — provider list omits the registered 6th provider (DataCat). - [ ] `client/.../bot-browser/BotBrowserView.tsx:108` — `nsfwMode` doc describes values ("true/false = normal") that do not exist; type is `"free"|"login"|"wyvern"`, and DataCat reuses `"wyvern"` semantics without the sort-hint toast. Low (header/section drift; still misleads a reader scanning file structure): - [ ] `client/.../characters/CharacterEditor.tsx:4` — header lists 4 sections; `TABS` has 9. - [ ] `client/.../personas/PersonaEditor.tsx:4` — header lists 6; `TABS` has 8. - [ ] `client/.../game/GameCombatUI.tsx:8` — action menu described as 5 entries; `ACTION_MENU` has 6. - [ ] `client/.../chat/ChatMessage.tsx:800` — "no class/loading"; the `<img>` two lines below sets `loading="lazy" decoding="async"`. - [ ] `client/.../chat/ChatMessage.tsx:1621` — "driven by a ref + RAF"; the mechanism is `setInterval(..., 2000)`. - [ ] `server/.../routes/chats.routes.ts:2264` — "(roleplay only)"; the guard also admits legacy `visual_novel` chats. - [ ] `client/.../hooks/use-generate.ts:3192` — "Returns null…"; every branch returns a string. - [ ] `win/installer/installer.nsi:3` — tracked in the uninstaller issue. ## Steps to reproduce Open any entry's file/line and compare the quoted claim with the referenced 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 Suggested replacement wording per entry is available in the sweep report on request; most fixes are one-line comment edits. Found by a repo-wide read-only sweep; every claim was adversarially re-verified against the code before filing. 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#1889
No description provided.