feat(db): architecture zone-bias + color-register-band tables + V-TT-06/07 (T-988)
Ratified content baked into systems.db as two new tables: - architecture_zone_bias (57 rows): sparse per-template, per-zone_type token-weight overrides (integer bps), Miri-authored — the D-235 step-2 zone bias. V-TT-06: every token must exist in that template's own visual_bundle axis. - color_register_bands (28 rows): per color_register integer HSV bands (hue centidegrees, sat/val bps), Araminta-authored. V-TT-07: full catalog coverage + valid integer bounds (min<max, in range). Both TOMLs registered in generator_sources (stamp coverage); DDL in systems-schema.sql + migration.py; validation wired into import_economics steps 18/19 and test_traits.py failure-branch units (make test-tooling). systems.db regenerated + re-stamped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -588,6 +588,36 @@ CREATE TABLE IF NOT EXISTS atlas_body_trait_bias (
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_atlas_body_trait_bias_body ON atlas_body_trait_bias(body_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_atlas_body_trait_bias_tag ON atlas_body_trait_bias(template_tag);
|
||||
|
||||
-- architecture_zone_bias: D-235 step-2 sparse bias table (T-988). Per
|
||||
-- (template, zone_type) axis-token weight overrides within that template's
|
||||
-- own visual_bundle; unlisted (template, zone_type) pairs — and unlisted
|
||||
-- tokens within a listed entry — fall back to a uniform draw. Baked from
|
||||
-- wiki/economics/architecture_zone_bias.toml. Importer-validated (V-TT-06):
|
||||
-- every referenced token must already be in the template's visual_bundle.
|
||||
CREATE TABLE IF NOT EXISTS architecture_zone_bias (
|
||||
template_tag TEXT NOT NULL REFERENCES trait_templates(tag) ON DELETE CASCADE,
|
||||
zone_type_id TEXT NOT NULL, -- D-142 zone-type id (BuildingPropertyTag.zone_type_id)
|
||||
bias TEXT NOT NULL, -- JSON {axis: {token: weight_bps}}, D-010 integer bps
|
||||
PRIMARY KEY (template_tag, zone_type_id)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_architecture_zone_bias_template ON architecture_zone_bias(template_tag);
|
||||
|
||||
-- color_register_bands: D-235 numeric HSV sampling band per trait-template
|
||||
-- `color_register` label (T-988). One band per register; the fill seed
|
||||
-- samples (hue, sat, val) uniformly within it per building. Baked from
|
||||
-- wiki/economics/color_register_bands.toml. Importer-validated (V-TT-07):
|
||||
-- every color_register referenced by trait_templates.visual_bundle must have
|
||||
-- a band here, and every band's ranges must be in-bounds with min < max.
|
||||
CREATE TABLE IF NOT EXISTS color_register_bands (
|
||||
color_register TEXT PRIMARY KEY,
|
||||
hue_min INTEGER NOT NULL, -- centidegrees (degrees x 100), 0..36000
|
||||
hue_max INTEGER NOT NULL,
|
||||
sat_min INTEGER NOT NULL, -- basis points, 0..10000
|
||||
sat_max INTEGER NOT NULL,
|
||||
val_min INTEGER NOT NULL, -- basis points, 0..10000
|
||||
val_max INTEGER NOT NULL
|
||||
);
|
||||
-- END TRAIT TEMPLATES (D-232, #993)
|
||||
|
||||
-- Indexes
|
||||
|
||||
Reference in New Issue
Block a user