abc_mine.preflight¶
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.preflight
¶
Preflight: prove the container can actually build and test the codebase.
Why this stage exists
The entire value of this tool rests on a precondition that "provide a git repo and a container" does not capture: the container must be able to verify a change in that repository deterministically, ideally via a targeted test. If it cannot, the workflow still runs — it just produces garbage. Screening mass-disqualifies commits, ranking selects from what is left, and construction authors verifiers that cannot work. You would discover this only after spending real money on a great many agent runs.
Preflight makes that failure cheap and immediate. It runs, in the real container against the real repository at HEAD:
- a sanity probe — is the source tree actually visible at the mount point?
- configure, if configured;
- build, timed;
- test_one with a known-matching selector, timed — the single most important check, because targeted verification is what makes emitted benchmarks affordable to grade;
- optionally the full test suite, timed, only when explicitly asked (it can be very slow, and nothing downstream depends on it).
Measured, not asserted
The timings are the point as much as the pass/fail is. The original pipeline hard-coded "a full build takes ~30+ minutes" into its screening prompt, which was wrong by roughly an order of magnitude; the mistake was discovered late and patched by adding a paragraph to the ranking prompt explaining that screening's cost scores were systematically too harsh. Both stages were then reasoning from different numbers, and every screening score already on disk was biased.
Here the numbers come from a real timed run and are written back into the config
with --write-config, after which every stage quotes the same measured figure.
A guessed constant in a prompt is a bug; a measurement is a fact.
Step
dataclass
¶
One preflight step and its outcome.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Step identifier ( |
command |
str
|
The command run, as rendered. |
status |
str
|
|
seconds |
float
|
Wall-clock duration. |
returncode |
int or None
|
Exit status, where applicable. |
detail |
str
|
Explanation for a non- |
log_file |
Path or None
|
Captured output. |
Source code in abc_mine/preflight.py
PreflightResult
dataclass
¶
The full outcome of a preflight run.
Source code in abc_mine/preflight.py
to_dict
¶
Serialize for the run manifest / preflight.json.
Source code in abc_mine/preflight.py
describe
¶
Render a human-readable report.
Source code in abc_mine/preflight.py
check_config
¶
check_config(cfg: MineConfig) -> list[str]
Return static problems with the toolchain, without running anything.
Cheap checks that catch the common mistakes before a container is ever
started. The test_one warning is the important one: a toolchain that can
build but cannot select a single test yields benchmarks whose verifiers must
run everything, which is precisely the expensive regime the rubric is designed
to avoid.
Source code in abc_mine/preflight.py
run
¶
run(cfg: MineConfig, *, dry_run: bool = False, include_full_test: bool = False, log_dir: Path | None = None) -> PreflightResult
Execute preflight against the repository at HEAD.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
MineConfig
|
The run configuration. |
required |
dry_run
|
bool
|
Print the container commands without executing them. |
False
|
include_full_test
|
bool
|
Also time the full test suite. Off by default: it can take hours, and no downstream stage needs the number. |
False
|
log_dir
|
Path
|
Where to write per-step logs. Defaults to |
None
|
Notes
Runs against a throwaway worktree at HEAD, never the user's checkout, so a build cannot leave artifacts in, or otherwise disturb, the source of truth for every later stage.
Source code in abc_mine/preflight.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 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 | |
write_measurements
¶
write_measurements(cfg: MineConfig, result: PreflightResult) -> Path
Write measured timings back into the run's config file.
Rewrites only the toolchain timing keys, textually, preserving comments
and formatting elsewhere. Editing in place is deliberate: the measurement must
become the value every stage reads, otherwise it is just a number in a log and
the prompts keep quoting nothing.
Raises:
| Type | Description |
|---|---|
ConfigError
|
If the config file location is unknown or unwritable. |
Source code in abc_mine/preflight.py
save_report
¶
save_report(cfg: MineConfig, result: PreflightResult) -> Path
Write preflight.json into the run directory and return its path.
Source code in abc_mine/preflight.py
load_report
¶
load_report(cfg: MineConfig) -> dict[str, Any] | None
Load a previous preflight.json, or None if absent/unreadable.