chore(meta): T-1044/T-1047 -> done (PR #170 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2614,3 +2614,5 @@ INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, chang
|
||||
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 ('06FBPTXPJ910NNR5T2R9F9NWQR', 'status', 'in_progress', 'backlog', NULL, '2026-06-16 14:01:36', '2026-06-16 14:01:36.371', '2026-06-16 14:01:36.371', NULL, 'd5b4d3133cd7d9428a028121e862bd07', 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 ('06FBPQ0381QWDAQABZAY7MRD8M', 'status', 'in_progress', 'review', NULL, '2026-06-17 07:48:14', '2026-06-17 07:48:14.916', '2026-06-17 07:48:14.916', NULL, '53e3b7d4cf5135629408bc8a2aa4896c', 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 ('06FBPTXP5N42SSGW300FEDTS3M', 'status', 'in_progress', 'review', NULL, '2026-06-17 07:48:14', '2026-06-17 07:48:14.920', '2026-06-17 07:48:14.920', NULL, 'e7115e66b6bd755538db65e42fbc162d', 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 ('06FBPQ0381QWDAQABZAY7MRD8M', 'status', 'review', 'done', NULL, '2026-06-17 08:14:43', '2026-06-17 08:14:43.302', '2026-06-17 08:14:43.302', NULL, 'f90f10ea8bfed4aceb71c55b391bc153', 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 ('06FBPTXP5N42SSGW300FEDTS3M', 'status', 'review', 'done', NULL, '2026-06-17 08:14:43', '2026-06-17 08:14:43.306', '2026-06-17 08:14:43.306', NULL, '1f6b136fdd32b361532caee73a6df1c7', 2) ON CONFLICT(hash) DO NOTHING;
|
||||
|
||||
@@ -3504,3 +3504,32 @@ CURRENT LOCATIONS: derive_basin_direction = chunk_context.rs:453-483 (false comm
|
||||
RESOLUTION (D-239 §8 BINDS the D8 thalweg → flow_accumulation alone is insufficient; use the true fdir): in run_layer1 (where fdir is still alive, before it''s discarded), aggregate the dominant D8 direction PER DISTRICT and carry that small per-district direction map on Layer1Output — which composes directly with T-1044''s Layer1Output caching. Thread it through derive_all_districts → derive_district_profile → DistrictProfile.basin_direction; derive_chunk_context reads district.basin_direction. Fix the false doc comment + module contract either way. Do NOT expose the full 131KB fdir grid on DrainageResult — aggregate to per-district direction in the pass.
|
||||
|
||||
COMPOSE WITH T-1044 (same batch, same layer1.rs/cascade.rs flow). Acceptance: chunk-scale channels respect the covering district''s D8 thalweg (flow downhill, connect across the chunk/region-seed boundary); false comment corrected; golden-seed determinism preserved.', 'review', 'medium', NULL, 'server', 'D-239', '2026-06-12 10:40:58', '2026-06-17 07:48:14.919', NULL, 'd23b3a339e46f292dbf6b65c9018ead0', 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 ('06FBPQ0381QWDAQABZAY7MRD8M', 'task', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Cache TerrainAnalysis on Layer1Output — drop the redundant per-body drainage re-run', 'Workshopped-but-unticketed cascade work captured 2026-06-12 (cascade-refocus grounding pass). Full grounded scope follows.
|
||||
|
||||
---
|
||||
Refinement (2026-06-16, /whats-next Si pass) — READY. Current-tree brief (line refs were ~15 lines off pre-T-1077/T-1078; the PERF/TODO(T-1044) marker pins it).
|
||||
|
||||
REDUNDANCY: run_layer1 (layer1.rs:44-74) computes drainage::analyze + TerrainAnalysis::analyze, but Layer1Output (layer1.rs:28-41) carries only river_network/drainage_basins/attractors. cascade.rs (~230-255, PERF/TODO(T-1044) at :235) RE-RUNS both from scratch to serve derive_all_districts (district_profile.rs:1356, takes &TerrainAnalysis) and build_road_graph (road_graph.rs:191, takes &TerrainAnalysis). ~45ms/body wasted (D-239 ref).
|
||||
|
||||
FIX: carry TerrainAnalysis from the run_layer1 pass and reuse it in cascade.rs instead of recomputing.
|
||||
SERIALIZE decision: TerrainAnalysis derives Debug+Clone only (features.rs:65); Layer1Output derives Serialize/Deserialize. Per D-203/T-1048 the LRU per-entry size is already a concern (TerrainAnalysis is ~2MB of full-grid Vecs) — so PREFER holding it transiently on CascadeSnapshot (drop after the cascade consumes it) rather than persisting it on the LRU-cached Layer1Output. If it must live on Layer1Output, use #[serde(skip)] + re-derive on deserialize. Do NOT bloat the cached state.
|
||||
|
||||
COMPOSE WITH T-1047 (same batch): T-1047 aggregates a per-district dominant-D8-direction in the SAME run_layer1 pass — do both together to avoid double-touching layer1.rs/cascade.rs.
|
||||
|
||||
Acceptance: T-1031 harness cost drops toward ~45ms/body; T-952 golden-seed byte-identity UNCHANGED. Files: layer1.rs, cascade.rs (+ CascadeSnapshot if transient).', 'done', 'medium', NULL, 'server', 'D-203', '2026-06-12 10:23:50', '2026-06-17 08:14:43.302', NULL, 'feb5cd321c4a3e079f1f85fac6e79450', 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 ('06FBPTXP5N42SSGW300FEDTS3M', 'task', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Derive ChunkContext basin_direction from the L1 D8 thalweg; fix the false doc comment', '(description follows in first append)
|
||||
|
||||
Filed 2026-06-12 from the fable-ous.md audit (S-36; citations adversarially verified).
|
||||
derive_basin_direction (chunk_context.rs:211-231) branches only on ocean_fraction_q then picks a direction from seed bits in both branches; the doc comment (:201-210) falsely claims an elev_q-gradient proxy; the module contract (:12-13, :40-42) claims D8-thalweg derivation. BodyWorldState.river_network exists (body_world_state.rs:79) and is never consulted — chunk-scale water has no guarantee of flowing downhill or connecting across the 16-chunk region-seed boundary. D-239 §8 binding law: respect the D8 thalweg.
|
||||
Fix: compute the covering region''s dominant D8 direction during the RegionProfile pass (DrainageResult is in scope there) and thread it into RegionProfile for derive_chunk_context to read; fix the misleading comments either way. Composes with T-1040 (channel anchor) and T-1042 (seam blend).
|
||||
|
||||
---
|
||||
Refinement (2026-06-16, /whats-next Si pass) — staleness corrected + resolution. Original scope pre-T-1077.
|
||||
|
||||
STALENESS (critical): the ticket says thread basin_direction into "RegionProfile" — WRONG post-T-1077. The per-chunk carrier derive_chunk_context receives is **DistrictProfile** (2km). The new RegionProfile (region_profile.rs) is the 205km climate tier (T-1078) and is NOT passed to derive_chunk_context. Thread basin_direction into **DistrictProfile**.
|
||||
|
||||
CURRENT LOCATIONS: derive_basin_direction = chunk_context.rs:453-483 (false comment :453-462 claims an elev_q/slope_q D8-gradient proxy but the body branches only on ocean_fraction_q>=15 then picks from seed bits; module header :12-13 claims D8-thalweg). BodyWorldState.river_network = body_world_state.rs:80 (stub, never consulted). fdir (D8 flow-dir grid) is computed in drainage.rs:81 but DROPPED (not on DrainageResult :44-56).
|
||||
|
||||
RESOLUTION (D-239 §8 BINDS the D8 thalweg → flow_accumulation alone is insufficient; use the true fdir): in run_layer1 (where fdir is still alive, before it''s discarded), aggregate the dominant D8 direction PER DISTRICT and carry that small per-district direction map on Layer1Output — which composes directly with T-1044''s Layer1Output caching. Thread it through derive_all_districts → derive_district_profile → DistrictProfile.basin_direction; derive_chunk_context reads district.basin_direction. Fix the false doc comment + module contract either way. Do NOT expose the full 131KB fdir grid on DrainageResult — aggregate to per-district direction in the pass.
|
||||
|
||||
COMPOSE WITH T-1044 (same batch, same layer1.rs/cascade.rs flow). Acceptance: chunk-scale channels respect the covering district''s D8 thalweg (flow downhill, connect across the chunk/region-seed boundary); false comment corrected; golden-seed determinism preserved.', 'done', 'medium', NULL, 'server', 'D-239', '2026-06-12 10:40:58', '2026-06-17 08:14:43.306', NULL, 'e221e440c3be0db6d0de73a2544dfb9d', 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);
|
||||
|
||||
Reference in New Issue
Block a user