From 6a694d10db09af51037d69421d5a231601d1405b Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 25 Aug 2026 17:38:57 -0600 Subject: [PATCH] test(jobs): assert kind-aware guardrail surfaces running jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reconciles the T2 guardrail delta with the T3 jobs-only-supervisor test at merge time, per plans/background-jobs-design.md ยง11 merge order. --- src/function/jobs.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/function/jobs.rs b/src/function/jobs.rs index bc36f0e..480c46e 100644 --- a/src/function/jobs.rs +++ b/src/function/jobs.rs @@ -2031,7 +2031,7 @@ mod tests { } #[test] - fn jobs_only_supervisor_guardrail_takes_no_action() { + fn jobs_only_supervisor_guardrail_surfaces_running_job() { let mut ctx = ctx_with_job_supervisor(5); ctx.supervisor .as_ref() @@ -2040,8 +2040,18 @@ mod tests { .register(make_running_job("j1")) .unwrap(); + match check_pending_agents_guardrail(&mut ctx) { + GuardrailAction::Inject(prompt) => { + assert!(prompt.contains("j1")); + assert!(prompt.contains("job__collect")); + } + _ => panic!("expected Inject for a running job"), + } + assert_eq!(ctx.pending_agents_guardrail_count, 1); + + let empty_ctx = &mut ctx_with_job_supervisor(5); assert!(matches!( - check_pending_agents_guardrail(&mut ctx), + check_pending_agents_guardrail(empty_ctx), GuardrailAction::NoAction )); }