Commit Graph

16 Commits

Author SHA1 Message Date
Zach Clendenen
9e2dbc207d feat(streaming): hydrate and resume only states the booted core can load
A RetroArch container's core filter comes from the core activate reports
booting, or before launch from the configured core and the broker's
default (asked over its cores route and cached for a minute). Hydration,
an explicit resume and the config payload all apply it, so a state
written by one core never lands where another core's quick-load reads it.
A resume the booted core cannot load launches fresh, and the resume
endpoint refuses such a state up front with a 400.
2026-09-27 16:42:02 -05:00
Zach Clendenen
21c5b65d17 fix(streaming): address Greptile review of the RetroArch core override
- Retry the exit once when a broker boots the wrong core and the first exit
  fails: the broker refuses every activate while that game runs, and the
  released claim leaves nothing behind to stop it.
- Stamp the launch's core tier on the session and report it through the
  status poll, so a tab that missed launch-ready still warns about an
  untested or broken core, once.
- Translate the core-untested and core-blocked warnings in every locale.
2026-09-27 16:41:38 -05:00
Zach Clendenen
8336f127b6 refactor(streaming): simplify pass on the RetroArch core override 2026-09-27 14:39:13 -05:00
Zach Clendenen
2d25618ee2 fix(streaming): code-review pass on the RetroArch core override 2026-09-27 14:29:47 -05:00
Zach Clendenen
cd813caeba fix(streaming): tighten core override edge cases from review 2026-09-27 09:49:31 -05:00
Zach Clendenen
66e268cce9 feat(streaming): ask import-spec about the configured RetroArch core 2026-09-27 09:49:17 -05:00
Zach Clendenen
a4d594404a feat(streaming): send the RetroArch core on activate and end sessions a broker booted on another 2026-09-27 09:49:03 -05:00
Zach Clendenen
9ade9dfdb8 simplify(pr-ready step 3): collapse duplicated branches and dead code
- config: one _keys_by_label grouping serves both the unique-label map
  and the shared-label warning.
- claim_session: one abort-and-raise for either refused pick; the
  newest-save lookup is a single conditional expression.
- launch: pick refusal fields off one optional ImportRefusedError.
- imports: skip_state is always true for a foreign save archive; drop an
  unreachable KeyError and the unused str form of _read_member.
- webstation: ImportSpec.state_channel is a Literal.
- Stream.vue: the 400 refusal hint folds into the generic server branch;
  pickableStates drops a guard nativeStreamStates already has.
2026-09-25 19:20:30 -05:00
Zach Clendenen
c9f1d5e33b feat(streaming): offer only the foreign picks a broker imports, and honour the picked state over an older save's exit state
The streaming config now ships import_kinds per container, from the broker's
cached import-spec, so the picker hides foreign saves and states a broker would
refuse instead of failing them after the launch starts.

On DuckStation and RPCS3, a save pick other than the newest archive no longer
lets that archive's own exit state stand in for the picked state: the state
rides the import archive, or the resume is reported lost where the broker
cannot import it.
2026-09-25 12:53:04 -05:00
Georges-Antoine Assi
b6dcfc6a3c polish(pr-ready step 4): trim comments and docstrings, keep the newest-state lookup off the event loop
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:48:16 -04:00
Georges-Antoine Assi
8f7d092d67 simplify(pr-ready step 3): one refusal type, one resume-import value, one zip staging loop
- build ImportRefusalSchema directly in the broker, dropping the mirror dataclass and the asdict conversion
- replace the resume_via_import/resume_needs_import pair with one ResumeImport literal
- stage base and foreign zips through a shared helper, parse each member once, and read the base only when something is imported
- ImportSpec.kinds is a set of names, and a successful import-spec answer is cached briefly so one claim asks once
- show the suggested emulator's display name in the refusal hint
- trim long comments and the dangling spec reference

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:43:08 -04:00
Georges-Antoine Assi
eaea7e6db1 review(pr-ready step 2): decide import eligibility on the won container and release the claim on refusal
- recheck import-spec right after the win; refuse a foreign save/state the won broker will not import instead of sending it natively
- only route an older native exit state through the import archive when the broker takes archive-channel states
- withhold resume_slot from activate when the import was lost
- import_spec: webstation-only, ACK timeout, catch http.client errors
- keep a foreign archive's own state out of a save import; preserve member timestamps and modes
- fix cs_CZ/pl_PL plural forms, a stale picker comment, and change-history docstrings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 11:33:48 -04:00
Zach Clendenen
068bb9bce1 fix(streaming): surface the refusal truncation count, fall through failed foreign reads, and log malformed import-spec replies 2026-09-22 07:12:57 -05:00
Zach Clendenen
31db0b5374 fix(streaming): scope the import-spec cache to the container and treat a malformed broker reply as unknown rather than crashing 2026-09-22 07:12:57 -05:00
Zach Clendenen
0eefde57a6 feat(streaming): add webstation.import_spec broker capability discovery 2026-09-22 07:12:57 -05:00
Georges-Antoine Assi
f78348da0f refactor(streaming): move the endpoint's domain layer into handler/streaming
endpoints/streaming.py had grown to 3778 lines, but only about a third of
that was routes. The rest was a second copy of the layer handler/streaming
already exists to hold: broker verbs, webstation protocol translation,
state and save and memory-card transfer, session teardown.

Split it along those seams rather than by route, and give claim_session
the same treatment: its 406 lines are now four named phases.

Cross-module calls go through the module (states.pull_state_to_library,
commands.stop) instead of imported names, so one definition site is what
tests patch and what every caller reads.

No route path, scope or response model changed, so the OpenAPI schema is
untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 18:47:18 -04:00