Commit graph

292 commits

Author SHA1 Message Date
acamilo
b3f6d6fbba Merge port/shadow-01 (SHADOW-01) into v0.7.0 release candidate
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).
2026-09-30 10:09:01 +00:00
acamilo
b996695f0a Merge port/serve-01 (SERVE-01) into v0.7.0 release candidate
Conflicts in fly-legacy-session task.rs (feed record next to PERF-01 profile spans) and
fly-session coordinator.rs (media_bytes doc, read_agent_extension and trim_records kept
alongside PERF-01 spans, publish span and publish metric both kept).
2026-09-30 10:06:03 +00:00
acamilo
0b56e03ae3 shadow: a live process that leaves no trace fails the verdict; the test builds the flysim it runs
tests/shadow.rs failed with 'one trace file per process' (0 vs 2) on a
build box because it ran a flysim binary that was not built from the
tree under test: cargo test -p fly-legacy-session does not build
flysim's binary, and the box's bx target directory was shared by name
with other trees, so the binary beside the test predated FLY_TRACE_DIR
and wrote no trace. Reproduced by running that test binary against its
stale flysim; not a timing or segment-handling bug. The test now builds
the flysim binary itself (cargo build -p flysim --bin flysim, same
target directory and profile), proved on a target another tree had
populated.

