Community database in the app: shipped data, predictions, ogc db, opt-in download #47

Manually merged
SkyfaR merged 2 commits from communitydb into main 2026-10-07 09:18:51 +02:00
Owner

Phases 1 and 2 of the community database design, on top of #43 (ogc-db-proto; this branch contains its commit, so merge #43 first).

Data. src/communitydb/ reads the published snapshot (format of LevelXStudios/ogc-db's model), checks the minisign signature of latest.json against embedded primary/backup keys, the snapshot's length and SHA-256, anti-rollback by serial (a floor that survives a discarded cache), and marks expired data stale. The app ships data/communitydb/ (serial 1: the nine curated Windows/LZX entries from ogc-db#1); scripts/communitydb-snapshot.sh refreshes it. Db::load takes the newer of shipped and cached data.

Lookup. Game::portable_key() for Steam, Epic, GOG and Amazon (Heroic too); None for everything without a store ID. Variant by content platform and size class.

App. Cards show the expected saving with "community data" and confidence until the local analysis replaces it; estimates are requested biggest predicted saving first. Predictions never drive Need::Small, auto-compress, the timer, skip decisions or the dashboard's "worth" total (separate line). Recommendation, poorly compressing types, curated notes (asked before compressing). Settings group "Community database" with the download switch (off by default), status and privacy link.

CLI. ogc db status, ogc db update (asking is consent), ogc db show <game|appid|key> [--json]; ogc list --format=json gains predicted_savings_bytes, prediction_confidence, prediction_source, prediction_method; ogc analyze adds a community line.

Download. ureq 3 + rustls (webpki-roots), whole files only, new agent per source, constant User-Agent, proxies honoured, size and time limits, at most once a day, Forgejo raw mirror after a failed primary. Disabled until the release keys exist (data/communitydb/keys/{primary,backup}.pub; the switch is greyed out with an explanation). No sending yet (phase 3).

Packaging: the Arch package's source tarball is built with tar, since cargo package cannot take the path dependency.

Review: 11 findings from two independent reviews, all handled. Locally: fmt, clippy (both feature sets), all tests incl. 630 GUI tests under Broadway pass. Translations beyond English and German are my own and need a native speaker's look.

Phases 1 and 2 of the community database design, on top of #43 (`ogc-db-proto`; this branch contains its commit, so merge #43 first). **Data.** `src/communitydb/` reads the published snapshot (format of `LevelXStudios/ogc-db`'s model), checks the minisign signature of `latest.json` against embedded primary/backup keys, the snapshot's length and SHA-256, anti-rollback by serial (a floor that survives a discarded cache), and marks expired data stale. The app ships `data/communitydb/` (serial 1: the nine curated Windows/LZX entries from ogc-db#1); `scripts/communitydb-snapshot.sh` refreshes it. `Db::load` takes the newer of shipped and cached data. **Lookup.** `Game::portable_key()` for Steam, Epic, GOG and Amazon (Heroic too); `None` for everything without a store ID. Variant by content platform and size class. **App.** Cards show the expected saving with "community data" and confidence until the local analysis replaces it; estimates are requested biggest predicted saving first. Predictions never drive `Need::Small`, auto-compress, the timer, skip decisions or the dashboard's "worth" total (separate line). Recommendation, poorly compressing types, curated notes (asked before compressing). Settings group "Community database" with the download switch (off by default), status and privacy link. **CLI.** `ogc db status`, `ogc db update` (asking is consent), `ogc db show <game|appid|key> [--json]`; `ogc list --format=json` gains `predicted_savings_bytes`, `prediction_confidence`, `prediction_source`, `prediction_method`; `ogc analyze` adds a community line. **Download.** ureq 3 + rustls (webpki-roots), whole files only, new agent per source, constant User-Agent, proxies honoured, size and time limits, at most once a day, Forgejo raw mirror after a failed primary. **Disabled until the release keys exist** (`data/communitydb/keys/{primary,backup}.pub`; the switch is greyed out with an explanation). No sending yet (phase 3). Packaging: the Arch package's source tarball is built with `tar`, since `cargo package` cannot take the path dependency. Review: 11 findings from two independent reviews, all handled. Locally: fmt, clippy (both feature sets), all tests incl. 630 GUI tests under Broadway pass. Translations beyond English and German are my own and need a native speaker's look.
Add ogc-db-proto, the community database's contribution protocol
All checks were successful
CI / Windows, MSYS2 sysroot (pull_request) Successful in 18s
CI / Windows, command line (clippy with tests) (pull_request) Successful in 33s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m17s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 1m37s
CI / Bundle programs, command line and helper (pull_request) Successful in 1m28s
CI / Arch package (pull_request) Successful in 2m46s
CI / Bundle programs, desktop app (pull_request) Successful in 2m3s
CI / Windows, GTK with AccessKit (pull_request) Successful in 8s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m5s
CI / Format, lint and test (pull_request) Successful in 5m42s
CI / Bundle for any distribution (pull_request) Successful in 14s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 1m24s
VM test / Migrations in a VM (pull_request) Successful in 18m41s
CI / Windows, installer and portable zip (pull_request) Successful in 5m17s
CI / Release (pull_request) Has been skipped
c936287435
A workspace member with the payload of the community database: game and
method keys, coarse values, the canonical 1024-byte body, the proof of work
with its weekly salt, and the validator the intake service will share.
Nothing in the app uses it yet. The workspace excludes target/, where the
Arch package and GTK's build unpack crates of their own.
Community database in the app: shipped data, predictions, ogc db, opt-in download
All checks were successful
CI / Windows, command line (clippy with tests) (pull_request) Successful in 40s
CI / Windows, MSYS2 sysroot (pull_request) Successful in 21s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m40s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 1m43s
CI / Bundle programs, command line and helper (pull_request) Successful in 1m36s
CI / Arch package (pull_request) Successful in 2m49s
CI / Bundle programs, desktop app (pull_request) Successful in 1m59s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m6s
CI / Bundle for any distribution (pull_request) Successful in 14s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 1m25s
CI / Windows, GTK with AccessKit (pull_request) Successful in 10s
CI / Format, lint and test (pull_request) Successful in 5m49s
CI / Windows, installer and portable zip (pull_request) Successful in 5m48s
CI / Release (pull_request) Has been skipped
VM test / Migrations in a VM (pull_request) Successful in 18m33s
de8a0b1985
The app ships a snapshot of the community database and shows its expected
savings on game cards until the local analysis replaces them; predictions
never drive compressing, skipping, the timer or the dashboard's total.
ogc db status, update and show, prediction fields in ogc list's JSON and a
community line in ogc analyze. Downloads are off until switched on in the
settings, fetch whole signed files at most once a day, and stay disabled
until the release keys are embedded.
Embed the community database's release keys
Some checks failed
CI / Windows, MSYS2 sysroot (pull_request) Successful in 20s
CI / Windows, command line (clippy with tests) (pull_request) Failing after 40s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m37s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 1m40s
CI / Bundle programs, command line and helper (pull_request) Successful in 1m38s
CI / Arch package (pull_request) Successful in 3m3s
CI / Bundle programs, desktop app (pull_request) Successful in 2m6s
CI / Format, lint and test (pull_request) Successful in 6m4s
CI / Windows, GTK with AccessKit (pull_request) Successful in 8s
CI / Bundle for any distribution (pull_request) Successful in 15s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m9s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 1m29s
CI / Windows, installer and portable zip (pull_request) Successful in 5m34s
CI / Release (pull_request) Has been skipped
VM test / Migrations in a VM (pull_request) Successful in 19m8s
027d9a8cdb
primary.pub verifies what ogc-db's publish run signs; backup.pub is the
offline key for a rotation. With them the download switch is available.
Windows check: allow ws2_32.dll and bcrypt.dll for the download
All checks were successful
CI / Windows, MSYS2 sysroot (pull_request) Successful in 20s
CI / Windows, command line (clippy with tests) (pull_request) Successful in 41s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m37s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 1m44s
CI / Bundle programs, command line and helper (pull_request) Successful in 1m38s
CI / Arch package (pull_request) Successful in 3m2s
CI / Bundle programs, desktop app (pull_request) Successful in 1m59s
CI / Format, lint and test (pull_request) Successful in 6m0s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m9s
CI / Windows, GTK with AccessKit (pull_request) Successful in 9s
CI / Bundle for any distribution (pull_request) Successful in 16s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 1m36s
CI / Windows, installer and portable zip (pull_request) Successful in 5m38s
CI / Release (pull_request) Has been skipped
VM test / Migrations in a VM (pull_request) Successful in 18m51s
caeaa4f069
With the release keys embedded, ogc.exe links the download: sockets from
ws2_32.dll and, through ring's getrandom, BCryptGenRandom from bcrypt.dll.
Neither is known to load user32.dll or gdi32.dll; a real-PC check of the
running program's modules is still to be done.
SkyfaR manually merged commit 1e80f5e6aa into main 2026-10-07 09:18:51 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LevelXStudios/OpenGameCompressor!47
No description provided.