69 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 24fa8554e2 test(a11y): hold the fixes; ACCESSIBILITY.md, CLAUDE.md, CHANGELOG
src/lib/a11y.test.ts reads the source, like mobile-layout.test.ts. It
checks:
- the table's roles, counts and row indexes, and that no <a> is a row or
  carries a fake link;
- every column has a name, and the cards are a list with positions;
- the panes have a minimum height;
- there is no colour-only kernel badge;
- the overlays are dialogs that focus themselves and make the page inert;
- the palette shortcut stands down, and back-to-top is inert while hidden;
- the zoom setting and its capability are present.

It also computes the theme's contrast with the WCAG formula, so a token
edit that drops below 4.5:1 for text or 3:1 for a control's edge fails.

ACCESSIBILITY.md moves the fixed items from "Known limitations" to "What
works today". The desktop and Android apps 2.5.0 predate them and get them
with their next release. CLAUDE.md lists the rules behind each fix, and
CHANGELOG [Unreleased] describes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:03:59 +07:00
poli0981andClaude Opus 5.5 b5b8b4eb12 docs: an accessibility statement, its issue form and a PR template
ACCESSIBILITY.md sits at the root beside SECURITY.md. GitHub reads it from
.github/, the root or docs/ and shows it as the repository's Accessibility
tab. It covers:
- WCAG 2.2 AA as a target, not a claim.
- What works today and what does not, with a way around each limitation
  where there is one.
- The browsers, apps and assistive technology actually used (keyboard,
  Narrator, NVDA).
- How to report a barrier without saying anything about yourself.
- Replies on SECURITY.md's terms: first within a week, blockers first, no
  fixed deadlines.
- The rules for contributors and coding agents.

.github/ISSUE_TEMPLATE/accessibility.yml files a report under the new
`accessibility` label, with no required final checkbox. The pull request
template is the short checklist, and completes the community profile.
CLAUDE.md says the statement is a claim about the code, and names the two
limitations that look solved but are not.

.gitattributes keeps the new file out of source archives like the other
community files. It also stops leaving out Contact, PRIVACY_POLICY and ToS:
the web build reads every legal document and stops when one is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:43:33 +07:00
poli0981andClaude Opus 5.5 4c987036e2 docs: random games and Leave site
CLAUDE.md: why /random keeps its picks in memory and only the reader
rolls, the crypto sampling (not Math.random), why the route is top-level,
and the base key a plural needs; how Leave site finds the page before the
site, the watchdog and its three cancel events, the deliberate second click
to close, and why Decline quits through exit(). Both READMEs list the
random page and its modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:27:56 +07:00
poli0981andClaude Opus 5.5 fd55963681 chore(deps): npm and cargo minor/patch updates, drop the undici override
Takes Dependabot's npm group (#236) and cargo group (#234) together: the
Tauri shell plugin moves to 2.6.0 on both sides, and the CLI refuses a
JavaScript/Rust pair on different minors. Adds the SvelteKit 3.1.1 and
adapter-static 4.0.1 patches (exact pins kept), @types/node 26.6.6, knip
6.44.1 and @lucide/svelte 1.66.0 - everything at least three days old;
newer releases wait for next week's Dependabot run.

wrangler 4.156.0's miniflare pins undici 7.30.1 itself, so the
"miniflare": {"undici": "^7.30.1"} override goes in the same commit, as
CLAUDE.md required. npm audit: only the known deepmerge low advisory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 09:06:40 +07:00
poli0981andClaude Opus 5.5 6026a8870e fix(deps): zip 9 in the desktop updater, patched glob and minimatch
- tauri-plugin-updater 2.14.0 -> 2.14.1 moves its Windows zip reader from
  zip 4.6.1 to 9.2.0: closes Dependabot #82 (critical), #83, #84 and
  RUSTSEC-2026-0367/0368/0369. Targeted cargo update; cargo test --lib ok.
- npm overrides workbox-build -> glob ^14.0.2 and filelist -> minimatch
  ^11.0.1 (GHSA-3g3m-2fjr-6pw4, GHSA-g3hv-75wg-m249, published 2026-10-30).
  The precache lists the same 172 URLs as before.
