Repository navigation
Conversation
Remove the SQLite strata/stratum_constraints/targets store and everything that only existed to fill or read it: the 19 db/etl_*.py loaders, the arch load/stats/query commands, the Supabase target helpers, arch.targets, scripts/export_to_json.py, the calibration/ package and the Microplex calibration modules in micro/us/ that consumed those rows. Live modules keep working: soi.py carries its AGI bracket constants, normalization keeps its lineage transforms, and db.cli keeps the source-artifact commands. The required "Arch checks" job no longer runs `arch load all`; it smoke-tests the source-artifact CLI instead. tests/test_legacy_targets_retired.py pins the removal and checks that the append-path scripts import nothing from this repository's packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`from arch import *` raised once arch/targets/ was gone; a test now checks every advertised arch export resolves. docs/pe-calibration-targets.md and docs/data-sources/irs-soi-state.md described the removed loaders as current, and the README coverage table listed BLS and UK sources only those loaders supplied; it now shows the per-source fact counts that tests/test_arch_bundle.py pins for the default 2023 bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…retire/thesis-branch-legacy-targets
…retire/thesis-branch-legacy-targets
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.
Retires the legacy target store on
codex/thesis-ledger-facts, and with it the step in the required "Arch checks" job that ranarch load allon every push and every resolver append PR.Why
The "Build target input database" step ran
arch --db /tmp/arch-targets-ci.db init,load allandstats.load allexecutes everydb/etl_*.pyloader, including the state SOI loaders. The audit in #348 (docs/us-legacy-etl-cleanup.mdon that PR) found those loaders write invented values presented as IRS figures. This branch'sdb/etl_soi_state.py,db/etl_soi_deductions.pyanddb/etl_soi_income_sources.pyare byte-identical to main's audited copies at a5280e1. Nothing on this branch read the tables those loaders filled, apart from the stack being removed here.What the append path executes (task 1)
Checked by reading the code, the workflows and the Thesis resolver, not from the audit summary:
.github/workflows/thesis-facts-append.yml): runs the BASE commit'sscripts/check_thesis_facts_append.py(which loadsscripts/receipt_pins.py) in the base'suv sync --locked --no-devenvironment. The pytest step runstests/test_policyengine_ledger.py,test_release_chain.py,test_thesis_append_adversarial.py,test_thesis_append_shim_isolation.py,test_receipt_shim_transparency.pyandtest_production_tsa_pins.py. These importarch.core(stdlib only),receiptand the scripts.scripts/resolve_pending.py,_regenerate_series_catalogandCATALOG_REGENERATION_INPUTS): fetchesscripts/build_series_catalog.py,check_thesis_facts_append.pyandreceipt_pins.pyplus theledger/catalog inputs from the base commit, and runs the generator with Thesis's own interpreter.scripts/refresh-data.sh): readsledger/official_observations.jsonl,ledger/immutable_prefix.jsonandreleases/from this branch. It builds its bundle from main, not from this branch.receiptand each other.build_series_catalog.pyimportscheck_thesis_facts_appendlazily. The newtest_append_path_scripts_load_nothing_from_the_repository_packagesenforces this: it imports all six append-path scripts in an isolated interpreter and asserts that noarch,db,micro,calibration,packages,sqlmodel,sqlalchemyorsupabasemodule loads.What changes
Removed, each with its tests:
all 19
db/etl_*.py(etl_targets_supabase.pyplus 18 others, including UKetl_hmrc,etl_obrandetl_ons) anddb/tests/;arch load,arch statsandarch query; theStratum,StratumConstraint,Target,TargetTypeandGeographicLevelmodels; andquery_strata,query_targets,insert_targets_batchandTARGETS_SCHEMAfromdb/supabase_client.py;arch/targets/,arch/normalization/targets.py(TargetBlueprint,as_target,target_kwargs) andscripts/export_to_json.py;calibration/(it pulled rows fromtargets.dbthroughget_targets; constraints, entropy and loader existed only to fit weights to those rows), plus the micro/us modules that read those rows or the hosted copy:targets,pipeline,district,calibrateandhierarchy_validation;validation_dashboard, whose only caller washierarchy_validation;hierarchical_pipeline, which reads hostedmicroplex.targetsand falls back to mock targets.Main removed
calibration/andmicro/outright in Add Ledger governance and raw fact boundary checks #68.scripts/cps_to_policyengine.py --calibrate, which called the deletedmicro.us.calibrate(and would otherwise have degraded to a printed warning).Kept and decoupled:
arch/jurisdictions/us/soi.pydefinesAGI_BRACKETSandTABLE_1_1_AGI_LABEL_TO_BRACKETitself. Both are identical in value and order todb/etl_soi.py, checked by AST evaluation of both files. Main's follow-on branch makes the same move.arch/jurisdictions/{us,uk}/__init__.pyno longer import every loader. Before, the bundle reached all 17 loaders througharch.suite -> arch.jurisdictions.us.soi -> arch.jurisdictions.us -> arch.targets.loaders.arch/normalization/transforms.pyholdsscale_value,convert_units,apply_shareandformat_derivation, verbatim from the deleted module (checked segment by segment).db/cli.pykeepsinit,load-source-filesandsource-stats.db/schema.pykeeps the source-artifact tables and theJurisdiction/DataSourceenums.CI (
.github/workflows/ci.yml, jobarch, display name Arch checks, unchanged, so branch protection needs no edit):tests/test_legacy_targets_retired.py;init+source-stats), as main's follow-on does;soi, normalization andmicro.us.entities, and asserts the retired modules are not in the wheel.pyproject.tomlchanges only the hatchpackageslist (dropscalibration).uv.lockis unchanged (uv lock --checkpasses). Nothing underledger/orreleases/and no gate-surface file changes.Invariants
git diff d7e45bc5...HEAD -- ledger releases scripts/check_thesis_facts_append.py scripts/verify_release_chain.py scripts/canonical_json.py scripts/cut_release_manifest.py scripts/receipt_pins.py scripts/build_series_catalog.py .github/workflows/thesis-facts-append.yml uv.lockis empty.arch/,db/,micro/,packages/,scripts/,tests/anddata/.arch initcreates exactly the four source-artifact tables, andload,statsandqueryexit 2 with "invalid choice" (tested).arch build-bundle --year 2023was built at d7e45bc and at da5a7eb, and all 745 files match: 548 byte for byte, includingconsumer_facts.jsonl(10,268 rows, sha25678ca9a51…) andcoverage.json. The rest are equal apart from the run's absolute paths, thearch_builds.created_atbuild timestamp, and the checksum and size fields indatapackage.json/ro-crate-metadata.jsonfor files already proven equal. A comparison script holds those rules and keeps a per-file sha256 manifest (local evidence folder; the raw bundles were deleted for disk space).These are exhaustive checks over finite sets (every module, every file, every bundle byte). The branch's dependencies don't include Hypothesis, and there is no input domain to sample.
Verification
test_committed_catalog_is_current_and_valid), which Fold seven entity-drift lineages into their economy/aggregate siblings #344 fixed and which this branch now includes;uv lock --checkpassed, and the wheel builds with none of the retired files in it.import db.schematoscripts/canonical_json.py, and a lazyfrom db.etl_soi import AGI_BRACKETStoarch/core.py, makes the closure test and the import-walk test fail. Both mutations were reverted."targets"left inarch.__all__(P2) and two docs that still described the deleted loaders as current (P3). Both are fixed in 08418cf, which also replaces a README coverage table that listed BLS and UK sources only those loaders supplied. Round 2 covers the delta.Merge order and coordination
pyproject.toml, where Fold seven entity-drift lineages into their economy/aggregate siblings #344 added Hypothesis dev-dependency lines and this PR changed the hatchpackagesline.CATALOG_REGENERATION_INPUTS, none of which this PR touches, and that none of its PRs editci.yml. Audit period strips by reviewed template, not an exact spelling list #309 needs a rebase onto 65822f4 because of Fold seven entity-drift lineages into their economy/aggregate siblings #344, not because of this PR. Neither Audit period strips by reviewed template, not an exact spelling list #309 nor Resolve catalog supersede links against every row's effective assertion id #306 nor Put every file that decides a gate verdict on the gate surface #308 has a hunk that overlaps this diff. No Thesis hub is registered.axiom: n/a: infra and dead-code removal on the Thesis ledger branch; no policy logic changes.
🤖 Generated with Claude Code