Builds the D-232 architecture-flavor storage + content foundation — the data
the Phase-4 generator will read to decide how settlements look. Two tickets,
one branch:
Retires the round-2 atlas_body_culture tables. Source location provisional
pending Q-107; the baked tables are invariant per D-232. Schema in both the
canonical systems-schema.sql and MIGRATION_SQL; stamp sources updated.
Cross-corridor pool (10): economic-function templates gated by BulkClass
(extraction / industrial / cold-chain / precision / information / civic) +
universal baselines + the foreign-import swerve. Guarantees the CI floor.
Per-corridor baseline (8): core cosmopolitan, north anglo-frontier, south
lusophone, west germanic + compact-cooperative, east dense-utilitarian,
deep-frontier surname + hardscrabble.
Heritage sub-pools (10): scottish highland, west-african compound, iberian
hacienda, atlantic creole, nordic timber, central-european blok, east-asian
temple, vietnamese water village, afrikaans kraal, arab oasis — tied to the
D-237 heritage taxonomy.
Shared ObjectTag material palette (walls/roofs/facades/streets) with generic
fallback parents (D-235); zone_affinity keys use the real DistrictType enum.
CI guardrails added to the baker (V-TT-01: ≥5 templates eligible per
BulkClass; V-TT-02: no template >60% of pool weight). Both pass with margin:
23–24 eligible/class, 5% max share.
The D-232 core hand-curated catalog (28 templates) the architecture-flavor
draw reads from, baked into trait_templates (#993):
- Cross-corridor pool (10): economic-function templates gated by BulkClass
(extraction/industrial/cold-chain/precision/information/civic) + universal
baselines + the foreign-import swerve. Guarantees the CI floor.
- Per-corridor baseline (8): each corridor's default cohesive look — core
cosmopolitan, north anglo-frontier, south lusophone, west germanic +
compact-cooperative, east dense-utilitarian, deep-frontier surname +
hardscrabble.
- Heritage sub-pools (10): deep-history callbacks tied to the D-237 heritage
taxonomy (scottish highland, west-african compound, iberian hacienda,
atlantic creole, nordic timber, central-european blok, east-asian temple,
vietnamese water village, afrikaans kraal, arab oasis).
Each template = holistic bundle: two-tier eligibility (hard gates
bulk_class/ubiquity/prosperity_bps + soft weight mods), zone_affinity over
the real DistrictType enum, allow/block tags from a shared ObjectTag
palette, and a D-235 visual_bundle with generic fallback parents. All
numerics integer basis-points (D-010).
Adds the D-232 CI guardrails to the baker (V-TT-01: >=5 templates eligible
per BulkClass; V-TT-02: no template >60% of pool weight) — both pass with
margin (23-24 eligible/class, 5% max share). Catalog can grow via the
bounded Gemma pass (#992); hero pins are #1017.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review fixes (Hoshe/Tyre, both APPROVE):
- populate_trait_templates / populate_atlas_body_trait_bias: the table
DELETEs ran unconditionally (safe only via transaction rollback on
dry-run, and divergent from every other populate_* function). Restructured
so validation + guardrails always run (dry-run now actually surfaces the
would-bake counts and catches errors) but mutations happen only under
`if not dry_run:`. Verified: --dry-run reports 28 templates, writes nothing.
- atlas_body_trait_bias: reject `pin` entries that carry a
weight_multiplier_bps (pin is mandatory, no multiplier) — closes a silent-
accept gap before #1017 authors ~30-40 real pins.
Deferred (noted on tickets): visual_bundle fallback-map completeness
(Phase-5/Araminta), pin-count-vs-K bake check (#1017 acceptance),
geographic_sector pool-narrowing semantics (#977).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verdict: APPROVED. Both actionable comments fixed in a4727bf73.
Clean on review
Schema ↔ migration parity exact; FK-safe clear+rebuild; all catalog bulk_class_gate / production_ubiquity_gate / zone_affinity values match the Rust enums; guardrails correct (V-TT-01 ≥5/class, V-TT-02 integer >60% math — both pass with margin, 23–24 eligible/class, ~5% max share); both TOMLs registered in IMPORT_ECONOMICS_SOURCES + GENERATOR_SOURCES; JSON columns are the right call for a read-once baked artifact; integer basis-points throughout (D-010); atlas_body_culture DROP correctly placed. Schema is a faithful realization of the D-232 storage spec and forward-fits #977/#1017 without changes.
Fixed
#
Reviewer
Finding
Fix
1
Hoshe + Tyre
populate_trait_templates/_trait_bias ran table DELETEs unconditionally (safe only via dry-run rollback; divergent from every other populate_*)
Fixed — validation + guardrails now run always (dry-run surfaces would-bake counts + catches errors); mutations gated by if not dry_run:. Verified --dry-run reports 28 templates, writes nothing
2
Hoshe
pin bias entries with a stray weight_multiplier_bps were silently accepted
Fixed — now rejected (pin is mandatory, no multiplier); closes the gap before #1017's ~30–40 pins
Deferred (tracked, not blocking)
visual_bundle fallback-map completeness (Hoshe) — 14 templates have axis tokens without a fallback entry. D-235 asset-resolution concern (Phase 5); the baker doesn't enforce it. Follow-up for Araminta's visual pass.
pin-count vs K budget (Tyre) — bake can't see complexity_tier; noted on #1017 acceptance (enforce in #977 draw or generator validation).
geographic_sector pool-narrowing semantics (Tyre) — column is a soft pool hint, never a gate; composes with weight_mods. Noted on #977.
## Review — PR #148 (code: trait-template tables + bake + core catalog, #993/#1005)
Multi-agent code review (Hoshe / Tyre).
| Reviewer | Focus | Verdict |
|---|---|---|
| Hoshe | QA / correctness | APPROVE |
| Tyre | Architecture | APPROVE |
**Verdict: APPROVED.** Both actionable comments fixed in `a4727bf73`.
### Clean on review
Schema ↔ migration parity exact; FK-safe clear+rebuild; all catalog `bulk_class_gate` / `production_ubiquity_gate` / `zone_affinity` values match the Rust enums; guardrails correct (V-TT-01 ≥5/class, V-TT-02 integer >60% math — both pass with margin, 23–24 eligible/class, ~5% max share); both TOMLs registered in `IMPORT_ECONOMICS_SOURCES` + `GENERATOR_SOURCES`; JSON columns are the right call for a read-once baked artifact; integer basis-points throughout (D-010); `atlas_body_culture` DROP correctly placed. Schema is a faithful realization of the D-232 storage spec and forward-fits #977/#1017 without changes.
### Fixed
| # | Reviewer | Finding | Fix |
|---|----------|---------|-----|
| 1 | Hoshe + Tyre | `populate_trait_templates`/`_trait_bias` ran table DELETEs unconditionally (safe only via dry-run rollback; divergent from every other `populate_*`) | **Fixed** — validation + guardrails now run always (dry-run surfaces would-bake counts + catches errors); mutations gated by `if not dry_run:`. Verified `--dry-run` reports 28 templates, writes nothing |
| 2 | Hoshe | `pin` bias entries with a stray `weight_multiplier_bps` were silently accepted | **Fixed** — now rejected (pin is mandatory, no multiplier); closes the gap before #1017's ~30–40 pins |
### Deferred (tracked, not blocking)
- **visual_bundle fallback-map completeness** (Hoshe) — 14 templates have axis tokens without a `fallback` entry. D-235 asset-resolution concern (Phase 5); the baker doesn't enforce it. Follow-up for Araminta's visual pass.
- **pin-count vs K budget** (Tyre) — bake can't see `complexity_tier`; noted on **#1017** acceptance (enforce in #977 draw or generator validation).
- **geographic_sector pool-narrowing semantics** (Tyre) — column is a soft pool hint, never a gate; composes with `weight_mods`. Noted on **#977**.
### Re-verified after fixes
regen clean · 28 templates · guardrails pass · dry-run non-mutating · ruff clean · stamp fresh · pre-push gates green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Builds the D-232 architecture-flavor storage + content foundation — the data
the Phase-4 generator will read to decide how settlements look. Two tickets,
one branch:
The generator consumer (#977) and per-body hero pins (#1017) are downstream; this
PR is storage + content only.
#993 — tables + bake mechanism
trait_templates— shared catalog of holistic template bundles (two-tiereligibility: hard gates
bulk_class/prosperity_bps/ubiquity+ soft weightmods;
zone_affinity,allow/blocktags,visual_bundle). List/map fieldsare JSON; all numerics integer basis-points (D-010).
atlas_body_trait_bias— sparse per-body hero bias (pin/boost/suppresswith basis-point multiplier ranges; boost ≤3×, suppress ≥0.33× never 0).
wiki/economics/architecture_trait_catalog.tomlarchitecture_trait_bias.toml. FK-validated (body_id → bodies, template_tag→ trait_templates), enum + multiplier-range checks, graceful on absent source.
atlas_body_culturetables. Source location provisionalpending Q-107; the baked tables are invariant per D-232. Schema in both the
canonical
systems-schema.sqlandMIGRATION_SQL; stamp sources updated.#1005 — core catalog (28 templates)
(extraction / industrial / cold-chain / precision / information / civic) +
universal baselines + the foreign-import swerve. Guarantees the CI floor.
lusophone, west germanic + compact-cooperative, east dense-utilitarian,
deep-frontier surname + hardscrabble.
hacienda, atlantic creole, nordic timber, central-european blok, east-asian
temple, vietnamese water village, afrikaans kraal, arab oasis — tied to the
D-237 heritage taxonomy.
fallback parents (D-235);
zone_affinitykeys use the real DistrictType enum.BulkClass; V-TT-02: no template >60% of pool weight). Both pass with margin:
23–24 eligible/class, 5% max share.
Verification
make regen-dbclean · 28 templates baked, JSON fields parse, guardrails pass ·bias FK-validation proven (valid row inserts; bad multiplier aborts) ·
empty-bias-source graceful · ruff clean · meta stamp fresh · pre-push gates green.
Unblocks
#1005 (done here) → #959/#988/#994/#1003; and one of the four prerequisites of
#1017. The draw consumer is #977.
🤖 Generated with Claude Code
Review — PR #148 (code: trait-template tables + bake + core catalog, #993/#1005)
Multi-agent code review (Hoshe / Tyre).
Verdict: APPROVED. Both actionable comments fixed in
a4727bf73.Clean on review
Schema ↔ migration parity exact; FK-safe clear+rebuild; all catalog
bulk_class_gate/production_ubiquity_gate/zone_affinityvalues match the Rust enums; guardrails correct (V-TT-01 ≥5/class, V-TT-02 integer >60% math — both pass with margin, 23–24 eligible/class, ~5% max share); both TOMLs registered inIMPORT_ECONOMICS_SOURCES+GENERATOR_SOURCES; JSON columns are the right call for a read-once baked artifact; integer basis-points throughout (D-010);atlas_body_cultureDROP correctly placed. Schema is a faithful realization of the D-232 storage spec and forward-fits #977/#1017 without changes.Fixed
populate_trait_templates/_trait_biasran table DELETEs unconditionally (safe only via dry-run rollback; divergent from every otherpopulate_*)if not dry_run:. Verified--dry-runreports 28 templates, writes nothingpinbias entries with a strayweight_multiplier_bpswere silently acceptedDeferred (tracked, not blocking)
fallbackentry. D-235 asset-resolution concern (Phase 5); the baker doesn't enforce it. Follow-up for Araminta's visual pass.complexity_tier; noted on #1017 acceptance (enforce in #977 draw or generator validation).weight_mods. Noted on #977.Re-verified after fixes
regen clean · 28 templates · guardrails pass · dry-run non-mutating · ruff clean · stamp fresh · pre-push gates green.
🤖 Generated with Claude Code
Pull request closed