Skip to content

Rename Populace to Microcosm in prose and code - #743

Draft
MaxGhenis wants to merge 5 commits into
mainfrom
microcosm-name-sweep-20261106
Draft

MaxGhenis wants to merge 5 commits into
mainfrom
microcosm-name-sweep-20261106

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Finish the Microcosm rename while preserving certified release identifiers and existing public imports.

Counts

Counts compare origin/main (57b5870) with the completed branch HEAD. Mentions are case-insensitive occurrences from git grep -I -i -o populace; filenames alone are not mentions.

Files Mentions
Before 63 914
After 58 833

The classification TSV preserves and corrects the earlier lane's rows and now covers every original occurrence: 56 P, 70 C, 1 D, 709 R and 78 H. Another 45 rows explicitly identify new HEAD occurrences: 42 compatibility names/markers and 3 frozen producer-label assertions. Original rows use origin/main line numbers; new rows use completed HEAD line numbers.

What changed

  • Updated live documentation, docstrings, comments, CLI help, example output and the current package-name example to Microcosm. Renamed test helpers, test descriptions, test constants and synthetic temporary filenames.
  • Introduced MicrocosmBelgiumDataset, MicrocosmDataProducerCertificationStrategy and MICROCOSM_* source constants. Updated internal references and preserved every prior public import with a marked alias.
  • Made the Belgium example prefer MICROCOSM_BE_DATASET, with a lazy fallback to the prior environment variable. Added regression tests for public imports, producer labels and environment precedence.
  • The complete branch holds 7734c12 (initial prose rename), 2cfd72a (changelog fragment), ca1b1bf (restore the required hosting link), 7b1f29f (finish code/prose renames and add compatibility coverage), and 06d7897 (fragment text).

Left as is

Category Remaining mentions Reason
R 712 Published HF repositories, release IDs, dataset keys, artifact filenames, package metadata, serialized producer labels and matching code/tests. Includes all 88 manifest mentions and all 11 bundle TRACE mentions. No dataset-key aliases were added.
H 78 70 released changelog occurrences, 6 occurrences in the dated TRACE case study, and 2 historical public runbook-link paths retained for existing links.
D 1 README calibration URL remains on its existing Vercel hosting address per the host's explicit instruction until the policyengine.org route is live.
C compatibility 42 Marked source aliases and tests that exercise them, including their required removal comments.

No actionable P or unaliased C occurrences remain. No mapping line was added. The certified manifest, TRACE sidecars, released changelog and JSON/JCS evidence fixtures are byte-identical to origin/main (39 files checked).

Compat aliases

All aliases are marked compat: populace alias, remove after 6.16.1. Release 6.16.1 is the next release inferred by .github/bump_version.py from the existing .changed.md fragment.

Prior name Current name Location Remove after
PopulaceBelgiumDataset MicrocosmBelgiumDataset policyengine.tax_benefit_models.be, .be.datasets, .be.model; package __all__ 6.16.1
PopulaceDataProducerCertificationStrategy MicrocosmDataProducerCertificationStrategy policyengine.provenance.certification 6.16.1
POPULACE_US_SOURCE_COVERAGE_FILE MICROCOSM_US_SOURCE_COVERAGE_FILE policyengine.provenance.certification 6.16.1
POPULACE_DATA_PACKAGES MICROCOSM_DATA_PACKAGES policyengine.provenance.certification 6.16.1
POPULACE_RELEASE_REPOS MICROCOSM_RELEASE_REPOS policyengine.provenance.certification 6.16.1
POPULACE_US_2024_ACS_LOCAL_BUILD_O MICROCOSM_US_2024_ACS_LOCAL_BUILD_O policyengine.tax_benefit_models.us.legacy_spm.registry 6.16.1
POPULACE_US_2024_ACS_LOCAL_MICROCOSM_1263 MICROCOSM_US_2024_ACS_LOCAL_MICROCOSM_1263 policyengine.tax_benefit_models.us.legacy_spm.registry 6.16.1
POPULACE_BE_DATASET MICROCOSM_BE_DATASET examples/belgium_axiom_pilot.py; new environment variable wins 6.16.1

The CLI value --data-producer populace is R, because it is written into certified manifests. It remains unchanged rather than becoming a new dataset/producer alias.

Tests

All pytest runs were serial; at most two pytest runners ran concurrently. Completed focused selections recorded 487 passing tests and 4 optional skips. The access and timeout failures below also reproduce on the unchanged baseline. The normal 18-file regression command below was interrupted twice before collection completed because pinned country-model initialization spent several minutes recursively importing US variable modules and loading parameter YAML. These are incomplete checks, not test passes. A retry using only POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 also stopped during country fixture imports; focused runs use --noconftest as well and tests with self-contained fixtures.

