fix(skills): wire trust config and RL routing head into ACP/serve/daemon#5976
Merged
Conversation
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
force-pushed
the
fix/5920-skill-trust-rl-head-wiring
branch
from
July 10, 2026 22:37
2adb407 to
b803152
Compare
bug-ops
enabled auto-merge (squash)
July 10, 2026 22:37
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.
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
AgentBuilder::with_trust_configand the skill-trust-DB seeding step were CLI-only (src/runner.rs). Agents built viadaemon.rs,acp.rs, or/sessions(serve/agent_factory.rs) leftservices.skill.trust_configat its default and never seeded fresh skills into the trust DB, so any skill without a prior row fell back toSkillTrustLevel::MISSING_ENTRY_FALLBACK(Trusted, fail-open) instead of the operator's configured[skills.trust]policy — ahash_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 intorunner.rs/daemon.rs; ACP and/sessionsagents always fell back to pure-cosine skill matching regardless of persisted RL weights.AppBuilder::seed_skill_trust_dbhelper called from all four construction paths, and wired.with_trust_config(...)into every one of them. Mirroreddaemon.rs's RL head load-or-cold-start logic intoacp.rsandserve/agent_factory.rs.Closes #5920, closes #5921.
Follow-ups filed during review (not blocking this fix):
routing_head_weightsis a single global row; concurrent RL-enabled ACP/serve sessions can lose each other's updates (last-write-wins). Bounded byrl_routing_enableddefaulting tofalse; documented at both RL wiring call sites.SkillInvokeExecutor(theinvoke_skilltool's per-invocation trust re-check) remains CLI-only; confirmed this does not make this fix inert since context assembly still gates on trust rows in every path.build_acp_agent-style helper;spawn_acp_agenthas no return seam today, so the ACP wiring is covered by a deps-level test rather than a realAgent-level regression test.Test plan
cargo +nightly fmt --checkcargo clippy --profile ci -p zeph -p zeph-core --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo check --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing"(post-rebase sanity)nextest(acp/daemon/serve/bootstrap modules): 174/174 pass, including 4 new/extended regression testszeph-coresession_config/trust/skills tests: 39/39 passnextest --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins: 12625/12625 passcargo test --doc -p zeph-core: 38 passed.local/testing/playbooks/skill-trust-rl-wiring.md(scenarios A-F), tracked asUntestedin.local/testing/coverage-status.mdpending a live CI cycle