Skip to content

refactor: add #[non_exhaustive] to remaining pub enums (workspace sweep)#4759

Merged
bug-ops merged 2 commits into
mainfrom
non-exhaustive-batch
May 30, 2026
Merged

refactor: add #[non_exhaustive] to remaining pub enums (workspace sweep)#4759
bug-ops merged 2 commits into
mainfrom
non-exhaustive-batch

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 30, 2026

Summary

Resolves the last batch of public enums missing #[non_exhaustive] across the workspace. Each omission was a forward-compatibility risk for downstream crates that match-exhaustively on these types.

  • Added #[non_exhaustive] to public enums in 14 crates
  • Added wildcard arms only in crates that import the annotated enum (never in the defining crate)
  • All 10 427 tests pass; fmt, clippy, and RUSTFLAGS checks clean

Crates affected: zeph-acp, zeph-channels, zeph-config, zeph-core, zeph-experiments, zeph-index, zeph-llm, zeph-mcp, zeph-orchestration, zeph-skills, zeph-subagent, zeph-tools, zeph-tui, zeph-worktree

Test plan

  • cargo +nightly fmt --check — pass
  • cargo clippy --workspace --features desktop,ide,server,chat,pdf,scheduler -- -D warnings — pass (0 warnings)
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — pass
  • cargo nextest run --config-file .github/nextest.toml --workspace --lib --bins — 10 427 / 10 427 passed

Closes #4743
Closes #4703
Closes #4735

@github-actions github-actions Bot added documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) skills zeph-skills crate channels zeph-channels crate (Telegram) rust Rust code changes core zeph-core crate refactor Code refactoring without functional changes size/M Medium PR (51-200 lines) labels May 30, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 30, 2026 15:44
@bug-ops bug-ops force-pushed the non-exhaustive-batch branch from 3c5fb9b to 4ba956a Compare May 30, 2026 15:45
bug-ops added 2 commits May 30, 2026 18:00
Resolves the last batch of public enums missing #[non_exhaustive]
across the workspace. Each omission was a semver-breaking change for
downstream crates that match-exhaustively on these types.

Crates affected: zeph-acp, zeph-channels, zeph-config, zeph-core,
zeph-experiments, zeph-index, zeph-llm, zeph-mcp, zeph-orchestration,
zeph-skills, zeph-subagent, zeph-tools, zeph-tui, zeph-worktree.

Added wildcard arms (`_ => unreachable!(...)` or `_ => {}`) only in
crates that import the annotated enum — never in the defining crate.

Closes #4743, #4703, #4735
@bug-ops bug-ops force-pushed the non-exhaustive-batch branch from e55cb2a to 979037e Compare May 30, 2026 16:00
@bug-ops bug-ops merged commit 88c8179 into main May 30, 2026
32 checks passed
@bug-ops bug-ops deleted the non-exhaustive-batch branch May 30, 2026 16:07
bug-ops added a commit that referenced this pull request Jun 5, 2026
…enum; fix sql! import guards

Move StopHint from zeph-core::channel to zeph-common::types to break the
circular dependency that would arise from zeph-agent-tools depending on
zeph-core. Re-export the type in both zeph-common and zeph-core::channel
so all existing call-sites remain source-compatible. Replace the string-
literal dispatch in AgentChannelView with typed StopHint variants and
remove the TODO(critic) debt comment. Closes #4792.

Replace #[allow(unused_imports)] on feature-gated sql! use declarations
with #[cfg(any(feature = "sqlite", feature = "postgres"))] guards in
zeph-scheduler and zeph-orchestration. Remove the import entirely where
it was unused at module level; move it inside #[cfg(test)] in
scheduler.rs where sql! is only used in tests. Closes #4841.

Note: #4779 (#[non_exhaustive] sweep for 18 pub enums) was already
resolved in PR #4759 (commit 88c8179) and is not part of this branch.
bug-ops added a commit that referenced this pull request Jun 5, 2026
…enum; fix sql! import guards

Move StopHint from zeph-core::channel to zeph-common::types to break the
circular dependency that would arise from zeph-agent-tools depending on
zeph-core. Re-export the type in both zeph-common and zeph-core::channel
so all existing call-sites remain source-compatible. Replace the string-
literal dispatch in AgentChannelView with typed StopHint variants and
remove the TODO(critic) debt comment. Closes #4792.

Replace #[allow(unused_imports)] on feature-gated sql! use declarations
with #[cfg(any(feature = "sqlite", feature = "postgres"))] guards in
zeph-scheduler and zeph-orchestration. Remove the import entirely where
it was unused at module level; move it inside #[cfg(test)] in
scheduler.rs where sql! is only used in tests. Closes #4841.

Note: #4779 (#[non_exhaustive] sweep for 18 pub enums) was already
resolved in PR #4759 (commit 88c8179) and is not part of this branch.
bug-ops added a commit that referenced this pull request Jun 5, 2026
…enum; fix sql! import guards

Move StopHint from zeph-core::channel to zeph-common::types to break the
circular dependency that would arise from zeph-agent-tools depending on
zeph-core. Re-export the type in both zeph-common and zeph-core::channel
so all existing call-sites remain source-compatible. Replace the string-
literal dispatch in AgentChannelView with typed StopHint variants and
remove the TODO(critic) debt comment. Closes #4792.

Replace #[allow(unused_imports)] on feature-gated sql! use declarations
with #[cfg(any(feature = "sqlite", feature = "postgres"))] guards in
zeph-scheduler and zeph-orchestration. Remove the import entirely where
it was unused at module level; move it inside #[cfg(test)] in
scheduler.rs where sql! is only used in tests. Closes #4841.

Note: #4779 (#[non_exhaustive] sweep for 18 pub enums) was already
resolved in PR #4759 (commit 88c8179) and is not part of this branch.
bug-ops added a commit that referenced this pull request Jun 5, 2026
…enum; fix sql! import guards (#4863)

Move StopHint from zeph-core::channel to zeph-common::types to break the
circular dependency that would arise from zeph-agent-tools depending on
zeph-core. Re-export the type in both zeph-common and zeph-core::channel
so all existing call-sites remain source-compatible. Replace the string-
literal dispatch in AgentChannelView with typed StopHint variants and
remove the TODO(critic) debt comment. Closes #4792.

Replace #[allow(unused_imports)] on feature-gated sql! use declarations
with #[cfg(any(feature = "sqlite", feature = "postgres"))] guards in
zeph-scheduler and zeph-orchestration. Remove the import entirely where
it was unused at module level; move it inside #[cfg(test)] in
scheduler.rs where sql! is only used in tests. Closes #4841.

Note: #4779 (#[non_exhaustive] sweep for 18 pub enums) was already
resolved in PR #4759 (commit 88c8179) and is not part of this branch.
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 documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines) skills zeph-skills crate

Projects

None yet

1 participant