Skip to content

test(context): add fidelity provider wiring assertions in apply_session_config#5038

Merged
bug-ops merged 1 commit into
mainfrom
5035-fidelity-provider-assertions
Jun 7, 2026
Merged

test(context): add fidelity provider wiring assertions in apply_session_config#5038
bug-ops merged 1 commit into
mainfrom
5035-fidelity-provider-assertions

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #5035

Adds apply_session_config_wires_fidelity_providers to the zeph-core builder test suite. The test covers all three control-flow branches of the fidelity provider wiring path (builder.rs:2240-2254):

  • Non-empty FidelityConfig::semantic_scoring_provider / compress_provider names → compaction.fidelity_semantic_provider and compaction.fidelity_compress_provider are both Some after apply_session_config.
  • Empty names → both fields are None.
  • Absent FidelityConfig → both fields are None.

Both fields are asserted independently so a partial regression (one field unwired while the other is not) is caught immediately.

Coverage scope: this test verifies Option-guard and field-wiring correctness. It does not assert end-to-end provider registry resolution (that path is a follow-up, see below).

Test plan

  • cargo nextest run -p zeph-core -E 'test(apply_session_config)' — 3/3 pass
  • Full cargo nextest run -p zeph-core — 1547/1547 pass, 0 regressions
  • cargo +nightly fmt --check — clean
  • cargo clippy -p zeph-core -- -D warnings — clean
  • Test-only diff: no production logic changed

Follow-up

The impl-critic identified that resolve_background_provider always returns a provider (never None), so Some(_) confirms the non-empty filter fired but not that the named provider was resolved from the pool. A separate P3 issue will cover end-to-end registry resolution coverage for arise.rs.

…on_config

Adds `apply_session_config_wires_fidelity_providers` to the builder test
suite. Covers three branches of the wiring path (builder.rs:2240-2254):

- Non-empty provider names → `fidelity_semantic_provider` and
  `fidelity_compress_provider` are both `Some` after `apply_session_config`.
- Empty provider names → both fields are `None`.
- Absent `fidelity_config` → both fields are `None`.

Both fields are asserted independently so a partial regression (one field
unwired) is caught immediately.

Closes #5035
@bug-ops bug-ops added tests Test-related changes P3 Research — medium-high complexity labels Jun 7, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate tests Test-related changes size/M Medium PR (51-200 lines) and removed tests Test-related changes labels Jun 7, 2026
@bug-ops
bug-ops enabled auto-merge (squash) June 7, 2026 17:54
@bug-ops
bug-ops merged commit f677dc8 into main Jun 7, 2026
35 checks passed
@bug-ops
bug-ops deleted the 5035-fidelity-provider-assertions branch June 7, 2026 18:01
bug-ops added a commit that referenced this pull request Jun 7, 2026
- Remove redundant apply_session_config_fidelity_providers_none_when_not_configured
  (exact duplicate of the absent-config sub-case already covered in the pre-existing
  apply_session_config_wires_fidelity_providers test from PR #5038)
- Add fidelity_compress_provider fallback assertion in the unregistered-name branch
  of apply_session_config_wires_fidelity_providers_registry_lookup for symmetric
  coverage of both provider fields
bug-ops added a commit that referenced this pull request Jun 7, 2026
…5042)

* test(core): add fidelity provider wiring tests for #5037 and #5039

Add three tests to agent::builder::tests covering apply_session_config
fidelity provider wiring:

- apply_session_config_wires_fidelity_providers: asserts both
  fidelity_semantic_provider and fidelity_compress_provider are Some
  for non-empty names, None for empty names, and None when fidelity_config
  is absent.

- apply_session_config_fidelity_providers_none_when_not_configured:
  explicit standalone coverage for the fidelity_config: None path.

- apply_session_config_wires_fidelity_providers_registry_lookup:
  verifies resolve_background_provider performs a registry lookup —
  registers an Ollama entry "named-test" in provider_pool, asserts the
  resolved provider is name()=="ollama" with the expected model, and
  confirms an unregistered name falls back to the Mock primary.

Closes #5037, closes #5039

* test(context): apply review fixes to fidelity provider tests

- Remove redundant apply_session_config_fidelity_providers_none_when_not_configured
  (exact duplicate of the absent-config sub-case already covered in the pre-existing
  apply_session_config_wires_fidelity_providers test from PR #5038)
- Add fidelity_compress_provider fallback assertion in the unregistered-name branch
  of apply_session_config_wires_fidelity_providers_registry_lookup for symmetric
  coverage of both provider fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation P3 Research — medium-high complexity rust Rust code changes size/M Medium PR (51-200 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(context): apply_session_config missing fidelity_semantic_provider and fidelity_compress_provider wiring assertions

1 participant