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
8 changes: 5 additions & 3 deletions src/flightdeck/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ def diff_releases(
candidate_rollup = compute_rollup(candidate_events, candidate_pricing_table)

# Confidence (policy can override thresholds; otherwise take config defaults)
min_candidate_runs = policy.min_candidate_runs or cfg.diff.min_candidate_runs
min_baseline_runs = policy.min_baseline_runs or cfg.diff.min_baseline_runs
min_low_runs = policy.min_low_runs or cfg.diff.min_low_runs
min_candidate_runs = (
policy.min_candidate_runs if policy.min_candidate_runs is not None else cfg.diff.min_candidate_runs
)
min_baseline_runs = policy.min_baseline_runs if policy.min_baseline_runs is not None else cfg.diff.min_baseline_runs
min_low_runs = policy.min_low_runs if policy.min_low_runs is not None else cfg.diff.min_low_runs

label = confidence_label(
baseline_rollup.runs,
Expand Down
24 changes: 24 additions & 0 deletions tests/test_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,27 @@ def test_diff_releases_rejects_mixed_agents_within_side() -> None:
candidate_pricing_table=table,
window="7d",
)


def test_diff_releases_respects_zero_policy_sample_thresholds() -> None:
cfg = WorkspaceConfig()
policy = Policy(
min_baseline_runs=0,
min_candidate_runs=0,
min_low_runs=0,
require_high_diff_confidence=True,
)
table = _pricing_table()

result = diff_releases(
cfg=cfg,
policy=policy,
baseline_events=[],
candidate_events=[],
baseline_pricing_table=table,
candidate_pricing_table=table,
window="7d",
)

assert result.confidence == "HIGH"
assert result.policy.passed
Loading