diff --git a/oxa/oxa-cli/tests/work_cli.rs b/oxa/oxa-cli/tests/work_cli.rs index b8ab6b7c..59a6a763 100644 --- a/oxa/oxa-cli/tests/work_cli.rs +++ b/oxa/oxa-cli/tests/work_cli.rs @@ -97,6 +97,28 @@ fn run_server_records( extra: &[(&str, &str)], expect_output: bool, ) -> Vec { + let out = run_server(env, server, args, path, extra); + assert!( + !expect_output || !out.stdout.is_empty(), + "{}", + String::from_utf8_lossy(&out.stderr) + ); + String::from_utf8_lossy(&out.stdout) + .lines() + .map(|line| { + serde_json::from_str(line) + .unwrap_or_else(|e| panic!("{e}: {line} / {}", String::from_utf8_lossy(&out.stderr))) + }) + .collect() +} + +fn run_server( + env: &TestEnv, + server: &FakeServer, + args: &[&str], + path: Option, + extra: &[(&str, &str)], +) -> std::process::Output { let mut command = Command::new(env!("CARGO_BIN_EXE_oxa")); command .args(args) @@ -111,21 +133,8 @@ fn run_server_records( std::thread::spawn(move || { tx.send(command.output().unwrap()).unwrap(); }); - let out = rx - .recv_timeout(std::time::Duration::from_secs(90)) - .expect("runner finished"); - assert!( - !expect_output || !out.stdout.is_empty(), - "{}", - String::from_utf8_lossy(&out.stderr) - ); - String::from_utf8_lossy(&out.stdout) - .lines() - .map(|line| { - serde_json::from_str(line) - .unwrap_or_else(|e| panic!("{e}: {line} / {}", String::from_utf8_lossy(&out.stderr))) - }) - .collect() + rx.recv_timeout(std::time::Duration::from_secs(90)) + .expect("runner finished") } #[test] fn task_usage_reads_one_checkpoint_without_exposing_the_task_record() { @@ -193,10 +202,49 @@ fn clean_task_is_nothing_to_do() { #[test] fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { + native_refill_completion(NativeSource::Issue); +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum NativeSource { + Issue, + Reviewed, + MissingHead, + MismatchedPacket, + AdvancedBranch, +} + +#[test] +fn native_refill_executes_the_exact_reviewed_pull_request() { + native_refill_completion(NativeSource::Reviewed); +} + +#[test] +fn native_refill_refuses_unverified_pull_request_sources_before_model_use() { + for source in [ + NativeSource::MissingHead, + NativeSource::MismatchedPacket, + NativeSource::AdvancedBranch, + ] { + native_refill_completion(source); + } +} + +fn native_refill_completion(source: NativeSource) { use oxa_work::board::{assignment::ManualAuthority, AttemptState, Claims, ImportState}; use std::{collections::BTreeMap, fs, io::Write, os::unix::fs::PermissionsExt, process::Stdio}; let env = TestEnv::new(); setup(&env, r#"["printf checked > native-acceptance"]"#); + let project = env.work().join("project"); + let reviewed_head = (source != NativeSource::Issue).then(|| { + git(&env, &project, &["switch", "-c", "agent/44"]); + env.write("work/project/reviewed.txt", "reviewed fixture\n"); + git(&env, &project, &["add", "reviewed.txt"]); + git(&env, &project, &["commit", "-m", "reviewed fixture"]); + let head = git(&env, &project, &["rev-parse", "HEAD"]); + git(&env, &project, &["switch", "main"]); + head + }); let controls = env.agent_dir().join("native-controls"); let queue = controls.join("queue"); let root = controls.join("claims"); @@ -223,27 +271,55 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { ) .unwrap(); let taskfile = controls.join("task.txt"); - fs::write(&taskfile, "i44 fake agent/44 main\nSynthetic admitted task.\n").unwrap(); + let header = if reviewed_head.is_some() { + "c44 fake agent/44 agent/44" + } else { + "i44 fake agent/44 main" + }; + fs::write(&taskfile, format!("{header}\nSynthetic admitted task.\n")).unwrap(); fs::set_permissions(&taskfile, fs::Permissions::from_mode(0o600)).unwrap(); let config = controls.join("refill.json"); - fs::write(&config, serde_json::json!({ - "enabled":true,"host_id":"host-a","nativeExecution":true,"intake":true,"queue":queue,"claims":root, - "pause":controls.join("paused"),"log":controls.join("audit.jsonl"), - "worker":{"id":"oxa:node/helper","kind":"oxa","roles":["builder"],"skills":[]}, - "partition":{"modulus":22,"residues":[0]}, - "packets":[{"number":44,"revision":"revision","action":"build_issue","branch":"agent/44","taskfile":taskfile}] - }).to_string()).unwrap(); + fs::write( + &config, + serde_json::json!({ + "enabled":true,"host_id":"host-a","nativeExecution":true,"intake":true,"queue":queue,"claims":root, + "pause":controls.join("paused"),"log":controls.join("audit.jsonl"), + "worker":{"id":"oxa:node/helper","kind":"oxa","roles":["builder"],"skills":[]}, + "partition":{"modulus":22,"residues":[0]}, + "packets":[{"number":44,"revision":reviewed_head.as_deref().unwrap_or("revision"), + "action":if reviewed_head.is_some() { "resolve_conflict" } else { "build_issue" }, + "branch":"agent/44","taskfile":taskfile}] + }) + .to_string(), + ) + .unwrap(); fs::set_permissions(&config, fs::Permissions::from_mode(0o600)).unwrap(); let tools = trusted_tools(&env); let gh = tools.join("gh"); fs::write(&gh, "#!/bin/sh\n[ \"$GH_TOKEN\" = synthetic ] || exit 93\nprintf 'HTTP/2.0 200 OK\\r\\n\\r\\n'\ncat \"$0.reply\"\n").unwrap(); fs::set_permissions(&gh, fs::Permissions::from_mode(0o700)).unwrap(); + let rows: Vec<_> = reviewed_head + .as_ref() + .map(|head| { + serde_json::json!({"number":44,"headRefOid":head,"headRefName":"agent/44", + "closingIssuesReferences":{"totalCount":0,"nodes":[]}}) + }) + .into_iter() + .collect(); fs::write(tools.join("gh.reply"), serde_json::json!({"data":{"repository":{ - "mergeQueue":null,"pullRequests":{"totalCount":0,"nodes":[],"pageInfo":{"hasNextPage":false,"endCursor":"last"}}, - "i44":{"number":44,"state":"OPEN","updatedAt":"revision"},"b44":null + "mergeQueue":null,"pullRequests":{"totalCount":rows.len(),"nodes":rows, + "pageInfo":{"hasNextPage":false,"endCursor":"last"}}, + "i44":{"number":44,"state":"OPEN","updatedAt":"revision"},"b44":null, + "p44":{"number":44,"headRefOid":reviewed_head,"baseRefName":"main","state":"OPEN","body":"", + "isDraft":false,"reviewDecision":null,"mergeable":"CONFLICTING","mergeStateStatus":"DIRTY", + "baseRef":{"refUpdateRule":null,"rules":{"totalCount":0,"nodes":[]}}, + "labels":{"totalCount":0,"nodes":[]},"files":{"totalCount":0,"nodes":[]}, + "reviewThreads":{"totalCount":0,"nodes":[]},"latestOpinionatedReviews":{"totalCount":0,"nodes":[]}, + "commits":{"nodes":[{"commit":{"statusCheckRollup":null}}]}} }}}).to_string()).unwrap(); let path = format!("{}:{}", tools.display(), std::env::var("PATH").unwrap()); - let mut child = Command::new(env!("CARGO_BIN_EXE_oxa")) + let mut command = Command::new(env!("CARGO_BIN_EXE_oxa")); + command .current_dir(env.work().join("project")) .env_clear() .envs(env.envs("http://127.0.0.1:1")) @@ -261,16 +337,18 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { .arg(&config) .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .unwrap(); - child.stdin.take().unwrap().write_all(b"synthetic\n").unwrap(); - let published = child.wait_with_output().unwrap(); - assert!( - published.status.success(), - "{}", - String::from_utf8_lossy(&published.stderr) - ); + .stderr(Stdio::piped()); + let mut refill = || { + let mut child = command.spawn().unwrap(); + child.stdin.take().unwrap().write_all(b"synthetic\n").unwrap(); + let published = child.wait_with_output().unwrap(); + assert!( + published.status.success(), + "{}", + String::from_utf8_lossy(&published.stderr) + ); + }; + refill(); let binding = claims.assignments().unwrap()[&44] .data .native_binding @@ -279,8 +357,65 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { let name = format!("board-{}.txt", binding.key); assert!(queue.join(&name).is_file()); assert!(claims.snapshot().unwrap()[&44].lease.as_ref() == Some(&binding.lease)); + assert_eq!(binding.reviewed_head, reviewed_head); + let rows = claims.assignments().unwrap(); + assert_eq!(rows[&44].data.item_owner.as_ref().unwrap().host_id, "host-a"); + let refusal = match source { + NativeSource::MissingHead => { + // Exercise a legacy persisted receipt with no reviewed-source field. + let saved = root.join("44.board-claim.json"); + let mut row: serde_json::Value = serde_json::from_slice(&fs::read(&saved).unwrap()).unwrap(); + assert!(row["data"]["native_binding"] + .as_object_mut() + .unwrap() + .remove("reviewed_head") + .is_some()); + fs::write(saved, serde_json::to_vec(&row).unwrap()).unwrap(); + Some("retained reviewed head") + } + NativeSource::MismatchedPacket => { + fs::write( + queue.join(&name), + "c45 fake agent/44 agent/44\nMismatched PR source.\n", + ) + .unwrap(); + Some("bound source") + } + NativeSource::AdvancedBranch => { + git(&env, &project, &["switch", "agent/44"]); + git( + &env, + &project, + &["commit", "--allow-empty", "-m", "unreviewed fixture"], + ); + git(&env, &project, &["switch", "main"]); + Some("not at the reviewed head") + } + NativeSource::Issue | NativeSource::Reviewed => None, + }; let server = FakeServer::start(vec![ScriptTurn::text("finished")], FakeOpts::default()).unwrap(); let args = ["work", "--native-queue", "--config", config.to_str().unwrap()]; + if let Some(reason) = refusal { + let result = run_server(&env, &server, &args, Some(path), &[]); + assert!(!result.status.success(), "{source:?}: {result:?}"); + let detail = if source == NativeSource::AdvancedBranch { + let receipt = storage(&env).join(format!("{}.json", binding.native_task_id)); + let checkpoint: serde_json::Value = serde_json::from_slice(&fs::read(receipt).unwrap()).unwrap(); + checkpoint["record"]["detail"].as_str().unwrap().to_owned() + } else { + format!( + "{}{}", + String::from_utf8_lossy(&result.stderr), + String::from_utf8_lossy(&result.stdout) + ) + }; + assert!(detail.contains(reason), "{source:?}: {detail} / {result:?}"); + assert!(server.requests().is_empty(), "{source:?} reached the model"); + let state = &claims.assignments().unwrap()[&44].state; + assert!(state.lease.as_ref() == Some(&binding.lease)); + assert_eq!(state.attempts, 1); + return; + } let records = run_server_records(&env, &server, &args, Some(path.clone()), &[], true); assert!(records .iter() @@ -295,6 +430,15 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { assert_eq!(record["step"], "finished"); assert_eq!(record["checkpoint_kind"], "task_transition"); assert!(record["checkpoint_revision"].as_u64().unwrap() > 0); + if let Some(head) = reviewed_head { + assert_eq!(checkpoint["task"]["reviewed_pull_request"]["head"], head); + assert_eq!(checkpoint["task"]["reviewed_pull_request"]["number"], 44); + assert_eq!(checkpoint["execution"]["initial"], head); + assert_eq!( + fs::read_to_string(Path::new(record["worktree"].as_str().unwrap()).join("reviewed.txt")).unwrap(), + "reviewed fixture\n" + ); + } assert_eq!( fs::read_to_string(Path::new(record["worktree"].as_str().unwrap()).join("native-acceptance")) .unwrap(), @@ -318,7 +462,7 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { assert!(std::iter::once(requests[0].system.as_str()) .chain(requests[0].messages.iter().filter_map(|m| m.content.as_deref())) .any(|text| text.contains("Synthetic admitted task."))); - run_server_records(&env, &server, &args, Some(path), &[], false); + run_server_records(&env, &server, &args, Some(path.clone()), &[], false); assert_eq!( server.requests().len(), 1, @@ -328,6 +472,61 @@ fn native_refill_runs_one_bound_attempt_through_real_cli_completion() { assert_eq!(replayed.state.attempts, 1); assert!(replayed.state.lease.is_none()); assert!(replayed.data.native_binding.as_ref() == Some(&binding)); + + if source == NativeSource::Reviewed { + let first_receipt = storage(&env).join(format!("{}.json", binding.native_task_id)); + let first_bytes = fs::read(&first_receipt).unwrap(); + let previous = Path::new(record["worktree"].as_str().unwrap()); + git( + &env, + previous, + &["commit", "--allow-empty", "-m", "second reviewed round"], + ); + let reviewed = git(&env, previous, &["rev-parse", "HEAD"]); + let edit = |file: &Path, pointers: &[&str]| { + let mut value: serde_json::Value = serde_json::from_slice(&fs::read(file).unwrap()).unwrap(); + for pointer in pointers { + *value.pointer_mut(pointer).unwrap() = reviewed.clone().into(); + } + fs::write(file, serde_json::to_vec(&value).unwrap()).unwrap(); + }; + edit(&config, &["/packets/0/revision"]); + edit( + &tools.join("gh.reply"), + &[ + "/data/repository/pullRequests/nodes/0/headRefOid", + "/data/repository/p44/headRefOid", + ], + ); + refill(); + let next = claims.assignments().unwrap()[&44] + .data + .native_binding + .clone() + .unwrap(); + assert_ne!(next.native_task_id, binding.native_task_id); + assert_ne!(next.key, binding.key); + assert_ne!(next.lease.generation, binding.lease.generation); + assert_eq!(next.reviewed_head.as_deref(), Some(reviewed.as_str())); + let server = FakeServer::start(vec![ScriptTurn::text("finished")], FakeOpts::default()).unwrap(); + let result = run_server(&env, &server, &args, Some(path), &[]); + assert!(result.status.success(), "{result:?}"); + assert_eq!(server.requests().len(), 1); + let saved: serde_json::Value = serde_json::from_slice( + &fs::read(storage(&env).join(format!("{}.json", next.native_task_id))).unwrap(), + ) + .unwrap(); + assert_eq!(saved["execution"]["initial"], reviewed); + assert_eq!(saved["task"]["reviewed_pull_request"]["number"], 44); + assert_eq!(saved["task"]["reviewed_pull_request"]["head"], reviewed); + assert_eq!(saved["record"]["step"], "finished"); + assert_eq!(fs::read(first_receipt).unwrap(), first_bytes); + assert!(git(&env, previous, &["branch", "--show-current"]).is_empty()); + let row = &claims.assignments().unwrap()[&44]; + assert_eq!(row.state.attempts, 2); + assert!(row.state.lease.is_none()); + assert!(row.data.native_binding.as_ref() == Some(&next)); + } } #[test] fn failed_checks_get_exactly_one_retry() { diff --git a/oxa/oxa-work/src/github.rs b/oxa/oxa-work/src/github.rs index 393badb5..d3cd03e2 100644 --- a/oxa/oxa-work/src/github.rs +++ b/oxa/oxa-work/src/github.rs @@ -73,6 +73,10 @@ impl Task { } } +pub(crate) fn reviewed_base(repo: &Path, policy: &RunPolicy, head: &str) -> Result { + checked(git(policy, repo, &["merge-base", "refs/heads/main", head])) +} + pub fn pull_request_task( repo: &Path, gh: &Path, @@ -123,7 +127,7 @@ pub fn pull_request_task( } // Capture acceptance from the trusted local main lineage. The branch can // be behind main without changing the reviewed tree before the worker runs. - let base = checked(git(policy, repo, &["merge-base", "refs/heads/main", head]))?; + let base = reviewed_base(repo, policy, head)?; let mut prompt = github_runner_guidance("pull request"); prompt.push_str(&pull_request_prompt(number, head, pr)?); Ok(Task { diff --git a/oxa/oxa-work/src/helper_queue.rs b/oxa/oxa-work/src/helper_queue.rs index 43cf6b7a..2645ae81 100644 --- a/oxa/oxa-work/src/helper_queue.rs +++ b/oxa/oxa-work/src/helper_queue.rs @@ -134,11 +134,7 @@ pub fn publish_reserved( /// Take the admitted packet into the existing started directory. The native name /// keeps retries distinguishable from packets already started by another consumer. pub fn take_native_packet(queue: &Path, binding: &crate::board::NativeBinding) -> Result { - if crate::board::NativeBinding::new(binding.number, &binding.key, &binding.lease, &binding.branch)? - != *binding - { - return Err("invalid native queue binding".into()); - } + binding.validate()?; directory(queue)?; let started = queue.join("started"); directory(&started)?; diff --git a/oxa/oxa-work/src/lib.rs b/oxa/oxa-work/src/lib.rs index b1b4aa31..fcc7f1c6 100644 --- a/oxa/oxa-work/src/lib.rs +++ b/oxa/oxa-work/src/lib.rs @@ -168,23 +168,28 @@ fn plan_new_task(repo: &Path, task: Task, policy: &RunPolicy, native: bool) -> R if branch != task.branch { return Err("branch aliases are not allowed; provide a literal branch name".into()); } - let base_sha = checked(git( - policy, - repo, - &["rev-parse", "--verify", &format!("{}^{{commit}}", task.base)], - ))?; + let (base_sha, base_alias) = if let Some(head) = task.reviewed_head().filter(|_| native) { + (github::reviewed_base(repo, policy, head)?, None) + } else { + let base_sha = checked(git( + policy, + repo, + &["rev-parse", "--verify", &format!("{}^{{commit}}", task.base)], + ))?; + let base_ref = checked(git( + policy, + repo, + &["rev-parse", "--symbolic-full-name", &task.base], + ))?; + if base_ref == format!("refs/heads/{}", task.branch) + || base_ref == format!("refs/remotes/origin/{}", task.branch) + { + return Err("task branch must differ from its base branch".into()); + } + let alias = tree::base_alias(policy, repo, &task.base, &base_sha)?; + (base_sha, alias) + }; let commands = done_commands(policy, repo, &base_sha)?; - let base_ref = checked(git( - policy, - repo, - &["rev-parse", "--symbolic-full-name", &task.base], - ))?; - let local_branch = base_ref == format!("refs/heads/{}", task.branch); - let remote_branch = base_ref == format!("refs/remotes/origin/{}", task.branch); - if (local_branch && !native) || remote_branch { - return Err("task branch must differ from its base branch".into()); - } - let base_alias = tree::base_alias(policy, repo, &task.base, &base_sha)?; Ok(PlannedTask { task, base_sha, diff --git a/oxa/oxa-work/src/queue/native.rs b/oxa/oxa-work/src/queue/native.rs index 547d5466..d008744c 100644 --- a/oxa/oxa-work/src/queue/native.rs +++ b/oxa/oxa-work/src/queue/native.rs @@ -1,5 +1,7 @@ //! The native queue consumes the original claim receipt and settles after joining the worker. -use super::super::{board, load_task_checkpoint, validate, CheckpointKind, LockedTask, Outcome, Step}; +use super::super::{ + board, load_task_checkpoint, validate, CheckpointKind, LockedTask, Outcome, ReviewedPullRequest, Step, +}; use super::{Record, Result, RunPolicy, Task}; /// Supplied by the trusted queue caller after authenticating its worker. @@ -10,11 +12,15 @@ pub struct NativeQueueOwner<'a> { /// Materialize a prepared task with the canonical attempt identity and existing branch. pub fn native_task(binding: &board::NativeBinding, mut task: Task) -> Result { - let canonical = board::NativeBinding::new(binding.number, &binding.key, &binding.lease, &binding.branch)?; - if binding != &canonical || task.branch != binding.branch { + binding.validate()?; + if task.branch != binding.branch { return Err("prepared task does not own the bound native attempt".into()); } task.id.clone_from(&binding.native_task_id); + task.reviewed_pull_request = binding.reviewed_head.as_ref().map(|head| ReviewedPullRequest { + number: binding.number, + head: head.clone(), + }); if !task.runner_owns_github() { let kind = if task.base == task.branch { "pull request" @@ -46,6 +52,9 @@ pub(super) fn from_packet(binding: &board::NativeBinding, packet: &str) -> Resul { return Err("native task packet disagrees with its bound source".into()); } + if change != binding.reviewed_head.is_some() { + return Err("native packet kind disagrees with its retained reviewed head".into()); + } native_task( binding, Task { @@ -69,6 +78,13 @@ impl NativeQueueOwner<'_> { if self.worker_id != binding.lease.holder || !task.runner_owns_github() { return Err("native task lacks the authenticated worker or runner-owned GitHub policy".into()); } + let reviewed = binding + .reviewed_head + .as_deref() + .map(|head| (binding.number, head)); + if task.reviewed_source() != reviewed { + return Err("native task reviewed source disagrees with the original admission".into()); + } let assignment = self.claims.assignments()?; if !assignment.get(&binding.number).is_some_and(|row| { row.state.lease.as_ref() == Some(&binding.lease) @@ -156,7 +172,7 @@ mod tests { Arc, }; - fn setup() -> (PrivateDir, Claims, board::NativeBinding, Task, RunPolicy) { + fn setup(reviewed: Option<&str>) -> (PrivateDir, Claims, board::NativeBinding, Task, RunPolicy) { let directory = PrivateDir::new("native-completion"); let claims = Claims::open(directory.path()).unwrap(); claims @@ -200,7 +216,13 @@ mod tests { ) .unwrap() .unwrap(); - let binding = board::NativeBinding::new(1, &"a".repeat(64), &lease, "agent/fixture").unwrap(); + let key = "a".repeat(64); + let branch = "agent/fixture"; + let binding = match reviewed { + Some(head) => board::NativeBinding::new_reviewed(1, &key, &lease, branch, head), + None => board::NativeBinding::new(1, &key, &lease, branch), + } + .unwrap(); assert!(claims.bind_native(&worker.id, &binding).unwrap()); let prepared = Task { id: "c1".into(), @@ -222,12 +244,50 @@ mod tests { (directory, claims, binding, prepared, policy) } + #[test] + fn change_packet_without_a_reviewed_head_is_refused() { + let (_directory, _claims, binding, prepared, _policy) = setup(None); + let packet = format!( + "c{} {} {} {}\nSynthetic change packet.\n", + binding.number, prepared.model, binding.branch, binding.branch, + ); + let error = match from_packet(&binding, &packet) { + Err(error) => error, + Ok(_) => panic!("change packet was admitted without an authoritative reviewed head"), + }; + assert!(error.contains("reviewed head"), "{error}"); + } + + #[test] + fn retained_reviewed_binding_fences_common_admission() { + let head = "b".repeat(40); + let (_directory, claims, binding, prepared, _policy) = setup(Some(&head)); + let packet = format!( + "c{} {} {} {}\nSynthetic change packet.\n", + binding.number, prepared.model, binding.branch, binding.branch, + ); + let task = from_packet(&binding, &packet).unwrap(); + assert_eq!(task.id, binding.native_task_id); + assert_eq!(task.reviewed_source(), Some((binding.number, head.as_str()))); + let owner = NativeQueueOwner { + claims: &claims, + worker_id: &binding.lease.holder, + }; + assert!(owner.admit(&task).unwrap() == binding); + + let mut different = task.clone(); + different.reviewed_pull_request.as_mut().unwrap().head = "c".repeat(40); + assert!(owner.admit(&different).is_err()); + different.reviewed_pull_request = None; + assert!(owner.admit(&different).is_err()); + } + #[test] fn only_the_exact_durable_whole_task_after_lock_release_settles_the_original_claim() { if crate::lock_process::in_parent() { return; } - let (_directory, claims, binding, prepared, policy) = setup(); + let (_directory, claims, binding, prepared, policy) = setup(None); let owner = NativeQueueOwner { claims: &claims, worker_id: &binding.lease.holder, @@ -279,7 +339,7 @@ mod tests { if crate::lock_process::in_parent() { return; } - let (directory, claims, binding, prepared, policy) = setup(); + let (directory, claims, binding, prepared, policy) = setup(None); let owner = NativeQueueOwner { claims: &claims, worker_id: &binding.lease.holder,