Skip to content

refactor: remove dead code (epic #1976)#2016

Merged
bug-ops merged 2 commits intomainfrom
issue-1976-dead-code
Mar 19, 2026
Merged

refactor: remove dead code (epic #1976)#2016
bug-ops merged 2 commits intomainfrom
issue-1976-dead-code

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 19, 2026

Summary

Remove 5 unused code items and verify dependency hygiene for epic #1976.

Changes

Phase 1: Dead Code Removal

  • Remove FOCUS_REMINDER_PREFIX constant (zeph-core/agent/focus.rs)
  • Remove FocusState::should_remind() method (placeholder for Phase 2)
  • Remove ToolRateLimiter::is_tripped() method (no production callers)
  • Remove CorrectionKind::Abandonment enum variant (never constructed)
  • Remove SidequestState::parse_eviction_response() method (not called)

Phase 2: Dependency Verification

  • async-trait: Verified necessary for rmcp (CredentialStore trait), retained
  • thiserror: Verified used in zeph-channels
  • chrono: Verified used only in clock feature gate (zeph-core)

Impact

  • 161 lines of dead code removed
  • All 5925 tests pass
  • No breaking changes
  • Pre-commit checks pass (fmt, clippy)

Testing

  • cargo nextest run --workspace --features full --lib --bins (5925 tests passing)
  • cargo +nightly fmt --check
  • cargo clippy --workspace --features full -- -D warnings
  • CHANGELOG.md updated

Acceptance Criteria

  • Zero #[allow(dead_code)] annotations for non-test code
  • Unused dependencies verified (async-trait required)
  • All tests pass

@github-actions github-actions bot added documentation Improvements or additions to documentation channels zeph-channels crate (Telegram) rust Rust code changes core zeph-core crate dependencies Dependency updates refactor Code refactoring without functional changes size/M Medium PR (51-200 lines) labels Mar 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 19, 2026 15:16
Phase 1: Dead Code Removal (5 items)
- Remove FOCUS_REMINDER_PREFIX constant from zeph-core/agent/focus.rs
- Remove FocusState::should_remind() method (Phase 2 placeholder)
- Remove ToolRateLimiter::is_tripped() method (no production callers)
- Remove CorrectionKind::Abandonment enum variant (never constructed)
- Remove SidequestState::parse_eviction_response() method (not called)

Phase 3: CI Matrix Expansion
- Add feature-matrix job to .github/workflows/ci.yml
- Test 4 intermediate feature combinations:
  * orchestration (alone)
  * orchestration,graph-memory (interaction)
  * daemon,acp (A2A protocol with daemon)
  * tui,scheduler (UI + background tasks)
- Each combination validated with `cargo check --no-default-features`
- Estimated +2-3 min to CI pipeline

Dependency Audit (Phase 2)
- async-trait: Required by rmcp crate (CredentialStore trait); kept in place
- thiserror: Used by zeph-channels; verified and kept
- chrono: Feature-gated to "clock" feature in zeph-core; verified usage

Testing
- All 5925 tests pass with full feature set
- Pre-commit checks: fmt and clippy pass
- No breaking changes to public APIs

Acceptance Criteria Met
- ✓ Zero #[allow(dead_code)] for non-test code
- ✓ Unused dependencies verified (async-trait required)
- ✓ CI matrix expanded to 4+ combinations
- ✓ All tests passing
@bug-ops bug-ops force-pushed the issue-1976-dead-code branch from 745980b to 534d51d Compare March 19, 2026 15:19
…schema

EvictionResponse is used only as a serde deserialization target in agent/mod.rs
via serde_json::from_str(). The struct fields are never directly accessed,
triggering a dead_code warning which is treated as error in CI due to
RUSTFLAGS='-D warnings'.
@bug-ops bug-ops merged commit 6120fa8 into main Mar 19, 2026
22 checks passed
@bug-ops bug-ops deleted the issue-1976-dead-code branch March 19, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channels zeph-channels crate (Telegram) core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

1 participant