Community database protocol: ogc-db-proto #43

Manually merged
SkyfaR merged 1 commit from db-proto into main 2026-10-07 07:31:32 +02:00
Owner

First piece of the community database (CompressDB), per the design: the crate crates/ogc-db-proto, which the app, the intake service and the aggregator (repo LevelXStudios/ogc-db) will share. Nothing in the app uses it yet.

  • Keys: store game keys (steam:, epic:, gog:, amazon:; numeric IDs without leading zeros, so one game has one key), builds, content platform, method keys as text (btrfs-zstd:N, wof:*; the kernel's own level maps to btrfs-zstd:3).
  • Values: ratios in ‰ (20–1000), size bucket round(4·log2(MiB)) computed exactly in integers, percentages rounded to 5, the rules for poorly compressing extensions.
  • Payload: the deny_unknown_fields allowlist, cross-field rules, a canonical writer (sorted keys, no whitespace, pad last, exactly 1024 bytes).
  • Proof of work: stamp, weekly HMAC-derived salt, bounded solver, replay set keyed on the stamp, ISO weeks.
  • Validator: size, schema, bounds, byte-for-byte canonical form, gen blocklist, injected app-ID set; each rejection is one code of the fixed enum.

Tests: golden bytes of both examples of the design, determinism across machines, proptest leak tests, every validator bound positive and negative, proof-of-work known-answer vectors checked independently in Python.

The root Cargo.toml becomes a workspace (the root package is unchanged). It excludes target/, because cargo refuses crates unpacked below a workspace (the Arch package's cargo package tree, accesskit-c in GTK's build). CI's check job formats, lints and tests the whole workspace; the Windows jobs are unchanged. ARCHITECTURE.md has a section on the crate.

First piece of the community database (CompressDB), per the design: the crate `crates/ogc-db-proto`, which the app, the intake service and the aggregator (repo `LevelXStudios/ogc-db`) will share. Nothing in the app uses it yet. - **Keys:** store game keys (`steam:`, `epic:`, `gog:`, `amazon:`; numeric IDs without leading zeros, so one game has one key), builds, content platform, method keys as text (`btrfs-zstd:N`, `wof:*`; the kernel's own level maps to `btrfs-zstd:3`). - **Values:** ratios in ‰ (20–1000), size bucket `round(4·log2(MiB))` computed exactly in integers, percentages rounded to 5, the rules for poorly compressing extensions. - **Payload:** the `deny_unknown_fields` allowlist, cross-field rules, a canonical writer (sorted keys, no whitespace, pad last, exactly 1024 bytes). - **Proof of work:** stamp, weekly HMAC-derived salt, bounded solver, replay set keyed on the stamp, ISO weeks. - **Validator:** size, schema, bounds, byte-for-byte canonical form, `gen` blocklist, injected app-ID set; each rejection is one code of the fixed enum. Tests: golden bytes of both examples of the design, determinism across machines, proptest leak tests, every validator bound positive and negative, proof-of-work known-answer vectors checked independently in Python. The root `Cargo.toml` becomes a workspace (the root package is unchanged). It excludes `target/`, because cargo refuses crates unpacked below a workspace (the Arch package's `cargo package` tree, accesskit-c in GTK's build). CI's check job formats, lints and tests the whole workspace; the Windows jobs are unchanged. ARCHITECTURE.md has a section on the crate.
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.
SkyfaR manually merged commit 7e4eedbd4a into main 2026-10-07 07:31:32 +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!43
No description provided.