.venv/bin/python -m pytest tests/test_certify_data_release.py tests/test_us_legacy_spm.py tests/test_us_legacy_spm_integration.py tests/test_us_legacy_inputs_integration.py tests/test_release_manifests.py tests/test_dataset_materialization.py tests/test_dataset_source.py tests/test_dataset_runtime.py tests/test_trace_tro.py tests/test_release_tro_generation.py tests/test_release_build_folders.py tests/test_uk_qualification_pipeline.py tests/test_execution_receipt.py tests/test_bundle.py tests/test_bundle_metadata.py tests/test_entity_utils.py tests/test_us_regions.py tests/test_uk_regions.py -q
  • Installed all extras using UV_CACHE_DIR=/private/tmp/policyengine-rename-uv-cache UV_PYTHON_INSTALL_DIR=/private/tmp/policyengine-rename-uv-python uv sync --all-extras: passed in about 4 minutes. The initial default-cache attempt was denied by the workspace sandbox; retrying with a writable cache succeeded. Dependency pins and lockfile are unchanged.
  • POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 .venv/bin/python -m pytest --noconftest tests/test_microcosm_compatibility.py tests/test_be_axiom_pilot.py -k 'not registry' -q: 25 passed, 4 optional source-stack tests skipped, 2 registry cases deselected; the actual registry module was validated separately below.
  • POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 .venv/bin/python -m pytest --noconftest tests/test_dataset_materialization.py tests/test_dataset_source.py tests/test_bundle.py -q: 41 passed.
  • POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 .venv/bin/python -m pytest --noconftest tests/test_certify_data_release.py tests/test_release_build_folders.py tests/test_uk_qualification_pipeline.py tests/test_trace_tro.py tests/test_release_tro_generation.py tests/test_bundle_metadata.py -k 'not test_preparation_generates_new_sidecars_and_verifies_the_exact_pair and not test_the_real_cli_generates_replay_requests_despite_country_import_suppression' -q --tb=short: 421 passed, 1 failed, 5 deselected. The remaining failure, test_the_certification_environment_falls_back_to_the_packaged_certificate, exceeded its unchanged 60-second subprocess timeout. The same test reproduced the identical timeout on the isolated origin/main archive (1 failed, 225.68 seconds), confirming the issue predates this branch. All 70 certification, 80 release-folder, 46 TRACE, 40 TRO-generation and 7 bundle-metadata tests passed, together with 178 UK qualification cases. The five excluded cases are the four private-HF variants and slow real CLI case described below.
  • The earlier lane's python -m pytest tests/test_entity_utils.py tests/test_us_regions.py -q failed because the package was not installed; the completion run installed the full development environment before retrying checks.
  • Lightweight registry check with .venv/bin/python and runpy.run_path: both aliases retain object identity, full serialized source records match origin/main, and registry/hash lookups return the same objects. This avoids initializing the entire country model.
  • Ruff lint and format checks on all changed Python files: passed.
  • AST/syntax checks on all changed Python files: passed.
  • git diff --check: passed.
  • Classification multiset comparison against origin/main: exactly 914 baseline occurrences, no missing/extra rows; all 45 added HEAD occurrences match their current file/line/token.
  • An initial certification/qualification/TRACE selection passed 168 tests and failed 4 parameterized preparation cases before its real CLI case was interrupted. All four failures hit HTTP 401 fetching policyengine/policyengine-uk-data-private release metadata. One representative failure reproduced identically on an isolated origin/main archive (57b5870, 1 failed), confirming pre-existing private-repository access requirements.
  • Byte comparisons against origin/main: all 39 frozen artifact/changelog files passed.

Host follow-ups (ca1b1bf, 06d7897)

  • README.md:10: the calibration dashboard link stays on its Vercel address until its policyengine.org route is
    live, under Max's link rule (ca1b1bf).
  • changelog.d/microcosm-name-sweep-20261106.changed.md: the fragment now names what this PR renames and the
    aliases' last release (06d7897). Its generic text had said "throughout docs, comments and code". The changed
    type makes bump_version.py cut a patch release, 6.16.1, which matches the aliases' remove after 6.16.1 markers.

Unsure

  • examples/belgium_axiom_pilot.py:22: retained populace_be_pilot_2026.h5 as R conservatively. The example refers to an existing pilot input artifact; this sweep has no evidence that its on-disk basename changed. The environment-variable name and surrounding prose are renamed.

Sweep record and rulebook: ~/reviews/populace-rename-2026-11-06/ (RULEBOOK.md).

🤖 Generated with Claude Code

MaxGhenis and others added 5 commits November 6, 2026 23:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rg route is live

Public links go to policyengine.org, never a hosting address, and when the
policyengine.org route isn't live the link is held rather than swapped for
another hosting address. policyengine.org/us/calibration-diagnostics returns
404 today, so README.md keeps calibration-diagnostics.vercel.app/populace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generic fragment said the stack was renamed "throughout docs, comments
and code", which claims more than this diff does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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