rewards-learning: the catalog row, "Damage rewards" (what counts as the fly's
attack, the magnitudes against the catalog, what cannot be farmed, why `damage`
has no feed counter, the measured press-to-payout delay against the 5 s trace,
the migration) and an honesty paragraph. flysim.md: v7 -> v8 under "Restoring
across an adapter version", with the exact compatibility-string change.
macros-wram: hWhoseTurn, wPlayerMoveNum, wEnemyMonPartyPos and the stale
wEnemyMon. Deploy examples name pokered-unique8-v7 (example.env: add v6 to keep
the pre-v0.6.0 milestone archives restorable).
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.
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).
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.
/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.
macros.md 12.32 and the 13.1 table rows; macros-wram.md 15 (the two
naming bytes); feed-protocol: padEmptyMs is 0 on the keyboard;
macros-traps row 69 with the ROM tests and the connectome survey.
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.
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.
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).
AGENT-01 review: learning.updates fell back to plasticity.updates on every FLYSIM01 round trip.
Both runtimes now count reinforcement calls the same way (one per commit while the rule is
enabled) and write the count as the optional manifest member reinforcements, which old readers
ignore and old files lack (a reader then starts from plasticity.updates, once). The import's
checkpoint id is the file's generation (flysim01-g<N>), and the agent worker checks for a
staged or activated restore before it builds the replacement network.
The environment's memory image is now Emulator::read_memory_image: the
register windows read $FF (legacy-gameboy-v1 section 8, MEM-01 amendment)
and the read is neutral by construction, so the export/import guard is
gone. The toy golden's image digests are regenerated (only 'memory'
changes), the neutrality test states MEM-01's rule, and the ENV-01 guard
amendment is struck in legacy-gameboy-v1 and implementation.md. The
service traces still match in all three modes (rollback 3,199, climb
3,156, r58 11,043).
review-pii-guard N2 (a broken private regex made grep exit 2 and the scan
report clean) and N3 (an added line starting '++ ' was taken for a file
header). Tests for both; the env README names BRIDGE_ID_KEY and
BRIDGE_SECRET_KEY.
The export assembles a FLYSIM01 file from the agent's FLYAGT01 and the world's FLYENV01 capture
payloads, the task's {reward, ratchet} and the host's fields, through flysim-store's encoder.
The import reads a file back into those halves. The agent payload is the shipped form of
AGENT-01's prototype: learning.updates starts at plasticity.updates, and the file's framebuffer
goes in an inputFrame chunk that StageRestore installs, as the legacy restore does.
LegacyCheckpointer keeps the legacy loop's generations, hot and durable intervals, per-process
milestone archives and writer thread. restore_from_store walks the legacy candidate order and
takes the next candidate on any refusal. The agent worker's payload encoder is now one shared
function, and legacy_parity seeds through the shipped import.
store.rs and journal.rs move unchanged from flysim into the new flysim-store crate, which flysim
re-exports, so the session runtime can write and read the same store (STATE-02). The journal gains
a per-process boot header, rotation at 4 MiB with three kept files, and clear(), which
flysim --reset-to-milestone now calls after copying the stores aside.
Both slices add a worker to the same launcher and CLI; the resolution keeps
both: the legacy-agent and legacy-environment subcommands, launch structs,
flags, flag round-trip rows and the flybrain-core/flybrain-gb/flate2
dependencies. Cargo.lock regenerated by cargo.
tests/rom_memory_image.rs runs a live arm and a shadow task+executor that
reads only per-boundary images and the cartridge, from nine rom-env
checkpoints: every MacroState answer, deal, pad, decision, reward, ledger and
rollback compared frame by frame, and every shadow read inside the captured
ranges. Plus the gameboy-memory-inspection-v1 encoding against the session
types.
One read-only bulk read in the shim, fly_gb_read_memory_image: the address
space's memory in address order, the register windows (VRAM, OAM, I/O) read
$FF because binjgb's catch-up on a register read moves the exported state.
MemoryImage, Cartridge and ImageReader put an image and the ROM behind
MemoryReader, so the same macro engine and adapter run over it; the
emulator's bank reads go through the same Cartridge. ROM tests prove the read
leaves the state byte-identical, equals the single and cached reads, changes
nothing downstream, and measure its cost.
tools/pii-scan.sh scans the tree, a commit range (added lines and messages) or a push
(pre-push protocol, incl. annotated tag messages). Generic shapes stay in the script; the
proper nouns move to the operator's private list ($FLY_PII_PATTERNS), which can also name
env files whose values are matched as literals and never printed. lint.sh section 5 now
runs it (a missing list is a note, so public CI still passes) and no longer spells the
names with one bracketed character. tag-release.sh fails closed without the list and scans
the tree and every line since the previous tag. tools/install-hooks.sh installs a pre-push
hook that scans pushes to github. Tests in infra/tests/pii-scan-test.sh.
The Twitch app id/secret entry names were spelled in 06-secrets.sh defaults and four docs.
06-secrets.sh now takes BRIDGE_ID_KEY and BRIDGE_SECRET_KEY from the env file (placeholders
in example.env) and skips twitch-app with a warning when they are unset; the docs use
twitch/<app>-client-{id,secret}, twitch/<bot>-token and twitch/<channel>-key.
On the first visit the Viridian clerk's script hands the parcel over, and
his counter sells nothing until Oak has it. MacroState::parcel_delivered
reads EVENT_OAK_GOT_PARCEL (defaulted true).
docs/design/macros.md 12.30 and infra/docs/macros-traps.md row 66: the
GO SHOP ring, the one-button purchase, the bag after a catch, and the
measured choices with the connectome.
The no-PP checkpoint is a trainer battle with a party of one and no Potion:
RUN, THROW BALL, ITEM and SWITCH have nothing behind them, and spent moves
are off the pad since 12.23/12.27, so MOVE 1 (FIGHT, then Struggle) is the
one button and the battle ends in 1,487 frames. The assertion demanded a
second button; it was red on main whenever FLY_NOPP_CHECKPOINT was set.
From the live checkpoint: on every own-turn frame the pad deals every move
with PP and an effect, and a uniform choice beats the Jr. Trainer the live
readout lost to 29 times. FLY_ROW67_CHECKPOINT.
A whiteout ring in the Pewter Gym ran for an hour and a half without a
flag: every macro completed, and a stray tile reward on a walk back reset
the unrewarded rule. Reward lines now carry their rewardKind, and
unwon-battles flags 24+ MOVE n decisions with no wildwin/trainer/badge
reward in the window, on two probes, with no new ground. Report only, as
every check-10 rule; lint case 8 fails on main and passes here.
FLY_TRACE carries digests, not the frames or the {boot, bound, location} context, so it checks
a worker rather than drives one. legacy_parity gains read_frame_trace and check_against_trace
(ticks, clock, exact remainder, rates digest, spike-set digest, decision; the script held to the
trace's sugar, frames, rewards and rollback), RestoredSource, and
AgentDriver::seed_from_legacy_state for a worker started from a FLYSIM01 agent state.
flysim/tests/agent_trace_parity.rs runs LegacyFrame on the ROM with the trace on, records the
missing inputs, and checks the direct reference and the worker in-process, on a thread and as a
process: toy raw from power-on (FLY_ROM), and gameboy-legacy-fafb-v783-v1 macros mode from a
stream checkpoint with sugar and a ratchet rollback (FLY_AGENT01_FAFB=1). fly-session is a
flysim dev-dependency only.
A FLYSIM01 import starts learning.updates at the legacy plasticity.updates
(legacy_reinforcements): starting at zero broke changed <= updates on the live checkpoint.
Operator decision on row 66. Measured with the connectome, the fly walked
to the Viridian clerk again and again and never chose TALK, so the four
choices a purchase took at the counter never happened. BUY BALL is now also
offered on the overworld pad inside a mart whose first stock row is a Poke
Ball (Viridian, Pewter, Cerulean), while service_needed holds (no ball,
money for one, no Oak's parcel) and the clerk is not in the blocked window.
One press walks to the clerk, talks, advances the greeting to BUY/SELL/QUIT
(checking the first row is a Poke Ball), buys one, answers the price box
and is done when the wallet drops. The open-counter BUY BALL is unchanged.
Unit test for each offer condition; ROM row66 floor purchase from
FLY_ROW66_MART_CHECKPOINT: base never dealt on the floor, no ball; branch
dealt, started, done, one ball, 200 paid.
trap_hunt: a shop/ball/catch tally (pad frames, starts, outcomes, balls,
party+box, Pokedex owned, mart entries) and FLY_TRAP_LOG_MACROS=1.
scene_probe offers: catch, party and Pokedex counts, FLY_PROBE_SCREEN_*
screen dumps, FLY_PROBE_SAVE_MART to save a mart entrance.
Row 62 re-deals GO SHOP/GO HEAL whenever the service is needed, with no
window. Live on v0.6.5 from the rung-8 archive that was a ring: GO SHOP to
the Viridian clerk, GO OUT/GO OBJECTIVE back out without TALK, GO SHOP again
(33 in 35 minutes). A completed GO SHOP/GO HEAL facing the counter person now
records TargetKey::Counter on the building's map; the service walk toward it
is withheld for the reached window, from the street and inside. TALK at the
counter is unchanged.
ROM row66 test (FLY_ROW66_MART_CHECKPOINT): base 31 street GO SHOPs in 10,000
frames, branch 0.
wListMenuID keeps ITEMLISTMENU after the list closes, so from a catch to the
end of the battle (caught text, Pokedex page, nickname offer, naming screen)
the pad read as the bag: BACK and THROW BALL, whose A presses typed the name.
The bag now also needs its TextBoxBorder at (4,2)-(19,12).
rom_catch: row66 test (THROW BALL dealt after the catch: base 666 frames,
branch 0), and both tests retry from idle offsets because one ball misses
about two throws in three and frame timing decides which.
The emulator half of flysim's LegacyFrame behind the environment methods:
the one-frame setup scaffold, one joypad batch per Advance, f32le audio
(sample/255, unfiltered), the per-boundary memory image behind the MEM-01
seam (read between an export and an import, because emulator_read_mem syncs
OAM/VRAM/timer/STAT/LY), gameboy-slots-v1 SaveSlot/RestoreSlot, capture and
staged restore, and the world's half of FLYSIM01. SaveSlot, RestoreSlot and
Agent.Rollback are step mutations under the ipc-v1 operation key. The parity
harness (toy cartridge, direct reference in LegacyFrame order, bus driver,
FLY_TRACE replay) is in legacy_env_parity.