Commit Graph

13229 Commits

Author SHA1 Message Date
Georges-Antoine Assi
c573d328a8 Merge pull request #4807 from rommapp/claude/sync-deleted-saves-followup
fix(sync): follow-ups to deleted-save tracking
2026-09-26 13:17:24 -04:00
Georges-Antoine Assi
a06ec55060 refactor(sync): simplify pass over deleted-save tracking
- Move unrecorded_hash onto FSAssetsHandler, so sync_watcher and the
  push-pull task no longer import handler.asset_store (and with it
  scan_handler and every metadata provider, ~80 modules)
- Drop the PSP bundle's unrecorded_hash call: bundles are never slotted
- Skip the removal-times query when the device's copy already matches
- Restore per-row deletes in prune_slot: the single `id IN (...)` delete
  from the review pass deadlocked the threaded removal test 3/10 runs on
  MariaDB (0/25 per row)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 13:11:37 -04:00
Georges-Antoine Assi
f0d42102d0 fix(sync): code-review fixes for deleted-save tracking
Follow-up to #4789 from the code-review pass:
- PUT /api/saves/{id} records the replaced bytes of a never-hashed save
- rehash_save keeps updated_at, so a recompute is not read as a write
- unstamped legacy versions keep their removal time when another is lost
- prune_slot deletes its locked rows in one statement
- 0138 creates the slot index after the collation change

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 12:59:17 -04:00
Sam Dornan
d1ce4e3db2 fix(sync): make deleted-save tracking exact, complete, and effective on filled slots (#4789) 2026-09-26 12:33:54 -04:00
Sam Dornan
6002b8fdaa chore(docker): verify downloads with ADD --checksum and pin RAHasher by commit (#4781) 2026-09-26 11:35:02 -04:00
Georges-Antoine Assi
aa01f05e23 Merge pull request #4767 from rommapp/claude/github-issue-4678-w41e12
fix(auth): rename seeded permission groups to Viewer and Editor
2026-09-26 11:05:59 -04:00
Georges-Antoine Assi
6c7e5d296e Merge pull request #4742 from andest01/feat/frontend-eslint-guideline-rules
chore: delegate llm tasks to static analysis tools.
2026-09-26 11:03:41 -04:00
Georges-Antoine Assi
d946af0539 refactor(auth): replace is_system with system_key
is_system was true exactly when system_key is set, so 0137 now drops it
after backfilling the key, and downgrade rebuilds it from the key. The
group API returns system_key instead, and the admin UI reads it for the
system tag and edit warning.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:58:21 -04:00
Georges-Antoine Assi
84be0fdaf7 Merge pull request #4799 from rommapp/fix/invalid-bearer-token-500
fix(auth): treat invalid bearer and basic credentials as unauthenticated
2026-09-26 10:49:35 -04:00
Georges-Antoine Assi
843ad1071a docs(skills): shorten the trunk check step
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:44:42 -04:00
Georges-Antoine Assi
ead613e263 fix(auth): treat invalid bearer and basic credentials as unauthenticated
HybridAuthBackend runs inside Starlette's AuthenticationMiddleware, so an
HTTPException raised while validating a JWT bearer token (expired, bad
signature, garbage) or parsing a malformed Basic header bypassed FastAPI's
exception handlers and surfaced as a 500 on every endpoint, including
/api/heartbeat. Return None instead, matching the rmm_ client token path:
public endpoints respond normally and protected ones return 401.

Fixes #4788

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:43:36 -04:00
Georges-Antoine Assi
5cad653261 fix(auth): look up seeded permission groups by a stable system key
Tests, fixtures and the e2e seed found the seeded groups by display name,
which an admin can edit and this PR just changed. A unique system_key
column (viewer/editor), added and backfilled by 0137, identifies them
instead, and get_system_group() replaces the name lookups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:42:44 -04:00
Georges-Antoine Assi
5600324f21 Merge remote-tracking branch 'origin/master' into feat/frontend-eslint-guideline-rules
# Conflicts:
#	.claude/skills/review-polish/SKILL.md
2026-09-26 10:39:09 -04:00
Georges-Antoine Assi
2f3523318b docs: point the lib boundary note at the resolver rule (review-polish)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:33:08 -04:00
Georges-Antoine Assi
3068ae9d97 refactor(auth): simplify group rename migration and e2e seed lookup (simplify)
The e2e seed resolves the viewer via get_default_group instead of a list
of fallback names. The migration drops the id pre-select, and the tests
load the revision once and call upgrade/downgrade directly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:32:36 -04:00
Georges-Antoine Assi
1c2a60a776 refactor(frontend): parse SFC styles with PostCSS, resolve the lib boundary (simplify)
- Style rules walk a PostCSS AST parsed once per file instead of
  hand-rolled declaration, @media and comment regexes. postcss becomes a
  direct devDependency at the version already in the lockfile.
- The src/v2/lib boundary uses import-x/no-restricted-paths, so aliases
  and relative imports resolve to the same zones. The resolver now knows
  .d.ts so the emitter types match.
- typescript-eslint's eslintRecommended applies to .vue in place of a
  single no-undef override.
- A reportAt helper replaces the per-rule loc boilerplate, and sfc()
  carries the test filename.
- The Trunk no-emdash linter runs batched.
- CLAUDE.md and address-bot-reviews point to review-polish instead of
  repeating the encode-a-check guidance.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:31:43 -04:00
Georges-Antoine Assi
f3e045196f fix(auth): renumber group rename migration to 0137 (code-review)
Master already chains 0135 and 0136 onto 0134, so the rename becomes
0137 revising 0136_deleted_assets to keep a single alembic head. Also
dedupe the migration filename in tests, rename tests that still said
legacy, and drop em-dashes and a long docstring.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:30:17 -04:00
Georges-Antoine Assi
48f2d4574e fix(frontend): tighten lint rule edge cases (code-review)
- no-color-literal: scan declarations after nested blocks, skip nested
  selectors and quoted strings.
- no-layout-media-query: allow the Media Queries 4 `or` keyword.
- no-emdash-in-comment: bound each search to its comment.
- Primitive import limits also cover the `@v2/` alias, `@/locales`, and
  `@/plugins/router`, and skip `*.spec.ts`.
- block-order puts scoped styles before unscoped ones.
- no-emdash (Trunk) points Python columns at the comment and treats .mdx
  as Markdown.
- Drop stale ESLint ignores and the unused sfc() lang parameter; update the
  scripts table in FRONTEND_ARCHITECTURE.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:22:12 -04:00
Georges-Antoine Assi
16a900eec7 Merge remote-tracking branch 'origin/master' into pr-ready/bb5d210 2026-09-26 10:21:48 -04:00
Georges-Antoine Assi
0fe3b356b6 Merge pull request #4731 from rommapp/claude/docker-dev-rolling-tag-dmqssl
ci: nightly image, index annotations and SBOMs
2026-09-26 10:14:20 -04:00
Georges-Antoine Assi
f7c57372da Merge pull request #4741 from yiannias/fix/amiga-puae-kickstart-firmware
fix(player): make all Amiga Kickstarts available to PUAE
2026-09-26 10:11:35 -04:00
Georges-Antoine Assi
ddc0c32a22 chore: drop the nightly note from the example compose file
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:05:46 -04:00
Georges-Antoine Assi
016fce75c5 chore: report em dashes without autofix, and check them repo-wide via Trunk
- romm/no-emdash-in-comment only reports now. The heuristic fixer produced
  mechanical prose and let fix-on-save rewrite every comment in touched files.
- A no-emdash Trunk linter covers Markdown and Python comments, which ESLint
  cannot see. Existing hits stay held back by Trunk's hold-the-line.
- Lint-rule tests run in their own node Vitest project, without the app's
  happy-dom environment and Storybook setup.
- The CLAUDE.md check rule and its skill echoes now ask for a named follow-up
  rather than a new rule in the current PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:00:42 -04:00
Georges-Antoine Assi
93f1107db2 refactor(frontend): simplify firmware externalFiles helper
Simplify pass. Move firmwareExternalFiles into v2/utils/playerFirmware
next to resolveInitialFirmware so one module owns the player's firmware
logic and FirmwareLike stays private, replace the single-member core set
with a direct check, and fold the filename guards into one regex.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:59:49 -04:00
Georges-Antoine Assi
2c9e861b1e refactor(ci): derive the build channel once and share tag lists (simplify)
A workflow-level CHANNEL replaces the scattered event-name checks and
the build-only CACHE_SCOPE. The image and tag lists, repeated in all
four metadata steps, move to workflow env, and the index annotation
level is set once on the merge job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:56:36 -04:00
Georges-Antoine Assi
2484d8f30f fix(player): limit firmware externalFiles to PUAE and cover console mode
Code review follow-up. Drop the all-firmware fallback for other cores:
a cleared picker there means "no BIOS" on purpose, and the fallback
refetched every platform file uncached on each launch. PUAE again gets
every Kickstart, including the selected one, as originally tested.
Console mode's player now sets EJS_externalFiles too, so #4733 is fixed
there as well.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:56:19 -04:00
Georges-Antoine Assi
468414f664 fix(ci): drop empty version labels and skip the nightly on forks (code-review)
metadata-action renders `{{version}}` in custom labels and annotations
as empty, overriding its own correct version label, so those entries
are removed and the shared title/description/licenses live in one
OCI_METADATA env. The scheduled run is limited to rommapp/romm, and
the compose note says `latest` won't start after a nightly migration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:54:41 -04:00
Georges-Antoine Assi
0d817a51e9 chore(frontend): apply code-review fixes to firmware helper
Reuse FirmwareLike instead of a duplicate type, correct the archive
comment for the nightly EmulatorJS build, and cover the dot-name filter
and URL encoding in tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:54:39 -04:00
Georges-Antoine Assi
3c09cd9e4c chore(frontend): drop the lint script in favour of trunk check
Trunk already runs ESLint with the same config in CI, scoped to changed files and respecting the v1 ignores.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 08:13:24 -04:00
Georges-Antoine Assi
f7c7b44e73 chore(frontend): drop two eslint config comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 08:11:03 -04:00
Georges-Antoine Assi
fe65f29545 docs(skills): move lint-rule encoding note out of the verify steps
It is a polish-phase action, not an ESLint check, so it now closes the polish passes before section E.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 08:09:57 -04:00
Georges-Antoine Assi
ae7b1cb22b ci: build the rolling master image nightly and tag it nightly
A cron run replaces the per-push build, so the tag is renamed from
`edge` to `nightly` (and `nightly-slim`), using metadata-action's
`type=schedule`. The version string becomes `nightly-<short sha>`.
The concurrency guard is dropped since scheduled runs can't overlap.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 08:06:17 -04:00
Georges-Antoine Assi
401b732e3d fix(player): pass all firmware to EmulatorJS when none is selected
Generalize the PUAE helper to any core. Filename-selecting cores (PUAE)
still receive every firmware file in the system directory, minus the one
already loaded through EJS_biosUrl. Every other core now receives all
firmware next to the game when no file is selected, the case where
EJS_biosUrl previously loaded nothing. Archives are skipped because
EJS_externalFiles writes them unextracted; they keep loading through the
picker.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 08:05:38 -04:00
Sam Dornan
c4f4d22687 chore(mypy): require coded ignores and flag stale ones, type protected_route (#4794) 2026-09-25 22:33:13 -04:00
Georges-Antoine Assi
72a1cd0201 Merge pull request #4792 from rommapp/fix/platform-icon-manifest
fix(frontend): only request platform icons that ship
2026-09-25 22:05:07 -04:00
Georges-Antoine Assi
ea8c734b65 test(frontend): run shared component stories in the Storybook harness
PlatformIcon's story moved out of src/v2/lib, which the harness only globbed, so CI stopped rendering it and running its axe checks. Covering components/shared restores that and adds the four other shared stories.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:52:40 -04:00
Georges-Antoine Assi
a35391f77d chore(frontend): trim platform icon comments (review-polish)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:47:39 -04:00
Georges-Antoine Assi
5269e942a6 refactor(frontend): simplify platform icon resolution
- Move the slug-to-URL resolver into src/v2/utils/platformIcons so
  PlatformIcon no longer pulls in the blob cache, and normalize slugs
  through one helper.
- Keep PlatformIcon's tooltip as title or alt, which drops the three
  :show-tooltip="false" overrides the slug fallback needed.
- Drop the plugin's unused directory argument, the redundant onError
  guards and the doubled fsSlug lookup, and shorten the test helper.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:45:59 -04:00
Georges-Antoine Assi
e75ac4515b Merge pull request #4791 from rommapp/feat/storybook-input-modality
feat(storybook): add an input modality toolbar
2026-09-25 21:42:43 -04:00
Sam Dornan
2c71226887 ci: run mypy in its own workflow instead of through Trunk (#4724) 2026-09-25 21:37:01 -04:00
Georges-Antoine Assi
d5e73dae5b fix(frontend): address code-review findings on platform icons
- Emit the slug-to-file map from the manifest plugin and reload it when
  icons change under the dev server.
- Default the plugin's icon directory so both configs share one path.
- Keep decorative platform icons at an empty alt, and turn off the slug
  tooltip where the display name already sits next to the icon.
- Clean up the manifest test's temp dir and cover CachedPlatformIcon.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:31:34 -04:00
Georges-Antoine Assi
f7bb931bdc Merge pull request #4790 from rommapp/claude/trim-claude-md
docs(claude): trim root CLAUDE.md and split stack guidance into nested files
2026-09-25 21:21:20 -04:00
Georges-Antoine Assi
89c06c9836 refactor(storybook): pin input modality in useInputModality
simplify pass:
- useInputModality gains pin(), which gates setModality so pinned modes
  ignore the listeners (and useGamepad) instead of a watcher undoing their
  writes; drops the manual data-input write and the HMR dispose
- one INPUT_DEFAULT shared by initialGlobals and the decorator fallback
- the Input Navigation stories share one render on meta

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:19:50 -04:00
Sam Dornan
63cd9eb1b8 fix(backend): replace the legacy Query API with Select and type the session decorators (#4730) 2026-09-25 21:19:02 -04:00
Georges-Antoine Assi
90693fab59 fix(storybook): address code-review findings on the input toolbar
code-review (xhigh) pass:
- lazy-load useGamepad so vitest.setup.ts no longer caches it ahead of
  useGamepad/index.test.ts's vue-router mock (5 failures in the full suite)
- drop flush: "sync" on the re-pin watcher, which ran between setModality's
  ref write and DOM write and let a listener's data-input win
- stop the re-pin watcher on HMR
- test that a pin survives the live listeners, and assert data-input in play()

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:15:13 -04:00
Georges-Antoine Assi
ffb6dc62f9 fix(frontend): only request platform icons that ship
The v2 platform icon components probed /assets/platforms/<slug>.svg, then
.ico, and let the browser 404 on every miss before settling on default.ico.
A build-time manifest of the shipped filenames (virtual:platform-icons) now
picks the right file up front, so unknown slugs go straight to the default
and the prefetch cache makes at most one request per shipped slug.

The manifest is a Vite virtual module rather than an eager import.meta.glob,
which would emit hashed copies of all ~240 icons and inline the small ones
into the lib chunk just to read their names.

RPlatformIcon moves out of lib/ to components/shared/PlatformIcon, since it
now depends on platform-specific asset knowledge. Its tooltip also falls
back to the slug when no title or alt is given (the empty-string alt default
used to short-circuit the `??` chain).

Based on the approach in #4728 by @andest01.

Fixes #4671

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:08:43 -04:00
Georges-Antoine Assi
af357010e5 docs(skills): drop em-dashes from review-polish description
Addresses Greptile review on #4790.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:07:51 -04:00
Georges-Antoine Assi
c5320928a4 feat(storybook): add an input modality toolbar
Stories had no data-input on <html>, so the key/pad focus rings and other
modality-gated styles never rendered in Storybook. The new Input toolbar
pins data-input to mouse, touch, key or pad, or tracks live devices with
the real useInputModality + useGamepad stack so a connected controller
drives the story. An Input Navigation story demos a useWrapGridNav grid
and covers arrow-key movement in play().

Slimmed-down take on the idea in #4695.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 20:58:17 -04:00
Georges-Antoine Assi
6b61931cfb docs(claude): trim root CLAUDE.md and split stack guidance into nested files
The root CLAUDE.md loads into every agent session. Drop the stack table
(derivable from pyproject.toml and package.json) and the skills table
(duplicates the skill listing agents already receive), and move the v1/v2
rules plus the per-stack command blocks into frontend/CLAUDE.md and
backend/CLAUDE.md, which load only when working in those directories.

Quote the review-polish skill description: its unquoted ": " made the
frontmatter invalid YAML.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 20:56:13 -04:00
Georges-Antoine Assi
939861094e Merge pull request #4691 from LoneAngelFayt/streaming-patches-6
feat(streaming): resume from a foreign emulator's save or state via declared import
2026-09-25 20:46:07 -04:00