refactor: drop crate-wide allow(dead_code) and sweep true dead code (#36) #65
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_os!65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "36-remove-dead-code-allow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fifth slice on #36.
hero_os_app/src/main.rs:6had a crate-wide#![allow(dead_code)]hiding a large amount of accumulated unused code. Removing the blanket allow surfaced 57 items, all of which were genuinely dead. This PR deletes them.Whole modules removed (never imported)
commands.rs(329 LOC) —AiCommandenum + dispatcher, superseded bymcpdom_automation.rs(585 LOC) — DOM query/click helpers, never wired upTrimmed modules
ai_service.rs— keptextract_tool_calls; dropped the Groq HTTP client (call_groq, system prompt,Message/GroqRequest/GroqResponse/GroqChoice/GroqMessage, constants,is_tool_call). The AI Bar talks to the Chat service viachatservice_completion(seecomponents/ai_bar.rs:176), not Groq directly.mcp.rs— keptMcpResult,McpToolCall,execute_tool, and helperparse_island_id. DroppedMcpTool/McpParametersschema types,get_available_tools,parse_tool_call, andget_tools_prompt(all unused after the ai_service slim).Scattered dead items
config.rs:books_url,forge_url,brand_name,brand_display_name,profile_name,display_name,brand_logocontroller.rs:can_go_back,close_all_except,get_focused_window,get_current_contextregistry.rs:islands_for_archipelago,has_island,len,is_emptytheme.rs:darken,primary_rgba,COLOR_PRESETSservices/env_service.rs:http_get(orphan after the auth Bearer removal in #37)services/theme_service.rs:fetch_default_theme(onlyfetch_all_themesis used)storage.rs:save_session_token,load_session_token,load_theme_preference(onlyclear_*helpers are still called; kept as stale-token scrubbers for upgrades)Net impact
-1712 LOC of dead code removed.
hero_os_appwarning count drops 22 → 13; every removed warning was a genuine dead-code hit. Remaining 13 warnings are unused_variables + pre-existing cfg warnings for other feature flags — tackled in follow-ups.Verification
Test plan
execute_tool→controller.*)fetch_all_themespath)Refs #36.
🤖 Generated with Claude Code