abc_mine.stages.screen¶
WARNING
This documentation is almost entirely "vibe coded"; while a helpful resource for humans and agents to understand this codebase, it should not be considered a source of ground truth in the way documentation normally is, and the user is responsible for verifying that all instructions given here are safe.
abc_mine.stages.screen
¶
SCREEN — score every selected commit against the rubric, in parallel.
One fresh agent per commit. Each reads the commit's diff, message, and surrounding source, then emits per-axis scores plus prose. The total score and the disqualification decision are computed here in Python, never by the model, so scoring stays deterministic and a run can be re-weighted afterwards without re-invoking a single agent.
Durable artifact and resume
The stage's source of truth is one file per commit:
<run>/screen/summaries/<short-sha>.json. Resume is simply "skip commits that
already have one". That choice has two properties worth naming:
- It is backend-independent — a run started serially can be resumed under MPI, because progress lives in files a human can read rather than in a pool's internal bookkeeping.
- It is all-or-nothing per commit. A commit either has a complete summary or has nothing. There is no partial state to reason about, and no way for a half-finished judgement to leak into ranking.
Failures are recorded separately, in an append-only attempts.jsonl. This closes
a real gap in the predecessor pipeline, where a failed screen wrote nothing at all:
"never attempted" and "failed six times" were indistinguishable, retries were
unbounded across resumes, and the transcripts had already been deleted. Here
failures are counted (so max_attempts can be enforced) and, under the default
retention policy, their transcripts are kept.
ScreenPlan
dataclass
¶
What a screen invocation intends to do.
Separating the plan from execution lets the CLI show a meaningful --plan
without starting any container, and lets every MPI rank compute an identical
work list from read-only state.
Source code in abc_mine/stages/screen.py
describe
¶
Render a human-readable plan.
Source code in abc_mine/stages/screen.py
summaries_dir
¶
summaries_dir(cfg: MineConfig) -> Path
summary_path
¶
summary_path(cfg: MineConfig, sha: str) -> Path
attempts_path
¶
attempts_path(cfg: MineConfig) -> Path
completed
¶
completed(cfg: MineConfig) -> set[str]
load_summaries
¶
load_summaries(cfg: MineConfig) -> list[dict[str, Any]]
Load every summary written for this run, sorted by score descending.
Unreadable files are skipped rather than fatal: one corrupt summary (a job killed mid-write, say) should not block ranking over hundreds of good ones.
Source code in abc_mine/stages/screen.py
plan
¶
plan(cfg: MineConfig, *, only: Sequence[str] = ()) -> ScreenPlan
Compute the work list. Read-only, and identical on every rank.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
only
|
sequence of str
|
Restrict to these SHAs (prefix-matched), for targeted debugging. |
()
|
Source code in abc_mine/stages/screen.py
make_worker
¶
make_worker(cfg: MineConfig, pack: PromptPack, model: dict[str, str], *, dry_run: bool = False) -> Callable[[Commit], ItemResult]
Build the per-commit worker callable.
Returned as a closure so the same function serves all three parallel backends and can be exercised directly in a test without any pool.
Source code in abc_mine/stages/screen.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
run
¶
run(cfg: MineConfig, pack: PromptPack, model: dict[str, str], *, dry_run: bool = False, only: Sequence[str] = (), progress: bool = True) -> BatchOutcome
Execute the screen stage.
Returns the batch outcome; on MPI worker ranks this is empty and
is_primary is False, so callers must not report from it.
Source code in abc_mine/stages/screen.py
summarize
¶
summarize(cfg: MineConfig) -> dict[str, Any]
Return aggregate statistics over this run's summaries.
Reads from disk rather than from a batch outcome so it reflects the whole run, including items screened in earlier allocations.