75 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 d482013cf7 docs: name changelog/ where CHANGELOG.md is named
README's link, the export-ignore beside CHANGELOG.md's, the watch-paths
note in DEPLOYMENT.md, and a CLAUDE.md rule for where release notes go
and how a release moves [Unreleased] into its own file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:02:17 +07:00
poli0981andClaude Opus 5.5 2e28d44885 docs: Qodana in README, DEPLOYMENT, CLAUDE.md and the changelog
README: a Qodana badge and the workflow in the list of scanners.
DEPLOYMENT: what qodana.yml runs, the three secrets, the gate, and what
to remove if the licence ends. CLAUDE.md: the setup and the traps the
first runs found (no interpreter in native Python, the Rust image's
missing linker and libraries, plugins only in Docker, the lucide import
false positive). CHANGELOG [Unreleased]: the Qodana entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:54:28 +07:00
poli0981andClaude Fable 5.2 fa8dbaf92b docs: put the project in maintenance mode
The project is stable: no new features, code changes only for security
advisories and runtime/dependency updates, and issues and pull requests
are for the data (add, correct, remove a game).

- README: status, build, quality, version, licence and runtime badges, a
  "Project status" section, and a data-first Contribute section
- CONTRIBUTING, SECURITY, Contact, the PR template and CLAUDE.md state
  the same policy
- Issue forms: add_game and edit_game are new; feature_request, feedback
  and off_topic are removed; blank issues are off (config.yml)
- About page: "Report something" links the five remaining forms

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 20:49:27 +07:00
poli0981andClaude Opus 5.5 2b4b988cc7 docs: sync the community docs with the repository
A read-through against the code found about forty claims that had drifted.

README:
- Dynamic game-count and version badges. The count is index.json's total.
  The version is the newest v* release by semver, since an app release
  published last would otherwise count as "latest".
- SvelteKit 3, every desktop package, and the shard layout without a last
  shard number.
- The media host, which commits deploy, and the nine workflows the table
  left out.
- The accessibility statement and form in the link lists.

