Skip to content

feat(population): population packs and the global-respondents pack - #593

Merged
the-data-viking merged 2 commits into
mainfrom
feat/population-packs
Oct 10, 2026
Merged

the-data-viking merged 2 commits into
mainfrom
feat/population-packs

Conversation

@the-data-viking

@the-data-viking the-data-viking commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds population conditioning to Althing, so benchmarks ask Althing which personas answer instead of building their own conditioning. This came out of a SynthBench experiment where conditioning each GlobalOpinionQA question on the countries that answered it lifted Haiku 5.5 from 0.742 to 0.817 SPS. The first version put that logic in SynthBench; this PR moves the conditioning into Althing, where the persona harness lives. The companion SynthBench PR passes its question metadata to these APIs.

Changes

  • althing.population
    • filter_personas(personas, {"country": [...]}) keeps personas whose attributes match (case-insensitive). If nothing matches, the error names the values the pack doesn't cover.
    • allocate_population(personas, key=, members=, n_samples=, seed=) splits a sample budget across population members. Each member gets an equal share, and a member listed twice gets twice the share, so pooled answers match a ground truth that averages over those groups. It's deterministic for a given seed.
    • Also parse_population("country=France,Japan;gender=female") and load_pack_personas(pack_id).
  • Bundled global-respondents pack: one minimal persona per country (name, country, background), 107 countries, using plain names that cover every GlobalOpinionQA country. It has no other demographics, so a run measures country conditioning alone. Richer packs can be added later and compared with pack calibrate.
  • persona_system_prompt now states country, gender, and region when a persona has them. No bundled pack set these fields before, so existing prompts are unchanged (a test pins the old output).
  • althing panel run --population "country=France,Japan" narrows a panel to matching personas.
  • Docs: a Population packs section in the README, updated pack counts (15 packs, 339 personas) in the README and docs/, and a CHANGELOG entry.

Testing

  • tests/test_population.py (15 tests): population parsing, filtering, even and repeat-weighted allocation, more members than samples, determinism, unknown members, persona prompt with and without attributes, and pack integrity.
  • test_mcp_data.py is updated for 15 bundled packs.
  • Full suite on Windows: 3,487 passed. The 44 failures also fail on main on Windows, and none are new.
  • Live: SynthBench --persona-pack global-respondents with claude-code:haiku, end to end through these APIs.
  • scripts/check_site_cli_sync.py passes. Ruff and mypy show nothing new.

Release note

SynthBench's --persona-pack needs a published Althing that includes althing.population. Until then, the SynthBench tests that use it skip.

Release

This PR pre-bumps __version__ and the rendered version artifacts to 1.8.0. Merging with semver:minor makes auto-tag.yml tag v1.8.0 (latest tag is v1.7.0), create the GitHub Release, and dispatch the PyPI publish. The pre-bump is needed because the workflow's own bump push to main has failed with GH013 on every merge since July: the release-bot app isn't a bypass actor on the main ruleset. 1.8.0 also ships the subscription CLI providers (#592), which never published.

🤖 Generated with Claude Code

Population conditioning belongs in althing, the conditioning harness, so
benchmarks ask althing which personas answer instead of building their
own.

- althing.population: filter_personas (narrow a pack by attribute),
  allocate_population (split a sample budget across population members,
  repeats weighted, deterministic per seed), parse_population,
  load_pack_personas.
- Bundled global-respondents pack: one minimal respondent persona per
  country (107, plain names), covering every GlobalOpinionQA country.
- persona_system_prompt states country / gender / region when present (no
  bundled pack set them before, so existing prompts are unchanged).
- `althing panel run --population "country=France,Japan"`.
- Docs: population packs section, pack counts (15 packs, 339 personas).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auto-tag.yml's bump push to main is rejected (GH013): the release-bot app
is not a bypass actor on the main ruleset, so every auto-tag run since
July has failed and nothing has published after 1.7.0. Pre-bumping in the
PR takes the workflow's documented escape hatch: on merge it finds the
artifacts already at the new version, skips the push, and tags,
releases, and publishes v1.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Deploying synthpanel with  Cloudflare Pages  Cloudflare Pages

Latest commit: ecaf3ba
Status: ✅  Deploy successful!
Preview URL: https://f51ae57d.synthpanel.pages.dev
Branch Preview URL: https://feat-population-packs.synthpanel.pages.dev

View logs

@the-data-viking
the-data-viking merged commit 44faef5 into main Oct 10, 2026
22 checks passed
@the-data-viking
the-data-viking deleted the feat/population-packs branch October 10, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:minor Bump minor version on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants