Route Guardian housekeeping through its dedicated sampler (#61799)

## What changed

Use `HousekeeperSampler` for evidence routing instead of starting a separate review-session thread. The housekeeper now owns a tool-free model conversation, retains completed routing batches, and evicts whole batches under context-window pressure.

Commit sampled history only after all board writes succeed and the evidence cursor advances. Stop the worker after a routing error or an interrupted routing future. Cancel routing when the account changes while allowing accepted appends to finish before shutdown.

## Testing

Extend housekeeping integration coverage for retained history, whole-batch eviction, transient retries, retry exhaustion with `Retry-After`, HTTP fallback, credential renewal, command-token rotation, and shutdown waiting for accepted evidence appends.

GitOrigin-RevId: 316ab1b90529e2a5874e617855d38c41f232872a
This commit is contained in:
felixxia-oai
2026-11-16 12:05:11 +00:00
committed by copyberry
parent 5630d58680
commit 0370e34fe8
9 changed files with 401 additions and 319 deletions
@@ -75,14 +75,6 @@ impl PreparedGuardianContext {
}
impl PreparedGuardianContext {
/// Start with no parent user, thread or project instructions and skip repository discovery.
pub fn without_parent_instructions(mut self) -> Self {
self.key.user_instructions = None;
self.key.thread_instructions = None;
self.key.project_instructions = Some(Arc::default());
self
}
pub fn reuse_key(
&self,
previous: Option<&GuardianReviewSession>,