R2-1: a failed step hands the begun captures to the writer before it reports the error, and LegacySession::flush_captures hands them over while the loop idles.
R2-2: completed_saves reports every queued save's outcome instead of stopping at the first error.
R2-3: the commit ends the in-flight admissions and records the pulses under one lock, and a sugar's reads and queueing take that same lock.
- Coordinator::snapshot_every(n): a snapshot every n-th boundary plus
every boundary with events or boundary actions; a service session
publishes every other boundary, the legacy feed's 30 Hz from 60 Hz.
- In-process participants reach the router in memory (a separate process
still uses its socket).
- Spans on the agent's and the coordinator's capture path; tests/speed.rs
times the legacy frame's phases, its agent export, and a session save.
- legacy-gameboy-v1: the artifact-backed ledger, the palette seed and the
pending pulse (amendments of 2026-09-29).
The session's ledger crosses the task's canonical JSON, which writes an
integral f64 as 7580031 where the legacy export writes 7580031.0; the
values are equal and the legacy import reads both alike.
Takes the artifact-backed task ledger (B1), the pending pulse (N1), the
palette seed (N3), queue_save/completed_saves (N4) and the bounded history
and concurrent seals (N5). The service host now queues its saves through
TASK-01's queue_save; SERVE-01's save_queued is gone.
- fly-session::profile: switchable per-phase spans (FLY_SESSION_PROFILE),
in the coordinator's phases, the world's advance and the agent's
prepare and commit.
- The world seals the view, the image and the audio chunk concurrently.
- Coordinator::bound_history: a service session keeps the newest 4096
transitions of trace, phase and audit logs and latency samples (it
grew without bound).
- tests/speed.rs: legacy loop against the session on one box, unpaced
and paced at 1x, in-process and process, with the span breakdown.
The TASK-01 review's N1: a second sugar before the next commit is refused
with the first one's pulse as the retry, legacy and session alike. A run
whose recorder misses a frame on a loaded box is repeated rather than
failed (it cannot be compared, and it says nothing about either runtime).
- B1: the pokered ledger's adapter state travels as an attachment
('reward', its JSON) beside a small typed value {reward: {digest,
byteLength}, ratchet, slotFilled}; Task gains capture_attachments /
validate_restore_with / install_restore_with, and the coordinator files
them as task-ledger-<name> payloads in captures and imports. Every
failure is an IncompatibleState error, so boot falls to the next
candidate. Tests: ledger_size (past 64 KB, and malformed ones).
- N1: a sugar admitted and not yet reported on by a commit is an active
pulse (AdmissionQueue::pending_stimulus_ms): two sugars between two
commits are one admission and one PulseActive, as the legacy drain.
- N3: a restore seeds the palette with the restored brain's RNG state,
as Sim::boot does; palette_seed holds on the cartridge that two seeds
press the same buttons (a fresh start's constant is therefore exact).
- N4: interval, milestone and after-rollback saves are queued to the
checkpointer's writer thread; startup and shutdown saves block.
- Boot parity adds row64 and the row65 yard (the largest ledgers); the
segments add them too. tests/speed.rs measures N5.
The service host (service.rs, bin flysim-session) runs the legacy composition
behind flysim::serve with flysim's own Config and keeps Sim's order and
bookkeeping: TASK-01's boot (legacy candidate order and gate), boot events,
chat sidecar, sugar journal (runtime fly-session), startup/shutdown durable
saves, queued hot/durable/milestone/after-rollback saves on the wall clock,
macro/reward/milestone/recovery/sugar/checkpoint events, the recovering
status, flysim's Pacer, sd_notify ready/watchdog, and the 30 Hz feed built
by flysim's feed_* functions from the committed view, the step's audio
through the legacy DC blocker, the OR of the commits' spike bitsets, the
task's adapter/ratchet/macro layer and the agent's Legacy.FeedStatus.
Task: FeedRecord (executed/rewards/abandoned/rollback events), the applied
mask (0 after a rollback, the checkpoint's after an import), inspect().
Composition: boot_unsaved, save_queued, the event-log watermark setter.
Tests: service_parity (legacy Sim vs session host behind flysim's router,
one scripted request set, every header/attachment/response/event/journal
line and the final checkpoint compared), journal_replay (a killed session
run's journal replayed from the seed in the legacy loop onto its last hot
checkpoint), unit tests for the audio path and the feed status;
examples/seed_store.
- The task ledger is STATE-02's TaskHalf ledger {reward, ratchet,
slotFilled} (pokered-task-ledger-v1); the task exposes its half, rank
and brain time for the host.
- The FLYSIM01 import uses legacy_checkpoint's halves, agent_payload
(the file's framebuffer as the next input, its reinforcement count)
and world_payload, with ids from the file; ImportSpec carries the
source scope.
- The coordinator can defer a rollback so the host captures first
(apply_pending_rollback) and takes a participant-coherent capture
for the legacy store (capture_payloads).
- LegacySession: attach_store (LegacyCheckpointer), save, advance in the
declared boundary order (slot save, milestone archive on a climb,
rollback, durable save after it, interval saves), shutdown_save; boot()
restores from the live stores in the legacy order and gate, one
session per attempt, fresh when the stores are empty.
- tests: fafb_boot_run_save_restore, the SHADOW-01 entry gate.
The live fly's composition under one coordinator: AGENT-01's agent,
ENV-01's world, and the Pokemon Red task and executor as one object
running the unchanged legacy engine (flysim's MacroLayer, flybrain-gb's
palette, executor, PokeState, reward adapter and ratchet) over MEM-01's
ImageReader of each boundary's memory image.
- task: Phase B decide over O[k], Phase C sample/observe/ratchet over
O[k+1], rollback clear_transient/cancel/observe over O'[k]; slot save
and rollback requests; legacy-transient-reset on restore; a reward
with no stimulation is a Reward alone; uncaptured reads are recorded.
- import: a FLYSIM01 checkpoint as the start (world, agent, task halves
in each participant's own format, the context from the checkpoint's
image), onto a replacement world.
- admission: sugar by flysim's RateLimiter against the last commit's
pulse; the operator reward pulse is refused.
- trace: the session's own FLY_TRACE lines and the comparison;
driver: the ROM tests' rotation stub readout for reward-bearing runs.
- tests: session_trace (toy raw from power-on; FAFB from the service
traces' checkpoints and from stream checkpoints, brain and driver
arms; in-process and process) and rollback_sequence (ROM-free).