Skip to content

chore: remove dead code in observation and tart modules#131

Merged
Miyamura80 merged 1 commit into
masterfrom
chore/dead-code-cleanup
Apr 7, 2026
Merged

chore: remove dead code in observation and tart modules#131
Miyamura80 merged 1 commit into
masterfrom
chore/dead-code-cleanup

Conversation

@Eito-Test-Account

Copy link
Copy Markdown
Contributor

Summary

  • observation::save_a11y_tree: gate behind #[cfg(test)] since it's only used in tests. The production a11y-saving function lives in provider/helpers.rs and remains the active one used by claude_cli.rs.
  • TartSession::vm_name: drop stale #[allow(dead_code)] annotation β€” the method is actively called from interactive.rs:378-379. Git history shows the annotation was added ~2 hours before the actual callers were added in commit 0291c6d and was never cleaned up.

Background

Came out of a dead-code audit. Three top-priority items were investigated by sub-agents:

  1. βœ… observation::save_a11y_tree β€” confirmed dead, fixed here
  2. ❌ TartSession::guest_shared_dir field/accessor β€” false positive (intentional architectural symmetry with WindowsVmSession); tracked in Remove #[allow(dead_code)] from TartSession accessors once wired upΒ #125 for later cleanup once wired up
  3. βœ… Stale #[allow(dead_code)] on TartSession::vm_name β€” confirmed stale, fixed here

Test plan

  • cargo build β€” clean
  • cargo test β€” all 533 tests pass

πŸ€– Generated with Claude Code

- observation::save_a11y_tree: gate behind #[cfg(test)] since it's
  only used in tests (the production version lives in
  provider/helpers.rs)
- TartSession::vm_name: drop stale #[allow(dead_code)] β€” the method
  is actively called from interactive.rs

Tracking issue for the remaining TartSession accessor scaffolding
(shared_dir, guest_shared_dir): #125

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Apr 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR is a targeted dead-code cleanup touching two files with no behavioral changes.

  • src/observation.rs: save_a11y_tree is correctly gated behind #[cfg(test)] and made private. The function is only called from two tokio::test functions within the same file (test_save_a11y_tree at line 566 and test_save_a11y_tree_creates_file at line 580). The production a11y-save path lives in src/provider/helpers.rs and is used by src/provider/claude_cli.rs β€” it is completely unaffected.
  • src/tart/mod.rs: The stale #[allow(dead_code)] suppression on vm_name() is correctly removed. The method is actively called from src/interactive.rs:378-379 to print Tart VM information to the user.

Both changes are minimal, accurate, and verified against the codebase. No issues found.

Confidence Score: 5/5

Safe to merge β€” purely dead-code cleanup with no behavioral changes

Both changes are verified correct: save_a11y_tree is only used in tests, and vm_name() is actively called. No P0/P1 issues found.

No files require special attention

Important Files Changed

Filename Overview
src/observation.rs Gates save_a11y_tree behind #[cfg(test)] and makes it private; only used in two tokio tests within the same file
src/tart/mod.rs Removes stale #[allow(dead_code)] from vm_name(), which is actively called from interactive.rs:378-379

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[A11y Tree Data] --> B{Which path?}
    B -->|Production| C[provider/helpers.rs\nsave_a11y_tree\npub crate]
    B -->|Test only| D[observation.rs\nsave_a11y_tree\ncfg test - private]
    C --> E[claude_cli.rs:265\nactive production caller]
    D --> F[observation.rs tests\ntest_save_a11y_tree\ntest_save_a11y_tree_creates_file]
Loading

Reviews (1): Last reviewed commit: "chore: remove dead code in observation a..." | Re-trigger Greptile

@Miyamura80 Miyamura80 merged commit 7dcfa13 into master Apr 7, 2026
4 checks passed
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