Production could miss a whole process the same way (a trace that
cannot be created, a failed consumer check), so the shadow now holds
every flysim boot header in the live sugar journal since it started to
a trace file created during that boot; an untraced process is a
coverage divergence and fails the verdict. In FLY_TRACE_DIR mode a trace
that cannot be created no longer stops flysim from starting (it runs
untraced and the shadow fails), and a heartbeat dated ahead of the
clock counts as fresh. The test adds an untraced third process and
expects the coverage divergence.
2026-09-30 04:57:50 +00:00
acamilo
e04b0c76b0 session_trace: boot parity accepts the adapter migrations v0.6.7 deploys with
The live checkpoints the boot parity starts from are pokered-unique8-v7 files;
since row 68 (v8) a boot takes them only with FLY_ACCEPT_ADAPTERS, as the
v0.6.7 deploy sets it. The test sets the adapter's own MIGRATES_FROM when the
environment names none; both runtimes read the same list.
2026-09-30 04:11:06 +00:00
acamilo
f7ca35ba2c infra: the shadow guard survives the shadow's crash-restart delay; check needs a live guard and a baseline; refuse a verdict dated in the future
Review round 3, G1-a: the guard stops only when flyshadow's ActiveState is inactive or failed
(systemctl show), not while it is activating/auto-restart. check also requires the guard timer
active and baseline.json. allows_cutover refuses an updatedAt more than 60 s ahead of the clock.
Lint drives the guard and check with a fake systemctl; a real systemd 257 user manager run is
kept in the review notes.
2026-09-30 04:06:38 +00:00
acamilo
5a7747210f Merge main (v0.6.7: row 68 damage reward, adapter pokered-unique8-v8) into port/shadow-01 2026-09-30 03:16:36 +00:00
acamilo
2058fff54a Merge main (606e386, row 68: pokered-unique8-v8) into port/perf-01 2026-09-30 03:09:59 +00:00
acamilo
8618e38a5f fly-session: clippy (box the bus request), race test starts from its torn state
The admission race test (TASK-01 R2-3) spawned its hammer before the first
iteration set the queue up; on a loaded build box the hammer could admit into
the empty initial queue, which is a legitimate admission, and fail the test.
2026-09-30 02:55:51 +00:00
acamilo
9a2d7c0286 PERF-01: the local lane carries every endpoint method but Worker.*; contract amendments
- worker: local_lane_carries is every method but Worker.*, so an endpoint's
  read-only extension (SERVE-01's Legacy.FeedStatus) no longer crosses the bus.
- ipc-v1 section 1, bus-v1 section 12, step-v1 and the framework README: the
  in-process local lane and in-memory artifacts, dated 2026-09-30.
2026-09-30 02:42:17 +00:00
acamilo
fa8c9305a7 PERF-01: spikes gathered per tick, 1 Hz session snapshots, fewer copies
- flybrain-core: LifNetwork::tick_spikes, the last CPU tick's spike list
  (None under the GPU backend); a test proves it is exactly the neurons the
  tick stamped and that window unions equal the last_spike_ms scan.
- legacy agent: Prepare runs its ticks one at a time and ORs each tick's list
  into the transition's bitset; Commit uses it instead of scanning 139,255
  last-spike times (falls back to the scan when no list is kept).
- legacy composition: a service session publishes its committed snapshot
  every 60th boundary (plus every boundary with events or boundary actions);
  nothing in the release subscribes, and each publication seals copies of
  the frame and the audio.
- coordinator: a single dispatch job is called in place; worker shell moves
  the reply result instead of cloning it; publication promotions begin when
  Advance answers whatever the cadence.
- profile: record() for a sample from another clock; finer spans (shell,
  local lane, handlers, advance parse/build, the brain's phase clock).
2026-09-30 02:15:25 +00:00
acamilo
3914f824ce rewards: rom_damage reports how long after the MOVE press each hit is paid 2026-09-30 02:11:45 +00:00
acamilo
17c4c88423 session types: the legacy composition names pokered-unique8-v8
The example composition's adapter and FLYSIM01 string move to v8 with the live
adapter, and the fixtures are regenerated by update_fixtures (composition digest
44916db0... -> d37ccb40...); invalid.json's hand-written cases follow, with the
one deliberately mismatched string moving from v6 to v7 so it is still the
previous adapter. Branches that carry these fixtures (the port stack) regenerate
them the same way on rebase.
2026-09-30 02:11:45 +00:00
acamilo
dfc9a2d227 rewards: damage, adapter v8 with a v7 migration
The operator's decision of 2026-09-29, chosen over a pad rule that would have
withheld a stat move once used: pay the fly for the HP its own attack removes
from the Pokemon it is fighting, so the move that deals damage is worth more
than the one that does not. Row 67: the live fly lost the Pewter Gym's Jr.
Trainer 29 times running with TAIL WHIP 155, BUBBLE 23, TACKLE 0, and nothing in
the catalog paid for anything inside a battle it did not win.

`damage`, the twelfth kind, 80 ms. 0.20 per whole enemy Pokemon's max HP, paid
in proportion on the sample the HP drops; +0.05 when the fly's hit knocks out a
trainer's Pokemon; at most 0.50 a battle (the trainer rule's own value, which
two Pokemon reach exactly). A wild battle pays at the wild-KO rule's scale, 1,
1/2, 1/3, for its first three battles per (map, species, level) that paid any
damage, then nothing, and a rollback blocks every key that has paid
(damageCounts, replay-blocked damage:<key>). Trainer battles keep no lifetime
ledger: a trainer is fought again only after losing to it.

The fly's attack is a drop in wEnemyMonHP on a sample where hWhoseTurn ($FFF3,
counted from the hJoyLast anchor to the end of HRAM) reads 0 and wPlayerMoveNum
is not STRUGGLE. ApplyDamageToEnemyPokemon runs in ExecutePlayerMove with it 0;
the enemy's poison, burn and Leech Seed ticks (HandlePoisonBurnLeechSeed picks
the enemy's HP because it is 1), its recoil, confusion self-hit, Explosion and
Substitute all land with it 1. Every drop moves the target's mark, so a tick is
never paid later as part of a hit. A target is (wEnemyMonPartyPos, species,
level) and keeps its lowest HP for the battle, so a heal is never paid twice and
a switch back keeps its mark; it is marked when it first reads full HP, because
InitBattleVariables leaves the last battle's wEnemyMon in place -- in the row 67
ring that is the same trainer's Diglett at the HP it won with.

v7 -> v8. STATE_VERSION stays 4: damageCounts and battle.damage are optional and
absent in a v7 state, which restores with no wild key paid and a battle in flight
marked where it stands, so nothing lost before the restore is paid.
MIGRATES_FROM is [v7, v6]: the chain composes, since v7's own migration (the
item seed) still runs in this build on the first sample without items:seeded.

Feed: `damage` has no counter (RewardKind::from_adapter -> None). On `wildwin`
the stage would fold every hit into "N wild wins", false of a trainer battle and
of one the fly goes on to lose. A hit reaches the page as a reward event with
its own label, HIT #<species> FOR <n> HP[ KO]; the feed's closed kind set does
not move.

The compatibility string differs from main's in exactly one segment:
pokered-unique8-v7 -> pokered-unique8-v8.

Tests: the rule (fly's turn vs the enemy's, Struggle, heal, switch, twin slots,
stale enemy, restored battle, cap, knockout, wild scale, round trip); the adapter
(proportional pay, TAIL WHIP nothing, poison then hit, the ring's second battle,
wild scale and rollback, one read per address, checkpoint round trip, a v7 state
mid-battle); compat_migration (v7 and v6 FLYSIM01 envelopes refused without
their own opt-in and restored with it; the v7 one mid-battle pays only what
follows); rom_damage (FLY_ROW67_CHECKPOINT: the live v7 string and ledger
migrate; from the live state BUBBLE and TACKLE are paid on every drop they cause
and TAIL WHIP never, the fly's hits land with hWhoseTurn 0 and the enemy's with 1).
2026-09-30 02:11:45 +00:00
acamilo
c433316179 symbols: wPlayerMoveNum and wEnemyMonPartyPos for the damage reward
resolve_wram.py --emit resolved both from ram/wram.asm at the pinned commit,
each bracketed by pinned anchors (wWalkCounter/wEnemyMonSpecies and
wEnemyMonHP/wEnemyMonStatus): $cfd2 and $cfe8. 77 of 81 pinned addresses
re-derived, no disagreement. wEnemyMonPartyPos is battle_struct's third field
(macros/ram.asm: Species db, HP dw, PartyPos). gen_symbols.py's EXTRA_RAM
carries both so a regeneration keeps them.
2026-09-30 02:11:45 +00:00
acamilo
d4b448f14c Merge port/task-01 (eaf588d, TASK-01 round-2 notes) into port/perf-01 2026-09-30 01:46:10 +00:00
acamilo
9aa7b92d04 fly-legacy-session: in-process sessions over the local lane; speed_ab arms
LegacySession starts in-process participants with Via::Local
(FLY_SESSION_LOCAL_LANE=0 keeps the bus path, a measurement knob). speed_ab
takes FLY_PERF_ARMS (local, bus, process), FLY_PERF_SERVICE (the service
host's per-frame reads), FLY_PERF_WORKERS (1 or 2 Tokio workers) and prints
the legacy brain's own tick time beside the session's.
2026-09-30 01:46:07 +00:00
acamilo
aaf660d48e fly-session: the in-process local lane, and the per-frame costs it leaves
- worker: one Shell per worker serves its bus loop and a LocalLane. A local
  request goes through the same admission (classification, body digest,
  result cache, arrival-order ticket, endpoint lock) and answers the same
  SessionRpcOutcome, without a bus message. Worker.* stays on the bus.
  HandlerCtx::seal keeps a local request's reply media in memory.
- rpc: a WorkerRef carrying a lane sends endpoint methods over it; sealed reply
  handles reach the caller in memory under the same reference; a bus call
  carries sealed copies of in-memory attachments (promote).
- launcher: Via::Local offers in-process participants over their lane.
- coordinator: publication attaches sealed copies of in-memory media, begun
  when Environment.Advance answers; defer_snapshots (publish without waiting
  for admission, settled at the next snapshot); digest_views and media_bytes
  as SERVE-01 has them.
- legacy env/agent: frame, memory image, audio and spike bitset sealed via
  HandlerCtx::seal; the spike bitset is built eight neurons a byte.
- profile: span maxima, enabled(); the agent runs the brain's phase clock
  when profiling.
- tests: every synthetic transport test also runs over the local lane; the
  two publication-identity checks state the sealed copy there.
2026-09-30 01:46:07 +00:00
acamilo
35d5a1f38d flybus: in-memory artifacts that never cross a router
Artifact::in_memory holds an immutable buffer in the caller's address space
(store id 'in-memory', no digest): it reads, clones and retains like any other
handle without a router round trip, and a bus call, reply or publish refuses it
as an attachment before anything is sent. Artifact::to_memory reads a sealed
handle into one under the same reference. PERF-01's local lane hands these
between participants of one process.
2026-09-30 01:46:07 +00:00
acamilo
a472adcaf4 fly-shadow: review round 2, R3, G1 (in-shadow back-off), N3 (SHADOW-01)
R3: allows_cutover floors the window at REQUIRED_BRAIN_SECONDS (10,800):
a verdict run with a shorter --required-brain-seconds never passes
check. G1: the in-shadow back-off (LagJudge) judges the live lag growth
rate against fly-shadow-run's pre-start baseline (baseline.json lagRate
and margin, re-read every poll) instead of any growth, and lifts itself
for 10 minutes when a pause did not help (the shadow is not the cause);
--lag-guard-margin replaces --max-live-lag-seconds. N3: lagTransitions
is refreshed at every verdict write, backed off or not, over the rest of
the current file and every newer one.
2026-09-30 01:39:52 +00:00
acamilo
e085876d79 fly-shadow: review fixes R1, R2, N3 (SHADOW-01)
R1: the verdict hashes flysim-session (SERVE-01's service) with the
other release binaries; check takes --current (default /opt/fly/current)
and --binary (default flysim-session) and requires the verdict's release
to be the directory the link resolves to, every shadowed binary
unchanged there. R2: a session that does not start, a restore-gate
refusal, a capture with no agent, an unrecorded transition and an
unbuildable trace line are divergences; skips carry a kind and only the
live side's own kinds (startup-save-gone, operator-reward-pulse,
trace-cap, no-transition) allow a cutover. N3: pass and the cutover rule
require one live save compared per 600 brain seconds and at most 10 %
unavailable, and the cutover rule a shadow at most 3,600 transitions
behind. N1: the shadow writes the consumer heartbeat, removes it when it
stops, and prunes history files. The coordinator's history is bounded
per segment. The test adds a gate refusal (a boot divergence) and waits
for the heartbeat; so does the rehearsal script.
2026-09-30 01:39:52 +00:00
acamilo
4bf664ee22 flysim: the trace needs a live consumer and a bounded directory (SHADOW-01 review N1)
In FLY_TRACE_DIR mode a process starts no trace unless the shadow's
heartbeat (<dir>/consumer) is fresh (FLY_TRACE_CONSUMER_STALE_SECONDS,
600), and a running trace stops within a minute of frames once it is
stale ({"truncated":true,"reason":"no-consumer"}). Before a
process creates its file the oldest trace files are deleted to keep the
directory under FLY_TRACE_DIR_MAX_BYTES (8 GiB). A dead or diverged
shadow can no longer leave the live service tracing.
2026-09-30 01:39:52 +00:00
acamilo
12f361436f fly-legacy-session: the shadow run, its comparator and verdict (SHADOW-01)
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.
2026-09-30 01:39:42 +00:00
acamilo
105f526200 flysim: trace switches for the shadow run (SHADOW-01)
FLY_TRACE_DIR writes one FLY_TRACE file per process (a restart truncated
the single path), FLY_TRACE_MAX_BYTES caps a file (4 GiB in directory
mode: a trace nobody consumes cannot fill the disk), FLY_TRACE_LEDGERS=<n>
adds ledgersDigest every n transitions. frame::ledgers_string is now the
one definition of the ledger string both runtimes digest. Recording only:
no behaviour field and nothing the fly does changes; compatibility string
unchanged.
2026-09-30 01:39:42 +00:00
acamilo
68bde25493 Merge port/task-01 (TASK-01 round-2 fixes) into port/serve-01; hand begun captures to the writer on pause 2026-09-30 01:37:12 +00:00
acamilo
eaf588d2e2 TASK-01 round-2 notes: saves reach the writer on a failed step and on pause, every save outcome reported, sugar admission atomic with the commit
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.
2026-09-30 01:30:56 +00:00
acamilo
405cf11498 flysim: read adapter.progress() once per publish
feed_game and feed_milestone each called adapter.progress() (a pure read), so every publish
computed it twice. Both now take the snapshot as an argument; publish and the session service
read it once. The header bytes are unchanged (service_parity and journal_replay pass).
2026-09-30 00:11:25 +00:00
acamilo
12940a5215 tests: speed_ab, the session against the legacy loop interleaved in chunks on one box 2026-09-29 23:08:12 +00:00
acamilo
d35eda399b N5: captures off the loop; wanted and cached artifacts held concurrently
- worker: a handler may finish its reply outside the endpoint's lock
  (HandlerReply::deferred); admitted mutations take the lock in arrival
  order (LockOrder), so a request sent before another is handled first;
  a reply's cache holds are taken concurrently.
- legacy agent: State.Capture copies the state under the lock and
  encodes, digests and seals it off the lock, so the next Prepare ticks
  while the payload is written.
- rpc: send/finish split (SentCall); the caller's holds on wanted
  attachments are taken concurrently.
- coordinator: begin_capture sends every State.Capture and returns;
  finish_capture collects them. LegacySession begins a boundary's saves
  and collects them after the next transition, then queues them to the
  writer thread.
2026-09-29 23:03:37 +00:00
acamilo
1bfaf923b2 N5: publication at the feed's rate, in-memory transport in-process, capture spans; docs for the fix round
- 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).
2026-09-29 22:20:39 +00:00
acamilo
2fc9fd7247 tests: the reward segments include row 64 and the row 65 yard 2026-09-29 21:58:23 +00:00
acamilo
42f3c91c29 journal_replay: compare the adapter ledger as numbers
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.
2026-09-29 21:54:41 +00:00
acamilo
5cf40c3148 Merge port/task-01 (TASK-01 review fixes) into port/serve-01
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.
2026-09-29 21:29:31 +00:00
acamilo
46d07260e9 TASK-01 review N5: the per-boundary costs measured, the world's seals concurrent, bounded history
- 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.
2026-09-29 21:06:32 +00:00
acamilo
0776fab225 service_parity: two sugars in one drain; repeat a run whose recorder fell behind
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).
2026-09-29 20:48:37 +00:00
acamilo
7a61877e78 TASK-01 review fixes: an artifact-backed task ledger, the pending pulse, the palette seed, queued saves
- 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.
2026-09-29 20:47:19 +00:00
acamilo
98f29e47c6 fly-legacy-session: flysim-session, the session runtime as the live service
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.
2026-09-29 20:31:13 +00:00
acamilo
4fcd9233c7 fly-session: what a service host needs from the session
- Legacy.FeedStatus (capability legacy-feed-status-v1): the legacy agent's
  read-only feed status at a committed boundary -- rates, pulse, the whole
  plasticity statistics and the decoder's baselines/scores -- which no
  session message carries and the legacy header and /status report.
- Coordinator::read_agent_extension (never fences), media_bytes (the
  committed view/audio chunk), digest_views (off for a host that reads the
  details only for commit attachments), trim_records (the trace, phase log,
  audit and injection log grew with every transition: ~120 KB/s on the live
  fly), and timings for the feed status and the per-step publication.
2026-09-29 20:31:13 +00:00
acamilo
95614122a9 flysim: serve() shell and shared feed-header builders for a second runtime
flysim::run is now serve(config, Sim::boot + Sim::run): serve binds the feed
(or the feed bus), the control API and the metrics listener, handles the
signals and runs any runtime on the calling thread with the shared state,
the snapshot slot and the command queue. The fly-derived pieces of a feed
header (feed_rates/learning/game/milestone/sugar) and the chat admission
(admit_chat) are free functions both runtimes call; DcBlocker gains an f32
entry point for audio already converted with v/255. No behaviour change:
the legacy frame, header bytes and compatibility string are unchanged.
2026-09-29 20:31:13 +00:00
acamilo
f34b236f12 tests: the service test waits for the first snapshot before reading /status
Some checks are pending
ci / node 22 (test + typecheck) (push) Waiting to run
ci / rust stable (cargo test --workspace --release) (push) Waiting to run
ci / infra/tests/lint.sh (push) Waiting to run
ci / playwright apps/stage (allowed to fail) (push) Waiting to run
/healthz goes green before the first snapshot is published, and until
then /status carries the placeholder header (a one-rung BOOT ladder). A
loaded box read that window and failed 'the ladder length is in
/status'. Bounded wait (30 s); every assertion unchanged.
2026-09-29 20:15:04 +00:00
acamilo
1700bd58e9 Merge feat/row69-throw-name (reviewed: APPROVE-WITH-NOTES): throw on low HP only, the fly names its catch
# Conflicts:
#	infra/docs/macros-traps.md
2026-09-29 19:34:10 +00:00
acamilo
70aa740b37 reset: a sugar journal that cannot be cleared is a warning once the reset is complete
review-state-02 N3: the error made fly-reset-to-milestone exit non-zero
after a finished reset, so fly-loop-reset reported it failed and the
stream's splash said so.
2026-09-29 18:45:05 +00:00
acamilo
5a05b1667a Merge fix/loop-row67 (reviewed: APPROVE-WITH-NOTES)
# Conflicts:
#	docs/design/macros.md
#	infra/docs/macros-traps.md
#	services/flysim/crates/flysim/tests/rom_macros_mode.rs
2026-09-29 18:43:50 +00:00
acamilo
494477e1f2 Merge test/row66-shop-catch (reviewed: APPROVE-WITH-NOTES) 2026-09-29 18:43:19 +00:00
acamilo
e561c81295 TASK-01 on STATE-02: the store, the boot and the task ledger
- 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.
2026-09-29 18:16:55 +00:00
acamilo
e6fa92613a Merge port/integration (STATE-02) into port/task-01 2026-09-29 18:11:33 +00:00
acamilo
851b4f85c4 fly-session: clippy (slice from_ref) 2026-09-29 18:11:30 +00:00
acamilo
9cc3a54dc9 Merge port/state-02 (unreviewed, integration base) 2026-09-29 18:11:26 +00:00
acamilo
0d444bb00f tests: row 69 ROM tests; trap_hunt counts the throw's pad and the keyboard
rom_catch: the low-HP pad is the ball (FLY_ROW69_CHECKPOINT), the
keyboard after a catch is the fly's own buttons and closes, a fly that
types nothing is ended by the bound, and the two naming bytes are where
the cartridge stores them. The row 66 catch drive passes the readout's
own buttons and leans on A and B on the keyboard.

rom_macros_mode: the keyboard is drawn, so its CONFIRM is not an
Unknown pad on nothing.
2026-09-29 18:07:15 +00:00
acamilo
e006db3742 macros: a ball at low HP is the only attack, and the fly types its catch's name
Two operator decisions (2026-09-29, row 69).

Throw on low HP only: in a wild battle with THROW BALL dealt and the
wild Pokemon at the HP where ItemUseBall's HP factor saturates
(W = (MaxHP*255/BallFactor)/max(HP/4,1) >= 255: about a third for a
Poke Ball, a half for a Great Ball), MOVE 1-4, SWITCH, RUN and the bag's
BACK are withheld. ITEM stays for a hurt thrower. Every precondition of
THROW BALL still gates it, so no ball, a caught species or a trainer
gives the ordinary pad back.

Let the fly name it: the naming screen is read (menu bytes, the
keyboard's box, the underscores; wNamingScreenNameLength and
wNamingScreenSubmitName pinned from the cartridge's own stores) before
the battle test and reads Unknown. Its pad is the fly's own D-pad, A, B
and START, passed through Observed::raw while nothing is bound. Once
the name is full or sixty brain seconds have run, CONFIRM alone is
dealt and presses START until the keyboard closes.

Also moves two doc comments row 66 split from their items (review N3).
2026-09-29 18:07:15 +00:00
acamilo
7c8d5a33dc fly-legacy-session: pokered-macros-v1 on the session framework (TASK-01)
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).
2026-09-29 18:03:59 +00:00