diff --git a/.pql/changelog/ticket_history/2026-07.sql b/.pql/changelog/ticket_history/2026-07.sql index 8557e16b9..369c35ab6 100644 --- a/.pql/changelog/ticket_history/2026-07.sql +++ b/.pql/changelog/ticket_history/2026-07.sql @@ -1559,3 +1559,14 @@ Implementation note (Tyre, T-1124 report): DISTRICT_WINDOW_MIN_ZOOM proposed at INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FPRZZ0P42NHC1QR5S3737EV4', 'status', 'in_progress', 'review', NULL, '2026-07-18 10:30:08', '2026-07-18 10:30:08.113', '2026-07-18 10:30:08.113', NULL, '475845ef730811d0a00675fcffba98fe', 2) ON CONFLICT(hash) DO NOTHING; INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FPQXHDSMSVD3VADV38NG9STW', 'status', 'in_progress', 'review', NULL, '2026-07-18 10:30:08', '2026-07-18 10:30:08.116', '2026-07-18 10:30:08.116', NULL, '4446cca99e042920271275c7e16b4934', 2) ON CONFLICT(hash) DO NOTHING; INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FPQXFFHXEEDQEM7PGXAH3534', 'status', 'in_progress', 'review', NULL, '2026-07-18 10:30:08', '2026-07-18 10:30:08.116', '2026-07-18 10:30:08.116', NULL, '748ea7e1d521afc72a2f34adf71c4f50', 2) ON CONFLICT(hash) DO NOTHING; +INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FQ9B8F39QD7PGPG4W35AWCRG', 'description', 'Implement the D-226 T-1124 amendment SS1-SS4 (server half). (1) AtlasLayerRequest gains window_center: Option-DistrictPos + window_n: u32, both serde(default) — absent = whole-body, wire back-compat. (2) AtlasLayerResponse gains district_window: Option-DistrictWindowLayer per the amendment''s exact field list (echoed center/n + six parallel arrays: morphology u8, elev_q u8, temp_dc i16 with the RegionGridLayer sentinel, moisture_q u8, vegetation u8 incl Marine=6, glaciation u8). (3) handle_atlas_request gains a window-serving branch calling derive_district per cell (district_profile.rs:1415), clamping window_n to 1..=DISTRICT_WINDOW_MAX_N=64 server-side (never trust the wire). + +MUST RESOLVE FIRST — the TerrainAnalysis availability decision (named in the amendment + T-1124 report): BodyWorldState does NOT retain TerrainAnalysis after cascade completion (transient ~2 MB, dropped at cascade.rs:141 per D-203 memory budget), but derive_district needs a reference to it. Either (a) cache TerrainAnalysis alongside BodyWorldState (quantify the ~2 MB/body cost against BodyWorldStateCache LRU capacity) or (b) re-derive via run_layer1 per cache miss (quantify the O(w*h) whole-body re-analysis as a window-request tax — aliveness_probe''s current workaround). Decide with numbers, record the choice in the PR. + +(4) Tests mirroring build_region_grid/build_district_grid precedents: empty/clamped-window edges, msgpack round-trip, and a determinism spot-check (two full passes byte-identical — promoting the T-1123 probe-only proof to a real test, since this is the first served layer built from the on-demand derive path).', 'Implement the D-226 T-1124 amendment SS1-SS4 (server half). (1) AtlasLayerRequest gains window_center: Option-DistrictPos + window_n: u32, both serde(default) — absent = whole-body, wire back-compat. (2) AtlasLayerResponse gains district_window: Option-DistrictWindowLayer per the amendment''s exact field list (echoed center/n + six parallel arrays: morphology u8, elev_q u8, temp_dc i16 with the RegionGridLayer sentinel, moisture_q u8, vegetation u8 incl Marine=6, glaciation u8). (3) handle_atlas_request gains a window-serving branch calling derive_district per cell (district_profile.rs:1415), clamping window_n to 1..=DISTRICT_WINDOW_MAX_N=64 server-side (never trust the wire). + +MUST RESOLVE FIRST — the TerrainAnalysis availability decision (named in the amendment + T-1124 report): BodyWorldState does NOT retain TerrainAnalysis after cascade completion (transient ~2 MB, dropped at cascade.rs:141 per D-203 memory budget), but derive_district needs a reference to it. Either (a) cache TerrainAnalysis alongside BodyWorldState (quantify the ~2 MB/body cost against BodyWorldStateCache LRU capacity) or (b) re-derive via run_layer1 per cache miss (quantify the O(w*h) whole-body re-analysis as a window-request tax — aliveness_probe''s current workaround). Decide with numbers, record the choice in the PR. + +(4) Tests mirroring build_region_grid/build_district_grid precedents: empty/clamped-window edges, msgpack round-trip, and a determinism spot-check (two full passes byte-identical — promoting the T-1123 probe-only proof to a real test, since this is the first served layer built from the on-demand derive path). + +Design change from the PR #185 Troblum review (binding, folded into the amendment): the window-serving branch must NOT call derive_district inline in serve_atlas_requests/PreInput — window derives ride the SAME Rayon background queue + Pending-response pattern the whole-body cache-miss path uses (response on a later tick; the client''s SS5 border-fade covers the wait). Recommended: per-connection coalescing — a newly queued window request supersedes an unserved older one for the same body. The SS4 numbers (~7ms n=32 / ~29ms n=64 debug) are background-queue latency, not tick-thread cost. Also: the amendment now pins a windowed-family ceiling — district_window is the ONLY windowed-query field this struct may carry; a second windowed query is a dedicated response message by rule.', NULL, '2026-07-18 10:38:20', '2026-07-18 10:38:20.072', '2026-07-18 10:38:20.072', NULL, '118a77ac05211ca1045f7d0cbfa07fae', 2) ON CONFLICT(hash) DO NOTHING; diff --git a/.pql/changelog/tickets/2026-07.sql b/.pql/changelog/tickets/2026-07.sql index 19b707ec5..832addc9c 100644 --- a/.pql/changelog/tickets/2026-07.sql +++ b/.pql/changelog/tickets/2026-07.sql @@ -2256,3 +2256,10 @@ Legend row is GATE-ENFORCED: test_atlas_overlays.gd:192-209 generically asserts Fixtures: client/tests/fixtures/msgpack/atlas_response_{ready,pending,not_found}.msgpack, generated by server/tests/gen_fixtures.rs::generate_atlas_layer_response_fixtures (:627/:641/:655 currently hardcode region_grid: None). Regen = make fixtures (NOT make fixtures-gauntlet — separate live pipeline). Populated fixture = add a non-empty RegionGridLayer literal following the road_graph/settlements populated literals at :577-618, run make fixtures, extend the Tier-2 replay test at test_atlas_overlays.gd:149. The server-side literal edit lands via Dudley (batch-mate, owns server/tests in this batch) — coordinate the literal''s contents with him; the client-side replay-test extension is this ticket''s. Channel ruling confirmed: mean-temp ramp first (i16 deci-degC, REGION_TEMP_NONE_DC = i16::MIN airless sentinel needs an explicit render disposition — distinct sentinel color or skip); season/weather/moisture as tooltip or later variant overlays, not this ticket.', 'review', 'medium', NULL, 'client', 'D-226', '2026-07-16 17:25:07.599', '2026-07-18 10:30:08.116', NULL, 'a018183b9ea2c1388fdc613cd72a3217', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash); +INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FQ9B8F39QD7PGPG4W35AWCRG', 'task', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Wire windowed district-resolution Atlas layer — server half (D-226 T-1124 amendment)', 'Implement the D-226 T-1124 amendment SS1-SS4 (server half). (1) AtlasLayerRequest gains window_center: Option-DistrictPos + window_n: u32, both serde(default) — absent = whole-body, wire back-compat. (2) AtlasLayerResponse gains district_window: Option-DistrictWindowLayer per the amendment''s exact field list (echoed center/n + six parallel arrays: morphology u8, elev_q u8, temp_dc i16 with the RegionGridLayer sentinel, moisture_q u8, vegetation u8 incl Marine=6, glaciation u8). (3) handle_atlas_request gains a window-serving branch calling derive_district per cell (district_profile.rs:1415), clamping window_n to 1..=DISTRICT_WINDOW_MAX_N=64 server-side (never trust the wire). + +MUST RESOLVE FIRST — the TerrainAnalysis availability decision (named in the amendment + T-1124 report): BodyWorldState does NOT retain TerrainAnalysis after cascade completion (transient ~2 MB, dropped at cascade.rs:141 per D-203 memory budget), but derive_district needs a reference to it. Either (a) cache TerrainAnalysis alongside BodyWorldState (quantify the ~2 MB/body cost against BodyWorldStateCache LRU capacity) or (b) re-derive via run_layer1 per cache miss (quantify the O(w*h) whole-body re-analysis as a window-request tax — aliveness_probe''s current workaround). Decide with numbers, record the choice in the PR. + +(4) Tests mirroring build_region_grid/build_district_grid precedents: empty/clamped-window edges, msgpack round-trip, and a determinism spot-check (two full passes byte-identical — promoting the T-1123 probe-only proof to a real test, since this is the first served layer built from the on-demand derive path). + +Design change from the PR #185 Troblum review (binding, folded into the amendment): the window-serving branch must NOT call derive_district inline in serve_atlas_requests/PreInput — window derives ride the SAME Rayon background queue + Pending-response pattern the whole-body cache-miss path uses (response on a later tick; the client''s SS5 border-fade covers the wait). Recommended: per-connection coalescing — a newly queued window request supersedes an unserved older one for the same body. The SS4 numbers (~7ms n=32 / ~29ms n=64 debug) are background-queue latency, not tick-thread cost. Also: the amendment now pins a windowed-family ceiling — district_window is the ONLY windowed-query field this struct may carry; a second windowed query is a dedicated response message by rule.', 'backlog', 'high', NULL, 'server', NULL, '2026-07-18 10:02:06.490', '2026-07-18 10:38:20.072', NULL, '70938bfe2ea753dc473e99143d62f745', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);