SECURITY.md:
- Fix the broken bullet list.
- Describe the real stack, and pushes with the built-in GITHUB_TOKEN.
- Add to scope: the media host, /api/ingest/*, /api/updates/desktop and the
  avatar origin.

AUTHORS.md and username.txt:
- Donations are in FUNDING.yml.
- The Add-games template is gone.
- Test devices come from pc_spec.

The issue forms lose the hash URLs, the GitHub Pages permalink, and the
editing and GPG options.

web/README.md, dev_env (EN + VI), the acknowledgements and the contact page
are updated to match. The last two are not consent documents, so nobody is
asked to accept the terms again.

CHANGELOG [Unreleased] lists all three commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:43:39 +07:00
poli0981andClaude Opus 5.5 bca818ee19 fix(pipeline): "Free To Play" is not a genre
appdetails writes "Free To Play"; SKIP_GENRE_TAGS said "Free to Play", and
the exact match let 1,357 of 12,854 games be stored with it as their genre
(the third most common), while the fallback to the first name could pick
it as well.

- fetcher.pick_genre() compares casefolded and never falls back to a price
  model or a release state (NOT_GENRES); with nothing else it says
  "Uncategorized". ingest uses it.
- Refresh Store Data replaces a stored one from appdetails: 150 games a
  day, first after the page repairs, never under an override. It is the one
  manual-field value the job writes; no person chose it. A dry run on the
  first 150 (2026-10-30): Casual 91, Indie 24, Strategy 11, Simulation 11,
  Uncategorized 10, three others; all answered, no override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:43:03 +07:00
poli0981andClaude Opus 5.5 a618aeae2f docs: games in every language
- docs/plan/19-all-languages.md: what kept them out, what every workflow
  does with them, the re-sweep, and what is left.
- CLAUDE.md: discovery's language rules, ASCII appids, search folds but
  storage never does, re-cut descriptions are not news.
- docs/ADMIN.md: the filters as they are now, re-sweeping a whole year,
  the Languages line in the candidate dialog.
- README.md, docs/plan/11 (the decision changed), CHANGELOG [Unreleased].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:28:47 +07:00
poli0981andClaude Opus 5.5 0240abfd02 docs: the Worker's rate limits count per server, as measured
Measured on production after v4.5.1 deployed (2026-10-27, SIN): over one
keep-alive connection each budget held exactly - /api/no-such-route
121 x 404 then 429 with Retry-After, no-store and CORS; /api/human-check
19 then 429 - while requests on fresh connections, which Cloudflare
spreads over many servers, were never refused (175 human checks in 70 s
against a budget of 20). A probe Worker in a remote preview confirmed the
binding itself enforces (limit 5: 6 allowed, then refused).

So the layer stops browsers and connection-reusing scripts; a client that
reconnects for every request is the WAF rule's, which counted exactly
(250). The docs, CLAUDE.md, the module comment, wrangler.jsonc and the
unpublished v4.5.1 entry said "per location, approximate"; they now say
what was measured. The section 3b check used xargs (fresh connections) and
would have shown no 429 - it now sends everything over one connection.
No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:10:29 +07:00
poli0981andClaude Opus 5.5 e167d7df02 docs(security): a WAF check command that actually trips the rule
The section 3a check ran 300 separate curls through xargs -P 30. Each one
pays a TLS handshake, so from here it managed about 21 requests a second -
300 x 200 in 14 s - and never crossed 250 in 10 s: the rule looked broken
when it was not. One `curl --parallel` with its URL list on stdin reuses
its connections and does: 250 x 200 then 150 x 429, measured against the
live site-wide rule on 2026-10-27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:02:52 +07:00
poli0981andClaude Opus 5.5 d8d395b568 feat(worker): per-surface rate limits behind the WAF rule
The zone's one Free-plan rate-limiting rule (IP, 10 s, block 10 s) stays
the first layer: it refuses a burst before the Worker is invoked and is the
only limit on the prerendered pages. The Worker now adds a second one with
the `ratelimits` bindings in wrangler.jsonc, 60-second windows and one
budget per surface, keyed by IPv4 address or IPv6 /64:

  RL_DATA   /api/data/*                             240/min
  RL_IMG    /img/*                                  600/min
  RL_API    /api/activity, /api/updates/desktop, …  120/min
  RL_HUMAN  /api/human-check                         20/min
  RL_ADMIN  /admin, /admin/*, /api/ingest/*         300/min

Checked after the country block and before every route and the Access
check; over a limit the answer is 429 + Retry-After: 60, no-store, with
CORS only where the route itself sends it (data, api). It fails open
(no binding, no CF-Connecting-IP, a throwing limit()) and logs no refusal.
Verified locally under wrangler dev: each budget refused exactly past its
limit, a second /64 address shared the first one's budget, pages were never
counted.

rate-limit.test.ts holds wrangler.jsonc to the code (binding names, period
60 = Retry-After, account-unique namespace ids) and checks that every
run_worker_first prefix draws on a budget. worker-configuration.d.ts gets
the five Env lines (and the IMG_MINT_PER_TICK value it had missed) without
regenerating the runtime types.

docs/SECURITY_SETUP.md section 3 describes both layers and recommends
widening the WAF rule to the whole zone except /_app/immutable/ at 250 per
10 s, counted from the build (a first visit sends 110-130 requests once
the service worker precaches); CLAUDE.md records the rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 06:57:27 +07:00
poli0981andClaude Opus 5.5 0f600a99aa build(web): migrate to SvelteKit 3 and adapter-static 4
@sveltejs/kit 2.70.3 -> 3.1.0, @sveltejs/adapter-static 3.0.10 -> 4.0.0.
Closes GHSA-27mw-82g8-phjj and GHSA-pfhg-q3qv-9q6r (dismissed in v4.4.1
as not applicable), and drops the cookie override kit 2 needed: npm audit
reports nothing.

- Config: svelte.config.js is refused by kit 3. Its options are now
  sveltekitConfig(tauri) in build/sveltekit-config.ts, passed by
  vite.config.ts as sveltekit(sveltekitConfig(IS_TAURI)), with tests for
  both CSP flavours, paths.relative, the sitemap entry and the prerender
  404 handler. The unused, now-deprecated "@" alias and typescript.config
  hook are gone; tsconfig.json extends $app/tsconfig and owns `include`.
- $lib -> #lib (package.json imports), with .js on module imports.
  tsconfig repeats the mapping in `paths`: svelte-check --tsgo only maps
  .svelte imports through `paths`, and without it every #lib component
  fell back to the *.svelte shim (props unchecked; proven with a planted
  error).
- Param matchers: src/params/legaldoc.ts -> src/params.ts (defineParams).
  vite build imports that file with Node's own import(), so it imports
  #lib/legal.ts and legal.ts imports ./schema.ts by their real names.
- PWA: @vite-pwa/sveltekit never supported kit 3 and wrote the worker when
  the SERVER build closed, which kit 3's environment build does first.
  build/pwa.ts wires vite-plugin-pwa in a buildApp hook after kit's
  prerender and before its adapter, with the same globs and URL mapping.
- goto options renamed (replace, reset: false, refreshAll); the /games
  filter write is a shallow goto; a legacy /#/ path that matches no route
  falls back to location.replace (kit 3's goto rejects it). Hook types
  from @sveltejs/kit/hooks; the client handleError returns nothing to keep
  kit's message.
- runed 0.35 (bits-ui) peers kit ^2: overridden to our kit, as for
  echarts-wordcloud.

Verified against a kit 2 build of the same commit: same 11,037 files bar
hashed chunks, same non-immutable precache URLs, navigateFallback "/",
identical CSP per page (hashes masked), manifest and sitemap byte-equal,
same visible text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:35:49 +07:00
poli0981andClaude Opus 5.5 11fb7a5b43 fix(reviews): stop depending on appreviews, which now redirects
The first run of the new Update Reviews on main asked appreviews about the
12 games GetItems counted at 0, and all 12 failed: since 2026-10-23
store.steampowered.com/appreviews/<id>?json=1 answers 302 to the store
front, from GitHub's runners as from anywhere else (it worked on 10-17).
The 38 games the ingest added that day were listed with "N/A".

- fetch_full() falls back to the GetItems summary when appreviews gives
  none (reviews_from_store_api()), so an ingest gets the value the daily
  refresh would write.
- update_reviews: a game never read ("N/A", nothing) with a count of 0
  becomes "No reviews" without a question; the first count GetItems has
  replaces it. A stored percentage is still never replaced by a 0 without a
  second source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:44:57 +07:00
poli0981andClaude Opus 5.5 0897443bd6 docs: the pipeline-scale assessment, CLAUDE.md, README, CHANGELOG
docs/plan/18-pipeline-scale.md holds the measurements (9,847 games,
+~280 a day), what each job cost, what GetItems answers, the direction
and what is left. CLAUDE.md gains the rules for reviews, the purge,
budgets and the data-write group; README the new schedules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:22:09 +07:00
poli0981andClaude Opus 5.5 529b8603c3 ci(pipeline): queue data-write runs and start each on the latest main
- queue: max on every data-write workflow (GitHub, 2026-05-07): up to
  100 runs wait, first in, first out. The default kept one, and a run
  queueing behind a running job cancelled it.
- ref: main on every checkout. A run's commit is fixed when it is
  created, so a run that waited behind another data job wrote shards
  from before that job's commit; Auto Update JSON failed four days in
  ten on the rebase conflict in data/index.json.
- timeout-minutes everywhere, and JOB_BUDGET_MINUTES at least 20 below
  it for the long loops (never for the ingest, which empties its queue).
- pipeline.test.ts fails on a data-write workflow missing any of these.
- The admin's Pipeline and Automation pages, docs/ADMIN.md and the
  auto-approve comment no longer say a push evicts a waiting job; the
  idle gate stays, so a batch's ingest starts at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:22:08 +07:00
poli0981andClaude Opus 5.5 df91b42c4f ci(sonar): import test coverage instead of excluding it
The scan job now runs both suites with coverage before scanning:
pytest --cov (pyproject.toml: scripts/ without its tests, relative
paths, coverage.xml) and `npm run test:coverage` (vite.config.ts: v8,
lcov with projectRoot "..", so paths start web/). sonar-project.properties
names both reports and drops sonar.coverage.exclusions.

requirements-test.txt gains pytest-cov 7.1.0 and coverage 7.16.2 with
every file's hash (uv pip compile --universal --generate-hashes
--python-version 3.15; the existing pins are unchanged). web gains
@vitest/coverage-v8 5.0.5, matching vitest; none of its packages has an
install script. Coverage stays off for a plain `npm test`.

The token check is its own job, so the scan steps no longer each repeat
the condition; the workflow grants nothing at the top and the scan job
contents: read. `npm run build:admin` replaces the bare `svelte-kit
sync`: it syncs too, and writes the admin bundle the Worker's tests load.

Locally: 576 vitest tests at 58.35% of lines, 299 pytest tests at 57.7%.
Against main's new-code lines (SonarCloud's isNew), the reports cover
92 of 114 coverable lines, 80.7%: the 80% gate is borderline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:34:51 +07:00
poli0981andClaude Opus 5.5 98430b7bb6 ci(sonar): give the TypeScript analyser the project's tsconfigs
The first CI scan logged "Failed to parse tsconfig web/tsconfig.json":
it extends .svelte-kit/tsconfig.json, which only `svelte-kit sync`
writes, so web/src was analysed without its compiler options or types.
The job now installs web/ (npm ci --ignore-scripts) and syncs before
scanning; both outputs are gitignored, so neither is analysed itself.

sonar.typescript.tsconfigPaths names all six tsconfigs: auto-detection
found only the two named tsconfig.json, leaving the Worker, shared/ and
the tests on fallback options.

The toolchain plan no longer claims sonar-python knows 3.15: the scan
warns and analyses as 3.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:16:51 +07:00
poli0981andClaude Opus 5.5 b465540faf ci: analyse with SonarCloud in CI instead of automatic analysis
A sonarcloud.yml workflow runs SonarSource/sonarqube-scan-action (pinned to
the v8.3.0 commit) on pull requests and main, with full history for blame.
Commits that touch only what the data jobs write are skipped, and a run
without SONAR_TOKEN (forks, Dependabot) passes without scanning.

.sonarcloud.properties becomes sonar-project.properties, now naming the
organization and project key; its scope settings are unchanged. The
toolchain test, Web CI's paths, CLAUDE.md and docs follow the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:12:56 +07:00
poli0981andClaude Opus 5.5 ee146dd023 docs: the TypeScript 7 / Node 26 / Python 3.15 move, and a runbook for 7.1
- docs/plan/16-toolchain-2026.md: the assessment - what each release
  changes, what was measured here, the decisions, how to move each runtime
  next time, and what was left.
- docs/plan/17-typescript-7.1.md: the springboard for dropping TypeScript 6
  once 7.1 ships - start conditions and how to check them, the steps, the
  planted-error table and the baselines to compare against.
- CLAUDE.md: "TypeScript is two packages, on purpose" and "One version of
  each runtime"; the uv compile line says 3.15.
- dev_env (EN/VI), README, AUTHORS, TAURI.md, web/README, THIRD_PARTY,
  DEPLOYMENT (Workers Builds' NODE_VERSION=26, the Checks paragraph),
  ACKNOWLEDGEMENTs and the About page's stack list ("TypeScript 7 + 6").
- CHANGELOG: the Tooling entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:19:52 +07:00
poli0981andClaude Opus 5.5 37f1783e90 chore(sonar): scope SonarCloud's automatic analysis
.sonarcloud.properties tells SonarCloud what is code, what is test code and
what to skip. Both start at the root and are split by patterns:

- tests: scripts/tests, every *.test.ts, and what only tests and the admin's
  dev server use (lib/testing, worker/testing, admin/mock) - analysed with
  the test rules, out of duplication and coverage;
- not analysed: the dataset and pipeline-written files (data/, games/,
  *.jsonl), the D1 migrations (SQLite, which the PL/SQL analyser parsed as
  Oracle), web/src/app.html (SvelteKit's template; its <title> arrives via
  %sveltekit.head%), and what the Tauri CLI generated and nobody edits
  (Android res/, buildSrc/, the icon set). The manifest, Gradle build files
  and MainActivity.kt stay in.

Simulated on the tracked files: 219 code, 84 tests, 16 excluded, none
indexed twice. Takes effect once on main. Also an [Unreleased] CHANGELOG
entry for this and the updater-json job, and the rule in CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:58:51 +07:00
poli0981andClaude Opus 5.5 d56d423876 docs: SonarCloud analyses pull requests too
The previous commit said SonarCloud's automatic analysis covers main only.
That was read from an empty pull-request list at a moment when no PR was
open; this PR got its own "SonarCloud Code Analysis" check (quality gate
passed, no new issues). DEPLOYMENT.md and the CHANGELOG entry now say that
CodeQL and SonarCloud both check pull requests and main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:35:50 +07:00
poli0981andClaude Opus 5.5 5247a3d3b3 docs: CI pinning rules, the worker's origin check, Android backup
- CLAUDE.md: the parser worker's origin check and why `e.origin &&` must
  stay; CI installs only what is pinned (action SHAs, --ignore-scripts, no
  npx, hashed Python requirements and how to add a package); the Android
  app's Auto Backup opt-out and why the policy is not the thing to change.
- docs/DEPLOYMENT.md: what web-ci and python-tests run now; CodeQL analyses
  pull requests, SonarCloud only main.
- docs/dev_env.md (and docs/i18n/vi): run the pipeline from the repo root
  with the hashed installs - `cd scripts` left data/ out of reach.
- docs/THIRD_PARTY.md: requirements-dev.txt goes in a pip call of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:32:11 +07:00
poli0981andClaude Opus 5.5 7449489519 docs: anti-cheat is the developer's declaration on Steam; the extension is archived
- DISCLAIMER section 5 and ToS item 5: anti-cheat is read from the
  anti-cheat disclosure on the Steam store page, which the developer fills
  in; an undeclared one shows "-", and a declaration can be wrong. Both are
  consent documents: the web gate shows these two diffs once.
- README, CONTRIBUTING, Contact (shown at /legal/contact, not
  consent-gated): no more extension; a missing game or a correction goes in
  Discussions > Ideas; the manual fork path queues store links only.
- CLAUDE.md: the anti-cheat sweep and its rules, the trio as the one manual
  set a writer replaces (an override still wins), OverrideGuard, links-only
  queue, clean_notes, the pattern mirror; 15 data writers.
- ADMIN, dev_env (+vi), web/README: the extension is no longer a producer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:38:50 +07:00
poli0981andClaude Opus 5.5 997cbd9208 docs: removals, auto-approve and the new admin pages
CLAUDE.md:
- data/blocklist.jsonl as a data invariant: applied first in save_main(),
  logged once, the 500 guard, never named data_*, whole-line writers, the
  shared golden fixture, Restore as the only way back.
- The pipeline rules for ingest (blocked links skipped, non-games refused,
  ingest-new.yml as the removal job on ref main), auto-approve's gates, and
  Remove/Restore's D1 semantics and WRITABLE paths.
- "Publication stays a human decision" now says who decides: a reviewer, or
  the capped auto-approve rule a reviewer turned on.
- Admin routes: the Overview at /admin, the queue at /admin/queue, and no
  /admin/api route answering 401/403 for anything but Access.
- save_main() has 14 callers, not 11 (here and in core/overrides.py).

docs/ADMIN.md: the App's Contents permission covers temp_info, overrides
and the blocklist (never a shard); why Actions read is not needed; the
discovery token's reach with auto-approve on; sections 11-13 for
auto-approve, removing/restoring and the Overview/Pipeline/Quality pages;
the mock's mock_pipeline switch.

README.md: the admin's description, the new scripts and the ingest
workflow's triggers.

Also: the delete_game.py help example kept its line break, and the mock's
removed rows carry the reason's label as the Worker writes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 13:08:13 +07:00
poli0981andClaude Opus 5.5 8bbdcb334c fix(pipeline): read age-gated games from Steam's JSON API; one release-date shape
An 'Adult Only' game's store page sends an anonymous client to /agecheck/
and on to a Sign In page that no age cookie opens (measured 2026-10-10).
The scraper read that page as the game's own: no language table, no tags,
no DLC section. 25 games sat with empty tags and languages (about 16 adult
games, plus Warframe, PUBG, Rainbow Six Siege and other M-rated games that
were gated on the US runners), and every one was written has_paid_dlc=false.

- steam_client: classify where a store-page request ENDED (the whole
  redirect chain), send age cookies with store-page requests only, ask
  appdetails and the page for l=english, add GetItems and GetTagList
  (keyless).
- store_items: a pure parser for GetItems items in scrape_store_page()'s
  shape (ELanguage tables derived from Steam's own data), plus DLC prices.
- fetcher.scrape_store_fields(): the page first, the JSON API when the page
  is gated or redirected, has_paid_dlc from the DLC's prices; None never
  overwrites a stored flag.
- refresh_store_data: a game with empty store fields is refreshed every
  day, first, capped at 150; --missing-only; values compared as stored.
- scraper: unescape tag and language names ("Point &amp; Click"), name the
  "#lang_slovakian" token.
- normalize, run by save_main() before overrides (idempotent, never bumps
  last_updated): release_date as "Aug 21, 2012" from any shape Steam
  writes; invisible characters and stray whitespace out of names and
  blurbs; HTML entities decoded in tags and descriptions; the extension's
  "Có DLC trả phí" notes as "Has paid DLC" (overrides translated too, so
  they cannot flip-flop).

Dry run on the 25 against Steam: 24 filled, 7 has_paid_dlc corrected
(396420 has no languages on Steam itself). The dataset normalised in
memory: 1,360 dates, 482 notes, 781 entity and 56 text records change, a
second pass changes nothing, and no last_updated moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 10:48:31 +07:00
poli0981andClaude Opus 5.5 e5365b3b6e feat(web): show the all-time peak; drop the misleading "(peak N)"
- A game's page gets an "All-time peak" row, and the games table a sortable
  column ("N/A" sorts to one end, as unrated reviews do); the CSV export
  carries the field. The record type mirrors the pipeline's new field.
- The "(peak N)" beside a game's player count is gone. It showed peak_today,
  which is the highest of our own occasional samples since the last refetch -
  neither a daily peak nor an all-time one - and read like both. Its i18n key
  goes with it.
- The Disclaimer's section on player counts names Steam Charts as the source
  and says what the number is not: Steam Charts samples periodically, and
  for games it does not track the figure is only what this project has seen.
  A consent document, so returning visitors see the gate once, showing that
  paragraph. The Acknowledgements credit Steam Charts (not a consent
  document).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:15:48 +07:00
poli0981andClaude Opus 5.5 a22589a334 fix(android): keep the app clear of the status and navigation bars
targetSdk 36 and MainActivity's enableEdgeToEdge() draw the webview under
both system bars. The React 1.x shell padded all four safe-area insets; the
SvelteKit rewrite kept only <main>'s bottom one, so the top bar of every 2.x
app has sat under the clock, which docs/android-support.md says cannot happen.

- styles/theme.css gains pt-safe, pb-safe, pl-safe, pr-safe and p-safe-or-4
  (env(safe-area-inset-*), named after the tailwindcss-safe-area classes).
  The shell root carries pt-safe pl-safe pr-safe, <main> pb-safe, the drawer
  pt-safe pb-safe pl-safe, and /welcome and the /error pages, which have no
  shell, pad themselves.
- The consent gate and the human check use p-safe-or-4 and centre their card
  with m-auto instead of items-center: on a short phone a card taller than
  the screen lost its top, unreachable (measured at 360x520: the 620px
  consent card now scrolls from its top edge).
- Back-to-top and the toasts add the bottom inset; the never-expiring Android
  update toast sat on the gesture bar.
- The status-bar icons follow the SYSTEM theme (enableEdgeToEdge() uses
  SystemBarStyle.auto), but the app defaults to dark, so a phone in light
  mode showed dark icons on a dark page. In the Android app the layout now
  puts a status-bar-strip behind them, keyed on prefers-color-scheme and
  never on the reader's theme. Its two colours are theme.css's --background
  tokens; mobile-layout.test.ts compares them and holds the shell padding.

env() reports these insets only from Android System WebView 136; an older
WebView reads 0 and keeps today's look. The Android docs now say so, and the
themes.xml comments, which still pointed at the React Layout and claimed
light icons, describe what enableEdgeToEdge() actually does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 06:42:01 +07:00
poli0981andClaude Opus 5.5 6123f7e0cc docs: the media host in the changelog and the deploy checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:21:04 +07:00
poli0981andClaude Opus 5.5 14d052a943 docs(privacy): artwork also loads from the site's own image host
"Everything the site loads is fetched same-origin" stops being literally true
once the web app loads art from media.free-steam-games.win. The substance does
not change - it is the site's own subdomain, served by Cloudflare like the rest,
and Valve still never sees a visitor's IP - but the policy says precisely what
the browser contacts, so it says this too.

Returning visitors see the consent gate once, showing this one paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:20:29 +07:00
poli0981andClaude Opus 5.5 e3bf4e6a8d perf(img): serve the minted AVIF from the R2 custom domain, out of Cloudflare's cache
A Worker always runs BEFORE Cloudflare's cache, so no `s-maxage` on /img/*
could ever spare an invocation: every thumbnail and hero view ran the Worker,
and every view the edge cache had not seen read R2. An R2 custom domain is
cached like any origin. On the web, thumbnails and the detail hero now load
from https://media.free-steam-games.win/img/v2/<w>q<q>/<path>@<t>.avif - the
exact key the cron mints - and a repeat view costs neither a Worker run nor an
R2 read.

- shared/img-keys.ts is now the one definition of the key scheme, shared by
  the cron, the /img route and the page (it moved out of worker/lib/img-store.ts).
- Every such <img> carries {@attach imgFallback(...)} with the /img URL. A key
  that is not minted yet is a 404 on the media host and a browser without AVIF
  cannot decode it; both fire `error`, and /img serves Steam's JPEG. A load
  that failed before hydration is recognised by complete && naturalWidth === 0.
  images.test.ts fails on an image without the fallback, or one built from a
  different value.
- An attachment, not an action: on a prerendered <img>, `use:` makes Svelte
  write onload/onerror="this.__e=event", which the hash CSP refuses - one CSP
  violation per game page. verify-dist.mjs now fails on it anywhere.
- The web CSP lists the media host in img-src; the Tauri one does not, and the
  packaged apps keep using /img/* for everything. verify-dist checks both ways.
- The service worker's /img/ rule matched the media host too (same path
  prefix). Its responses are opaque no-cors loads the rule can never cache, so
  it is same-origin only now; the objects' year of immutable Cache-Control is
  what keeps them.
- /img remembers an R2 miss per data centre for one cron tick (15 min), so the
  fallbacks and the apps stop paying an R2 read for art the backfill has not
  reached.

Measured with the domain not yet connected (so every media load fails): the
hero and all 100 thumbnails on /top-online fell back to /img and rendered,
including lazy images below the fold; none broke.

Merge only once media.free-steam-games.win serves a minted AVIF -
docs/SECURITY_SETUP.md section 5 has the setup and the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:20:28 +07:00
poli0981andClaude Opus 5.5 75b4e08c37 docs: data commits still deploy - say so, and how to tell
The previous commit said documentation AND data commits no longer deploy.
Documentation commits do not; data commits still did: 3f9e8cff ("Refresh store
data [2026-10-02]", four files under data/) carries a Workers Builds check
with a new Version ID, 712b4ab8, at 16:54Z. DEPLOYMENT.md and CLAUDE.md now
state the rule rather than claim it is in force, keep the configuration that
stops both, and say how to verify it: the next bot data commit must have no
Workers Builds check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:19:59 +07:00
poli0981andClaude Opus 5.5 6198ae7cdf docs: which commits deploy, the legal-document trap, and the cache rules
- DEPLOYMENT: documentation and data commits no longer deploy (watch paths,
  2026-10-02) - except that the legal documents are build inputs
  (build/legal-versions.ts, lib/server/markdown.ts), so a commit that
  changes only them must still trigger a build, or the consent gate keeps
  the old text and hash. Gives a watch-path configuration that does both
  (excludes are applied before includes) and how to check it.
- CLAUDE.md: the same, plus how static/_headers caches by path and why
  pages, sw.js and version.json must keep revalidating.
- CHANGELOG [Unreleased]: the static cache rules (PR #160) and the above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 23:32:57 +07:00
poli0981andClaude Opus 5.5 ad75d4ff31 docs: bring the docs in line with what shipped on 2026-10-02
- CHANGELOG [Unreleased]: AVIF art minted into R2, the packed catalogue,
  themed and hideable scrollbars, the prerender 404 noise, uncompressed
  shards, the Tailwind scrollbar-thin collision, the thumbnail probe, the
  data-commit redeploy, and the /cdn-cgi/image billing hole.
- SECURITY_SETUP §5: zone Transformations are OFF (every /cdn-cgi/image/
  request answers 404) and the cron kept minting with them off, so the
  Images binding does not need them.
- DEPLOYMENT: shard compression depends on the `ndjson-shards` Compression
  Rule, a dashboard setting; packed files are deliberately not .jsonl.
- CLAUDE.md: the scrollbar rules (scrollbar-slim, never Tailwind's core
  scrollbar-thin; panel/page markers; the stored key), and Transformations
  must stay off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 17:45:46 +07:00
poli0981andClaude Opus 5.5 659df7c169 feat(web): themed scrollbars, and a setting to hide them
Scrollbars now take the site's warm palette in both themes: a neutral thumb
that warms towards the brand amber on hover and turns amber while dragged,
on a transparent track. Firefox gets the standard scrollbar-color; WebKit
and Chromium get the ::-webkit-scrollbar pseudo-elements.

Why the tables never looked themed: Tailwind 4.3 ships a core
`scrollbar-thin` utility (scrollbar-width: thin), and our own utility of the
same name merged with it. In Chromium 121+ any standard scrollbar property
switches ::-webkit-scrollbar off for that element, so every panel showed the
OS's grey bar. The utility is now `scrollbar-slim`: the standard property only
for browsers without the WebKit pseudo-element, a 6 px themed bar elsewhere.
A test fails on any `scrollbar-thin` in markup (web and admin).

Settings → Scrollbars offers Visible (default) / Hidden in tables and panels
/ Hidden everywhere, stored as `f2p:scrollbars` (only once changed) and
applied as <html data-scrollbars>. Scroll containers opt in with
.scrollbar-panel (games table, card list, sidebar, command palette, the
anti-cheat table) or .scrollbar-page (the main content area); a test fails on
a themed container that opts into neither. Dialogs and the legal documents
keep their bars so a reader can see there is more. Hidden never means
unscrollable.

docs/PRIVACY_POLICY.md lists the new key, so returning visitors see the
consent gate once, showing that one line.

Verified in the dev server: table bars 6 px and themed in dark and light;
"panels" hides them (0 px) while the table still scrolls; "all" also hides
the main area; the choice survives a reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 17:43:54 +07:00
poli0981andClaude Opus 5.5 8aaa010088 fix(img): refuse to be a source for /cdn-cgi/image/ URL transformations
With zone Transformations enabled, the zone itself is always an allowed
source and Sources cannot exclude it. /img/* proxies any Steam appid, so
/cdn-cgi/image/<any options>/img/d2/<appid>/header.jpg let anyone bill a new
transformation per option set, outside IMG_TRANSFORM_MONTHLY_CAP. Measured
in production: width=77 on app 440 answered 200 (cf-resized: internal=ok),
and wrangler tail showed the resizer fetching the source with
`Via: 1.1 image-resizing-proxy` and the caller's own User-Agent.

handleImg now answers 403 to any request whose Via names image-resizing.
The site never transforms by URL: only the cron does, through the Images
binding, from Steam directly, so nothing legitimate is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 17:23:12 +07:00
poli0981andClaude Opus 5.5 42fb8e6250 fix(img): hero AVIF at q80, quality in every key, mint 40 per tick
The first production batch (10 most-played games, 2026-10-02 09:30Z) came
back at the expected sizes - median 40.0 KB JPEG -> 10.9 KB `d`, 3.4 KB `s` -
but Cloudflare's quality scale runs well below libavif's: `d` at q60 scored
SSIM 0.960 against Steam's JPEG (0.937 on Counter-Strike 2 and PUBG), and a
3x crop showed fine background stripes and texture smoothed away. The hero
is enlarged by the browser to up to 768 CSS px, so that softness shows. `s`
(q55, SSIM 0.952) is shown downscaled and stays.

- `d` goes to q80.
- The R2 key and the edge-cache key now carry width AND quality
  (img/v2/460q80/...): an old encoding can never be served for a new one by
  an edge that cached it, and changing one variant's quality re-mints only
  that variant. The v1 objects (the first 10 sources) are simply not read.
- IMG_MINT_PER_TICK 10 -> 40: the backfill finishes in about a day and a
  half, still well inside IMG_TRANSFORM_MONTHLY_CAP.

Docs: SECURITY_SETUP §5 and CLAUDE.md now say /cdn-cgi/image/ must not work
on this zone. With zone Transformations on, "This zone only" still accepts
/img/* as a source, and /img/* proxies any Steam appid, so anyone could bill
transformations with arbitrary options outside the monthly cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:39:18 +07:00
poli0981andClaude Opus 5.5 2f883238aa feat(img): AVIF header art minted by the cron into R2, served read-only
/img/* used to pass Steam's JPEG straight through (median 36 KB; every
header is 460x215). Thumbnails and the detail hero are now AVIF for every
browser that accepts it: measured locally, 6.9 KB for the 460 px hero and
2.7 KB for the 230 px thumbnail of Counter-Strike 2, against a 34.3 KB JPEG.

How it is split:
- worker/lib/img-mint.ts (cron, every 15 min) is the ONLY place a billed
  transformation happens. It builds the source list from shards that hash
  to data/index.json (a lagging raw.githubusercontent shard would otherwise
  freeze a stale list under the new generation), most-played first, encodes
  `s` 230 px q55 and `d` 460 px q60 with the Images binding and writes them
  to R2 `f2p-media` under img/v1/<w>/<path>@<t>.avif. The list is kept in a
  marker object, so a backfill does not re-download the shards every tick.
- worker/routes/img.ts only READS: Cache API -> R2 -> Steam's JPEG. No
  request (unknown appid, forged ?t=, HEAD) can create a transformation or
  an R2 object. The old cf.image WebP branch is gone.
- Budget: Images Paid has no spend cap, so IMG_TRANSFORM_MONTHLY_CAP (20,000,
  at most $7.50 against the agreed $15/month) is enforced by an atomic D1
  counter (locks.ts bumpCounter), counted before each call, fail closed.
  Error 9422 stops every isolate until the month turns.

Variants: s/d are negotiated on Accept with Vary: Accept. An AVIF browser
gets the JPEG only as a provisional answer (one day, no X-Img-Final) and the
service worker now caches only X-Img-Final responses, because CacheFirst
ignores Cache-Control. t and d2 stay JPEG: released apps request them and d2
is og:image. Cache keys are normalised, so stray query strings no longer
fork the edge cache, and the t capsule probe no longer runs on hashed paths
where it was two guaranteed 404s.

Client: thumbnails use s, the hero uses d with fetchpriority="high". The
Steam URL parser moves to shared/steam-image.ts so the client, route and
cron cannot disagree. worker-configuration.d.ts regenerated (runtime types
unchanged). Bucket f2p-media already exists (created 2026-10-02).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:58:44 +07:00
poli0981andClaude Opus 5.5 a74a004e19 docs: publish role contact addresses and the maintainer's website
contact@ stays the default. Three role aliases go where a reader of that
document will look for them, and nowhere else:

- security@  SECURITY.md, security.txt, SECURITY_SETUP section 8
- privacy@   the Privacy Policy's "Your rights"
- copyright@ LICENSE-DATA (new "If you hold rights" section) and ToS
             section 6, one address for copyright, DMCA and takedown notices

security.txt now lists GitHub's private vulnerability reporting first and
security@ second, in RFC 9116 preference order; the links page is not a
security channel and is dropped from it. The About page gains a Website card
(https://poli0981.dev/), two columns at sm and three from md so the email
handle never truncates. AUTHORS, Contact, CONTRIBUTING and username.txt carry
the full map.

The copyright text promises a human reading, not an outcome: an override
cannot blank a field and the store refresh rewrites description monthly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:31:09 +07:00
poli0981andClaude Opus 5.5 fa8b81fd9b docs: the Turnstile check and the Referer fix, and what they made untrue
Legal (both reopen the consent gate for returning visitors, showing only
the changed lines - edited line-locally so that diff stays small):
- PRIVACY_POLICY: a section on the website's Turnstile check - after
  acceptance, at most daily, what challenges.cloudflare.com reads (IP,
  User-Agent, TLS fingerprint, page signals), that Cloudflare is processor
  for the site and controller where it improves its bot detection (the
  Turnstile Privacy Addendum), that the Worker forwards the token and IP
  and keeps neither; the f2p:human_check storage row. "The only third
  party", "the verification step" and "No fingerprinting" are corrected.
- ToS section 9: the check exists; /api/data/*, /img/* and the apps stay
  excluded from both human checks.

SECURITY_SETUP:
- section 10 rewritten. It said the apps survived Hotlink Protection only
  because their webview sent no Referer (untrue since WebView2 started
  sending tauri.localhost), recommended switching the protection off, and
  said no allowlist could express the apps' origin - a Configuration Rule
  on http.referer can. Now: the per-<img> fix and its test, the rule for
  2.0.0 installs, and the check, with the results measured today.
- new section 12: widget settings (hostname, Managed, pre-clearance off),
  the TURNSTILE_SECRET secret and rotation, what the check is not, local
  testing with Cloudflare's test keys, the optional rate-limit expression.
- the CSP block, the script-src/frame-src prose, "no form posts", the
  rule budget (Configuration Rules 1/10), and two stale paths.

CLAUDE.md gains the human-check and <img> invariants and says "after
consent and the human check" where the service worker, analytics and
/welcome used to say "after consent". README, web/README, DEPLOYMENT,
ACKNOWLEDGEMENTs, SECURITY (bypassing the client-side gate is out of
scope), TAURI troubleshooting and the changelog follow. _headers and
worker/lib/http.ts: comments only - why images override Referrer-Policy,
what X-Frame-Options does and does not govern, and the public/_headers
and SITE_ORIGIN references that were stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:47:01 +07:00
poli0981andClaude Opus 5 7d0025112b docs: record the WAF rules as live, and replace the React-era dependency list
THE TWO WAF RULES EXIST NOW. `human-check-pages` (Managed Challenge) and
`blocked-countries` (Block) went live 2026-09-20, so SECURITY_SETUP no
longer reads as instructions for something that has not been done. Section
4 says what is deployed and when, and carries what was measured afterwards:
a plain curl with no browser User-Agent is still served `/`, `/games`,
`/legal/tos`, `/.well-known/security.txt`, `/sitemap.xml` and `/robots.txt`,
the challenge rate has stayed at 0%, and a real browser loads a game page,
the service worker and the beacon uninterrupted. Section 9 records the
analytics beacon returning 200 and its reports 204 on the live site, and
that "Enable with JS Snippet installation" is the only mode this CSP can
ever accept. "Still open" now names the Free-plan rule budget - 1/1 rate
limiting, 2/5 custom - because that is the next thing to run out.

THE DEPENDENCY LIST WAS THE REACT APP'S. ACKNOWLEDGEMENTs credited React 18,
react-router, i18next, Zustand, TanStack Query, Radix, shadcn/ui, cmdk,
OpenPGP.js, Tailwind 3, TypeScript 5 and PostCSS - none of which has
shipped since the v4 rewrite - while omitting Svelte, SvelteKit, Bits UI,
unified and the typefaces that actually do. Rewritten from package.json and
Cargo.toml, with every licence read out of node_modules rather than
remembered: echarts-wordcloud is ISC, not BSD-3-Clause. The claim that
/about carries a "full SPDX list" is gone; it is a curated subset and says
so now.

THIRD_PARTY.md gains svelte-check and vitest, which the pre-publish suite
has been running unlisted, and drops "the TypeScript SPA".

web/README.md documents the two analytics CSP hosts, why automatic
injection can never be used, the navigateFallback fix, and the consent
hashing and diff mechanism - none of which existed when its CSP and PWA
sections were written. Its file tree lists the four new modules.

DEPLOYMENT.md records that a zero-duration "Workers Builds" failure on a PR
branch is a preview-build artefact: it happened twice on PR #130 while the
identical commits deployed from main minutes later, and the GitHub Actions
`check` job already runs the same build, verify-dist and wrangler dry-run.

Also fixes a pre-existing broken curl snippet in section 10, whose
`%{http_code}\n` had been saved with a literal newline in it.

The dead relative links the link checker finds in CHANGELOG.md are left
alone: they are in released sections and name files that existed at the
time. A changelog is a record, not documentation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 20:21:58 +07:00
poli0981andClaude Opus 5 5dfd9dd36e docs: analytics, the two WAF rules, and the claims they made false
The privacy policy said the site had no analytics, set no cookies, loaded
nothing from a third party and did not have Cloudflare Web Analytics
enabled. Three of those were already shaky and all four had to change, so
this rewrites the affected sections rather than bolting a paragraph on:
what the beacon does and does not do, why it waits for consent, the
human-verification step, and where the site is no longer served. ToS gains
section 9, which did not exist - there was no availability or automated-
access clause at all.

SECURITY_SETUP section 9 is reversed. It recommended turning Web Analytics
OFF; it now records why the automatic mode can never work under a
hash-based CSP, so nobody re-enables it, and what the JS-snippet setup is.
Section 4 keeps "leave Bot Fight Mode off" and adds the two custom rules
that are safe here, each exclusion annotated with what breaks without it,
plus the country block with its real costs: Yandex indexing ends, the
packaged apps stop working there, VPNs evade it trivially.

The verification command for the country block is deliberately NOT the
obvious one. `-H 'CF-IPCountry: CN'` proves nothing: geo.ts reads
request.cf.country first, which cannot be spoofed, and Cloudflare
overwrites that header on ingress. The doc gives the two checks that do
prove something, including the local one whose expected result is 403 on
every Worker route AND 200 on / - which is the whole argument for the WAF
rule.

Also corrected: the CSP transcribed in section 1 was missing both new hosts
and still listed a frame-ancestors this policy has never carried (it is
ignored in a meta CSP; X-Frame-Options covers it).

CLAUDE.md gains four standing rules - the navigateFallback invariant, the
two web-only CSP hosts and why automatic injection is impossible,
per-document consent hashing and why it lives outside prefs.svelte.ts, and
BLOCKED_COUNTRIES being defence in depth rather than the boundary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 20:01:28 +07:00
poli0981andClaude Opus 5 4e206cb64c fix(admin): /admin wrote the maintainer's address into public Git
Every approval committed `Approved in /admin by <email>.`, every override
edit `Edited in /admin by <email>.`, and `data/overrides/<appid>.json`
recorded the same address as `set_by`. All three are public forever, and
the Git AUTHOR was already the App's own bot identity - only the body text
named a person.

They now say `admin` (ADMIN_ATTRIBUTION, shared/admin-api.ts). The four
override files that already carried the address are rewritten; `set_by` is
informational, so nothing in the pipeline reads it.

appendLinks() loses its `actor` PARAMETER rather than merely stopping at
the one call site that passed `who.email`: a parameter nobody can supply
cannot be supplied by mistake. A new case in git-commit.test.ts asserts the
generated body contains no `@` at all.

D1 is untouched and still records the acting Access identity in
audit_log.actor, ingest_queue.decided_by, ingest_decisions.decided_by and
commit_jobs.requested_by - 0001_init.sql calls that deliberate, and the
audit view filters on it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 20:01:28 +07:00
poli0981andClaude Opus 5 0a4c5013c5 fix(admin): serve the admin API under /admin, in the page's Access app
/admin reported "Your Cloudflare Access session has expired" straight after
signing in, in a private window too. The page and its API were two Cloudflare
Access applications: /admin (AUD ca93...) and /api/admin (AUD a15d..., read
from the kid= of each login redirect). Access issues its session cookie per
application and fetch() cannot follow the sign-in redirect, so the session
for /admin never reached the API. Every call came back as an opaque redirect,
which api.ts correctly reads as an expired session, and a reload only renewed
the page's session. The Worker never answers 401/403 on these routes, so the
redirect could only have come from the edge.

The API now lives at /admin/api/*, under the page's own application:
ADMIN_API_PREFIX in shared/admin-routes.ts, used by the router, both
handlers, the SPA's api() (views pass routes like "queue?...") and the mock
backend. /api/admin/* is no longer served, and its AUD leaves
ACCESS_AUD_ADMIN.

Every existing test called the handlers directly, so none could see this.
worker/index.test.ts drives the real router and Access check with a signed
RS256 token: a reviewer reaches /admin/api/*, a write still needs the header
rather than the cookie alone, another application's token and the old prefix
both get 404. security.test.ts keeps the prefix under /admin and API paths
out of the views. Verified in preview:admin under the production CSP: queue,
stats, me, health and the ping write all answer from /admin/api/*.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 11:38:30 +07:00
poli0981andClaude Opus 5 1b10b33a40 docs: describe v4.0.0 as it is - README, web README, Tauri, security, changelog
- README: SvelteKit rather than React, Cloudflare rather than GitHub Pages, a
  resizable self-updating desktop app, the /admin review queue, the real
  workflow list, and no in-browser editing or GPG signing (removed in
  September).
- web/README.md: the admin app, verified shard generations, prerendered game
  pages, the service worker as it is now, and the checks CI runs.
- TAURI.md: the update feed at /api/updates/desktop (drafts are never offered),
  settings surviving updates, the Android update check; the OAuth note is gone
  with sign-in.
- dev_env (en, vi), CONTRIBUTING, android-support (en, vi): tests exist now,
  and the web side is Svelte.
- SECURITY_SETUP: the admin shell's nonce policy, and the report-only CSP that
  Cloudflare's Continuous script monitoring adds at the edge (turn it off).
- CLAUDE.md: where old /#/ links still come from and why the upgrade uses
  goto; /api/activity sends CORS too.
- CHANGELOG [v4.0.0]: the admin app, verified data, a page per game, the
  installable web app, the desktop updater, the new pages, and the live-site
  fixes. Deploying needs D1 migration 0002.
- Code comments that still described React, GitHub Pages, hash routing or a
  sign-in token.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 23:13:17 +07:00
poli0981andClaude Opus 5 727aadabf8 feat(admin): a Svelte admin app embedded in the Worker, with read-only decided rows
The two Worker-rendered admin pages (admin-ui.ts, edit-ui.ts: 1,400 lines of
HTML and script inside template literals) are replaced by a Svelte 5 app in
web/admin/. It is built on its own and embedded in the Worker as the gitignored
worker/generated/admin-bundle.ts, so no admin code ever reaches dist/, the
service worker's precache or the packaged apps. worker/routes/admin-spa.ts
serves the shell with a per-response nonce CSP after the existing Access checks,
serves hashed assets immutably, and 404s any other path under /admin.

Queue
- Rows that are decided (approved, committed, rejected) or whose game is already
  published have no checkbox, show a lock and are skipped by select-all. The
  rules come from shared/queue-rules.ts, the same module the Worker enforces.
- Decisions confirm every row first and report skipped rows with their reasons.
- Tabs with counts, cross-status search, sort, page size, all kept in the URL.
- Keyboard: j/k, x, a, r, d, e, /, Esc, ?. Ignored while typing or composing.
- Details dialog: payload, durable decision, other rows for the game, Reopen for
  a rejected row with the reason when it cannot be reopened.
- Phone layout as cards.

Edit
- One game: every change reviewed in a diff dialog before the commit; retire;
  delete a settled override file; unsaved-change guard.
- Several games: any field, set or retire, selection kept across pages and
  genres (up to 10), each game shown in the review.

Jobs, Audit and Health get their own paged, filterable pages. Health draws its
table on a 503 too, and Test write proves the write path.

An expired Access session reloads the page once; a refusal that survives the
reload is reported instead of looping. A non-JSON response is a server error,
never "session expired".

Local development: npm run dev:admin runs the real handlers against an in-memory
D1 with demo data, and npm run preview:admin serves the built bundle through the
real serveAdmin with the production CSP. Nothing in worker/ or admin/src imports
the mock, and the Worker has no authentication switch.

Also: design tokens move to src/styles/theme.css, shared by both builds;
verify-dist fails if admin code reaches dist/; vite-plugin-pwa is declared, as
src/app.d.ts references its types; docs/ADMIN.md, DEPLOYMENT.md and CLAUDE.md
describe the new admin.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 22:46:33 +07:00
poli0981andClaude Opus 5 1b6ad7be47 feat(admin): read-only decided and published rows, reopen, reconcile sweep, retention
The server half of the admin rework. The pages still run on it unchanged -
every change here is additive - until the new UI replaces them.

Read-only rows. web/shared/queue-rules.ts holds the queue's rules once, for the
Worker and the UI: a row is locked when it is approved (its request is already
committed to Git), committed (the game was observed in data/) or rejected, and
also when its GAME is already published, since one appid can have several
rows. /api/admin/decide refuses locked rows when it reads them and again in
every UPDATE's WHERE, and reports each refused id with a reason - not-found,
not-decidable, published, open-row-exists, duplicate-in-request, no-op,
changed-concurrently. It used to drop them silently, so a mixed selection
reported fewer decisions than it was sent. The queue listing carries
`published` per row, and status=all searches every tab when there is a query.

Bugs fixed on the way:
- Requeueing or deferring a failed row while another row for the appid was
  open broke uq_queue_open_appid inside the batch: a 500 for the whole request.
  It is now a skip.
- When an approval's commit landed and the queue update failed, the job's
  status was in the same rolled-back batch and stayed 'pending' forever, and
  the message promised reconcile would promote rows it never reads. The job is
  recorded first, and the message says what is actually true.
- The health endpoint returned 503 without a body the page could render.

New: POST /api/admin/reopen returns one rejected row to pending and deletes
only its 'rejected' decision, in one transaction whose guards refuse a
published game or an appid with another open row - replacing a raw-SQL step in
the runbook. Jobs and audit page with totals and filters. Approval reasons are
recorded in the audit row and the commit body.

Reconcile sweeps pending, deferred and failed rows whose game is already in
data/ to committed (a game published after its approval aged out stayed
'failed' forever), holds a cross-isolate D1 lease, and skips the ~6 MB dataset
fetch while index.json's generation is unchanged. Migration 0002 adds the two
tables; lib/locks.ts treats a missing table as unavailable, so the Worker and
the migration can ship in either order.

Overrides: the Worker can now delete a SETTLED override file - no active field,
every retirement already restored - through createCommitOnBranch deletions,
and every override commit writes a commit_jobs row.

audit_log and commit_jobs are pruned daily after ADMIN_RETENTION_DAYS (180),
which the privacy policy now states.

Tests: the real handlers against the real migrations on node:sqlite
(worker/testing/sqlite-d1.ts), with GitHub and the dataset faked - 57 new
cases across decide, reopen, reconcile, leases, retention, override deletion
and the createCommitOnBranch payload.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 22:03:39 +07:00
poli0981andClaude Opus 5 75c5fcb8ab feat(desktop): a working auto-updater, and updates that no longer reset the app
The updater plugin, its signing key and its capability shipped with 2.0.0,
but nothing called check(), and its endpoint could not have worked anyway:
releases/latest/download/latest.json follows GitHub's single "latest" release,
and this repository publishes dataset, Android and desktop releases on one page.

- The feed is now /api/updates/desktop. The Worker reads releases.atom (no
  anonymous-API rate limit, never lists drafts), takes the highest
  desktop-vX.Y.Z, and serves its latest.json only if the version matches the
  tag and every artefact URL is this repository's own release download.
  Anything unusable is a 204, the updater's "no update". Public, edge-cached,
  and - like /api/activity - never touches the GitHub App token.
- The app checks five seconds after launch, once per session and only after
  consent, and offers the update in a dialog: plain-text release notes,
  download progress, then relaunch through tauri-plugin-process. The npm
  plugins match their Rust crates' minor versions, which the Tauri CLI
  requires.

That exposed a second bug. purge_stale_webview_data cleared the webview's
storage whenever the stamped version differed from the running one - so every
update would have wiped consent, theme, language and the cached catalogue.
Only builds before 2.0.0 ever registered a service worker, so needs_purge()
now clears only for a missing or pre-2.0 stamp, with unit tests.

Release plumbing: both release workflows use a plain `npm ci` (web-ci.yml
already forbade the `|| npm install` fallback that once hid a broken
lockfile), their notes stop describing a fixed 1400x900 window, GitHub Pages and
raw.githubusercontent, and web-ci builds and verifies the Tauri configuration
on every change. The privacy policy states what each app's update check
contacts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 21:53:22 +07:00
poli0981andClaude Opus 5 416990e7e2 feat(web): prerender a page per game, from build-time seeds
/games/<appid> was client-rendered only, so the 3,650 pages that describe the
actual catalogue were invisible to search. On the web build each one is now a
real document with its own title, description, social image, JSON-LD
VideoGame record and sitemap entry. The Tauri build prerenders none.

Two constraints shaped how:

- A crawler never accepts the terms, so it never loads the catalogue. The page
  must render from data baked in at build time. build/game-seeds.ts reads
  ../data once in the SSR build and inlines a seed per game - slow-changing
  fields only. Players, peak, reviews and metacritic are never baked: data
  commits do not rebuild the site, so they always come from /api/data/*.

- It is a UNIVERSAL load, not a server load. With +page.server.ts every client
  navigation fetches /games/<appid>/__data.json, and for a game added after the
  deploy that is index.html at 200 - parsing fails and the page errors. The
  browser half of the load reads the same seed back out of the page's
  #game-seed block, so hydration matches, and returns null after a client-side
  navigation, where the live catalogue renders.

fallback-route.ts previously re-rendered /games/* on every cold load, which a
prerendered page must not get. Pages that may arrive as the dashboard shell now
announce themselves with markRouteRendered(); recovery runs only when that did
not happen (new games, Tauri, studio pages). A page for a game removed since the
deploy shows "Game not found" with noindex once the catalogue loads, with the
removal reason when there is one.

Measured: 3,649 pages, build 16 s -> 30 s, dist 143 MB, ~38 KB a page. The
service-worker precache ignores them, the crawler ignores 404s for Worker-only
/img/ and /api/ paths and nothing else, and verify-dist.mjs --web checks every
game page carries its seed and JSON-LD and that no __data.json exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 21:43:14 +07:00
poli0981andClaude Opus 5 c8f17d8efa feat(web): verified shard generations, offline fallback, and revalidation
The screenshots showed "3,666 games · 2026-09-12" on 09-17, while the site
served 3,649 / 09-17. Three client-side paths could produce that, and each is
closed:

1. A tab loaded the catalogue once and never looked again. The layout now
   revalidates on visibility, focus and online (at most once a minute) and
   every ten minutes while visible: one ~600-byte index request, shards only
   when the generation changed. Resource.data is $state.raw, and a check that
   finds nothing new returns the same object, so pages do not re-render.

2. The service worker answered /api/data/* NetworkFirst with a 5 s timeout, so
   a slow index came back from its cache and was taken as current. That route
   is gone; lib/pwa.ts deletes the leftover f2p-data-v3 cache. IndexedDB is the
   only offline copy, and the loader now falls back to it when the index
   cannot be fetched - which also gives the packaged apps, which have no
   service worker, the offline mode their comments already claimed.

3. index.json and the shards are cached independently on the way to the
   client, so a new index could arrive with an old shard and be cached as a
   pair under the new stamp. Shards are now requested by the sha256 their
   index entry records. The Worker serves such a request only if the bytes
   hash to it - then caches it for a year, since content addressed by its own
   hash cannot go stale - and otherwise answers 503 (remembered for 20 s, so a
   wave of retries does not re-pull 1.2 MB each from GitHub, whose CDN does not
   honour a query string). The client verifies again, caches only a fully
   verified generation, keeps showing the one it holds meanwhile, and retries
   with backoff. An index without hashes loads exactly as before.

games-loader.ts is the whole policy as a pure function, with a test for every
branch; data.test.ts covers the Worker side. The topbar says when data is an
offline copy or when newer data is waiting upstream.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 21:32:39 +07:00
poli0981andClaude Opus 5 85f1a97f39 fix(web): CSP that lets the app hydrate, the PWA, and two unported modules
Four regressions the port had introduced, all found by looking at the running
app and at knip rather than by assuming the migration was complete.

## The app did not hydrate at all

SvelteKit emits exactly one inline <script> per page - the hydration bootstrap
- and offers no way to avoid it. Under _headers' `script-src 'self'` the
browser blocked it, so every page rendered its prerendered HTML and then sat
there completely inert. Measured in a real browser, on every route:

  Executing inline script violates ... directive 'script-src 'self''

The CSP now lives in svelte.config.js under kit.csp with mode "hash", so
SvelteKit computes that script's sha256 at build time and emits the whole
policy as a <meta> tag that already trusts it.

The header CSP had to GO, not relax: browsers enforce the INTERSECTION of a
header policy and a meta policy, so leaving `script-src 'self'` in _headers
would have kept blocking the script whatever the meta allowed. One directive
is lost in the move - `frame-ancestors` is ignored in a meta CSP - so
X-Frame-Options: DENY in _headers is now load-bearing rather than
belt-and-braces.

Verified after: hydration confirmed by 26 virtualised rows existing (they only
exist if the client ran), both fonts reporting "loaded", and a fresh tab
walking /about and /charts/genres with ZERO console messages. The font
"preloaded but not used" warnings were a symptom of the same thing and are
gone with it.

## The PWA was simply missing

@vite-pwa/sveltekit was installed and never configured, so the build emitted no
service worker at all - no offline support and no update flow, both of which
the React app had. Configured with the runtime caching carried over verbatim,
including the reasons: NetworkFirst for /api/data/* because index.json carries
last_updated and serving THAT from cache strands every reader on stale records,
and the navigateFallbackDenylist because an installed SW answering /admin from
the app shell would serve the public shell where the Access gate is expected.

## Two modules ported but never wired up

- external-link-interceptor: the Tauri webview blocks window.open() and
  target="_blank" to external http(s), so without it every external <a> in the
  packaged builds dead-clicks.
- android-update: Android has no native Tauri updater (the plugin is
  desktop-only), so the APK checks GitHub Releases itself. Both packaged apps
  had silently lost a feature.

## knip was blind to the whole UI

Its project globs were still {ts,tsx} from the React era, so after the
migration it could not see a single .svelte file and reported the entire UI
dependency tree as unused. Fixing that is what surfaced the three items above,
plus two primitives I wrote and never used. No unused files or dependencies
remain.

CLAUDE.md updated: six of its notes described a React app that no longer
exists, which is worse than no note - an agent reading it would go looking for
files that are gone. It now records the four traps this change cost:
the CSP-must-not-be-in-two-places rule, adapter-static's fallback overwriting
index.html, nothing gating markup behind onMount, and $state being required for
a value an $effect must react to.

check / test / build / knip clean. 46 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:04:33 +07:00
poli0981andClaude Opus 5 369cc776d0 feat(web): app shell, data layer and first pages on SvelteKit
The shell runs end to end against real data: consent gate, sidebar, topbar,
command palette, theme switching, i18n, the catalogue load, and a rendering
ECharts chart. Verified in a browser at 1440x900 and at mobile width.

## Data layer, without TanStack Query

lib/resource.svelte.ts is ~90 lines of runes replacing @tanstack/react-query.
What the app used from that library was isLoading/error/data/refetch, a stale
time and one refetchOnWindowFocus. Caching is deliberately NOT reimplemented:
the catalogue's real cache is IndexedDB keyed on index.json.last_updated, the
only invalidation signal this dataset has, and a memory cache on top would be a
second thing to get wrong. The three-step load (read cache, compare
last_updated, else fetch shards and parse in a worker) is carried over exactly.

## i18n gaps closed rather than carried forward

The plan listed eleven categories of hardcoded English inside an otherwise
translated app. Fixed so far:

- The seven KPI labels, which lived as string literals in KpiCards.tsx.
- formatRelativeDate, which returned "today" / "3d ago" / "2w ago" regardless
  of locale. Now Intl.RelativeTimeFormat, which also handles pluralisation -
  the part a template string per language cannot do.
- formatNumber, which hardcoded toLocaleString("en-US"), so a Vietnamese
  reader saw 1,234,567 where their locale groups as 1.234.567.
- The command palette, whose 17 labels were the only untranslated strings in
  the app. It is now built from the nav lists instead of its own array - which
  had already drifted, missing /top-offline, /donate,
  /charts/anti-cheat/list, /charts/delisted and /welcome.

en.json and vi.json go 353 -> 392 keys, edited together by script with the leaf
sets asserted equal, because hand-editing one is how they stop matching.

## Things fixed on the way through

- Ctrl-K now checks e.isComposing. Without it the shortcut fires mid-IME
  composition and steals the keystroke, which made the palette actively
  hostile to Vietnamese input - the locale it exists for.
- The theme "system" option now listens for prefers-color-scheme changes. The
  React Topbar read matchMedia once and never subscribed, so "system" never
  actually reacted.
- The Toaster took the resolved theme instead of a hardcoded "dark", which had
  put a dark toast on a white page in light mode.
- The sidebar version is derived from __APP_VERSION__; it said "Steam · v1.0"
  while package.json was 1.4.5.
- Distinct icons per nav row: Trophy was used for BOTH leaderboards and Shield
  for two anti-cheat entries, which makes an icon useless for finding a row.
- legal.ts said "The 5 binding documents"; the licence split made it six.
- /legal/<slug> links are real links now. Welcome.tsx built that exact href
  and then called preventDefault() to bounce to /about, because nothing was
  there to receive it.

## Two bugs found by looking, not by guessing

**The chart rendered nothing.** ECharts initialised and created its container
but painted no canvas - which looks exactly like the unregistered-theme
failure CLAUDE.md warns about. It was not that: `chart` was a plain `let`, so
the setOption effect ran once while it was still undefined and never re-ran
when init assigned it. Making it $state fixed it, and the comment now names
both failure modes so the next person does not misdiagnose it the same way.

**Cloudflare Hotlink Protection is ON and the packaged apps survive it by
luck.** Every /img/* request from the dev server came back 403, body
`error code: 1011`. Measured against the live zone: no Referer 200, own-origin
Referer 200, but `http://localhost:5173/` 403, `tauri://localhost/` 403 and
`http://tauri.localhost/` 403 - the two origins the desktop and Android builds
actually load images from. They render today only because the Tauri webview
sends no Referer for <img>, which is not a guarantee anyone made: a WebView
update doing the ordinary spec-compliant thing would blank every image in both
apps with no change on our side. Written up as SECURITY_SETUP.md section 10
with the measurements and a recommendation to turn it off - it restricts
nothing that worker/routes/img.ts's anchored PATH_RE and host allowlist do not
already restrict, and Referer is client-set anyway.

## Still to port

The games table, nine of the eleven chart pages, about/settings/health/
activity/donate, /legal/[doc], and the four new surfaces (/stats,
/developers, /publishers, /games/[appid]). The foundation they all sit on -
routing, data, i18n, theming, charts, consent - is proven working.

check / test / build all clean; the 39 Worker tests are untouched by this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 13:17:27 +07:00
poli0981andClaude Opus 5 e4c3bd14d8 feat(web): SvelteKit scaffold, real fonts, and the palette rework
First step of the framework switch. The React UI is removed and replaced by a
building SvelteKit 2 / Svelte 5 shell; page porting follows. The React app is
in git at 290b1ad7 and is the reference for every port.

Nothing outside web/src changes: the Worker, wrangler.jsonc, the Python
pipeline and data/ are untouched, and /admin stays Worker-rendered HTML.

## The routing risk is settled, and it went the easy way

The plan named one blocker: SvelteKit has no HashRouter, and the React app used
one under isTauri() because "the Tauri webview has no server-side fallback".

That claim is out of date. tauri::manager::get_asset() resolves a miss through
<path>.html, then <path>/index.html, then index.html - read from tauri-2.11.1,
which is the exact version in Cargo.lock. So the packaged apps serve real paths
already, and adapter-static's fallback output works unmodified on Cloudflare
AND in both apps. No HashRouter, no hash shim, one build shape for two targets.
Written up in docs/plan/15-sveltekit-migration.md, including the honest caveat
that this is read from source and still needs the Phase 7 smoke test.

## Fonts exist now

index.css declared `--font-sans: Inter` and `--font-mono: JetBrains Mono` with
no @font-face, no link tag and no woff2 anywhere in the repo, so the app had
always rendered in system-ui. Three self-hosted variable faces, each with a
job: Bricolage Grotesque (display), IBM Plex Sans (body and the 3,400-row
table), JetBrains Mono (numerals).

scripts/gen-fontface.py generates src/fonts.css from Fontsource's own CSS,
keeping latin, latin-ext and vietnamese and dropping cyrillic, cyrillic-ext and
greek - 91 KB of a 308 KB payload, for scripts an en/vi app cannot render.
unicode-range values are parsed from Fontsource rather than transcribed,
because a mistyped range is a silent rendering bug on one character. Generated
rather than hand-written so a font bump cannot leave a stale range behind.

Verified in a browser: all three faces render, and the Vietnamese subset draws
"Phiêu lưu, nhập vai, chiến thuật" with full diacritics.

**Measured, not assumed:** the plan said to verify IBM Plex Sans has real
tabular figures before committing to it for the table. It does better than
that - every digit already renders at the same advance width (all ten at 24px
at font-size 40), so alignment holds with or without `tnum`. The utility is
kept because it states the requirement and protects a future face swap.

## The palette rework index.css deferred

In its own words: "The palette rework is a separate change." This is it. Off
the stock Tailwind sky-blue, which on Steam's own blue-grey surfaces is exactly
the generic look this was meant to fix; onto a warm amber accent over
warm-hued neutrals. Meaning-bearing colours (review scores, safety, anti-cheat)
deliberately do NOT follow the accent - they have to stay distinguishable.

Token format is unchanged (raw HSL channels), because two things depend on it:
@theme inline needs them bare for bg-primary/15 to resolve through color-mix(),
and lib/chart-theme.ts reads them with getComputedStyle at call time.

Also added three things index.css never had: a :focus-visible rule, a
prefers-reduced-motion block, and a skip link.

## Ported, not rewritten

lib/ is framework-agnostic and carries over as-is. The three files that were
not:

- lazy.ts -> chunk-error.ts. lazyWithRetry is gone (SvelteKit falls back to a
  full page load itself), but the DETECTION stays, with the reason spelled out:
  a deleted hashed chunk does not 404 on either host - Cloudflare's SPA
  fallback and Tauri's get_asset both answer index.html at HTTP 200 - so the
  check has to match the MIME-type message, not a status.
- chart-nav.ts - lucide-react -> @lucide/svelte.
- i18n/index.ts -> lib/i18n.svelte.ts. Replaces i18next + react-i18next +
  the language detector with ~90 lines of runes. The locale JSON is untouched
  byte for byte: converting 353 keys x 2 for Paraglide would have been 706
  chances to typo text nobody proofreads. Keeps en statically bundled (it is
  the fallback - a lazily-fetched fallback that failed would render raw keys),
  vi dynamic, the same detection order, and the _one/_other convention.

## Housekeeping

public/ -> static/ (SvelteKit's convention). Verified _headers and
.well-known/security.txt still land in dist/. tsconfig now extends the
generated config; skipLibCheck restored deliberately - src/workers has a
`reference lib="webworker"` that clashes with lib.dom, and TypeScript resolves
`cookie` to the hoisted 1.1.1 from wrangler->miniflare->youch while SvelteKit
uses its own nested 0.6.0 at runtime.

check / typecheck / test / build / wrangler --dry-run all clean.
39 tests still pass - the Worker suite is unaffected by any of this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 13:00:05 +07:00