Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions tests/compiler_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5225,21 +5225,6 @@ fn test_pipeline_filter_has_resources_and_gate() {
);
}

/// Agent job depends on Setup when filters are active.
#[test]
fn test_pr_filter_agent_depends_on_setup() {
let compiled = compile_fixture("pr-filter-tier1-agent.md");

assert!(
compiled.contains("dependsOn: Setup"),
"Agent job should depend on Setup"
);
assert!(
compiled.contains("prGate.SHOULD_RUN"),
"Agent job condition should reference gate output"
);
}

/// Regression guard for the synth-mode gate-bypass bug: with `mode:
/// synthetic` (the default) AND `on.pr.filters` present, the Agent-job
/// condition must REQUIRE the gate to pass for real-PR and synth-PR
Expand All @@ -5250,6 +5235,15 @@ fn test_pr_filter_agent_depends_on_setup() {
fn test_pr_filter_synth_mode_agent_condition_enforces_gate() {
let compiled = compile_fixture("pr-filter-tier1-agent.md");

// Agent job must depend on Setup when PR filters are active — the gate
// step lives in Setup and the Agent job's condition below reads its
// output via `dependencies.Setup.outputs[...]`, which requires the
// dependsOn edge to exist.
assert!(
compiled.contains("dependsOn: Setup"),
"Agent job should depend on Setup"
);

// Extract the Agent-job dependsOn condition body so the assertions
// target only that section (the same strings can appear elsewhere —
// e.g. the exec-context-pr.js step's condition — and would create
Expand Down