Skip to content

Regional category schemes: pick a region at first launch - #316

Merged
charpy4n6 merged 1 commit into
mainfrom
feat/regional-categories
Oct 27, 2026
Merged

charpy4n6 merged 1 commit into
mainfrom
feat/regional-categories

Conversation

@charpy4n6

Copy link
Copy Markdown
Collaborator

What

Every case used to be seeded with the US Project VIC category scheme (codes 0–5). Examiners elsewhere work under different schemes, so the locked presets now come from a region the examiner picks.

17 regions are included (gleapp/regions.py): the United States (Project VIC, unchanged), Australia, Austria, Canada (English and French), Denmark, Estonia, Europol, France, Ireland, the Netherlands, Norway, Romania, South Korea, Sweden, Switzerland and the United Kingdom.

How it behaves

  • Picked once, app-wide. On first launch the launcher asks for a region, after the intro video closes, and previews that region's codes, names and keys. You can change it later with ☰ Menu → Category region or gleapp region <ID>.
  • Each case keeps its region. A case records the region it was created under (meta category_region), because its stored codes only mean something under that scheme. A case from before this change opens as US. If a case's region differs from the app's, the case header says so.
  • Scheme-driven everywhere. Uncategorized, number keys (custom categories take the digits the region leaves free), the first custom code, report grouping, LAVA artifacts and saved category sets all follow the case's scheme. Previously 0 and 5 were hard-coded.
  • NSRL known-good hits auto-categorize only where the region names a non-pertinent category: US 0, South Korea 0, Europol 3. Elsewhere the file stays uncategorized and keeps its badge.
  • Hash stash entries are keyed on (md5, region), and a case matches only its own region's entries. The stash keeps the categories the region's scheme marks illegal; for the US that is still 1–3. A format-1 stash migrates to US entries on first open. CSV export and merge carry the region.
  • Project VIC import passes codes through unchanged and warns, in the header and the audit log, when the file's @odata.context region differs from the case's.

Compatibility

  • Once this version opens a stash it is format 2. Older builds can still read it but can no longer add to it, which matters for a stash shared on a drive.

Known gaps

  • Denmark's letter shortcuts (n, k, o, p, q) get no key in GLEAPP; its digit keys work.
  • Severity is still "lowest code first", which may not fit every region (Sweden's 6 Särskilt hänsynslöst ranks below 3).
  • The stash keeps only illegal-flagged categories outside the US. A per-region list (for example UK 6 Indicative / Borderline) is a possible follow-up.
  • Only a US VIC file was available, so other regions' @odata.context tags are unverified.

Tests

  • New tests/test_regions.py: schemes, seeding and persistence, pre-region cases, stash isolation, migration, CSV round trip, NSRL landing per region, VIC mismatch, and the settings API.
  • Full suite locally on Windows: 1107 passed, 7 skipped. One test was deselected because it needs Windows symlink privilege.
  • The lint check reports no new warnings, and line endings are LF.
  • The region picker and save, and a Sweden case's categories and stash codes, were checked in a browser against a scratch config. A single-file exe passed --selfcheck.

🤖 Generated with Claude Code

GLEAPP seeded every case with the US Project VIC codes 0-5. Other
countries and agencies categorize differently, so the locked presets now
come from the region the examiner picks: the US plus Australia, Austria,
Canada (EN/FR), Denmark, Estonia, Europol, France, Ireland, Netherlands,
Norway, Romania, South Korea, Sweden, Switzerland and the UK
(gleapp/regions.py).

- The region is app-wide (config category_region). The launcher asks for
  it on first launch, after the intro video closes; Menu > Category
  region or `gleapp region <ID>` changes it.
- A case records the region it was created under (meta category_region)
  and keeps it, since its stored codes only mean something under that
  scheme. A case from before this is a US case; US behavior is unchanged.
- Uncategorized, number keys, the first custom code, NSRL auto-landing
  (only where the region names a non-pertinent category) and severity
  come from the case's scheme instead of hard-coded 0/5.
- The hash stash keys entries on (md5, region) and a case matches only
  its own region's entries; a format-1 stash migrates to US entries.
  CSV export/merge carry the region.
- A Project VIC import passes codes through and warns when the file's
  @odata.context region differs from the case's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@charpy4n6
charpy4n6 merged commit 40749ee into main Oct 27, 2026
8 checks passed
@charpy4n6
charpy4n6 deleted the feat/regional-categories branch October 30, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant