Country registry + typed release_manifest.country (spec-driven countries 1/2) - #168
Merged
Conversation
One isomorphic registration point per country (repository, revision, deployment variable names, labels, national geography, visibility, capabilities, jurisdiction aliases) with a fixture flag for the conformance-only zz country. Selectors, parsers, and capability gates read the registry so adding a country is one entry (issue #166). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
latest-artifact.ts derives COUNTRY_REPO (with the existing POPULACE_* deployment overrides) from the registry and re-exports MicrocosmCountry, parseCountry, and isCountry. releaseCountry merges a typed release_manifest.country block over the registration: string fields override, a mismatched code ignores the block, capabilities intersect. The resolved block is stored as Calibration.country_info, served as country on the summary and target-diagnostics responses, and supplies the national geography for rows without one. Staging loaders and routes gate on the staging capability; the webhook allowlist is the non-fixture registry; cross-dataset env naming and jurisdiction aliases read the registry. The target page also reports scope_counts so the healthcare focus can be offered from data rather than a country code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Country is the registry's MicrocosmCountry; the sidebar lists selectable countries with the registered dataset label and shows the repository slug only for public registrations. Navigation items carry a capability instead of usOnly and filter on the country's (or an artifact-narrowed) capability list. Staging hooks, the staging page, and the targets release picker gate on the staging capability; the healthcare focus card appears when the release reports healthcare targets. Source attribution links public repositories, honouring the artifact's repository visibility when the summary carries one. Legacy overview and browse copy tables become partial with a generic fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The zz conformance country now enters the shared client views through the registry (valid, never selectable, navigation gated by capability), and the registration test asserts the summary's typed country block and a release_manifest.country override flowing through buildCalibration to the summary and row geography. The spec records the implemented block, its merge rule, the capability list, and the fixture flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…llowlist, placeholder-safe healthcare card An explicit code: null in release_manifest.country is a malformed field, not an absent one — the whole block is now ignored. The HF-webhook allowlist uses the env-resolved repositories the dashboard actually reads. The healthcare focus card no longer trusts kept-previous placeholder data across a country or release switch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 23, 2026
Merged
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.
First of two PRs for #166 (heads-up + contract on the issue thread). One country registry replaces the closed client tables, and
release_manifest.countrybecomes a typed artifact block. Conformance todo 1 of 4 is now a passing test.What changed
frontend/lib/microcosm/countries.ts(new): the one registration point. An entry carries the HF repo/revision (+ the deployment override variable names), display and dataset labels, national geography label/id, repository visibility, capabilities, and optionalfixture: true. Isomorphic — no env reads, no server imports.latest-artifact.tsresolves registrations into the existingCOUNTRY_REPOshape server-side (env overrides unchanged:POPULACE_HF_REPOetc. still work) and re-exportsparseCountry/isCountry/MicrocosmCountry, so no import churn.release_manifest.country(releaseCountry): registry defaults, overridden by well-typed string fields; a block whosecodenames another country is ignored whole (an artifact cannot re-route the dashboard);capabilitiesis filtered to the enumerated set and intersected with the registration — an artifact can narrow, never widen. Served ascountryon the overview summary and target-diagnostics responses; the resolvedgeography_labelis the national geography for rows that carry none.staging,model_coverage,pipeline,variables,external_checks,cross_dataset, …); the staging routes, hooks, release-picker candidates, and staging page gate onhasCapability(country, "staging").navGroupsForCountryaccepts an artifact-narrowed capability list.selectableCountries()(fixtures excluded) and visibility; the HF-webhook allowlist derives from the registered repos (unchanged names, BE now included; a BE tag still alerts nothing — no webhook configured); public/private source links read visibility (artifact override wins); cross-dataset env-var suffixing keys onDEFAULT_COUNTRYand the UK'sGBalias moves onto its registration.country === "us"; it now renders when the release actually has healthcare targets, via a new additivescope_counts: { healthcare }field on the target-diagnostics response.Partiallegacy fallbacks with generic sentences — the artifactpresentationblock that replaces them is the follow-up PR (todos Upgrade frontend to canonical Next 16 stack #2–Dataset-mode loader: load runs from canonical us-data repo (no calibration_package.pkl) #4).Conformance
Todo #1 ("zz can enter the shared client views") is enabled with its original assertion, plus: the summary's typed
countryblock from the registration alone, a manifest override flowing through to rows and responses, zz excluded from selectors, and zz nav gated by its registered capabilities. Nozzconditional exists outside the registry entry; the repo-wide grep forcountry === "us"-style gates comes back empty.Validation
bun test: 240 pass / 3 todo / 0 fail (was 219 / 4)bun run lint(tsc --noEmit) clean;bun run buildexit 0uv run pytest -q: 403 passed (untouched)latest-artifacttests cover the merge rules, malformed blocks, and geography fallback)Part of #166.
🤖 Generated with Claude Code