Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "postil-cli"
version = "0.8.25"
version = "0.8.26"
edition = "2024"
description = "Postil: a low-noise AI review gate. Silent on clean PRs, hard gate on real risk."
license = "Apache-2.0"
Expand Down
14 changes: 14 additions & 0 deletions src/llm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6826,6 +6826,20 @@ mod tests {
"more operations must divide the phase further, not less"
);

// Batches run concurrently, so a four-batch review is one wave and its
// slot is the one-operation slot, not a quarter of it. Running them one
// at a time is what put each batch under a slot the review model's tail
// latency does not fit.
let concurrent = build();
concurrent
.ensure_hosted_review_schedule(&config, 4, false, 4)
.expect("four batches at concurrency four must schedule");
assert_eq!(
concurrent.scheduled_review_model_slot(),
Some(single_slot),
"one wave of four batches must get the same slot as one batch"
);

// The slot only matters if the operation actually runs under it, so
// check the deadline the review path builds, not just the derivation.
let operation = single.for_review_model_operation();
Expand Down
21 changes: 11 additions & 10 deletions src/review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1802,11 +1802,13 @@ async fn review_diff_at(
.any(|id| !candidates.mandatory_ids.contains(id)))
.then_some((candidates.manifest.as_str(), remaining))
});
let admitted_concurrency = if deterministic_large_review {
large_diff_batch_concurrency(cfg)
} else {
1
};
// Batch requests carry their own prompts and are collected by
// index, so nothing orders them. `max_hosted_review_batches`
// already prices capacity at this concurrency; running them
// one at a time instead divides the phase by the batch count
// and puts each batch under a slot the review model's tail
// latency does not fit.
let admitted_concurrency = large_diff_batch_concurrency(cfg);
let scorer_system = prompt::scorer_system_prompt(cfg, current_utc_date);
let admission = client.preflight_review_plan_with_output_limits(
cfg,
Expand Down Expand Up @@ -1996,11 +1998,10 @@ async fn review_diff_at(
));
request_index += 1;
}
let concurrency = if deterministic_large_review {
large_diff_batch_concurrency(cfg)
} else {
1
};
// Must match the concurrency admission priced the schedule at,
// or the phase is divided into a different number of waves than
// the plan was checked against.
let concurrency = large_diff_batch_concurrency(cfg);
let scorer_batch_evidence_budget = (MAX_SCORER_EVIDENCE_CORPUS_BYTES
/ total_requests.max(1))
.min(MAX_SCORER_BATCH_EVIDENCE_BYTES);
Expand Down