Skip to content

fix(skills): wire trust config and RL routing head into ACP/serve/daemon#5976

Merged
bug-ops merged 1 commit into
mainfrom
fix/5920-skill-trust-rl-head-wiring
Jul 10, 2026
Merged

fix(skills): wire trust config and RL routing head into ACP/serve/daemon#5976
bug-ops merged 1 commit into
mainfrom
fix/5920-skill-trust-rl-head-wiring

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • AgentBuilder::with_trust_config and the skill-trust-DB seeding step were CLI-only (src/runner.rs). Agents built via daemon.rs, acp.rs, or /sessions (serve/agent_factory.rs) left services.skill.trust_config at its default and never seeded fresh skills into the trust DB, so any skill without a prior row fell back to SkillTrustLevel::MISSING_ENTRY_FALLBACK (Trusted, fail-open) instead of the operator's configured [skills.trust] policy — a hash_mismatch_level = "blocked" tightening, for example, was silently ignored for these three entry points.
  • AgentBuilder::with_rl_head/with_rl_routing (the SkillOrchestra REINFORCE-trained re-ranking head) were wired only into runner.rs/daemon.rs; ACP and /sessions agents always fell back to pure-cosine skill matching regardless of persisted RL weights.
  • Extracted the trust-DB seeding block into a shared AppBuilder::seed_skill_trust_db helper called from all four construction paths, and wired .with_trust_config(...) into every one of them. Mirrored daemon.rs's RL head load-or-cold-start logic into acp.rs and serve/agent_factory.rs.

Closes #5920, closes #5921.

Follow-ups filed during review (not blocking this fix):

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci -p zeph -p zeph-core --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo check --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" (post-rebase sanity)
  • Targeted nextest (acp/daemon/serve/bootstrap modules): 174/174 pass, including 4 new/extended regression tests
  • zeph-core session_config/trust/skills tests: 39/39 pass
  • Full workspace nextest --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins: 12625/12625 pass
  • cargo test --doc -p zeph-core: 38 passed
  • rustdoc gate clean on touched crates
  • Live-session verification — playbook at .local/testing/playbooks/skill-trust-rl-wiring.md (scenarios A-F), tracked as Untested in .local/testing/coverage-status.md pending a live CI cycle

@bug-ops bug-ops added the bug Something isn't working label Jul 10, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate size/XL Extra large PR (500+ lines) labels Jul 10, 2026
with_trust_config and the skill-trust-DB seeding step were CLI-only,
leaving ACP/daemon/serve agents fail-open (Trusted) for any skill with
no seeded trust row, silently ignoring operator-configured
default_level/hash_mismatch_level policy. Likewise with_rl_head and
with_rl_routing were wired into runner.rs/daemon.rs only, so ACP and
serve-sessions agents never applied persisted RL-learned skill
re-ranking weights.

Extract the trust-DB seeding block into a shared
AppBuilder::seed_skill_trust_db helper and call it, together with
with_trust_config, from all four agent-construction entry points.
Mirror daemon.rs's RL head load-or-cold-start logic into acp.rs and
serve/agent_factory.rs.

Closes #5920, closes #5921
@bug-ops
bug-ops force-pushed the fix/5920-skill-trust-rl-head-wiring branch from 2adb407 to b803152 Compare July 10, 2026 22:37
@bug-ops
bug-ops enabled auto-merge (squash) July 10, 2026 22:37
@bug-ops
bug-ops merged commit 7fd8056 into main Jul 10, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/5920-skill-trust-rl-head-wiring branch July 10, 2026 22:45
bug-ops added a commit that referenced this pull request Jul 10, 2026
Merging origin/main brought in ServeAgentDeps::rl_embed_dim_resolved
and SharedCore::rl_embed_dim_resolved (#5976) plus this branch's own
ServeAgentDeps::shadow_sentinel_config/shadow_sentinel_probe_provider
fields. Git's auto-merge silently left three test-literal struct
initializers out of sync with the merged struct definitions instead of
flagging a conflict, so the missing fields only surfaced as E0063
compile errors in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant