Skip to content

test: improve coverage for security-critical and core modules#680

Merged
bug-ops merged 6 commits intomainfrom
test-coverage-improvements
Feb 20, 2026
Merged

test: improve coverage for security-critical and core modules#680
bug-ops merged 6 commits intomainfrom
test-coverage-improvements

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 20, 2026

Summary

  • Add 23 new tests (2053 → 2076) across 11 files targeting security-critical code, zero-coverage modules, and core functionality gaps
  • Security modules now at 95-100% coverage (redact 99%, vault 99%, audit 98%, permissions 100%, filter/security 100%)
  • trust_commands.rs coverage improved from 3.88% to 45.74%
  • zeph-memory coverage improved from 70% to 87%
  • Added property-based tests for panic safety in redact, vault, filter pipeline, matcher, and retry
  • Added mock HTTP server tests for retry logic
  • Extracted shared MockChannel to eliminate DRY violation in integration tests

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings passes
  • cargo nextest run --workspace --lib --bins — 2076 passed, 0 failed, 9 skipped
  • CI gate job passes

@github-actions github-actions bot added llm LLM provider related skills SKILL.md system memory Persistence and memory channels User interface channels rust core tests dependencies size/XL labels Feb 20, 2026
Add 23 new tests across 11 files targeting security-critical code,
zero-coverage modules, and core functionality gaps:

- trust_commands: 6 integration tests for skill trust management
- retry: 3 mock HTTP server tests + proptest for delay bounds
- pipeline: 2 unit tests for IngestionPipeline
- redact: 3 proptests (panic safety, path sanitization, non-secret preservation)
- vault: 3 proptests (SecretValue round-trip, debug/display redaction)
- embedding_store: 5 unit tests with InMemoryVectorStore
- line_editor: 14 unit tests for internal text manipulation
- filter: 2 proptests (FilterPipeline + OutputFilterRegistry panic safety)
- matcher: 2 proptests (ScoredMatch round-trip, cosine_similarity bounds)
- e2e: config TOML to agent single-loop integration test

Security module coverage: redact 99%, vault 99%, audit 98%,
permissions 100%, filter/security 100%, trust_commands 46% (was 4%).
Add 36 unit tests for previously under-tested modules:

- persistence.rs: 5 tests for load_history/persist paths
- utils.rs: 8 tests for token estimation, context injection
- mcp.rs: 8 tests for subcommand dispatch without manager
- any.rs: 8 tests for AnyChannel::Cli variant delegation
- router.rs: 6 tests for SubProvider delegation and status_tx
Add 28 tests covering remaining gaps:

- tool_execution.rs: 11 tests for redaction, tool result handling,
  sandbox violations, and exit code paths
- learning.rs: 9 tests for skill command dispatch edge cases
- Snapshot tests (insta): config default serialization, git diff/status
  filter output, cargo build/error filter, clippy grouped warnings
- Add insta as dev-dep to zeph-core and zeph-tools
@bug-ops bug-ops force-pushed the test-coverage-improvements branch from a676236 to 99a880c Compare February 20, 2026 04:16
Update dev dependencies:
- proptest 1.6 -> 1.10
- insta 1.46 -> 1.46.3

Remove unused dependencies detected by cargo-machete:
- root: tokio-util, sqlx (not used in binary crate)
- zeph-llm, zeph-memory, zeph-skills: anyhow (replaced by typed errors)
- zeph-memory: tokio-stream
- zeph-a2a: tokio-util
- zeph-index: tokio-stream

Add insta snapshot files for config, filter output tests.
@bug-ops bug-ops enabled auto-merge (squash) February 20, 2026 04:20
Initialize variables with correct values directly instead of
assigning and then overwriting, fixing -D warnings CI failure.
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 20, 2026
The any_channel_cli_confirm_returns_bool test calls dialoguer::Confirm
which blocks waiting for stdin input, causing hangs on Windows CI.
@bug-ops bug-ops force-pushed the test-coverage-improvements branch from b206cf8 to fcae43f Compare February 20, 2026 12:32
@bug-ops bug-ops merged commit c50e5c0 into main Feb 20, 2026
20 checks passed
@bug-ops bug-ops deleted the test-coverage-improvements branch February 20, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channels User interface channels core dependencies documentation Improvements or additions to documentation llm LLM provider related memory Persistence and memory rust size/XL skills SKILL.md system tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant