refactor(vault,sanitizer,config): split monolithic source files into focused submodules#3407
Merged
refactor(vault,sanitizer,config): split monolithic source files into focused submodules#3407
Conversation
…ariants
Add ApiError { provider, status } to LlmError to replace the common pattern
of wrapping non-success HTTP responses in Other(String). Add NoActiveSession
to ChannelError to replace Other("no active chat"/"no active channel") across
telegram, discord, and slack adapters.
Move context-length detection from is_context_length_error() into a
pub(crate) body_is_context_length_error() helper used at the transport layer
in each provider (claude, openai, gemini). is_context_length_error() now only
matches ContextLengthExceeded, removing the string-heuristic fallback.
Update all affected tests to assert on the new typed error format.
…ix broken doc link
Split monolithic source files into focused submodules: - zeph-vault: extract age/arc/env/mock backends from lib.rs (1302 → ~150 lines) - zeph-sanitizer: extract ContentSanitizer into sanitizer.rs (2313 → ~150 lines) - zeph-config: split 5080-line migrate.rs into migrate/mod.rs + migrate/steps.rs Replace wildcard `use super::*` and `use steps::*` in migrate split with explicit imports to satisfy clippy::wildcard_imports. Standardize deferred-refactor comment markers across 41 files to a searchable `TODO(review):` prefix. Fix error message casing in zeph-skills and zeph-index error enums.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lib.rsintoage.rs,arc.rs,env.rs,mock.rs— each backend in its own file;lib.rsnow contains only theVaultProvidertrait and re-exportsContentSanitizerstruct and all pipeline logic intosanitizer.rs;lib.rsreduced to module declarations and re-exports; fixpub mod sanitizer→mod sanitizerto avoid dual public pathmigrate.rsintomigrate/mod.rs(trait, registry, migration functions) andmigrate/steps.rs(35 zero-size wrapper structs); replace wildcarduse super::*anduse steps::*with explicit importsAdditional:
// TODO(review):prefix (searchable, consistent with existingTODO(B2)convention from main)zeph-skillsandzeph-indexerror enumsExcluded from this PR (per critic review)
agent/mod.rs:154explicitly defers thisrunner.rssplit — 102#[cfg(feature)]directives; needs feature-flag inventory + multi-PR approachAgentError::Othercallsites are already minimal (3, all in tests)Test plan
cargo check --workspace— cleancargo clippy --workspace -- -D warnings— zero warningscargo nextest run --config-file .github/nextest.toml --workspace --features testing --lib --bins— 8500/8500 passedcargo +nightly fmt --check— clean