idle-draft: add sample_override config flag to bypass cold-start throttle

Optional config key (default false). When true, research candidates are
offered even at max_unreviewed_research_per_dossier; research_sampled
bookkeeping, mark sampled, and status flags are unchanged so unsampled
items stay visible for later human verification.

Claude-Session: https://claude.ai/code/session_01Lgv4Qn82boNFC1jn8QXSNw
This commit is contained in:
Paul O'Reilly
2026-08-03 07:26:41 +12:00
parent 29618f4319
commit bdd10cbbc1
3 changed files with 21 additions and 1 deletions

View File

@@ -570,6 +570,17 @@ draft_candidates = [c["slug"] for c in tqueue if c["work_type"] == "draft"]
check("cold-start throttle: draft candidates for 01/02 unaffected by the research throttle",
set(draft_candidates) == {"01-a", "02-b"}, draft_candidates)
# sample_override: throttle bypassed, sampling state untouched
override_config = dict(throttle_config)
override_config["sample_override"] = True
oqueue = m.build_ready_queue(throttle_repo, override_config, throttle_state, set())
override_research = [c["slug"] for c in oqueue if c["work_type"] == "research"]
check("sample_override: item 03's research is offered despite the dossier being at the cap",
"03-c" in override_research, override_research)
check("sample_override: research_sampled state is not mutated by queue building",
not any(m.get_item_state(throttle_state, f"ai/{s}")["research_sampled"]
for s in ("01-a", "02-b", "03-c")), throttle_state)
# topic_ideas: only offered when nothing else is eligible
idle_repo = tmpdir / "idle-repo"
(idle_repo / "ai").mkdir(parents=True, exist_ok=True)