Repository navigation
AirOpsEnv v4: realism layers, crews legal on schedule and a playable day - #2
Open
agutmanstein-scale wants to merge 6 commits into
Open
agutmanstein-scale wants to merge 6 commits into
agutmanstein-scale wants to merge 6 commits into
Conversation
main's push runs have been cancelled at the 20-minute limit since 0.3.2's tests landed (five in a row from 2026-10-20 08:03Z), with no test failing; a passing leg takes 15-19 minutes, so whether a run finishes was down to the runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v3 (fork PRs #1-#12, tag v3.0) replayed onto Edgar's main at 0ac85d2 as one commit: his sim.execute became the Dispatch state machine with crew pools, and every v3 code unit edited the same dispatch loop. - sim: departure caps, ramp closures, outstation arrival caps, reserve grants and the desk's view of them move into Dispatch; pinned flights count in the layers' rows at the start and again after `switch`. - mip: v3's rows and reserve columns beside Edgar's flat pricing (a reserve- backed auto-cancel prices flat too under `flat`). - network: v3's bases and layers beside the 04:00 start and MIN_CONTROLLED. - v3_pack: a date the build's rules leave out is kept on --resume; only an error is rebuilt. - flow.sources imports PIL only where it reads radar, so the layers (and the occ CLI through them) import on a clean install. - tests: from 04:00 the slice date has several JFK closures and Edgar's crew model times out one leg; the pack test takes four winter months, as v2's split trains only events without an eval date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Cut v4's crew pairings legal on schedule (layers/crew.py) Edgar's proxy pairings run a tail's chain from a base departure to the next base arrival with no duty limit, so long outstation chains break FAR 117 on schedule. layers/crew.py starts a duty at a tail's first leg, a base departure or after a REST-long gap, and takes the next leg only while the duty ends `buffer` inside its Table B limit with at most `max_segments` legs; the Crew records are Edgar's, so the sim, the MIP and the references are unchanged. network.build, build_all and candidates.build_candidate take a crew Rule (Edgar's by default). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fit v4's crew cut on a train sample under DESIGN §0's guards calibrate.crew_fit scores every buffer x max_segments cut on a seeded sample of at most 12 train dates (anchor and calm day at 600 s) and takes the one with the largest do-nothing median excess over the anchor whose calm-day, recorded-day and cancellation guards hold; the rates and the pools split into calibrate.rates and calibrate.pooled_fit around it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Give v3_pack --crew v4 with --buffer and --max-segments --crew v4 (with --bases) cuts pairings legal on schedule; a buffer or segment cap left out is fitted on the train sample, every date then built again at the fit into DIR/built-v4-B-S/. The manifest records the crew mode, its constants and its fit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Read the crew fit's calm-day guard against the no-crew build v2's and v3's own calm days pass the absolute <= 1 and <= 2 on only 80.6% of the 129-date pack, so no crew cut could reach 90%. The guard now asks that a cut force no more calm-day cancellations or ferries than the same date built without crews, on every sample date. Scores are kept under DIR/crew-fit/ by task signature, so a rerun solves only what changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Check v4's guards on a crew pack, the calm day against v3's v3_check gains --v3 DIR and, on a pack with crew bases, DESIGN §0's guards as criteria: recorded day >= anchor on >= 95% of dates, anchor cancellations <= JetBlue's, calm day no worse than the no-crew pack's on every date, replay within-15 share within 1 point of v2's. DESIGN §0 reads the calm-day guard relative to v3, and §1 says max_segments has no effect in practice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Record V4-1's fit in DESIGN §1's note on max_segments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Edgar's v0.5.0 ships its own v3 (airops-occ3 on the b6-v3 pack), so the realism layers and the crew ship as one v4: the env airops-v4-day, the v4day package and scripts/v4_pack.py and v4_check.py. docs/v4/DESIGN.md is the layers design and docs/v4/CREW.md the crew design; v3's report goes, as the v4 check writes docs/v4/REPORT.md. Edgar's v3 is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
world_check's calm-day bar, <= 1 forced cancellation and <= 2 ferries, was set for hub windows of 60 to 190 flights. On whole days of about 690, v2, the layers and the crew all miss it (0.81, 0.81 and 0.79 of dates), while JetBlue itself has <= 1 carrier cancellation on only 69% of its fair days. layers.fairday measures the bar from the pack's BTS months: a fair day has no weather (B) or NAS (C) cancellation among a whole-network task's flights, and the bar is the 90th percentile of its carrier (A) cancellations' share of the day's flights (0.92% over the 19 months, 315 fair days of 578). A calm day is within it when it forces at most max(1, floor(rate x flights)) cancellations and at most 2 ferries; the whole-day v2, layers and crew packs are within it on 0.968 of dates. - v4_pack writes the bar to the manifest as `calm` and builds with crews at JetBlue's bases by default; `--bases none` builds the no-crew pack. - The crew fit's calm guard: every sampled date whose no-crew calm day is within the bar stays within it with the crew (was: no more cancellations and ferries than without crews, on every date). - v4_check's calm_day gate and the crew's guard_calm_vs_nocrew (`--nocrew`, was `--v3`) read the bar from the manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agutmanstein-scale
force-pushed
the
v3/for-edgar
branch
from
October 23, 2026 15:53
6b21cc8 to
fa67806
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AirOpsEnv v4, beside Edgar's v3 (
airops-occ3onb6-v3, untouched): v2's programs world with realism layers, crews legal on schedule, the desk's view of both and a playable live day. A task without layers is v2's, byte for byte; one with any is written as model version 4.What a v4 task adds to v2's
CAP_LOOKahead, a closure once it has begun, advisories, METARs, SPECIs and TAFs at their delivery lags; watches also wake on eventsEach layer is enforced alike in the sim's
Dispatchand inmip.Network, so every anchor still replays exactly.Why
The probe found v2's world too easy and too loose for the task to test a desk: 64% of JetBlue's cancellations on the candidate days could have flown in hindsight, doing nothing costs +8.9% over the optimum at the median, and the optimum cancels 26% of what JetBlue did (docs/v4/DESIGN.md §0). v4 adds the constraints the programs leave out, held to guards that keep a day no stricter than JetBlue's own (docs/v4/CREW.md §0).
The calm-day bar
world_check's calm day (the day with no delays and no programs) had to force <= 1 cancellation and <= 2 ferries. That bar was set for hub windows of 60 to 190 flights; whole days have about 690, and JetBlue itself has <= 1 carrier cancellation on only 69% of its fair days. v4 holds the calm day to JetBlue's fair weather instead (
layers.fairday): at most max(1, floor(0.92% x flights)) forced cancellations and 2 ferries, 0.92% being the 90th percentile of JetBlue's carrier (code A) cancellations' share of the day's flights over the 315 of 578 days with no weather or NAS cancellation.On the whole-day packs (94 storm dates), the calm days within the bar:
The same three dates are out in all three, so none is the crew's. The crew's calm guard is now that a date within the bar without crews stays within it with them.
Where §0 stands
The last check on whole days (v2 0.3.2, crew cut fixed at buffer 0 and 3 legs) passed soundness and the guards (the calm one under the new bar), but the days are not yet hard enough: do-nothing's median excess over the anchor is 14.1% (1.27x v2's; target 1.4x) and the follower's 4.00% (1.29x; target 1.5x). world_check's airline-replay gate (0.883) and eval-JFK fidelity (0.775) fail too. The pack is being rebuilt on this branch, with the crew's cut fitted on whole days under the new bar. Its check will land in docs/v4/REPORT.md, and #3 will publish the pack as the
airops-v4bundle onb6-v4.In the diff
programs/layers/: depcaps, closures, arrcaps, weather, crew, config, calibrate, fairday. AlsoLayersonTask, and the layers insim,mip,references,networkandprobe.v4day/and the live serverairops-v4-day.scripts/v4_pack.py: crews at JetBlue's bases by default,--bases nonefor the no-crew pack.scripts/v4_check.py: §0 against v2 (and against the no-crew pack with--nocrew), plus world_check's gates.docs/v4/DESIGN.md,docs/v4/CREW.md.main's push runs were being cancelled at 20 with no test failing.Test plan
pyteston this branch: 1356 passed, 12 skipped (the network, browser and docker tests deselected, as configured).ruff check .is clean.Security impact
None: public inputs only (BTS, FAA, IEM), pinned by sha256, and no credentials.
🤖 Generated with Claude Code