Skip to content

fix(acp,daemon,serve): wire SelfCheckPipeline, TrajectorySentinel, and SkillInvokeExecutor into all entry points#6047

Merged
bug-ops merged 1 commit into
mainfrom
fix/5951-acp-daemon-wiring-gaps
Jul 11, 2026
Merged

fix(acp,daemon,serve): wire SelfCheckPipeline, TrajectorySentinel, and SkillInvokeExecutor into all entry points#6047
bug-ops merged 1 commit into
mainfrom
fix/5951-acp-daemon-wiring-gaps

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • SelfCheckPipeline (config.quality.self_check), TrajectorySentinel (config.security.trajectory, spec-050), and SkillInvokeExecutor (invoke_skill tool) were each constructed and wired into the Agent only in src/runner.rs (CLI/TUI entrypoint) — another instance of the recurring "wire-X-into-ACP/daemon/serve" defect class (18+ prior confirmed instances in this codebase).
  • Extracted agent_setup::build_quality_pipeline as a shared helper used by all four entry points (runner.rs, acp.rs, daemon.rs, serve), closing a future-divergence risk.
  • Wired TrajectorySentinel config plus the paired PolicyGateExecutor/ScopedToolExecutor signal-queue plumbing into acp.rs (per-session), daemon.rs (process-wide), and serve/agent_factory.rs (per-session).
  • Constructed and registered SkillInvokeExecutor in the ACP and daemon composite tool chains, sharing a trust_snapshot Arc with the Agent. Serve does not wire skill_loader/memory/overflow at all (separate pre-existing gap, tracked in serve /sessions* never wires skill_loader, memory, or overflow tools — confirmed pre-existing gap #6046) and is correctly out of scope for this fix.
  • Added 9 regression tests covering reachability of each fix through the real production composite chains in acp.rs, daemon.rs, and serve/agent_factory.rs.

Known limitation (not fixed here)

Serve's ScopedToolExecutor ([security.capability_scopes] wrap) is built once, eagerly, and shared across every concurrent /sessions* agent — before any per-session trajectory signal queue exists. Attaching a per-session queue there would leak one session's OutOfScope signals into every other session sharing that executor. This is documented in code (gate_serve_session_executor's doc comment) and tracked as a follow-up in #6045. It is a bounded defense-in-depth gap, not a control bypass or a regression from baseline (serve had zero trajectory wiring before this PR).

Follow-up issues filed

Closes #5951
Closes #5975
Refs #5958

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 12817 passed, 0 failed, 35 skipped
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • 9 new regression tests added (reachability through real production composite chains, not shallow/tautological)
  • Adversarial critic review — no critical/blocking findings
  • Code review — approved
  • .local/testing/playbooks/ and coverage-status.md updated (main repo path)

…d SkillInvokeExecutor into all entry points

SelfCheckPipeline (config.quality.self_check), TrajectorySentinel
(config.security.trajectory, spec-050), and SkillInvokeExecutor
(invoke_skill tool) were each constructed and wired into the Agent
only in src/runner.rs (CLI/TUI entrypoint) -- another instance of the
recurring wire-X-into-ACP/daemon/serve defect class.

- Extract agent_setup::build_quality_pipeline as a shared helper used
  by all four entry points (runner.rs, acp.rs, daemon.rs, serve),
  closing a future-divergence risk.
- Wire TrajectorySentinel config plus the paired PolicyGateExecutor
  and ScopedToolExecutor signal-queue plumbing into acp.rs (per
  session), daemon.rs (process-wide), and serve/agent_factory.rs (per
  session). Serve's shared ScopedToolExecutor cannot safely receive a
  per-session signal queue without leaking signals across sessions;
  this is documented as a known limitation, not fixed here.
- Construct and register SkillInvokeExecutor in the ACP and daemon
  composite tool chains, sharing a trust_snapshot Arc with the Agent.
  Serve does not wire skill_loader/memory/overflow at all (separate
  pre-existing gap) and is correctly out of scope.
- Add regression tests covering reachability of each fix through the
  real production composite chains in acp.rs, daemon.rs, and
  serve/agent_factory.rs.

Refs #5951
Refs #5958
Refs #5975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant