* refactor(docker): supervise the container with s6-overlay
The init script was a hand-rolled supervisor: PID files, /proc polling, a
5s watchdog loop and a trap-based shutdown. Its shutdown wait was unbounded,
so a process that refused to exit stranded PID 1 and left the container up
and serving nothing, which no restart policy can detect.
s6-rc replaces it with a declared service graph. Ordering and readiness
gates that were sequential bash become dependencies, and the failure modes
become configuration:
- timeout-kill bounds SIGTERM before SIGKILL, and flag-timeout-killpg
escalates to the whole process group.
- S6_BEHAVIOUR_IF_STAGE2_FAILS=2 exits the container when a startup step
fails, so the restart policy retries instead of the container wedging.
- valkey gets --shutdown-on-sigterm force, so it stops refusing to exit
when the snapshot it writes on shutdown cannot be written.
A crashed service is now restarted on its own instead of taking the whole
container down. Its leftover children are swept first, because children
reparented from a hard-killed master keep holding its listening sockets and
would make every replacement fail to bind.
Optional services have no conditional mechanism in s6-rc, so they start,
check their environment variable, and take themselves down with s6-svc -O.
Running with a read-only root filesystem now needs /run mounted exec, since
s6 executes its generated stage scripts from there.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): always start the RQ scheduler under s6
The s6 service carried over the four-flag ENABLE_SCHEDULED_* gate from the
init script, which #4033 has since removed on master. Since this branch
deletes that script, the fix would be lost on rebase.
Nothing else respects the condition: startup.py registers the netplay,
upload-tmp and zip-cache cleanups unconditionally, three more flags gate
periodic tasks absent from the list, and the watcher defers its rescans
through the scheduler. Any of those leaves jobs in the scheduler registry
with no process to run them, and a stuck delayed scan_platforms entry reads
to the concurrent scan guard as a scan already queued, refusing every
manual scan.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): port master's init changes to the s6 services
Master reworked docker/init_scripts/init while this branch replaced it,
so carry those changes into the s6-rc services:
- Replace rq-scheduler with `rq cron` (romm-rq-cron) on tasks.cron_config.
- Add romm-rq-scan-worker (scans queue) and romm-rq-streaming-worker
(streaming queue, down unless config.yml enables streaming).
- Run every worker with --with-scheduler and the RomMRedis connection
class, passing the Redis URL through RQ_REDIS_URL so the password stays
off the command line, and read REDIS_SSL as a boolean.
- Bring gunicorn's flags in line: --no-control-socket, a private-range
FORWARDED_ALLOW_IPS default, 4 workers and a 65s keep-alive.
- Check the sync folder and SSH keys path in romm-init, and switch the
features off through the container environment when they're unusable.
- Accept the backend's truthy values for the watcher flags.
- Point the serving-layer guard tests at the gunicorn run script and
drop the PID-file tests, which guarded the bash watchdog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(docker): guard the s6-overlay service tree
Check that every service is in the user bundle, depends on something
that exists, and that every longrun has its finish sweep, kill timeout
and process-group flag. Also check that the dev entrypoint starts the
same RQ workers and cron scheduler as the image, since it keeps its own
launcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(dev): pass the image's RQ flags in the dev entrypoint
The dev image's RQ cron scheduler and workers ran without the RomMRedis
connection class, and the workers without --results-ttl, so they kept
redis-py's maintenance notification probe and RQ's default result TTL.
The s6 guard test now compares each rq command's flags with the image's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(docker): address Greptile review on the s6 service tree
- Cut the s6 script comments to two lines, keeping the reason each
helper exists.
- Compare the values of the dev entrypoint's RQ options with the
image's, not only their names, allowing for the dev image's path,
PID files and LOGLEVEL default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(docker): check every s6 service stays up after boot
The heartbeat only proves gunicorn and nginx came up. Enable both watchers
and require each longrun in the s6 tree to report up for 15s straight, so a
crashing or restart-looping worker, cron, valkey or watcher fails the job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(docker): enable streaming so its worker is checked too
The streaming worker turns itself off when streaming.enabled is false in
config.yml, which the services check read as a failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(patcher): cap the output size a patch can declare
RomPatcher.js allocates the patched ROM from the size written in the
patch header, so a few-byte UPS/BPS/APS/BDF/RUP patch could make the
Node patcher allocate and write gigabytes. patcher.js now wraps the
BinFile constructor and refuses any allocation above a cap passed by
the backend: twice the source ROM, or the ROM plus 64 MiB when that is
larger, never above ROM_PATCHER_MAX_FILE_SIZE_BYTES. An oversized
output is reported with exit code 3 and surfaces as a 400.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(patcher): run the output size guard through the real patcher.js
The CI pytest job now installs Node and RomPatcher.js so the patcher
tests can exercise patcher.js itself: a UPS patch declaring a 2 GiB
output is rejected, and one growing the ROM within the cap applies.
The tests skip when node or RomPatcher.js is missing locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(coherence): adopt Coherence with specs, invariants and a PR report
Install @posthog/coherence as a frontend dev dependency and wire its
Claude Code hooks into the committed .claude/settings.json, so every
agent session in the repo gets the vocabulary, specs, journal and checks.
The hooks call the binary under frontend/ through $CLAUDE_PROJECT_DIR.
Declare 23 components and the entrances that carry outside trust, and
six invariants, each refuted with a deliberate break before it counted:
- every /api route requires auth and its scopes, except a named public
list (new route sweep in tests/endpoints/test_route_guards.py)
- a hidden rom, platform or firmware answers every id route exactly as
a missing id would (new sweep over every method of every id route)
- the unscoped save, state and screenshot fetches by id are reached only
from their own routers (chokepoints)
- validate_path never resolves outside its base folder
The PR workflow runs in comment mode: one report comment, failing only
when Coherence itself breaks. Trunk skips Prettier and markdownlint on
*.spec.md and *.practice.md, since Prettier escapes their globs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(routes): satisfy mypy in the route guard sweep
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(coherence): record the worktree test database enactment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(roms): answer a hidden rom like a missing one on file routes; tighten route sweeps
Addresses Greptile's review on #5584.
The rom file delete and reading-progress routes answered "File not found"
for a hidden rom but "Rom with id N not found" for a missing one, so a
caller could tell them apart. They now raise the same not-found.
The route sweeps now reach the checks they claim to test: a protected
route with no scopes counts as public (its guard admits anyone), write
requests carry a body and upload name so validation can't answer first,
RomFile-keyed routes get a real file id, error bodies are compared with
the id normalized, and the rom routes are swept with the rom hidden
directly, through its platform, and by the unrated filter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(coherence): tighten route guard sweeps and isolate oracle test databases (code-review)
- Count a route as protected only when its endpoint is the scope-checking
wrapper with non-empty scopes, not just when it declares the bearer scopes.
- Treat 401 and 403 like 422 as never reaching the visibility check, and
sweep /api/streaming/states/{rom_id}.
- Run pytest oracles with a per-run ROMM_TEST_DB_TAG unless one is set.
- Use the shared setup-frontend action and ubuntu-24.04 in the workflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(tests): simplify route guard sweeps and path tests (simplify)
- Mark scope-guard wrappers with required_scopes so the auth sweep reads a
public attribute instead of the private closure.
- Derive the entity regex from one segment list, ask each missing id once,
and run the three hide scenarios through one sweep helper.
- Fold the new validate_path inputs into the existing valid, traversal and
absolute path tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(coherence): trim workflow comments (review-polish)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(filesystem): restore the validate_path property test the paths invariant cites
Filesystem.spec.md names test_validate_path_never_escapes_its_base as the
invariant's evidence, and Coherence selects it by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(coherence): run hooks from the local binary instead of npx
Each hook calls frontend/node_modules/.bin/coherence directly and exits 0
when it isn't installed, so sessions without frontend deps (fresh
worktrees, backend-only setups, cloud setup still installing) don't report
a hook error on every tool call, and no hook pays npx's startup.
Also commits the journal and run records left by earlier sessions, which
.coherence/.gitignore keeps as durable records.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(tests): share the bearer, user token and hide helpers
Tests built the same Authorization headers and HiddenEntity rows in about
40 local copies, and two modules imported private helpers from other test
files. They now use bearer, user_headers and hide from tests/auth_helpers.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(endpoints): one 404 for a missing or hidden rom, platform or firmware
Each route wrote the missing-row 404 and the hidden-row 404 separately and
had to keep them identical by hand. visible_rom_or_404,
visible_platform_or_404 and visible_firmware_or_404 take the lookup result
and raise one answer for both, either the standard not-found or a bespoke
detail. Re-reads after a write keep a plain not-found check, so an edit that
hides the row doesn't turn into a 404 after it succeeded.
The RomFile-keyed routes (/roms/{file_id}/files, .../files/content/{name},
/roms/{file_id}/patch) name their path parameter file_id instead of id, so
the route sweep reads which id a route takes from its path and drops its
hand-kept list. URLs are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(setup): develop inside WSL on Windows
@posthog/coherence installs only on Linux and macOS, so npm install in
frontend/ fails on native Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(coherence): record the whole-repo chokepoint run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(types): regenerate API types for the file_id patch route
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* ci(coverage): measure frontend coverage with v8 and backend branch coverage
The frontend had no coverage measurement, and the backend's line-only
report counts a one-sided `if` as covered when its body never runs.
- Add @vitest/coverage-v8 and `npm run test:coverage`. Its include lists
every source file, so a file no test imports reports 0% instead of
disappearing. Generated types, locales, tokens, test utilities,
stories, fixtures and play helpers are excluded.
- Frontend Checks runs tests with coverage and uploads the cobertura
report to GitHub code coverage as code-coverage/vitest, mirroring
pytest.yml: a separate job holds code-quality: write and fork PRs skip
the upload.
- Turn on branch coverage in backend/.coveragerc.
Baseline on master: 407 test files pass; frontend lines 63.3%, branches
55.3%. The app project alone (no stories) gives 61.4% lines, so stories
add about two points.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4iK9WRvZqdTHiRc9gY
* ci(coverage): include JavaScript sources in the frontend coverage report
The two audio worklets (gmeAudioWorklet.js, pico8AudioWorklet.js) are
production code that the `{ts,vue}` glob left out of the report, so they
now show at 0% instead of being omitted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4iK9WRvZqdTHiRc9gY
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(i18n): pluralize the memory card import message
Replace "save file(s)" with vue-i18n plural forms in en_US and en_GB.
The dialog already passes count, which selects the form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(i18n): check placeholder parity and fix es_ES placeholders
check_i18n_locales.py now fails when a translation's {placeholders}
differ from en_US. The check found 33 es_ES strings that dropped a
placeholder (usernames, error details, file paths) or used one the code
never passes, which renders empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(i18n): derive the language list from the locale folders
The language store kept its own list of locales next to the folders
that locales/index.ts already discovers, so a new locale had to be
registered in both. The store now lists availableLocales and keeps only
their display names, and a test fails when a folder has no name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(i18n): address Greptile review on #5375
Give memory-card-import-body plural forms in the locales whose
"(s)"-style text has a one/other split (de, es, fr, pt_BR, ro, sv, bg)
and in cs_CZ's four-form rule. Extract the placeholder comparison into a
function, cover it with stdlib unittest tests, and run them in i18n.yml.
The locale checker now skips __pycache__.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(i18n): type the locale checker for mypy
mypy.yml runs strict mypy over frontend/src/locales, which rejected the
untyped helpers and tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(i18n): humanizer pass on the i18n skill changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(i18n): handle two-form Czech plurals
The cs_CZ plural rule always returned a four-form index, so the 17
cs_CZ strings with only "one | other" forms showed the wrong form for
0 and 1 and threw "Unexpected return type in composer" for counts of
2 or more. Two-form strings now use the one/other split, which also
lets memory-card-import-body drop its duplicated segments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* ci: bound apt network timeouts for Playwright's dependency install
`npx playwright install --with-deps` runs its own `apt-get update`, so the
`-o` flags from #5181 could not reach it, and a stalled Ubuntu mirror hung
the frontend test job until the 15 minute limit cancelled it. Move the
retry/timeout options into an apt.conf.d file written by a small composite
action, used by setup-backend and the frontend test job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: install Playwright's headless shell without apt
The apt.conf.d timeouts did not stop the hang: on a runner whose Azure
mirror is unreachable, apt falls back to archive.ubuntu.com and stalls
while downloading the package indexes, slowly enough that no timeout
fires. The ubuntu-latest image already ships Chrome's system libraries,
so drop --with-deps from the frontend and e2e jobs and keep apt out of
their path. Revert the bound-apt-timeouts action, and run the frontend
checks when frontend.yml itself changes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: install setup-backend's apt packages from a cache
The MariaDB connector .debs (plus each job's extra apt packages) were
fetched from an Ubuntu mirror on every backend job, so a stalled mirror
could hang any of them until the 15 minute limit, the same way it hung
Playwright's dependency install. Cache the downloaded .debs keyed on the
runner image OS and package list, saved from master only, and install
from them without apt-get update on a hit. A miss still downloads them
with the #5181 retry and timeout options.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: install cached apt packages without re-downloading them
With package lists present, apt fetched the mirror's copy of each local
.deb instead of installing the file, so even the cached path reached the
mirror. Point apt's archives dir at the .deb directory and pass
--no-download. Also read ImageOS in a shell step: it is a runner shell
variable, not in the `env` context, so the cache key came out empty.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: pin workflow runners to ubuntu-24.04
The apt .deb cache in setup-backend only holds packages built for one
Ubuntu release. Pin every job to ubuntu-24.04 so a GitHub move of
ubuntu-latest can't restore noble packages onto a newer image, and
hardcode the release in the cache key instead of reading ImageOS.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: check that PR titles follow Conventional Commits
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: address Greptile review on the PR title check
Give the HLTB updater a Conventional Commits title so its PRs pass the
check, and strip line breaks from the title before echoing it so it
cannot start a workflow command.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(e2e): Update playwright #4772, smaller focus
* chore(e2e) address greptile feedback
* chore(e2e): keep static analysis out of e2e/.output
Everything the suites write (reports, traces, saved sessions) lands in
e2e/.output. It was already gitignored and ESLint skipped it, but the
e2e tsconfig included it through ./**/*.ts, so any .ts file written
there was type-checked, and Trunk skipped it only through the
.gitignore default. Exclude it from the tsconfig and list it in
Trunk's ignore paths explicitly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(e2e): run with zero config locally and typecheck the suite in CI
- Every E2E_* variable now falls back to a default matching
seed_e2e_users.py, and the shell wins over e2e/.env, which is optional.
- With E2E_BASE_URL unset, the config starts (or reuses) `npm run dev`
through webServer; CI still sets the URL and serves the static build.
- Drop the migration table for removed variables, the unknown-key checks,
and the gitignore entries for suite versions that never shipped.
- Add e2e/tsconfig.json to the root project references, so
`npm run typecheck` (run by Frontend Checks) covers specs/ and setup/.
- Restore `test:e2e:ui`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(e2e): make seedUiState win over the user's stored preferences
Preferences are now stored per user (#5098), and the app only adopts an
unscoped value when the user has no `user:<id>:` copy. Saved sessions
carry one, so seedUiState(page, "light") was silently ignored. Drop the
scoped copies before seeding, and assert the light theme in the spec
that relies on it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(frontend): add build:preview, which copies frontend/assets into dist
Vite leaves frontend/assets out of the build and only the Docker image
copies it in, so a bare `vite preview` serves the SPA fallback for every
icon, logo, font and default cover. Give that copy one home: the e2e
workflow and the local production-build recipe both use the script. It
copies with fs.cpSync so it also runs from cmd.exe and PowerShell.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(e2e): let the Playwright webServer serve CI again
The suite starts its own server once more, so the workflow no longer
needs its own build, serve, wait and teardown steps, nor the E2E_*
variables that now default to the seeded accounts. In CI the webServer
runs `build:preview` and `vite preview` as it did before this PR; locally
it runs (or reuses) `npm run dev`. The default URL is 127.0.0.1, which
the preview binds, rather than localhost, which can resolve to ::1.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): simplify the setup files
- auth.setup.ts signs each account in afresh every run, instead of
validating saved sessions in a separate browser context. Two sign-ins
cost about 3s.
- The hand-rolled login retry loop and its CI-specific attempt counts
give way to `retries: 2` on the setup project, and the timeout
arithmetic to `setup.slow()`.
- global-setup.ts folds its four check functions into one, and reads the
library total from the admin's account check instead of fetching it
twice.
- Drop isSessionValid(), login() and the ESLint exception that only the
old setup needed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): drop the global-setup preflight
The suite already reports what it checked: a downed backend fails
sign-in through the app-error guard (`GET /api/heartbeat returned 502`),
and a wrong E2E_BASE_URL fails page.goto with the URL. The one case it
explained better, a rejected account, is now an assertion on the
`POST /api/login` status in auth.setup.ts. With no preflight, the suite
never calls the API directly, so its ESLint exception goes too.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(e2e): cover every route for both roles, and stop the theme leaking
loads.spec.ts:
- Key PAGES by RouteName from src/plugins/routeNames.ts, with a `skip`
reason for routes it can't open, so a new route fails the typecheck
until it is listed. That adds devices and conversion-settings, which
had drifted out.
- Load each page as every role allowed on it, not only as admin, so a
viewer-only 403 shows up.
- Drop the wait for in-flight requests, which timed out on pages that
load slowly on a large library.
Tags and folders now use route names (@page:rom, specs/rom/,
specs/user-profile/).
The app syncs UI settings to the account and reapplies them on sign-in,
so a theme a spec wrote leaked into later sessions: admin ended up on
"auto", and every "dark" spec rendered light. seedUiState now always
stores "auto", the config sets `colorScheme: "dark"`, and the light
spec uses emulateMedia. The saved sessions carry the seeded settings, so
specs no longer call seedUiState themselves.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): keep support/auth.ts to accounts and sign-in
- Navigation helpers (gotoHydrated, gotoFirstRom, gotoOwnProfile) move
to support/navigation.ts, with a gotoFirstPlatform that loads.spec.ts
and gotoFirstRom now share.
- openMoreMenu and menuLabels move into rom/actions-menu.spec.ts, their
only user.
- Role derives from ROLES, and accountFor's return type is inferred, so
the Account interface goes.
- watchAppErrors folds into the app-error guard, its last caller.
- output.ts exports the results and report paths instead of a
suiteOutput() that only ever took "specs".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(e2e): don't count the page load against gotoHydrated's waits
The /api/permissions/me and login-form waits are armed before page.goto,
so their 5s local action timeout also covered the navigation, and a slow
page timed out before the request was sent. The test's own timeout now
bounds them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): replace the environment module with plain reads
With every variable defaulted, the parser, its aggregated error and the
e2eEnv fixture guarded against mistakes that can barely happen, and
Playwright reports the rest itself.
- playwright.config.ts loads e2e/.env with process.loadEnvFile (the
shell still wins) and reads E2E_BASE_URL; support/auth.ts reads the
accounts into ACCOUNTS. Specs that need the URL use the baseURL
fixture.
- E2E_WORKERS goes: `--workers N` already does that.
- Drop the e2eEnv fixture, its ESLint import ban and the empty-pattern
exception it needed, and trim .env.example.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(e2e): typecheck the suite with tsconfig.node.json
e2e/tsconfig.json was a looser copy of the Node config: it lacked
noUncheckedIndexedAccess and exactOptionalPropertyTypes, so specs/ and
setup/ escaped flags the rest of the frontend, and the e2e support files
through playwright.config.ts, already obey. The suite runs in Node, so
it joins tsconfig.node.json, and typecheck:e2e goes with its config.
The specs needed no changes under the stricter flags.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): trim the ESLint config and the app-error guard's opt-out
- Drop the Node globals block: typescript-eslint turns no-undef off for
.ts files, so it changed nothing.
- Drop no-skipped-test's allowConditional: nothing in the suite skips.
- Fold the type-info, floating-promise and no-API blocks into one, and
move the e2e/.output ignore to the base config's generated-output list.
- Remove failOnAppErrors and E2EOptions: nothing opts out of the guard.
Every remaining rule still fires on a probe spec.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(frontend): shorten the test:e2e command note
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* build(frontend): copy assets with cp -R in build:preview
Also puts a comma in the test:e2e command note.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(e2e): one set of timeouts, and treat empty variables as unset
- Local runs used 3-10s timeouts against CI's 10-45s, so slow pages on
a large dev library failed locally while CI passed. Both now use the
CI values; a debugger still turns them off.
- An empty E2E_BASE_URL left baseURL as "" while still starting the
server, and an empty account variable signed in as "". Both fall back
to their defaults now.
- Set the Desktop Chrome device once, point the slow-test comment at
test.slow(), and anchor the setup project's testMatch.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(e2e): apply code-review findings
pr-ready step 2 (code-review xhigh --fix):
- fall back to E2E_PASSWORD, which the seed script uses, for both accounts
- name the cause when the library has no platform or game to click
- read PWDEBUG=0/false as off, as Playwright does
- widen the API-call lint ban to any uncalled `.request` and its import
- compare the signed-in username case-insensitively
- only allow adminOnly with a URL, so the viewer 404 check always runs
- fix the README grep recipe and the recorded-spec location
- Object.hasOwn in seedUiState, ROLES in role.spec, shorter comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): apply simplify findings
pr-ready step 3 (simplify):
- one home for the login-form and signed-in-user locators
- derive ROLES and STORAGE_STATE from ACCOUNTS
- openMediaSubtab returns the panel; upload helpers take a scope
- menuLabels reads the panel openMoreMenu returns
- seed the UI state in login.spec's beforeEach
- one no-restricted-syntax entry for the API-call ban
- one port constant in playwright.config.ts
- drop .gitignore entries for paths nothing writes any more
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(e2e): trim two long comments
pr-ready step 4 (review-polish).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(e2e): plainer README opener and comments
pr-ready step 5 (humanizer).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(e2e): role selectors, one first-game lookup, shared route scopes
- Select by role and label: the account menu's name ("Account menu for
<user>") replaces the user-name span, the Login button the login form's
class, the "Page not found" heading the 404 class, and the subtab rail's
tablist role the subtab button class.
- library.setup.ts clicks through to the first game once per run and saves
its URL; specs open it with gotoFirstRom() instead of clicking through
/platforms in every test. loads.spec keeps the click-through.
- Move the router's route scope table to routeNames.ts as ROUTE_SCOPES, so
loads.spec derives admin-only pages from it: a newly gated route gets the
viewer 404 check unless it is listed in VIEWER_OPENS.
- `vite preview` serves frontend/assets through a sirv middleware, as the
dev server and the Docker image do, so build:preview goes away.
- CI builds the frontend in the background while the backend is set up,
and the Playwright webServer only runs `vite preview` on that build.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(v2): menuitem role on button menu items, tabpanel role on Media panels
- RMenuItem sets role="menuitem" on its button form too, not only on links,
so every item in an RMenu is a menuitem. Stories give the items a
role="menu" parent.
- SubtabNav takes an optional idPrefix that gives each rail tab an id and
aria-controls. MediaTab uses it to make its sections tabpanels labelled
by their tab; the small-screen sheet variant has no tabs, so its sections
stay plain.
- The e2e specs read menu labels by the menuitem role and find a Media
panel by its tabpanel name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Cosign signs on Docker Hub only, which stores the signature as an OCI
referrer. GHCR has no referrers API and would add a sha256-<digest> tag
per signature, so provenance attestations stay in GitHub's attestation
API, where gh attestation verify finds them for either registry.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GHCR has no OCI referrers API, so every pushed signature or attestation
lands under a new sha256-<digest> tag, which piles up with a nightly.
Nightly now only records the provenance attestation in GitHub's API,
which still exercises the OIDC and attestation path every day.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
upload-artifact refuses an existing name, so re-running a scan job that
failed at the critical gate failed at the upload instead. The malware
summary now records which signature version ran, so a stale fallback
after a failed freshclam is visible.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Sign and attest per variant through a matrix instead of paired steps.
- Read the index digest back from the GHCR tag, not the first Docker Hub one.
- Drop the name= prefixes from IMAGES so the sign loop uses it as is.
- Let Trivy gate on criticals itself instead of parsing SARIF message text.
- Export both platforms in one malware job per image, so freshclam runs once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Sigstore or registry failure while signing no longer skips the scan of an
already published image. Grants artifact-metadata: write so the attestation
storage records are created.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Sign each pushed index with keyless cosign in both registries and attach
a GitHub build provenance attestation.
- Keep the Trivy SARIF as a 90-day artifact, since code scanning rejects
tag refs, and fail the scan on fixable critical vulnerabilities.
- Add a ClamAV pass over the exported filesystem of every scanned image,
on both platforms.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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>
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>
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>
- The multi-platform index now carries the OCI annotations (version,
title, description, licenses, plus metadata-action's revision, source
and created). Labels only live in each platform's image config, so
GHCR showed no description for the package.
- Labels drop the literal quotes metadata-action kept in their values,
and the licence is the SPDX id AGPL-3.0-only. The description has one
home in the workflow env.
- Both builds attach an SBOM attestation alongside the default
provenance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01817LYuBpFBV5Pi6VEcKfFZ
Every push to master builds and pushes rommapp/romm:edge (plus
edge-slim, edge-<sha> and edge-<sha>-slim) to Docker Hub and GHCR,
reusing the release build, merge and scan jobs. Release tagging is
unchanged: the semver rules emit nothing on a push and the edge rules
nothing on a release.
- Concurrency cancels a superseded edge build so an older commit
cannot land on the tag last.
- Edge reads the release layer cache but writes its own scope, so
master layers never seed a release image.
- The baked version is edge-<short sha>, which keeps version-keyed
caches (ROM filter values) fresh between edge builds and makes bug
reports identifiable. The v2 version display links it to the commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01817LYuBpFBV5Pi6VEcKfFZ
- Set limit-severities-for-sarif, since trivy-action otherwise unsets the
severity filter for SARIF output and every severity was reported.
- Key the code scanning category by image ref, so a dispatched scan of an
older tag can't replace the analysis of latest.
- Validate and compact caller-provided JSON before writing it to outputs.
- Correct the build.yml comment: the weekly run rescans latest only.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
aquasecurity's IP allow list rejects GitHub API calls from hosted
runners, so pinact 403s verifying the trivy-action tag comment. A
.pinact.yaml rule skips verification for aquasecurity actions only once
they are pinned to a full SHA, so an unpinned ref is still flagged.
zizmor (enabled on master) wants the $/ self-repository syntax for the
reusable workflow call, but actionlint 1.7.12 rejects it, so the finding
is suppressed inline for now.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>