feat(scheduler): record build identity and reservations in the observation log #749
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 399 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #749"
general
weight: 0.35
jbellis
mbx's scheduler observation log (#746) records one line per finished compile, link, and test run. Replaying it to compare admission policies showed two gaps. The log has no build identity, so per-build limits cannot be modelled. And
mbx reservewrites no observation, so capacity held by reserved external commands, such as test runs that wrap a whole build, is invisible. In a replay of 3,333 real admissions, the modelled baseline accounted for only 57% of the waiting actually recorded. These were the two main missing inputs.This change fills both gaps:
build_id,build_capacity(that build's permit ceiling), anddomain_capacity, when the scheduler knows them. All three are optional and omitted when unset. The line version stays 1, so older readers and older lines keep working.mbx reservereservation ends, mbx appends an observation with kindreservation. It records:- the reserved permits;
- the bytes per permit;
- the admission wait and run times;
- the external command's outcome, or
unknownif it could not start.A reservation has no measured peak, so
mbx stats --schedulercounts reservations under their ownreservationkey and never treats them as exceeding a reservation.Both follow the existing gates. Nothing is written when
events = falseor when memory weighting is off.Validation: the scheduler and reserve tests pass. They cover:
eventsgate;cargo clippy -p mbx --all-targets --all-features -- -D warningsandcargo fmt --checkpass. The full library suite passed 979 tests and failed 3, all in tests this change does not touch. One is the renderer testmascot_keeps_progress_readable_and_leaves_successful_builds. The other two arematerializefilesystem-timestamp tests:a_restore_stamp_is_never_ahead_of_a_write_that_follows_itanda_filesystem_without_clones_links_the_object_instead_of_copying_it. They ran on a heavily loaded host, and they fail intermittently there. The fullmise run cigate was not run locally.AI-assisted — Tool: Claude Code; model: Anthropic/claude-opus-5-5; version: 2.1.302.
AI-assisted — Tool: Codex; model: OpenAI/gpt-6-luna; version: unavailable.
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Reservation activity is now included in scheduling observations, with reservation weight, wait and run times, and command outcome.
Scheduling observations can include build identity and applicable build and domain capacity details. Older observation records remain compatible.
Bug Fixes
Reservation requests that lack required resources, or request memory when memory scheduling is unavailable, now return an error.
Documentation
* Updated scheduling guidance to describe the additional reservation observation details.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->