Repository navigation
Schema-1 append: scale activity, game mix, permission shape, region, export - #7
Merged
Merged
Conversation
…ts to schema-1
Append-only additions to schema/1.lock.json, no schema bump:
- doubles (13 -> 16): scale.bans_30d, scale.admins_active_30d,
scale.ban_history_months
- bits (27 -> 39): scale.games.{tf,cstrike,csgo,garrysmod,left4dead2,other},
scale.perms.{web_groups,server_groups,overrides,immunity},
scale.web_bans_majority_30d, panel.exported_30d
- blobs (11 -> 12): panel.region, appended after extras
src/schema.ts gains the matching optional Zod fields, including nested
scale.games / scale.perms objects. No mapper changes: readPath and the
bit-pack already walk multi-level dotted paths.
Tests pin each new slot to its lock-derived position, check that older
payloads yield null doubles / blobs and 0 bits with extras staying null,
and that wrong-typed nested leaves are rejected. README layout block,
request examples, slot counts and a panel.region privacy note updated.
Refs #6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XsiwAF3BzPy1aMBEuQcGZe
5 of 7 tasks
rumblefrog
added a commit
to sbpp/sourcebans-pp
that referenced
this pull request
Oct 25, 2026
… region and export signals (#1609) sbpp/cf-analytics#7 appended these slots to schema-1 for sbpp/cf-analytics#6. Mirror them in the vendored JSON Schema and add the matching extractors so the parity test stays green: - scale.bans_30d / admins_active_30d: 30-day counts from :prefix_bans.created and :prefix_admins.lastvisit. - scale.ban_history_months: whole calendar months since the oldest ban (created = 0 legacy rows ignored); null without bans, so it is dropped from the wire body. - scale.web_bans_majority_30d: more than half of last-30d bans have sid = 0. - scale.games.*: tf / cstrike / csgo / garrysmod / left4dead2 / other over enabled servers' modfolders. Other folder names never leave the panel. - scale.perms.*: any web group (type 1), server group, override, or admin with immunity > 0. - panel.exported_30d: a Data Export success row in :prefix_log in the last 30 days. - panel.region: continent code via the new Sbpp\Telemetry\Region, from config.timezone when it holds a zone name, else PHP's default timezone. Fresh 2.0 installs have no config.timezone and pre-2.0 upgrades can hold a bare UTC offset there, so the fallback is what most installs will use. Never derived from the request. Operator docs and the Features help text list the new fields. Refs sbpp/cf-analytics#6 Claude-Session: https://claude.ai/code/session_01XsiwAF3BzPy1aMBEuQcGZe Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6.
Append-only additions to
schema/1.lock.json. All new fields are.optional(), no schema bump, no existing position moves.Lock changes
panel.region(afterextras, soblob12)scale.bans_30d,scale.admins_active_30d,scale.ban_history_monthsscale.games.{tf,cstrike,csgo,garrysmod,left4dead2,other},scale.perms.{web_groups,server_groups,overrides,immunity},scale.web_bans_majority_30d,panel.exported_30dWorker changes
src/schema.ts:panel.region(string),panel.exported_30d(bool), the threescale.*numbers,scale.web_bans_majority_30d, and nestedscale.games/scale.permsobjects (each.passthrough(), like the other sub-schemas).src/ae.ts/src/features.ts: no changes.readPathand the bit-pack already walk multi-level dotted paths likescale.games.tf.curlexamples, slot counts, bit/double headroom (39 bits, 4 doubles free). Also corrected the "extras(last blob)" note, sincepanel.regionnow sits behind it, and added a short privacy note thatpanel.regioncomes from the panel'sconfig.timezone, neverrequest.cf.Tests
2^lock.bits.indexOf(name).nullfor the new doubles andpanel.region,0for the new bits, andextrasstaysnull.scale.games/scale.permsand rejects wrong-typed leaves.npm run typecheck,npm run lint,npm test(65 passing),prettier --checkandnpm run deploy:dry-runall pass locally.Note for review
panel.regionis validated asz.string(), not an enum of the six continent codes, to match the other blobs and the forward-compat optionality rule (a stricter enum would 400 a whole ping over one unexpected value). Happy to tighten it toz.enum([...])if you'd rather reject anything else at the edge.Panel collector changes are out of scope; the paired
sourcebans-ppPR re-vendors the lock.Generated by Claude Code