Skip to content

Remove seven dead modules and correct roadmap citations - #6

Closed
MadTinker wants to merge 2 commits into
claude/mcp-stdout-logging-fixfrom
claude/remove-dead-modules
Closed

Remove seven dead modules and correct roadmap citations#6
MadTinker wants to merge 2 commits into
claude/mcp-stdout-logging-fixfrom
claude/remove-dead-modules

Conversation

@MadTinker

Copy link
Copy Markdown
Collaborator

Stacked on #5 (which is stacked on #4). Base is claude/mcp-stdout-logging-fix, so the diff shows only this change.

What

Seven files, ~988 lines, none of which was declared in lib.rs, main.rs, or any mod.rs — so none had ever compiled:

File Lines #[test] fns (never ran)
src/browser/state_manager.rs 199 4
src/browser/navigation.rs 167 5
src/browser/window_manager.rs 158 3
src/browser/error.rs 153 4
src/browser/native_ui.rs 137 3
src/platform/macos.rs 124 2
src/browser/menu.rs 50 0

Combined with the two removed in #4 (browser/tests.rs, src/cli/), that's nine dead modules totalling roughly 1,100 lines.

Why it stayed hidden

The cluster was self-referential. error.rs was imported by navigation.rs, window_manager.rs, and state_manager.rs — all themselves dead. So a "is this imported anywhere?" check finds real references and concludes the code is live. Only comparing files on disk against mod declarations reveals it.

native_ui.rs is the one worth a second look: its tests build real windows via WindowBuilder, and are #[ignore]d on macOS for main-thread reasons but not elsewhere. Had that file ever been wired up, it would have failed on any CI runner without a display. Removing it now avoids a trap for whoever adds CI.

Roadmap corrections

Two errors in ROADMAP.md, both from writing it against a static scan rather than a build:

  • It cited browser/navigation.rs as implementing per-tab navigation history. That file never compiled — the implementation is in browser/tabs.rs.
  • Its per-module test counts included tests in files that never ran.

The file now carries a short note recording this, since its stated purpose is that every claim cites a checkable file. Citing files only helps if the citations are checked against what actually builds.

Verification

cargo build → success
cargo test  → 167 passed, 0 failed, 0 ignored

Identical to before the removal — which is the point. If any of those ~21 tests had been running, the count would have dropped.

Every remaining file under src/browser/ now maps to a declared module.

Note

Git history retains all of this if any turns out to be worth reviving. Per discussion, the intent is to rewrite rather than resurrect if the functionality is wanted later — state_manager.rs and window_manager.rs in particular read as an abandoned refactor rather than working code.


Generated by Claude Code

claude added 2 commits August 22, 2026 18:17
MCP speaks JSON-RPC 2.0 over stdout, but the tracing subscriber defaulted to
stdout too, so every log line was interleaved into the protocol stream. A
client reading the first line for its initialize response got

  INFO ThreadId(01) tinker: src/main.rs:90: Starting Tinker Workshop...

instead of JSON, and failed to parse. This affected any MCP client, including
Claude Desktop using the configuration in the readme.

Logging was also initialized before the arguments were parsed, so it could not
know whether --mcp was set. Parse first, then point the subscriber at stderr
when running as an MCP server. Non-MCP output is unchanged.

The MCP write loop itself was already correct, and there are no other stdout
writers in the tree, so the subscriber was the sole corruption source.

This is why tests/mcp_tests.rs had three #[ignore]d tests. The attribute said
they were skipped because they require building the binary, but they were
failing on the corrupted stream. They pass now and are re-enabled, giving
end-to-end protocol coverage that guards this regression.

cargo test: 167 passed, 0 failed, 0 ignored (was 164 passed, 3 ignored).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pg53xf5xcUV7oc5CkaiCpz
None of these files was declared in lib.rs, main.rs, or any mod.rs, so none
had ever compiled:

  src/browser/navigation.rs      167 lines
  src/browser/state_manager.rs   199 lines
  src/browser/window_manager.rs  158 lines
  src/browser/error.rs           153 lines
  src/browser/native_ui.rs       137 lines
  src/platform/macos.rs          124 lines
  src/browser/menu.rs             50 lines

The cluster was self-referential: error.rs was imported only by navigation.rs,
window_manager.rs, and state_manager.rs, all themselves dead. A naive "is this
imported anywhere?" check finds references and concludes the code is live.

Every remaining file under src/browser/ now maps to a declared module.

Also corrects two errors in ROADMAP.md introduced when it was written from a
static scan rather than a build:

- It cited browser/navigation.rs as implementing per-tab navigation history.
  That file never compiled; the implementation is in browser/tabs.rs.
- Its per-module test counts included tests in files that never ran.

Verified: cargo build succeeds; cargo test reports 167 passed, 0 failed,
0 ignored — identical to before the removal, confirming the ~21 #[test]
functions in the deleted files were never executed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pg53xf5xcUV7oc5CkaiCpz

Copy link
Copy Markdown
Collaborator Author

Closing — this change has been folded into #4 rather than dropped.

The dead-module removal is the same kind of work as #4's M1 cleanup (removing things the repo claimed existed but didn't), so keeping them as separate stacked PRs added review overhead without adding clarity. The commit is now the third of three in #4, and the stack is one level shallower:

PR Contents
#4 Roadmap rewrite + M1 cleanup + dead-module removal
#5 MCP stdout logging fix
#7 CI workflow

Nothing was lost. Verified on the rebased tip: cargo build --all-targets succeeds and cargo test reports 167 passed, 0 failed.


Generated by Claude Code

@MadTinker MadTinker closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants