agent-bios 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1935,7 +1935,7 @@ class Supervisor:
1935
1935
  run, _digest, _amendments = records.declaration_state(self.run_dir, who="dispatch")
1936
1936
  held = gate.seats(self.seats_path)
1937
1937
  declared = {v for k, v in run["seats"].items() if k == stage or k.startswith(f"{stage}.")}
1938
- if seat not in declared | set(held.get("stage_seats", {}).get(stage, [])):
1938
+ if seat not in declared | set(gate.stage_seats(held).get(stage, [])):
1939
1939
  raise Refused(f"SEAT_UNPINNED {call_id}: {seat} is neither declared in run.json nor pinned in seats.json for {stage}")
1940
1940
  # what the driver sends, counted by the rule's owner over everything this call SENDS: the packet
1941
1941
  # (its template, principles block and window payload are one object by now), the schema, and what
@@ -3799,7 +3799,7 @@ def self_test(scratch=None):
3799
3799
  # file the admission reads, never copied, so re-measuring preflight cannot leave this test behind. The
3800
3800
  # seat and the Claude host version are read from it too, so a re-pin moves this suite with it.
3801
3801
  vstage = "S3"
3802
- vseat, pinned_claude = gate.seats()["stage_seats"][vstage][0], gate.seats()["hosts"]["claude"]["version"]
3802
+ vseat, pinned_claude = gate.stage_seats()[vstage][0], gate.seats()["hosts"]["claude"]["version"]
3803
3803
  claude_flags = gate.pinned_flags_sha256("claude", pinned_claude, "hermetic")
3804
3804
  claude_allowance = gate.seats()["hosts"]["claude"]["host_allowance"]["hermetic"]["allowance_tokens"]
3805
3805
 
@@ -5140,23 +5140,24 @@ def self_test(scratch=None):
5140
5140
  control("call-reserved-before-the-run-stopped-dispatches-nothing", (got or "").startswith("RUN_STOPPED INPUT_BOUND_EXCEEDED")
5141
5141
  and launches == before and not (dv / "calls" / later["call_id"]).exists(), f"{got} {launches[len(before):]}")
5142
5142
 
5143
- # seats are pinned per stage (design §4 in seats.json, or run.json); a view-window call needs its measured allowance
5144
- design_4 = { # design §4's stage table, "Seat (default)" column, copied by hand
5145
- "S3": ["claude:claude-sonnet-5-5/high"], "S4": ["claude:claude-opus-5-5/high"],
5146
- "S6": ["claude:claude-opus-5-5/high", "codex:gpt-6-astra/xhigh", "claude:claude-sonnet-5-5/medium", "codex:gpt-6-luna/medium"],
5147
- "S7": ["claude:claude-opus-5-5/high"], "S7b": ["codex:gpt-6-astra/xhigh"], "S9b": ["codex:gpt-6-astra/high"]}
5148
- # the owner's departures from that table, each named with its date: approving the C3 run (2026-11-12) the owner
5149
- # seated gpt-6.1-sol as S6's Judge B in place of gpt-6-astra, and on 2026-11-13 seated the same model for S7b and
5150
- # S9b; on 2026-11-24 the three moved to gpt-6.2-sol with the launch profile (D-20261124-ebb701). A seat that
5151
- # differs from §4 and is not listed here fails.
5152
- owner_departures = {("S6", 1): "codex:gpt-6.2-sol/xhigh", ("S7b", 0): "codex:gpt-6.2-sol/xhigh",
5153
- ("S9b", 0): "codex:gpt-6.2-sol/high"}
5154
- expected_seats = {stage: [owner_departures.get((stage, n), seat) for n, seat in enumerate(row)] for stage, row in design_4.items()}
5155
- pinned = {k: v for k, v in gate.seats().get("stage_seats", {}).items() if not k.startswith("$")}
5156
- control("stage-seats-are-design-section-4", pinned == expected_seats, f"{pinned}")
5157
- control("and-an-owner-departure-replaces-a-seat-the-design-names",
5158
- all(design_4[stage][n] != seat for (stage, n), seat in owner_departures.items()) and expected_seats != design_4,
5159
- f"{owner_departures}")
5143
+ # seats are pinned per stage through seats.json's launch-profile tiers (or declared in run.json); a view-window call
5144
+ # needs its measured allowance. The owner's table of 2026-11-29 (D-20261129-946698), copied by hand: each stage on
5145
+ # the tier its work matches, each cross review on the same tier of the other host, S9b's per-row check on WORKHORSE,
5146
+ # and no SWEEP seat. Until then the seats were model names, design §4 and the owner's departures from it.
5147
+ import tomllib
5148
+ owner_tiers = {"S3": "claude:workhorse", "S4": "claude:helm", "S6.A": "claude:helm", "S6.B": "codex:helm",
5149
+ "S6.sweep_a": "claude:workhorse", "S6.sweep_b": "codex:workhorse", "S7": "claude:helm",
5150
+ "S7b": "codex:helm", "S9b": "codex:workhorse"}
5151
+ control("seat-tiers-are-the-owner-s-table", gate.seat_default_tiers() == owner_tiers, f"{gate.seat_default_tiers()}")
5152
+ # read from the launch profile here by this suite's own reading, not through gate.launch_tiers
5153
+ profile = tomllib.loads(gate.LAUNCH_PROFILE.read_text(encoding="utf-8"))
5154
+ by_profile = {}
5155
+ for key, ref in owner_tiers.items():
5156
+ host, _colon, tier = ref.partition(":")
5157
+ bound_tier = profile["hosts"][host]["tiers"][tier]
5158
+ by_profile.setdefault(key.split(".")[0], []).append(f"{host}:{bound_tier['model']}/{bound_tier['effort']}")
5159
+ control("and-each-stage-seat-is-its-tier-in-the-launch-profile", gate.stage_seats() == by_profile,
5160
+ f"{gate.stage_seats()} {by_profile}")
5160
5161
  # a slot is unmeasured (no number) or measured (a positive count and the measurement it came from);
5161
5162
  # the negative rows build their own slots, so the control keeps testing when every live slot is measured
5162
5163
  def allowance_slot_problem(slot):
@@ -5202,8 +5203,12 @@ def self_test(scratch=None):
5202
5203
  plain, measured = supervisor(da), supervisor(da, seats_path=measured_seats)
5203
5204
  got, untouched = admitted(plain, "S6", "claude:claude-opus-5-5/max", False)
5204
5205
  control("seat-neither-declared-nor-pinned-refused", (got or "").startswith("SEAT_UNPINNED") and untouched, f"{got}")
5205
- got, _untouched = admitted(plain, "S6", "codex:gpt-6-luna/medium", False)
5206
- control("seat-pinned-by-design-section-4-admitted", got is None, f"{got}")
5206
+ # a seat seats.json pins for S6 through its tier and the run does not declare, so admission is the pin's alone
5207
+ tier_pinned = gate.seat_defaults()["S6.sweep_b"]
5208
+ got, _untouched = admitted(plain, "S6", tier_pinned, False)
5209
+ control("seat-pinned-through-its-tier-admitted",
5210
+ got is None and tier_pinned not in records.declaration_state(da, who="dispatch self-test")[0]["seats"].values(),
5211
+ f"{got} {tier_pinned}")
5207
5212
  got, untouched = admitted(supervisor(da, seats_path=claude_unmeasured), vstage, vseat, True)
5208
5213
  control("view-window-call-without-a-measured-allowance-refused", (got or "").startswith("ALLOWANCE_UNMEASURED") and untouched,
5209
5214
  f"{got}")
@@ -49,7 +49,9 @@ import importlib.util
49
49
  import itertools
50
50
  import json
51
51
  import pathlib
52
+ import re
52
53
  import sys
54
+ import tomllib
53
55
 
54
56
  if __package__ in (None, ""): # run as a script: put session-distill/ on the import path
55
57
  sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
@@ -198,6 +200,96 @@ def seats(path=SEATS):
198
200
  return _seats[path]
199
201
 
200
202
 
203
+ # The launch profile whose tiers seat distill's stages (owner, 2026-11-29): seats.json names a tier per run.json seat
204
+ # key (`seat_tiers`) and the model and effort come from here, so a model change in the profile moves distill's seats
205
+ # with it. The checkout's own file, never a user's saved preset: a run's seats do not depend on whose machine declared
206
+ # it. SWEEP is not a distill tier (same decision): the stages that swept on cheap seats sit on WORKHORSE.
207
+ LAUNCH_PROFILE = pathlib.Path(__file__).resolve().parents[2] / "launch" / "agent-launch.toml"
208
+ SEAT_TIERS = ("frontier", "helm", "workhorse")
209
+ SEAT_KEY = re.compile(r"^S[0-9]+b?(\.[A-Za-z0-9_-]+)?$") # run.schema.json's seat keys
210
+ _tiers = {}
211
+
212
+
213
+ def launch_tiers(path=LAUNCH_PROFILE):
214
+ """`{host: {tier: {"model": ..., "effort": ...}}}` as the launch profile binds them (`[hosts.<host>.tiers.<tier>]`)."""
215
+ path = pathlib.Path(path)
216
+ if path not in _tiers:
217
+ profile = tomllib.loads(path.read_text(encoding="utf-8"))
218
+ _tiers[path] = {host: dict(entry.get("tiers") or {}) for host, entry in (profile.get("hosts") or {}).items()
219
+ if isinstance(entry, dict)}
220
+ return _tiers[path]
221
+
222
+
223
+ def launch_profile_sha256(path=LAUNCH_PROFILE):
224
+ """The sha256 of the launch profile's bytes: what a run records beside the seats its tiers resolved to."""
225
+ return hashlib.sha256(pathlib.Path(path).read_bytes()).hexdigest()
226
+
227
+
228
+ def resolved_seats(doc, tiers=None):
229
+ """`(seats, problems)`: every run.json seat key seats.json's `seat_tiers` names, resolved to `host:model/effort`
230
+ through the launch profile's tiers, and by name what keeps a key from resolving or a cross review from being one:
231
+ SEAT_TIER_UNKNOWN (not a seat key, not `host:tier`, or a tier the profile does not bind with a model and an
232
+ effort), SEAT_TIER_EXCLUDED (the SWEEP tier), CROSS_REVIEW_UNSEATED (a pair seat_tiers does not seat) and
233
+ CROSS_REVIEW_SAME_PROVIDER (a reviewer on the host of the work it reviews)."""
234
+ tiers = launch_tiers() if tiers is None else tiers
235
+ found, problems = {}, []
236
+ for key, ref in ((doc or {}).get("seat_tiers") or {}).items():
237
+ if str(key).startswith("$"):
238
+ continue
239
+ where, (host, colon, tier) = f"seat_tiers.{key}", str(ref).partition(":")
240
+ if not SEAT_KEY.match(str(key)):
241
+ problems.append(f"SEAT_TIER_UNKNOWN {where}: {key!r} is not a run.json seat key")
242
+ elif not (host and colon and tier):
243
+ problems.append(f"SEAT_TIER_UNKNOWN {where}: {ref!r} is not host:tier")
244
+ elif tier not in SEAT_TIERS:
245
+ problems.append(f"SEAT_TIER_EXCLUDED {where}: {ref!r} names the sweep tier, which seats no distill stage "
246
+ f"(owner, 2026-11-29); a distill tier is one of {list(SEAT_TIERS)}" if tier == "sweep" else
247
+ f"SEAT_TIER_UNKNOWN {where}: {ref!r} names no distill tier, one of {list(SEAT_TIERS)}")
248
+ else:
249
+ bound = (tiers.get(host) or {}).get(tier) or {}
250
+ model, effort = bound.get("model"), bound.get("effort")
251
+ if isinstance(model, str) and model and isinstance(effort, str) and effort:
252
+ found[key] = f"{host}:{model}/{effort}"
253
+ else:
254
+ problems.append(f"SEAT_TIER_UNKNOWN {where}: the launch profile binds no model and effort for {host} "
255
+ f"{tier} ([hosts.{host}.tiers.{tier}] in {LAUNCH_PROFILE.name})")
256
+ for key, producer in ((doc or {}).get("cross_review") or {}).items():
257
+ if str(key).startswith("$"):
258
+ continue
259
+ where = f"cross_review.{key}"
260
+ if key not in found or producer not in found:
261
+ problems.append(f"CROSS_REVIEW_UNSEATED {where}: {key} reviews {producer}, and seat_tiers seats "
262
+ f"{[k for k in (key, producer) if k in found] or 'neither'}")
263
+ elif found[key].partition(":")[0] == found[producer].partition(":")[0]:
264
+ problems.append(f"CROSS_REVIEW_SAME_PROVIDER {where}: {key} ({found[key]}) reviews {producer} "
265
+ f"({found[producer]}) on the same host; a cross review is the other provider's")
266
+ return found, problems
267
+
268
+
269
+ def seat_defaults(doc=None, tiers=None):
270
+ """`{seat key: host:model/effort}`: the seat each run.json seat key takes when a declaration names none, seats.json's
271
+ tier resolved through the launch profile. Refused by name while any of seats.json's tiers does not resolve."""
272
+ found, problems = resolved_seats(seats() if doc is None else doc, tiers)
273
+ if problems:
274
+ raise Refused("\n".join(problems))
275
+ return found
276
+
277
+
278
+ def seat_default_tiers(doc=None):
279
+ """`{seat key: host:tier}` as seats.json names them: what a run records for each seat it took by default."""
280
+ held = seats() if doc is None else doc
281
+ return {k: v for k, v in (held.get("seat_tiers") or {}).items() if not str(k).startswith("$")}
282
+
283
+
284
+ def stage_seats(doc=None, tiers=None):
285
+ """`{stage: [host:model/effort, ...]}`: the seats pinned for each stage, in seat_tiers order (design §4's shape:
286
+ a stage's keys are `S6`, `S6.A`, ...)."""
287
+ out = {}
288
+ for key, seat in seat_defaults(doc, tiers).items():
289
+ out.setdefault(key.split(".")[0], []).append(seat)
290
+ return out
291
+
292
+
201
293
  def seat_capacity(seat, host_version, path=SEATS):
202
294
  """`(context_capacity, basis)` seats.json declares for `seat` at `host_version`, or `(None, reason)`.
203
295
 
@@ -275,7 +367,7 @@ def host_schema_problems(c):
275
367
  return out
276
368
 
277
369
 
278
- def seats_problems(doc):
370
+ def seats_problems(doc, tiers=None):
279
371
  """What makes seats.json's pins disagree with the version each was established at, by name (`PIN_PATH_VERSION`,
280
372
  `PIN_STALE`); empty when none does. A host's pinned binary is the versioned file (plan P2), so its path names the
281
373
  pinned version as one of its parts. Everything measured or observed for a host is valid at the version it was
@@ -285,7 +377,10 @@ def seats_problems(doc):
285
377
  version is named here, and the re-pin takes each with it: re-measured, marked unmeasured, or declared carried.
286
378
 
287
379
  And every seat a stage is seated with has a capacity (`CAPACITY_UNDECLARED`): a seat with none was the one
288
- exception check (d) could not hold, and a re-pin that drops a capacity leaves that seat unbounded by name."""
380
+ exception check (d) could not hold, and a re-pin that drops a capacity leaves that seat unbounded by name. A stage
381
+ is seated through its launch-profile tier (`resolved_seats`), so what keeps a tier from resolving, or a cross
382
+ review from being one, is named here too, and a tier the profile moves to a model with no capacity is named
383
+ CAPACITY_UNDECLARED before any call."""
289
384
  out = []
290
385
  hosts = (doc or {}).get("hosts") or {}
291
386
  for host, entry in sorted(hosts.items()):
@@ -315,11 +410,11 @@ def seats_problems(doc):
315
410
  out.append(f"PIN_STALE seat_capacity.{seat}: reported at host {held.get('host_version')!r}, and the pin is "
316
411
  f"{pinned!r}; report it again at the pinned version, or remove it")
317
412
  declared = (doc or {}).get("seat_capacity") or {}
413
+ found, tier_problems = resolved_seats(doc, tiers)
414
+ out.extend(tier_problems)
318
415
  seated = {}
319
- for stage, rows in sorted(((doc or {}).get("stage_seats") or {}).items()):
320
- if not stage.startswith("$") and isinstance(rows, list):
321
- for seat in rows:
322
- seated.setdefault(seat, stage)
416
+ for key, seat in found.items():
417
+ seated.setdefault(seat, key.split(".")[0])
323
418
  for seat, stage in sorted(seated.items()):
324
419
  if not isinstance(declared.get(seat), dict):
325
420
  out.append(f"CAPACITY_UNDECLARED seat_capacity.{seat}: {stage} is seated with it and seats.json declares no "
@@ -2666,17 +2761,60 @@ def self_test():
2666
2761
  ("a-seat-capacity-at-another-version",
2667
2762
  lambda d: d.setdefault("seat_capacity", {}).update(
2668
2763
  {"claude:planted/high": {"context_capacity": 1, "host_version": "0.0.1", "basis": "b"}}),
2669
- "PIN_STALE seat_capacity.claude:planted/high"),
2670
- # a seat of its own, so the control keeps testing whichever seats the real file holds
2671
- ("a-seated-seat-with-no-capacity",
2672
- lambda d: d.setdefault("stage_seats", {}).update(Splanted=["codex:planted/xhigh"]),
2673
- "CAPACITY_UNDECLARED seat_capacity.codex:planted/xhigh")):
2764
+ "PIN_STALE seat_capacity.claude:planted/high")):
2674
2765
  ran.append(name)
2675
2766
  bent = copy.deepcopy(held_seats)
2676
2767
  bend(bent)
2677
2768
  got = seats_problems(bent)
2678
2769
  if not any(line.startswith(want) for line in got):
2679
2770
  failures.append(f"{name}: expected a line starting {want!r}, got {got}")
2771
+ # a stage is seated through its launch-profile tier: the real profile's tiers resolve every real key, and each break
2772
+ # is planted on keys and tiers of its own, so the controls keep testing whichever tiers the real files bind
2773
+ real_tiers = launch_tiers()
2774
+ planted_tiers = {**real_tiers, "codex": {**real_tiers.get("codex", {}), "frontier": {"model": "planted", "effort": "xhigh"}},
2775
+ "claude": {**real_tiers.get("claude", {}), "frontier": {"model": "planted", "effort": "high"}}}
2776
+ real_found, real_tier_problems = resolved_seats(held_seats)
2777
+ ran.append("seat-tiers-resolve-through-the-launch-profile")
2778
+ if real_tier_problems or not real_found or set(real_found) != set(seat_default_tiers(held_seats)):
2779
+ failures.append(f"seat-tiers-resolve-through-the-launch-profile: {real_tier_problems} {real_found}")
2780
+ ran.append("a-moved-tier-moves-the-seat")
2781
+ moved = resolved_seats({"seat_tiers": {"S99": "codex:frontier"}}, planted_tiers)[0]
2782
+ if moved != {"S99": "codex:planted/xhigh"}:
2783
+ failures.append(f"a-moved-tier-moves-the-seat: {moved}")
2784
+
2785
+ def seat(key, ref):
2786
+ return lambda d: d.setdefault("seat_tiers", {}).update({key: ref})
2787
+
2788
+ def reviewed(key, producer, key_ref, producer_ref):
2789
+ return lambda d: (d.setdefault("seat_tiers", {}).update({key: key_ref, producer: producer_ref}),
2790
+ d.setdefault("cross_review", {}).update({key: producer}))
2791
+ for name, bend, want in (
2792
+ # a seat of its own, so the control keeps testing whichever seats the real file holds
2793
+ ("a-seated-seat-with-no-capacity", seat("S99", "codex:frontier"),
2794
+ "CAPACITY_UNDECLARED seat_capacity.codex:planted/xhigh"),
2795
+ ("a-seat-on-the-sweep-tier", seat("S99", "codex:sweep"), "SEAT_TIER_EXCLUDED seat_tiers.S99"),
2796
+ ("a-seat-on-a-tier-distill-does-not-know", seat("S99", "codex:planted"),
2797
+ "SEAT_TIER_UNKNOWN seat_tiers.S99"),
2798
+ ("a-seat-on-a-host-the-profile-does-not-bind", seat("S99", "planted:helm"),
2799
+ "SEAT_TIER_UNKNOWN seat_tiers.S99"),
2800
+ ("a-seat-that-is-not-host-tier", seat("S99", "helm"), "SEAT_TIER_UNKNOWN seat_tiers.S99"),
2801
+ ("a-seat-key-that-is-no-stage", seat("planted", "codex:helm"), "SEAT_TIER_UNKNOWN seat_tiers.planted"),
2802
+ ("a-cross-review-on-the-host-it-reviews", reviewed("S99.b", "S99.a", "claude:frontier", "claude:frontier"),
2803
+ "CROSS_REVIEW_SAME_PROVIDER cross_review.S99.b"),
2804
+ ("a-cross-review-of-an-unseated-key",
2805
+ lambda d: d.setdefault("cross_review", {}).update({"S99.b": "S99.none"}),
2806
+ "CROSS_REVIEW_UNSEATED cross_review.S99.b")):
2807
+ ran.append(name)
2808
+ bent = copy.deepcopy(held_seats)
2809
+ bend(bent)
2810
+ got = seats_problems(bent, planted_tiers)
2811
+ if not any(line.startswith(want) for line in got):
2812
+ failures.append(f"{name}: expected a line starting {want!r}, got {got}")
2813
+ ran.append("a-cross-review-on-the-other-host-is-one")
2814
+ crossed = copy.deepcopy(held_seats)
2815
+ reviewed("S99.b", "S99.a", "codex:frontier", "claude:frontier")(crossed)
2816
+ if any(line.startswith(("CROSS_REVIEW", "SEAT_TIER")) for line in seats_problems(crossed, planted_tiers)):
2817
+ failures.append(f"a-cross-review-on-the-other-host-is-one: {seats_problems(crossed, planted_tiers)}")
2680
2818
  # a call's manifest declares the built-in context without the declaration's provenance, and none at another version
2681
2819
  ran.append("builtin-context-is-the-declaration-without-its-provenance")
2682
2820
  codex_entry = held_seats["hosts"]["codex"]
@@ -727,8 +727,9 @@ def self_test():
727
727
  "S7b": {"s7b": lambda: json.loads(s7b.schema_bytes())},
728
728
  "S9b": {"s9b": lambda: json.loads(s9b.schema_bytes())}}
729
729
  seats_doc = json.loads((REPO / "session-distill" / "seats.json").read_text(encoding="utf-8"))
730
- codex_stages = {stage for stage, held in seats_doc["stage_seats"].items()
731
- if not stage.startswith("$") and any(str(seat).startswith("codex:") for seat in held)}
730
+ from runlib import gate as gates # gate imports this module, so inside the self-test only
731
+ codex_stages = {stage for stage, held in gates.stage_seats(seats_doc).items()
732
+ if any(str(seat).startswith("codex:") for seat in held)}
732
733
  handed = {name: json.loads(schema_bytes(make())) for stage in sent_by for name, make in sent_by[stage].items()}
733
734
  found = {name: provider_schema(held, "codex") for name, held in handed.items()}
734
735
  reached = []
@@ -2377,7 +2377,7 @@ def self_test():
2377
2377
  and "with its retry's correction room" in short_by_one, short_by_one)
2378
2378
 
2379
2379
  # W r1, F4: a run that died holding a reservation of S4 is closed, or refused beside, when S4 runs again
2380
- s4_seat = gate.seats()["stage_seats"][STAGE][0]
2380
+ s4_seat = gate.stage_seats()[STAGE][0]
2381
2381
 
2382
2382
  def reserved_copy(label, plant=None):
2383
2383
  """A copy of the golden run whose S4 reservation a dead run left open, `plant` marking what it got to."""
@@ -3658,14 +3658,18 @@ def self_test():
3658
3658
  and any(x.startswith("CROSS_OVER_CAPACITY B") for x in kw.get("packet_check", lambda m: [])(huge))
3659
3659
  for _i, _s, kw in asked_c), f"{said_c[:200]} {len(asked_c)}")
3660
3660
  # C3 (lead's (가)): before the first sweep, the whole plan's claims are held against what S6 has left, all
3661
- # or none; driven over the same copy with both sweep seats measured, so each call's claim is computable
3661
+ # or none; driven over the same copy with both sweep seats measured, so each call's claim is computable.
3662
+ # Both capacities are planted, for the seats the stage's own declaration names: seats.json keeps a row only
3663
+ # for a seat some tier resolves to (D-20261129-946698), so a live row is nothing a fixture's seat can lean on
3662
3664
  summary_pre = guarded(lambda: records.read_json(capped / SUMMARY), {})
3663
3665
 
3664
3666
  def preflight(left):
3665
- sup = Asked(fx_seats(root, name=f"sweep-preflight-{left}.json",
3666
- capacities={"codex:gpt-6-luna/medium": 272_000}, codex_allowance=19_167))
3667
- sup.remaining = lambda stage_: left
3668
3667
  with records.run_stage(capped, STAGE, INPUTS) as stg:
3668
+ swept = sweep_seats(stg.declaration)
3669
+ sup = Asked(fx_seats(root, name=f"sweep-preflight-{left}.json",
3670
+ capacities={swept["a"]: 1_000_000, swept["b"]: 272_000},
3671
+ codex_allowance=19_167))
3672
+ sup.remaining = lambda stage_: left
3669
3673
  try:
3670
3674
  section, _receipts = sweep_stage(capped, stg, sup, stg.declaration, judged_w, judgments_w,
3671
3675
  sources_w, {}, "calibration")
@@ -3134,7 +3134,7 @@ def self_test():
3134
3134
  "quarantined by name", [q["reason"] for q in golden(root, "nobound", overhead=bound.INPUT_BOUND - 10_000)["manifest"]["quarantined"]],
3135
3135
  "WINDOW_UNBOUNDED")
3136
3136
  # The S3 seat and the Claude host version these controls cut against are the checkout's pins.
3137
- s3_seat, pinned_claude = gate.seats()["stage_seats"]["S3"][0], gate.seats()["hosts"]["claude"]["version"]
3137
+ s3_seat, pinned_claude = gate.stage_seats()["S3"][0], gate.seats()["hosts"]["claude"]["version"]
3138
3138
  # BA#1: cutting a window reads the SAME declaration the dispatcher admits against, and there is no
3139
3139
  # default - a window cut against an invented capacity is cut against nothing.
3140
3140
  refused("control, BA#1: a seat seats.json declares no context capacity for cuts no window",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$comment": "design §4.1; posture: design/session-distill/2026-10-21T0318--2d4fbd4--plan-addendum-wp01.md; output_caps: design/session-distill/2026-11-03T2155--6779ed7--the-output-cap-is-declared-and-a-reading-cites-its-own-quotes.md; density (optional): design/session-distill/2026-11-11T0410--c4a9a24--a-run-may-declare-an-earlier-runs-measured-density-and-an-unmeasured-class-is-reserved-at-its-estimate.md; retry (optional): design/session-distill/2026-11-11T0535--c4a9a24--a-call-past-its-claim-stops-the-run-and-a-density-belongs-to-its-class.md; retrieval (optional) and judge (optional): design/session-distill/2026-11-11T1545--58ad0cf--a-run-declares-what-s5-retrieves-and-which-candidates-s6-judges.md; sweeps (optional): plan WP-11 J3a, lead decision E2 (2026-11-11); environment (optional): what the run HANDS its writers rather than where they may write, WP-21",
3
+ "$comment": "design §4.1; posture: design/session-distill/2026-10-21T0318--2d4fbd4--plan-addendum-wp01.md; output_caps: design/session-distill/2026-11-03T2155--6779ed7--the-output-cap-is-declared-and-a-reading-cites-its-own-quotes.md; density (optional): design/session-distill/2026-11-11T0410--c4a9a24--a-run-may-declare-an-earlier-runs-measured-density-and-an-unmeasured-class-is-reserved-at-its-estimate.md; retry (optional): design/session-distill/2026-11-11T0535--c4a9a24--a-call-past-its-claim-stops-the-run-and-a-density-belongs-to-its-class.md; retrieval (optional) and judge (optional): design/session-distill/2026-11-11T1545--58ad0cf--a-run-declares-what-s5-retrieves-and-which-candidates-s6-judges.md; sweeps (optional): plan WP-11 J3a, lead decision E2 (2026-11-11); environment (optional): what the run HANDS its writers rather than where they may write, WP-21; seat_resolution (optional): written by declare.fill_seats when it fills a seat from seats.json's launch-profile tiers, never declared, design/session-distill/2026-11-29T0047--2245338--distill-seats-take-their-launch-profile-tier-and-no-stage-sits-on-sweep.md",
4
4
  "title": "Run declaration",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
@@ -59,6 +59,15 @@
59
59
  "type": "object", "additionalProperties": false, "required": ["S3"],
60
60
  "patternProperties": {"^S[0-9]+b?(\\.[A-Za-z0-9_-]+)?$": {"$ref": "#/$defs/text"}}
61
61
  },
62
+ "seat_resolution": {
63
+ "$comment": "written by declare.fill_seats at declaration_seq 0, never declared: the seat keys it filled from seats.json's launch-profile tiers, the tier each came from (host:tier), and the sha256 of the launch profile resolved against",
64
+ "type": "object", "additionalProperties": false, "required": ["profile", "profile_sha256", "filled"],
65
+ "properties": {
66
+ "profile": {"$ref": "#/$defs/text"},
67
+ "profile_sha256": {"$ref": "#/$defs/sha256"},
68
+ "filled": {"type": "object", "additionalProperties": false, "minProperties": 1,
69
+ "patternProperties": {"^S[0-9]+b?(\\.[A-Za-z0-9_-]+)?$": {"type": "string", "pattern": "^[a-z]+:[a-z]+$"}}}}
70
+ },
62
71
  "actor_seats": {
63
72
  "type": "array", "minItems": 4, "maxItems": 4,
64
73
  "items": {"type": "object", "additionalProperties": false, "required": ["stratum", "seat", "provenance"],
@@ -1,5 +1,5 @@
1
1
  {
2
- "$comment": "The hosts distill dispatches to, pinned per host version: the versioned binary (plan P2: the file itself, never a symlink an update moves), the flag set of each runner profile (its sha256 is what a receipt and a capture must carry; `wrappers/claude-run.sh` sends `hermetic` for `--use judge|authoring` and `hermetic-producing` for `--use producing`, whose manifest directory is hashed as `<manifest>`), and `context`, what the host loads by itself under a profile, which dispatch.py declares in every call's manifest (codex-cli's built-in skills, as codex-run's capture records them by name: wrappers/codex_frame_filter.py, WP-04), and the auxiliary roles a host runs beside the declared seat (design §3.2 step 2, plan S-7). Read by runlib/gate.py (flag-set hash, auxiliary roles) and runlib/dispatch.py (pinned paths). An auxiliary role is accepted only in a call's closing aggregate, never as a main or child response, and for a live call only once `measured` is true (gate.auxiliary_models); a provisional entry serves replayed and golden captures. The request kind an auxiliary role serves is added by preflight (WP-23) together with the check that reads it. `stage_seats` pins each model stage's seats from design §4's stage table (the defaults a run may use without declaring them; run.json seats add to them), read by dispatch.py, which refuses a seat neither names for the call's stage. `host_allowance` is the host's own share of a view-window request, per host version and runner profile (the input-bound amendment of 2026-10-21): preflight (WP-23) measures it; a slot preflight has not measured is unmeasured, and dispatch.py refuses a view-window call that needs it; the Claude hermetic slot was measured live in WP-03v. Everything measured or observed for a host is valid at the version it was established at, and says which: a measured host allowance its `measured_version`, a profile's `context` its `observed_version` (or `carried`, with the basis for carrying it to the pinned version until a capture observes it), a seat capacity its `host_version`. A version move takes each of them with it: re-measure it, mark it unmeasured, or declare it carried. gate.seats_problems holds the file to that, and to a pinned path that names its version.",
2
+ "$comment": "The hosts distill dispatches to, pinned per host version: the versioned binary (plan P2: the file itself, never a symlink an update moves), the flag set of each runner profile (its sha256 is what a receipt and a capture must carry; `wrappers/claude-run.sh` sends `hermetic` for `--use judge|authoring` and `hermetic-producing` for `--use producing`, whose manifest directory is hashed as `<manifest>`), and `context`, what the host loads by itself under a profile, which dispatch.py declares in every call's manifest (codex-cli's built-in skills, as codex-run's capture records them by name: wrappers/codex_frame_filter.py, WP-04), and the auxiliary roles a host runs beside the declared seat (design §3.2 step 2, plan S-7). Read by runlib/gate.py (flag-set hash, auxiliary roles) and runlib/dispatch.py (pinned paths). An auxiliary role is accepted only in a call's closing aggregate, never as a main or child response, and for a live call only once `measured` is true (gate.auxiliary_models); a provisional entry serves replayed and golden captures. The request kind an auxiliary role serves is added by preflight (WP-23) together with the check that reads it. `seat_tiers` names, per run.json seat key, the launch-profile tier that seats it (`host:tier`; owner, 2026-11-29): gate.stage_seats resolves each through the checkout's launch/agent-launch.toml to `host:model/effort`, so a model change in the launch profile moves distill's seats with it. Those are the defaults a run may use without declaring them (run.json seats add to them, and `distill.py declare --from` writes them into run.json for every key the declaration leaves out, recording the tier and the profile's sha256 under `seat_resolution`); dispatch.py refuses a seat neither names for the call's stage. `cross_review` names, per reviewing key, the key whose work it reviews; the two must resolve to different hosts (gate.seats_problems, CROSS_REVIEW_SAME_PROVIDER). `host_allowance` is the host's own share of a view-window request, per host version and runner profile (the input-bound amendment of 2026-10-21): preflight (WP-23) measures it; a slot preflight has not measured is unmeasured, and dispatch.py refuses a view-window call that needs it; the Claude hermetic slot was measured live in WP-03v. Everything measured or observed for a host is valid at the version it was established at, and says which: a measured host allowance its `measured_version`, a profile's `context` its `observed_version` (or `carried`, with the basis for carrying it to the pinned version until a capture observes it), a seat capacity its `host_version`. A version move takes each of them with it: re-measure it, mark it unmeasured, or declare it carried. gate.seats_problems holds the file to that, and to a pinned path that names its version.",
3
3
  "schema": "DistillSeats/v1",
4
4
  "hosts": {
5
5
  "claude": {
@@ -79,32 +79,27 @@
79
79
  }
80
80
  }
81
81
  },
82
- "stage_seats": {
83
- "$comment": "design §4: S3 claude-sonnet-5-5/high (plan amendment row 13, D-20261103-4b967e); S4 claude-opus-5-5/high; S6 A claude-opus-5-5/high, B gpt-6.2-sol/xhigh (owner, 2026-11-12, gpt-6.1-sol for the C3 run, moved to gpt-6.2-sol 2026-11-24; the design named gpt-6-astra/xhigh), sweeps claude-sonnet-5-5/medium and gpt-6-luna/medium; S7 claude-opus-5-5/high; S7b gpt-6.2-sol/xhigh and S9b gpt-6.2-sol/high (owner, 2026-11-13, the same model as Judge B, moved with it 2026-11-24; the design named gpt-6-astra for both). S8 and S10b seat their actors from run.json actor_seats (design §8.4).",
84
- "S3": [
85
- "claude:claude-sonnet-5-5/high"
86
- ],
87
- "S4": [
88
- "claude:claude-opus-5-5/high"
89
- ],
90
- "S6": [
91
- "claude:claude-opus-5-5/high",
92
- "codex:gpt-6.2-sol/xhigh",
93
- "claude:claude-sonnet-5-5/medium",
94
- "codex:gpt-6-luna/medium"
95
- ],
96
- "S7": [
97
- "claude:claude-opus-5-5/high"
98
- ],
99
- "S7b": [
100
- "codex:gpt-6.2-sol/xhigh"
101
- ],
102
- "S9b": [
103
- "codex:gpt-6.2-sol/high"
104
- ]
82
+ "seat_tiers": {
83
+ "$comment": "Launch-profile tiers, per run.json seat key (owner, 2026-11-29, D-20261129-946698): a stage takes the tier of the launch profile its work matches, and SWEEP is not a distill tier (gate.SEAT_TIERS; SEAT_TIER_EXCLUDED), so the absence sweeps sit on WORKHORSE. A cross review sits on the tier of the work it reviews, on the other host: Judge B on HELM beside Judge A, the OpenAI-side sweep on WORKHORSE beside the Claude-side one, S7b on HELM beside S7. S9b checks each row's Korean against its English payload, per-item work, so it sits on WORKHORSE. Before 2026-11-29 the seats were model names (design §4 and the owner's departures from it); resolved today they are the same seats except the two sweeps, which were claude-sonnet-5-5/medium and gpt-6-luna/medium.",
84
+ "S3": "claude:workhorse",
85
+ "S4": "claude:helm",
86
+ "S6.A": "claude:helm",
87
+ "S6.B": "codex:helm",
88
+ "S6.sweep_a": "claude:workhorse",
89
+ "S6.sweep_b": "codex:workhorse",
90
+ "S7": "claude:helm",
91
+ "S7b": "codex:helm",
92
+ "S9b": "codex:workhorse"
93
+ },
94
+ "cross_review": {
95
+ "$comment": "The reviewing seat key -> the seat key whose work it reviews. The pair must resolve to different hosts: independent judgment is the other provider's (design §3.1). Sitting on the same tier is the convention seat_tiers states, not a check: S9b reviews S7's Korean on WORKHORSE.",
96
+ "S6.B": "S6.A",
97
+ "S6.sweep_b": "S6.sweep_a",
98
+ "S7b": "S7",
99
+ "S9b": "S7"
105
100
  },
106
101
  "seat_capacity": {
107
- "$comment": "The seat's context window, as the host states it: host-reported where the host reports one, else the host's own model catalogue at the pinned version, the basis saying which. A view-window call on a seat with no entry here is refused (CAPACITY_UNDECLARED): check (d) is about the context, and an invented capacity is a check about nothing. Every seat stage_seats names has an entry (gate.seats_problems, CAPACITY_UNDECLARED).",
102
+ "$comment": "The seat's context window, as the host states it: host-reported where the host reports one, else the host's own model catalogue at the pinned version, the basis saying which. A view-window call on a seat with no entry here is refused (CAPACITY_UNDECLARED): check (d) is about the context, and an invented capacity is a check about nothing. Every seat seat_tiers resolves to has an entry (gate.seats_problems, CAPACITY_UNDECLARED).",
108
103
  "claude:claude-sonnet-5-5/high": {
109
104
  "context_capacity": 1000000,
110
105
  "host_version": "2.1.317",
@@ -115,26 +110,6 @@
115
110
  "host_version": "2.1.317",
116
111
  "basis": "host catalogue, read 2026-11-06 for S4's bound (W review of WP-09 r1, F5): the model catalogue the installed claude caches under ~/.claude/cache/model-catalog gives claude-opus-5-5 runtime.max_input_tokens 1000000 (max_output_tokens 128000) in each of the three catalogue files that carry runtime, the freshest fetched 2026-11-06T01:08+09:00. The same catalogue gives claude-sonnet-5-5 1000000, which is that seat's measured modelUsage.contextWindow above. Not yet compared with a host-reported contextWindow of an opus call: the first live S4 call's result carries one. Compared 2026-11-12: D7's two live S6 judge calls (claude 2.1.317, claude-opus-5-5/high, commit 6670341) reported modelUsage.contextWindow 1000000, the catalogue's figure."
117
112
  },
118
- "claude:claude-sonnet-5-5/medium": {
119
- "context_capacity": 1000000,
120
- "host_version": "2.1.317",
121
- "basis": "host-reported modelUsage.contextWindow, D13 re-pin 2026-11-12: D7's live S6 sweep call (claude 2.1.317, claude-sonnet-5-5/medium, commit 6670341) reported 1000000"
122
- },
123
- "codex:gpt-6-astra/xhigh": {
124
- "context_capacity": 272000,
125
- "host_version": "0.171.0",
126
- "basis": "host catalogue, read 2026-11-24 (re-pin D-20261124-ebb701): the model catalogue the pinned codex-cli 0.171.0 binary bundles (the versioned file at hosts.codex.path, read as bytes for its models list; no owner data, no network, ~/.codex not read) gives gpt-6-astra context_window 272000. The same entry carries max_context_window 872000, which is the entry's ceiling and is not what is declared. Codex captures report no context size (D7, codex-cli 0.167.0), so this is the host's catalogue, not a host-reported window; bound to 0.171.0 and re-read from the binary on a re-pin"
127
- },
128
- "codex:gpt-6-astra/high": {
129
- "context_capacity": 272000,
130
- "host_version": "0.171.0",
131
- "basis": "host catalogue, read 2026-11-24 (re-pin D-20261124-ebb701): the model catalogue the pinned codex-cli 0.171.0 binary bundles (the versioned file at hosts.codex.path, read as bytes for its models list; no owner data, no network, ~/.codex not read) gives gpt-6-astra context_window 272000. The same entry carries max_context_window 872000, which is the entry's ceiling and is not what is declared. Codex captures report no context size (D7, codex-cli 0.167.0), so this is the host's catalogue, not a host-reported window; bound to 0.171.0 and re-read from the binary on a re-pin"
132
- },
133
- "codex:gpt-6-luna/medium": {
134
- "context_capacity": 272000,
135
- "host_version": "0.171.0",
136
- "basis": "host catalogue, read 2026-11-24 (re-pin D-20261124-ebb701): the model catalogue the pinned codex-cli 0.171.0 binary bundles (the versioned file at hosts.codex.path, read as bytes for its models list; no owner data, no network, ~/.codex not read) gives gpt-6-luna context_window 272000. The window is the model's, so it holds for the medium seat. The same entry carries max_context_window 872000, which is the entry's ceiling and is not what is declared. Codex captures report no context size (D7, codex-cli 0.167.0), so this is the host's catalogue, not a host-reported window; bound to 0.171.0 and re-read from the binary on a re-pin"
137
- },
138
113
  "codex:gpt-6.2-sol/xhigh": {
139
114
  "context_capacity": 500000,
140
115
  "host_version": "0.171.0",
@@ -45,6 +45,9 @@
45
45
  # Verified against claude 2.1.221 (inherit). The hermetic flag set is verified per host version by
46
46
  # the author-side re-pin, on the version session-distill/seats.json pins.
47
47
  set -euo pipefail
48
+ # The helpers run under the interpreter the installation bound (the agent-launch
49
+ # launcher exports AGENT_BIOS_PYTHON on the standalone route), else python3 on PATH.
50
+ helper_python="${AGENT_BIOS_PYTHON:-python3}"
48
51
 
49
52
  usage() {
50
53
  cat <<'USAGE'
@@ -358,7 +361,7 @@ if [ "$needs_evidence" = 1 ]; then
358
361
  echo "claude-run: CAPTURE_HELPER_MISSING the evidence helper is missing beside the adapter: $helper" >&2
359
362
  exit 2
360
363
  fi
361
- command -v python3 >/dev/null 2>&1 || { echo "claude-run: CAPTURE_HELPER_MISSING python3 is required by $helper" >&2; exit 2; }
364
+ command -v "$helper_python" >/dev/null 2>&1 || { echo "claude-run: CAPTURE_HELPER_MISSING $helper_python is required by $helper" >&2; exit 2; }
362
365
  fi
363
366
 
364
367
  # Builtins only: the token never reaches an argv (where any process listing shows it), a
@@ -383,7 +386,7 @@ read_token() {
383
386
  # database, so a HOME pointed elsewhere changes nothing), the operator's own, mode 700, and no
384
387
  # instruction surface in it or any ancestor.
385
388
  if [ "$profile" = hermetic ]; then
386
- python3 "$helper" check-root --root "${cell_root:-$(dirname "$cell")}" --home "$HOME" || exit 2
389
+ "$helper_python" "$helper" check-root --root "${cell_root:-$(dirname "$cell")}" --home "$HOME" || exit 2
387
390
  fi
388
391
  if [ -n "$cell" ]; then
389
392
  for part in home config cwd; do
@@ -421,7 +424,7 @@ fi
421
424
  # The cell used is the cell validated: it and its homes resolve beneath the checked root, and the
422
425
  # producing profile reads only the working directory the manifest declares.
423
426
  if [ "$profile" = hermetic ]; then
424
- python3 "$helper" bind --root "${cell_root:-$(dirname "$cell")}" --cell "$cell" --cwd "$cd_dir" \
427
+ "$helper_python" "$helper" bind --root "${cell_root:-$(dirname "$cell")}" --cell "$cell" --cwd "$cd_dir" \
425
428
  ${manifest:+--manifest "$manifest"} || exit 2
426
429
  fi
427
430
 
@@ -450,7 +453,7 @@ fi
450
453
  # the environment the call gets, so the organisation the token belongs to is the one reported. The
451
454
  # helper runs `claude doctor` with stdin closed and a bound, and prints only the status of its one line.
452
455
  if [ "$server_policy_probe" = 1 ]; then
453
- py="$(command -v python3)"
456
+ py="$(command -v "$helper_python")"
454
457
  (
455
458
  for name in $(compgen -e); do unset "$name" 2>/dev/null || true; done
456
459
  export PATH=/usr/bin:/bin:/usr/sbin:/sbin HOME="$cell/home" CLAUDE_CONFIG_DIR="$cell/config" \
@@ -471,7 +474,7 @@ appended_snaps=()
471
474
  if [ "$needs_evidence" = 1 ]; then
472
475
  strict=()
473
476
  if [ "$profile" = hermetic ]; then strict=(--strict); fi
474
- session_id="$(python3 "$helper" prepare --cell "$cell" --cwd "${cd_dir:-$PWD}" --home "$HOME" \
477
+ session_id="$("$helper_python" "$helper" prepare --cell "$cell" --cwd "${cd_dir:-$PWD}" --home "$HOME" \
475
478
  --out "$work/pre.json" ${strict[@]+"${strict[@]}"})" || exit 2
476
479
  fi
477
480
  if [ "$profile" = hermetic ]; then
@@ -625,14 +628,14 @@ if [ "$needs_evidence" = 1 ]; then
625
628
  --appended-declared "${append_declared[$i]}")
626
629
  i=$((i + 1))
627
630
  done
628
- if python3 "$helper" "${render[@]}" > "$work/result"; then
631
+ if "$helper_python" "$helper" "${render[@]}" > "$work/result"; then
629
632
  cat "$work/result"
630
633
  else
631
634
  # A hermetic call without its evidence is not a completed call, whatever claude said.
632
635
  echo "claude-run: the evidence of call $call_id could not be rendered" >&2
633
636
  [ "$status" -ne 0 ] || status=70
634
637
  fi
635
- elif ! python3 "$helper" "${render[@]}" >/dev/null; then
638
+ elif ! "$helper_python" "$helper" "${render[@]}" >/dev/null; then
636
639
  echo "claude-run: WARNING: the evidence of call $call_id could not be rendered" >&2
637
640
  fi
638
641
  # A cell this adapter made is deleted on exit; its transcripts are evidence, kept first.
@@ -42,6 +42,9 @@
42
42
  #
43
43
  # Verified against codex-cli 0.144.1; capture against 0.163.0.
44
44
  set -euo pipefail
45
+ # The helpers run under the interpreter the installation bound (the agent-launch
46
+ # launcher exports AGENT_BIOS_PYTHON on the standalone route), else python3 on PATH.
47
+ helper_python="${AGENT_BIOS_PYTHON:-python3}"
45
48
 
46
49
  usage() {
47
50
  cat <<'USAGE'
@@ -356,23 +359,23 @@ if [ -n "$capture_dir" ]; then
356
359
  if [ "$prev" = "-c" ]; then render_c+=(-c "$a"); fi
357
360
  prev="$a"
358
361
  done
359
- env ${run_env[@]+"${run_env[@]}"} DISABLE_AUTOUPDATER=1 python3 "$helper" context --codex "$codex_bin" \
362
+ env ${run_env[@]+"${run_env[@]}"} DISABLE_AUTOUPDATER=1 "$helper_python" "$helper" context --codex "$codex_bin" \
360
363
  --version "$CODEX_RUN_VERSION" --codex-home "$run_home" --child-home "$child_home" \
361
364
  --cwd "$cd_dir" --capture "$capture_dir" --work "$work" "${render_c[@]}" \
362
365
  || { echo "codex-run: CONTEXT_EVIDENCE_MISSING the effective-context evidence failed, so nothing is dispatched" >&2; exit 3; }
363
- t0="$(python3 -c 'import time; print(int(time.time() * 1000))')"
366
+ t0="$("$helper_python" -c 'import time; print(int(time.time() * 1000))')"
364
367
  set +e
365
368
  # codex's stdout (the --json events) goes to fd 9, its stderr through the filter, which
366
369
  # passes every line on to this script's stderr and keeps the reduced records.
367
370
  exec 9> "$work/events.raw"
368
371
  env ${run_env[@]+"${run_env[@]}"} CODEX_HOME="$run_home" DISABLE_AUTOUPDATER=1 "$codex_bin" "${args[@]}" --json -o "$work/result" \
369
372
  < "$work/packet" 2>&1 >&9 9>&- \
370
- | python3 "$helper" filter --frames "$capture_dir/frames.jsonl" --rust-log "${RUST_LOG:-}" 9>&-
373
+ | "$helper_python" "$helper" filter --frames "$capture_dir/frames.jsonl" --rust-log "${RUST_LOG:-}" 9>&-
371
374
  status=${PIPESTATUS[0]}
372
375
  exec 9>&-
373
376
  set -e
374
- t1="$(python3 -c 'import time; print(int(time.time() * 1000))')"
375
- python3 "$helper" events --out "$capture_dir/events.jsonl" < "$work/events.raw" \
377
+ t1="$("$helper_python" -c 'import time; print(int(time.time() * 1000))')"
378
+ "$helper_python" "$helper" events --out "$capture_dir/events.jsonl" < "$work/events.raw" \
376
379
  || echo "codex-run: WARNING: events not captured" >&2
377
380
  # the bytes delivered on stdout are the final message and one newline, as without capture
378
381
  if [ -s "$work/result" ]; then { cat "$work/result"; printf '\n'; } > "$work/stdout"; else : > "$work/stdout"; fi
@@ -382,7 +385,7 @@ if [ -n "$capture_dir" ]; then
382
385
  fi
383
386
  evidence=()
384
387
  while IFS= read -r line; do evidence+=(--evidence "$line"); done < <(
385
- python3 "$helper" finish --capture "$capture_dir" --work "$work" --call-id "$call_id" --profile "$profile" \
388
+ "$helper_python" "$helper" finish --capture "$capture_dir" --work "$work" --call-id "$call_id" --profile "$profile" \
386
389
  --cwd "$cd_dir" --packet "$work/packet" --model "${cmodel:-$model}" --effort "${ceffort:-$effort}" \
387
390
  --exit-status "$status" --wall-ms "$((t1 - t0))" ${schema:+--schema "$schema"} \
388
391
  ${REVIEW_CONTEXT_MANIFEST:+--manifest "$REVIEW_CONTEXT_MANIFEST"} ${flag_args[@]+"${flag_args[@]}"} \