- deepmerge (#81, low) has no fixed release: build-time only, dismissed.
- CLAUDE.md: when the new overrides and the undici one can go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:40:24 +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 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 f42a854b66 fix(web): keep legacy hash links on this site (CodeQL js/xss)
The SvelteKit 3 fallback for a /#/ path that matches no route passed the
hash straight to location.replace(): CodeQL code-scanning alert #25,
client-side XSS, and an open redirect in practice - `#//other.example/x`
resolved to another site once goto rejected it.

The hash is now resolved against the page's origin and ignored when it
names another one, goto gets that URL, and an unmatched path goes to the
404 page at its fixed address (/error/404). Nothing from the hash reaches
location.* any more. Tests cover both off-site forms (`#//host`,
`#/\host`) and the 404 fallback; checked in a browser on `npm run dev`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:42:59 +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 d057e3f620 fix(deps): patch the open advisories in npm, cargo and pip; Node 24 actions
npm (web/):
- undici 7.30.1 through a "miniflare" override (GHSA-xjj6-f33q-929c,
  GHSA-4qv8-2p9j-2685, GHSA-f72v-6w45-q472). miniflare pins undici exactly
  and wrangler 4.152.0, the newest, still ships 7.29.1. Local tooling only.
- zod 4.6.7 (GHSA-mrhx-c7xc-m3w5, via knip).
- Minor/patch: @lucide/svelte 1.61.0, @tanstack/svelte-virtual 3.13.48,
  bits-ui 2.20.2, vite 8.3.5, wrangler 4.152.0, knip 6.43.0,
  @tauri-apps/cli 2.12.4.

cargo (web/src-tauri/Cargo.lock, targeted updates only):
- rustls 0.23.46 (RUSTSEC-2026-0346..0349), rustls-webpki 0.103.16
  (RUSTSEC-2026-0382), webpki-root-certs 1.0.11 (RUSTSEC-2026-0383),
  tokio 1.54.1 (RUSTSEC-2026-0386), anyhow 1.0.104 (RUSTSEC-2026-0190),
  event-listener 5.4.2 (RUSTSEC-2026-0221), plist 1.10.3 -> quick-xml
  0.42.0 (RUSTSEC-2026-0194/0195). Dependabot had none of these.
- Left upstream: zip 4 (tauri-plugin-updater 2.14.0 asks for ^4), glib 0.18
  (GTK 3), unmaintained proc-macro-error/zbus_names/zvariant.

pip: certifi 2026.10.23, coverage 7.17.0 (tests), with every file's hash.

CI: actions/checkout v4/v5 -> v6 and actions/setup-python v5 -> v6
everywhere (the Node 20 majors warned on every data job), rust-cache 2.9.3
by SHA. dependabot.yml says why those majors are taken by hand.

CLAUDE.md: the undici override and when to drop it; why SvelteKit stays on 2
(GHSA-27mw-82g8-phjj and GHSA-pfhg-q3qv-9q6r need setHeaders or use:enhance,
which the app does not have).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:50:58 +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 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 bbe4e3e118 ci(sonar): declare coverage unmeasured so the gate does not read 0%
The first full CI analysis of main (db804e27) failed the "Sonar way"
quality gate on one condition: coverage on new code 0.0% < 80%, over 109
new lines. The scan uploads no test report, so every executable line
counted as uncovered; automatic analysis never computed coverage, so the
condition was never evaluated before. Every other condition passed, with
0 open issues and 0 hotspots.

sonar.coverage.exclusions=**/* restores that: no lines to cover, no
coverage condition. Measuring coverage means generating reports in the
workflow and removing this line in the same change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:22:50 +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 a04f24abb6 ci: point every desktop release's latest.json at its download URLs
tauri-action v1 (Dependabot moved release-desktop.yml from v0 after 2.2.0)
writes each artefact's API URL (api.github.com/repos/<repo>/releases/
assets/<id>) into latest.json, and has no setting to change that. The
desktop updater feed accepts only this release's download URLs and answers
204 to anything else, so desktop-v2.2.1 was offered to no installed app
until its latest.json was fixed by hand.

A new `updater-json` job runs after every platform's build: it downloads
latest.json and the .sig files, rewrites each URL to
github.com/<repo>/releases/download/<tag>/<file> (scripts/updater_json.py,
which refuses a version that is not the tag's, an asset of another release,
any other URL shape, or a signature that is not its file's .sig), and
uploads it back. Run on 2.2.1's original file it produces exactly the
hand-fixed one, and a second run changes nothing. Also renames the v0
input includeUpdaterJson to v1's uploadUpdaterJson (same default).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:57:41 +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 39e504fd7f feat(anti-cheat): seven more product families, matched as whole words
After v4.3.1 read every game's anti-cheat from Steam, 68 of the 159 named
ones fell in the charts' "Other" slice. Add the families Steam's
disclosures use most - ACE, Anti-Cheat Toolkit, CrackProof, HoYoKProtect,
NGS (Nexon Game Security), EA Javelin, SARD - to ANTI_CHEAT_PATTERNS and its
web mirror (+ ANTI_CHEAT_ENUM). "Other" drops to 35, all one-off names.

Both sides now match a key or a pattern only as whole words (_has_term /
hasTerm): "ace" is inside "faceit ac", "space" and "interface", and the
web's substring check also filed "vacuum" under VAC. No stored value moves
between existing families (checked over all 56 distinct values).

A stored label is never rewritten: the old raw name and the new key are the
same family. refresh_anticheat.py --dry-run against Steam: 0 games changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:04:54 +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
poli0981 a43112b277 Merge pull request #169 from poli0981/feat/opaque-catalogue-cache
feat(web): keep the offline catalogue as the packs it arrived in
2026-10-03 20:32:40 +07:00
poli0981andClaude Opus 5.5 ebdd7073a1 feat(web): keep the offline catalogue as the packs it arrived in
IndexedDB held the catalogue as ~5,568 parsed records (~9.5 MB of
structured-clone objects, readable in DevTools) while fetcher.ts threw
away the pack it had just downloaded. Now the cache stores those packs:
seven Uint8Arrays, ~1.4 MB, opaque. Obfuscation and compression like
the wire packs - the key is public - never protection.

- cache.ts: new database `f2p-catalogue`, the SAME two keys the Privacy
  Policy lists (so no policy edit, no consent gate): `f2p:index` (the
  DataIndex, readable public metadata) and `f2p:records` (one pack per
  index entry). A generation is stored only when every shard arrived
  packed - the browser never packs - and every pack's IV must be its
  entry's sha256 prefix, or the cache is a miss. Both keys go in one
  setMany, records first; the old code's two set() calls could leave a
  new index next to old records.
- The copy app <= 2.1.x left in idb-keyval's default `keyval-store` is
  read like any verified generation until the next one is written,
  which delMany's it. A new database is what keeps a tab still running
  old code from reading Uint8Arrays as records; indexedDB.databases() is
  checked first so nobody gets an empty legacy database.
- games-loader.ts: readCache() hands back the index at once and the
  records lazily, so an older cached generation is never decoded just
  to compare it; fetchShard returns { plain, pack } and writeCache gets
  the packs. The verify-then-cache contract is unchanged.
- The parser worker opens packs (decodeShard), so a cache hit costs the
  main thread ~6 ms at most instead of a ~20 ms block (desktop,
  measured), for ~45 ms more until the data is ready.
- Found in the browser: Chromium's failed AES-GCM decrypt is a
  DOMException with an EMPTY message, and worker-pool's `if (error)`
  read "" as success - a damaged pack resolved as a shard with no
  records. The worker now always names the error and the pool rejects
  on any string; both have tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:26:36 +07:00
poli0981andClaude Opus 5.5 d4e56eba3f fix(deps): close every open security alert
19 Dependabot alerts (6 high) plus what npm audit adds; npm audit and
pip-audit now report none.

- devalue 5.9.2 -> 5.9.4, brace-expansion 2.1.4 -> 2.1.7 and
  5.0.9 -> 5.0.12, fast-uri 3.1.7 -> 3.1.8, serialize-javascript
  7.1.1 -> 7.1.2: lockfile only, every parent's range already allowed
  the fix. devalue's parser ships in the page and the apps; the rest is
  build tooling.
- wrangler 4.130.0 -> 4.147.0: miniflare pins undici exactly, and only
  wrangler >= 4.144 brings 7.29.1. Dev and deploy tooling only.
- cookie 0.6.0 -> 0.7.2 under @sveltejs/kit via an override. Kit 2.70.3
  is the newest 2.x and still asks for ^0.6.0; it imports only
  parse/serialize, which 0.7 keeps, and under adapter-static that code
  runs only at prerender and in vite dev. npm refuses a range key for a
  direct dependency (EOVERRIDE), hence the exact version; CLAUDE.md says
  what to do when kit moves. This also ends the Dependabot security
  job that failed on every push to main.
- The sharp 0.35.4 override is dropped: miniflare now pins 0.35.4
  itself, and an exact override would force a downgrade the day it
  pins a newer one.
- urllib3 2.7.0 -> 2.8.0 for the data pipeline (requests 2.34.2 allows
  it).

Verified: npm ci, typecheck, 448 tests, web build + verify-dist, Tauri
flavour build + verify-dist, wrangler deploy --dry-run, vite dev with a
Cookie header, 55 Python tests on urllib3 2.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:09:32 +07:00
poli0981andClaude Opus 5.5 f997d79054 feat(data): all_time_peak, from SteamCharts and our own samples
The dataset only knew how many people play a game now. The only peak it had,
peak_today, is not today's: nothing resets it, so it is the highest of our
sparse samples (online games 3x a week, the rest twice a month) since the
last refetch - The First Descendant reads 8,052 against a real all-time peak
of 264,860.

all_time_peak is the most players a game has had at once, and it only ever
goes up (core/peaks.py):
- refresh_peaks.py reads SteamCharts' recorded all-time peak, the only public
  source older than our sampling (SteamDB forbids scraping; Valve's APIs only
  know today). It takes a crc32 thirtieth of the catalogue a day, so each game
  is asked once a month, ~186 pages 2-3 s apart. SteamCharts has no API, no
  terms and no robots.txt, so it is read politely (core/steamcharts.py): a
  User-Agent that names the project, 500/404 read as "not tracked", and a
  403, 429 or Cloudflare challenge stops the run with a warning, keeping
  everything raised so far. Measured: 9 of 10 games with a few dozen players
  or more are tracked; most of the 0-3 player long tail is not.
- Every run also raises the field from our own samples (peak_today,
  current_players) without a request, and apply_players() raises it on every
  sample - never from a 0. That seeds 2,329 games on the first run.
- Nothing else is written, last_updated included (player counts never moved
  it), and refetch_all.py does not clear the field: it cannot be fetched again.

"Refresh All-Time Peaks" runs daily at 19:30 UTC, between Refresh Store Data
and the snapshot, in the data-write group, committing through
commit_push.sh; a manual run with "backfill" asks about every game (~4 h).
The crc32 rotation moves to core/rotation.py, shared with
refresh_store_data.py. test_refresh_peaks.py holds the rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:15:39 +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 21d06a32fb fix(web): phone-width layout - grids, rows, long names
On a 360px phone (the Android app and mobile browsers) cards ran off the
right edge of Dashboard, Publishers and Developers, and game names vanished
from the Top Online/Offline and studio lists.

- 22 layout grids declared columns only from sm/lg up. Below that a grid has
  one implicit auto track sized to its widest item's min-content, and a
  truncate name counts at full length there, because the grid item keeps
  min-width:auto. Measured at 360px: the dashboard scrolled sideways by
  124px, Publishers by 46px with all 300 counts off screen. Every one now
  starts at grid-cols-1, which is repeat(1, minmax(0, 1fr)).
- Top Online/Offline and the studio pages hide the genre badge below sm, and
  the studio pages the score as Top Online already did: a Badge cannot
  shrink below its longest word, and names were squeezed to 0-28px.
- Page titles and a game's name, description and notes wrap long words: some
  studio names are raw URLs.
- The header search reserved pr-16 for the Ctrl K chip, which is hidden on
  phones, and cut the placeholder to "Search by na".
- /games cards are fixed 96px rows; a long anti-cheat badge wrapped to a
  third line and painted over the next card. The card now clips and the
  badge truncates.

src/lib/mobile-layout.test.ts fails on a layout grid without a base
grid-cols-N; CLAUDE.md has the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 06:41:46 +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 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
poli0981 53556a649b Merge pull request #150 from poli0981/feat/data-packs
feat(data): serve shards packed at /api/data/p1, plain stays in Git
2026-10-02 16:16:21 +07:00
poli0981 674d4f4e8e Merge pull request #149 from poli0981/feat/img-avif-r2
feat(img): AVIF header art minted by the cron into R2, served read-only
2026-10-02 16:14:52 +07:00
poli0981andClaude Opus 5.5 2cb8235d6a feat(data): serve shards packed at /api/data/p1, plain stays in Git
Phase A of making the dataset unreadable on the wire while the repository
stays its readable home. /api/data/p1/data_NNN.bin (and removed_games.bin)
is the committed file run through shared/data-pack.ts at the edge:

  "F2P\x01" | IV (first 12 bytes of its SHA-256) | AES-GCM(deflate-raw)

under a key that is PUBLIC in this repository. Obfuscation and compression,
not secrecy: curl and DevTools see an opaque blob instead of a ready-made
JSON API, and it is ~15% of the JSONL (data_001: 223,907 bytes against
1,497,828). Native WebCrypto and Compression Streams only - installed apps'
CSP has no 'wasm-unsafe-eval'.

The cache contract does not move: a pack unpacks to the exact committed
bytes, so games-loader.ts is untouched and its sha256 check against
index.json runs on the unpacked bytes before anything is cached. The Worker
verifies `?v=` before packing (the fetch-and-verify step and its mismatch
marker are now shared with the plain versioned path), caches versioned packs
immutably and unversioned ones for five minutes, and answers every error
with CORS. `.bin`, not `.jsonl`, so the zone's .jsonl Compression Rule never
recompresses a pack.

The app fetches packs when it can unpack and falls back to the plain path
for a missing pack or one that will not open - never after a network error.
The plain /api/data/data/*.jsonl paths are unchanged for released apps
(1.4.5 unversioned, 2.0.x ?v=), which cannot unpack.

Verified locally with wrangler dev: all seven shards loaded as p1 packs,
5,568 records verified and cached in IndexedDB, /games shows 5,568 of 5,568.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:08:25 +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 cd18146ed2 fix(web): stop the prerender from rendering 5,566 Worker-route 404s
Every production build log was 91% `[404] GET /img/d2/<appid>/...` lines,
one per game page. The prerender crawler follows each page's
<img src="/img/d2/...">; /img/* and /api/* are Worker routes the SvelteKit
app does not contain, so each request rendered the root layout plus the
error page and SvelteKit's DEFAULT server handleError printed the line.
kit.prerender.handleHttpError only decides pass/fail and cannot silence it.

src/hooks.server.ts now answers both prefixes before routing: no render, no
log. The prerenderer still sees the 404 and handleHttpError still ignores
exactly these prefixes, so a broken internal link still fails the build.
The hook only runs at build time and under `vite dev`, whose proxy takes
/api and /img first.

Local build: 0 `[404]` lines (was 5,566), log 294 lines (was 11,590),
verify-dist --web OK (5,610 HTML files, 5,568 game pages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:38:41 +07:00
poli0981andClaude Opus 5.5 de9d380994 feat(pipeline): refresh tags, languages and store details on a rotation
update_data.py only enriches records that are incomplete, and fetcher.py's
apply_details()/apply_scraped() only fill EMPTY fields. Once a game had its
tags, languages, platforms or header image, nothing looked at them again
short of the manual refetch_all.py. A dry run on three games found all three
with tags that had drifted since they were first fetched.

scripts/refresh_store_data.py re-reads them a slice at a time, daily:
- store page (tags, languages, language_details, has_paid_dlc): every game
  once every 7 days;
- appdetails (name, header_image, description, developer, publisher,
  release_date, platforms, metacritic, drm_notes): every game once every
  30 days.
Measured on the live catalogue: 600-675 store pages and 121-166 appdetails
calls a day, about 40 minutes at the client's throttle, instead of ~8,800
requests in one sitting.

A game is due when crc32(appid) % cycle == day % cycle. Not appid % cycle:
Steam appids are nearly all multiples of 10, which would leave 27 of the 30
monthly slices empty.

These fields were fill-if-empty until now, so the refresh keeps the same
care: it replaces a value only with a non-empty one (a failed request or an
age-gated page changes nothing), never writes MANUAL_FIELDS or notes, reads
has_paid_dlc only from a real store page, compares description as stored
(truncated to DESCRIPTION_MAX), bumps last_updated only on a real change,
and writes through save_main() so overrides and index.json behave as for
every other job. scripts/tests/test_refresh_store_data.py pins each rule and
the even spread of the slices.

"Refresh Store Data" runs at 16:00 UTC: scheduled runs here start 2-5 hours
late, the morning data jobs run 2-4 hours, and the data-write group keeps
only one pending run, so the slot is the one nothing long overlaps. It is in
data-write, commits through bash/commit_push.sh, and is on the CI-failure
notification list. README, CLAUDE.md and the changelog describe it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 22:40:48 +07:00
poli0981andClaude Opus 5.5 197bc6f064 fix(web): no page loads data before consent and the human check
The root layout held the catalogue back until consent (and, since the
Turnstile change, the human check), but two pages did not:
/activity and /charts/delisted called load() from $effects of their own,
and the activity feed also refetched on window focus - so both fetched
before the reader had accepted anything.

The gate now lives in Resource itself. An `enabled` option is read at the
top of every load() - the focus refetch and Retry included - and because it
is read inside load(), an $effect that calls load() subscribes to it and
runs again when it turns true: a held-back load starts by itself once the
reader is through. lib/app-ready.ts defines appReady() (consent accepted
AND the check cleared, which the packaged apps do as soon as they hydrate),
the root layout uses it for its own effects, and every Resource passes it.

resource.test.ts checks the option (no load, focus refetch or retry while
closed; open by default), fails on any `new Resource` in src without
`enabled: appReady`, and pins the layout's gated effect. Verified in a
browser: /activity before consent makes no /api/activity request, even on
a focus event; after consent and the check it loads once, by itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 22:01:50 +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