The control semantics move to flysim::control, one ControlRequest per
docs/control-api.md endpoint; flysim::api becomes the HTTP layer over a
ControlBackend. flysim::controlbus registers them as services scoped per
session and per agent (fly), with a closed grant table per client role;
flysim::bus composes the feed and control on one embedded router.
fly-control-edge serves :7401 from the services with flysim's own router.
Tests: every endpoint through the edge equals direct (status, headers,
body, and raw HTTP over TCP); grants refuse what they should, including
an input service on a shared router and per-agent/per-port player grants;
backpressure, cancel, deadlines and the edge's unbind/rebind; serve() in
control-bus mode; the session runtime's service contracts over the bus.
Conflicts: deploy/build/package scripts (flysim-session, fly-shadow and fly-session all
built, packaged and given cpuset drop-ins; fly-runtime and fly-shadow-run both converged),
fly-legacy-session Cargo.toml and lib.rs (service and shadow both kept, tokio gains signal),
runbook and implementation guide (both sections kept).
shadow::run follows the live service's per-process trace files: each
segment boots a session from that process's startup save (a fresh start
powers on instead), replays the transition's admissions, runs it, takes
the live captures in the live order around a deferred rollback, and
compares its own trace line field by field, the ledger digest, and the
FLYSIM01 bytes of every live save (host-fields and archive-order
substituted). The first difference stops it with a diverged verdict and
divergence.json. A spool copies live generations as they appear; a lag
guard backs off while the live fly loses real time.
verdict.json is fly-shadow-verdict-v1, the contract CUT-01 reads;
fly-shadow check applies the cutover rule. trace::compare_line is shared
with trace::compare. tests/shadow.rs runs the real service through a
restart under a shadow and plants four differences, each caught with the
right kind, field and step.
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 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).