Commit Graph
2396 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Opus 4.8 711ac65d20 chore(meta): activate Phase-4 batch — T-1044/T-1047 (cascade) + T-1049/T-1050 (assets)
Two parallel tracks with refinement appends: T-1044+T-1047 compose on the run_layer1
pass (TerrainAnalysis cache + per-district D8 basin_direction); T-1049+T-1050 are the
asset-pipeline track (per-class story breakdown + catalog/manifest/conventions + glb-gen
path). Staleness corrected (T-1047: basin_direction threads through DistrictProfile, not
the post-T-1077 RegionProfile).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 15:42:26 +02:00
jpmschweitzerandClaude Opus 4.8 718a97cda6 chore(meta): T-1039/T-1043 -> done (PR #168 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:05:04 +02:00
jpmschweitzerandClaude Opus 4.8 387ee1b4c2 Merge PR #168: L3→L4 dispatch threading — political_archetype / morphology_zone / road_entry_directions (T-1039, T-1043)
Reviewed by Hoshe + Tyre; Hoshe's 2 findings addressed, Tyre approved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:56:35 +02:00
jpmschweitzerandClaude Opus 4.8 2d85f8ca3c chore(config): align branch post-checkout with main's do-nothing version
Reconciles the branch's earlier export --stage hook (d2cbdc243) with main's
superseding do-nothing fix (b24a3596b) so the two merge cleanly instead of
conflicting on this file. (The hook fix is already live on main; this just keeps
the branch copy identical.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:51:33 +02:00
jpmschweitzerandClaude Opus 4.8 43aadc4491 fix(simulation): address PR #168 review — fallback diagnostic, parity coverage, doc (T-1039)
Hoshe H1: the morphology_zone AlluvialPlain fallback fired silently. Now logs
tracing::debug! when the district grid is empty (expected: params-missing body /
early cascade) and tracing::warn! when a populated grid misses the key (indicates a
pixel->district convention bug) — no more silently-wrong topology.

Hoshe H2: the arrangement_pattern parity tripwire only covered transit_hub with
Commission + Corporate. Added Pioneer/Industrial/Military/Academic rows so an
accidental archetype-conditionalization of the cross-archetype override is caught.

Tyre (non-blocking): clarified the build_skeleton_work_item doc — the
arrangement_pattern re-derivation call lives in generate_quarter_skeleton (the
consumer), not in this function.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:51:27 +02:00
jpmschweitzerandClaude Opus 4.8 b24a3596b5 fix(config): post-checkout does nothing on same-HEAD instead of export --stage
Refines 34ffcda86. The export --stage approach preserved the mutation but did more
than the bug needs: it eagerly stages changelog rows mid-checkout (surprising in
git status), and those staged rows can leak onto the wrong branch when a later
switch rebuilds by replaying the working-tree changelog.

Minimal fix: on a branch *creation* / no-op checkout (prev-HEAD == new-HEAD) the
working tree is unchanged, so pql.db already holds the committed state plus any
uncommitted mutation — just skip the whole block (do nothing). The mutation stays
in pql.db untouched and the next commit's pre-commit hook flushes it normally. Only
a real branch *switch* (prev != new) rebuilds. No git-index side effects, no leak.

Verified: same-HEAD invocation preserves an uncommitted status mutation and stages
nothing. (Credit: pql-clide's review of the upstream feature request.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:42:08 +02:00
jpmschweitzerandClaude Opus 4.8 34ffcda86f fix(config): post-checkout preserves uncommitted pql mutations on branch creation
The post-checkout hook ran 'pql plan rebuild' (drop + replay changelog) on every
branch checkout, including 'git checkout -b'. That silently dropped any pql.db
ticket mutation not yet in the committed changelog — e.g. an in_progress status set
right before cutting a feature branch (hit this session: T-1039/T-1043 reverted to
backlog at branch creation).

Git has no pre-checkout/pre-worktree hook, so capture the changelog at post-checkout
instead: when prev-HEAD == new-HEAD (a branch *creation* — content unchanged, pql.db
already correct), run 'pql plan export --stage' (the same flush the pre-commit hook
does) instead of the destructive rebuild. Real branch *switches* (prev != new) still
rebuild to match the branch's changelog.

Verified: simulating a same-HEAD checkout with an uncommitted in_progress mutation now
preserves it (previously reverted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:23:28 +02:00
jpmschweitzerandClaude Opus 4.8 d2cbdc2431 fix(config): post-checkout preserves uncommitted pql mutations on branch creation
The post-checkout hook ran 'pql plan rebuild' (drop + replay changelog) on every
branch checkout, including 'git checkout -b'. That silently dropped any pql.db
ticket mutation not yet in the committed changelog — e.g. an in_progress status set
right before cutting a feature branch (hit this session: T-1039/T-1043 reverted to
backlog at branch creation).

Git has no pre-checkout/pre-worktree hook, so capture the changelog at post-checkout
instead: when prev-HEAD == new-HEAD (a branch *creation* — content unchanged, pql.db
already correct), run 'pql plan export --stage' (the same flush the pre-commit hook
does) instead of the destructive rebuild. Real branch *switches* (prev != new) still
rebuild to match the branch's changelog.

Verified: simulating a same-HEAD checkout with an uncommitted in_progress mutation now
preserves it (previously reverted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:05:19 +02:00
jpmschweitzerandClaude Opus 4.8 a3c3929c4e chore(meta): activate T-1039/T-1043 + board cleanup (T-960->backlog, T-1038->done)
T-1039/T-1043 in_progress + refinement appends (the locked arrangement_pattern
re-derive + RoadGraph-source decisions). Board hygiene: T-960 (Atlas map viewer)
parked since 2026-06-07 -> backlog; T-1038 (Layer 2 road graph) full scope landed
on main (c0d4ac89d) and consumed by T-1043 -> done.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 11:42:35 +02:00
jpmschweitzerandClaude Opus 4.8 9c8ad83071 feat(simulation): thread political_archetype/morphology_zone/road_entry_directions through L3->L4 dispatch (T-1039, T-1043)
Completes the GenerateSkeleton dispatch T-1022 wired (which only carried
founding_orientation). build_skeleton_work_item now also threads:

T-1039:
- political_archetype — real value from CityPlacement, replacing the Commission stub.
- morphology_zone — looked up from the covering DistrictProfile via new
  scale::heightmap_pixel_to_district (exported HEIGHTMAP_CELLS_PER_DISTRICT;
  cascade.rs drops its local CELLS_PER_REGION literal for the shared const).
- arrangement_pattern — RE-DERIVED at L4 (option b) via the single pure fn
  attractor_matching::arrangement_pattern(&archetype, &economic_role); both
  inputs already at L4. No CityGenerationContext field, no stored derived state
  (DB-as-cache). Parity test asserts L4 re-derivation == L3-stored value.

T-1043:
- road_entry_directions — derived from T-1038's BodyWorldState.road_graph:
  octant = bearing of each incident road edge, deduped per octant, ordered by
  MaintenanceAuthority rank (the AdminFacing prestige-edge consumer). Feeds
  derive_access_points -> AccessKind::QuarterEdge; BlockJunction fallback now
  fires only for genuinely isolated settlements.

Acceptance covered: Corporate+Fjord -> Ribbon topology (not mesh+Commission);
settlement with a road -> QuarterEdge on the correct octant. 11 new tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 11:34:22 +02:00
jpmschweitzerandClaude Opus 4.8 f98297d136 chore(meta): T-1042/T-1078 -> done (PR #167 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:42:32 +02:00
jpmschweitzerandClaude Opus 4.8 2acab55b2a Merge PR #167: D-243 region-tier finish — region climate stack + cross-district blending (T-1078, T-1042)
Reviewed by Hoshe + Tyre; all findings addressed, T1 wiring re-reviewed (APPROVE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:40:56 +02:00
jpmschweitzerandClaude Opus 4.8 ff5e7ee944 fix(simulation): VoxelCache precondition doc + sec_phase decontamination + cache blend test (T-1042)
Addresses PR #167 review (Hoshe H1/H2/H3, Tyre T2).

H1 — the VoxelCache 'same (seed, body_id, tile_pos) -> same column' invariant
is no longer unconditional after the T-1042 blend (the key omits blend_weight/
secondary). Replaced with an explicit precondition on the struct + get_or_derive:
the caller must pass the ChunkContext of the chunk that contains the tile.

H2/T2 — sec_phase claimed to be 'position-independent' but mixed in
primary_meander_phase/2 (the primary's per-position seed), making the secondary
phase proxy asymmetric and primary-contaminated. Dropped that term; sec_phase is
now the secondary's own morphology scalars (slope_q + moisture_q), with a comment
honestly naming it a bounded cosmetic approximation and where to thread the real
secondary seed if needed.

H3 — added cache_boundary_tile_blend_is_stable: derives a boundary ChunkContext
(blend_weight=128, secondary=Some), calls get_or_derive twice, asserts a cache
hit + identical blended elevation + that the Cow::Owned blend path actually ran.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:30:46 +02:00
jpmschweitzerandClaude Opus 4.8 d974cf42b0 fix(simulation): wire region baseline into production district temp + rename latitude field (T-1078)
Addresses PR #167 review (Tyre T1, T3).

T1 — the region climate tier was built but no live path consulted it: both
derive_district_profile (cascade) and derive_district (on-demand) passed
region_baseline_c: None, so the D-243 §4 edge-fuzz blend was dead in production
and district temperature was still derived from scratch. Now both paths compute
region_baseline_at_district(...) and pass it through build_district_profile so
the two-phase modulation (D-243 §3) actually runs. The cascade path
(derive_all_districts) builds a BTreeMap<RegionPos, RegionProfile> covering all
district positions + their +/-1 neighbours once per body and looks up from it;
the on-demand path derives the four surrounding region baselines on the fly.
No production path passes None except genuinely airless bodies (no planet_class).

T3 — renamed BodyParams.district_latitude_deg -> latitude_deg (it is the region
centre latitude in the region fns, a call-site trap under the old name);
dual-scale doc; propagated to body_params_reader.rs and all literal sites.

Golden fixtures are unaffected (they construct districts directly via make_region,
bypassing build_district_profile) — derivation_harness 37/37 green, no re-pin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:30:33 +02:00
jpmschweitzerandClaude Opus 4.8 568370b7c2 fix(client): space proof moves past the stance cooldown — test_proof_corner_reveal flake (T-1037)
test_proof_corner_reveal drove moves back-to-back. The Gauntlet player is
Walk stance (ticks_per_move=2, server stance.rs), so a move arriving within
the cooldown window is silently throttled (movement.rs::apply_move ->
PlayerMoveCooldown::try_move). _send_and_receive returned the instant a move
landed, so the next send raced the cooldown and an occasional move was
dropped — leaving the player one tile short, which (via the test's cumulative
expectations) cascaded into the corner-reveal perception assert. A different
move dropped each run = flaky; exposed by the heavier post-cascade tick timing.

Test-side fix only — game behaviour is correct and the Gauntlet world is
immutable: after a move lands, wait for the server clock to advance
COOLDOWN_TICKS past the landing tick before the next send. Full client suite
2538/2538 green; the proof suite drops from ~28s (timeouts) to ~4s.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 16:24:13 +02:00
jpmschweitzerandClaude Opus 4.8 0bcc57d213 chore(meta): T-1042/T-1078 -> review (Batch A code-complete)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 14:06:03 +02:00
jpmschweitzerandClaude Opus 4.8 32010cc498 feat(simulation): cross-district parameter blending at chunk/voxel scale (T-1042)
Replaces the single-DistrictProfile walking-skeleton restriction so
continuous terrain parameters no longer step at the 2 km district pitch
(D-239 §4/§7/§8). ChunkContext gains secondary: Option<DistrictProfile> +
blend_weight: u8; derive_chunk_context detects a chunk within one chunk of
a district border, looks up the adjacent profile, and integer-blends
meander/channel params on the context. derive_voxel_column integer-blends
elev_q/moisture_q before material selection, reusing the same warp offset so
the seam cannot align with the chunk edge (Cow fast-path keeps interior
chunks bit-identical — golden seed unchanged).

Morphology FAMILY selection is never blended — stays sharp per D-239 §7
(family dispatch reads the primary district only). Climate feathering is the
separate T-1078 path. Adds cross_district_elevation_blend_reduces_seam_step
and cross_district_morphology_family_seams_stay_sharp to the derivation
harness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 14:05:48 +02:00
jpmschweitzerandClaude Opus 4.8 030e0907bc feat(simulation): region climate tier — baseline + district modulation + edge fuzz (T-1078)
Introduces the region (~205 km) climate tier per D-243 §3/§4, above the
DistrictProfile carrier. New region_profile.rs: RegionProfile/RegionClock,
derive_region_baseline_c (latitude lerp + greenhouse, D-240 class-envelope,
no orbit/star inputs), and region_baseline_at_district — the D-243 §4
edge-fuzz warp-perturbed bilinear blend of surrounding region baselines so
the ~205 km grid is invisible in the output.

Splits district temperature (D-243 §3): derive_district_temperature_c now
modulates the region baseline with elevation lapse only, replacing the
from-scratch per-district derivation. build_district_profile takes an
Option<f32> region baseline; None preserves the legacy single-phase path
(existing call sites unchanged). derive_cover (voxel.rs) consumes the
post-refactor value with no signature change.

Region clock (season/weather) scaffolded; transient tick callbacks deferred
to Q-105 per the two-phase convention. 14 region_profile + 5 district
modulation tests added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 14:05:37 +02:00
jpmschweitzerandClaude Opus 4.8 fcc9fcc4ec chore(meta): activate Batch A — T-1042/T-1078 in_progress, T-1046 done
/whats-next batch activation for the D-243 region-tier finish.
Refinement briefs (Si pass) appended to T-1042 and T-1078 reconciling
their 2026-06-12 scope against the post-T-1077 tree. T-1046 (Region→
Chunk→Voxel wiring) flipped to done — already committed in cfd5e18d0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 14:05:25 +02:00
jpmschweitzerandClaude Opus 4.8 cfd5e18d0a feat(client): district morphology generation overlay in the Atlas (T-1046, D-226)
Client half — the cascade's district tier is now visible in the Atlas map.

- protocol.gd: decode the district_grid field from AtlasLayerResponse.
- atlas_viewer.gd: a gen_district ('MRPH') toggle in OVERLAY_DEFS + the
  district-grid generation state (set/get) + wire it from the Ready response.
- atlas_marker_overlay.gd: _draw_gen_district() paints the coarse cols×rows grid,
  each cell coloured by its MorphologyZone discriminant (D-239 §6, 17-zone
  palette), semi-transparent under the Layer-1 line overlays. Planetary map view
  (not the 2km on-demand districts — those are Phase 5 in-world).

gdUnit4 test: overlay registered + district grid round-trips through the viewer
and the protocol decode. Visual tuning of the palette can follow once eyeballed
in the running Atlas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 12:55:59 +02:00
jpmschweitzerandClaude Opus 4.8 d03b4d1e09 feat(simulation): serve the coarse district/morphology grid through the Atlas proxy (T-1046)
Server half of wiring the derived tier into production. The D-225 proxy
(AtlasLayerResponse) carried only Layer1Output, so the Atlas could not show the
DistrictProfile tier that the cascade derives. Adds DistrictGridLayer (cols/rows
+ row-major MorphologyZone discriminants + elev_q for relief shading) and
build_district_grid(), populated on a cache hit. Because the response is
rmp_serde msgpack end-to-end, the new field reaches the client automatically.

This is the planetary-scale coarse grid (the Atlas map view); the on-demand 2km
derive_district (T-1077) is for in-world Phase 5, not the map. MorphologyZone
gains Copy (fieldless repr(u8) enum; additive).

Next: client decode (protocol.gd) + the D-226 generation overlay in the Atlas
viewer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 12:30:47 +02:00
jpmschweitzerandClaude Opus 4.8 d1fa785678 chore(meta): T-1077 -> review (D-243 re-scale code-complete)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 10:49:40 +02:00
jpmschweitzerandClaude Opus 4.8 e96ed0e9e4 feat(simulation): detail-scatter synthesis + on-demand 2km derive_district (T-1077)
Phase 3 of the D-243 re-scale — the corrected 2km carrier and its 'stretch
magic'.

- detail_scatter.rs: the mid-scale terrain (2-40km) invented between coarse
  heightmap samples. Locked character (T-1077): ADAPTIVE (ruggedness follows
  local slope/morphology -> gentle flats, rugged highs) + ENVELOPE+MODULATION
  (heightmap relief caps amplitude; morphology flavors within). Deterministic
  seed+position value-noise (D-227/D-010); C1-continuous, no lattice creases.
- derive_district(): the on-demand 2km carrier. Maps the district to a
  fractional heightmap pixel via body_radius_km (the elastic seam, D-204),
  bilinearly interpolates the L1 envelope, composes the scatter, derives the
  profile. body_radius None falls back to direct indexing (tiny test bodies).
- Factored build_district_profile() (climate+morphology tail) shared by the
  cell-aggregate and interpolation paths.

5 scatter tests + 5 derive_district tests (determinism, latitude->climate via
the seam, the envelope rule, radius fallback). Full suite + clippy -D warnings
green; existing goldens untouched (additive).

Scope: T-1077 delivers the corrected on-demand 2km derivation + scatter. The
eager-grid -> on-demand region/district production + Atlas surfacing (decision
A) is T-1046's chartered job (derive_all_districts stays the coarse Atlas grid
for now, documented).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 10:00:01 +02:00
jpmschweitzerandClaude Opus 4.8 b3b5bfc2e3 refactor(simulation): rename carrier RegionProfile->DistrictProfile + re-scale to the D-243 ladder (T-1077)
Phase 2 of the D-243 re-scale. The ~1km carrier is renamed and re-scaled to
the 2km district, and every consumer reads scale from the canonical scale.rs
instead of a local literal.

- region_profile.rs -> district_profile.rs; RegionProfile -> DistrictProfile,
  RegionPos -> DistrictPos (re-exported from scale::DistrictPos), derive_*_regions
  -> derive_*_districts, across all 10 consumers + the derivation harness.
- chunk_context now references scale:: for the carrier cell: district 1024m -> 2048m,
  shift 4 -> 5 (CHUNK_DISTRICT_SHIFT). This caught a real latent bug: the seed-district
  index used a literal '>> 4' while the anchor used the constant, so same-district
  chunks could derive different anchors — now both use scale::CHUNK_DISTRICT_SHIFT.
- derivation_harness scale literals ('>> 4', '* 1024', '0..16') converted to
  scale:: constants (the same drift the canonical source eliminates). Believability
  tests pass at 2km; the voxel determinism golden re-pinned (anchors moved with the
  re-scale — deterministic, intended).

Full suite + clippy --all-targets -D warnings green. The district DERIVATION still
tiles the heightmap at 8 cells (the old coarse path); replacing it with on-demand
heightmap interpolation + detail-scatter is phase 3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 22:53:18 +02:00
jpmschweitzerandClaude Opus 4.8 38054d4b12 feat(simulation): canonical spatial scale ladder + body_radius_km (T-1077)
First phase of the D-243 re-scale. Adds server/src/atlas/scale.rs as the
single source of truth for the metric containment ladder (voxel 1m -> chunk
64m -> block 128m -> quarter 512m -> district 2048m -> region 204.8km), the
fixed integer addressing (ChunkPos -> DistrictPos -> RegionPos), and the
elastic seam regions_per_equator(R). Compile-time const asserts enforce the
nesting so the rungs cannot silently drift again — the structural fix for the
Q-110 failure mode (three files, three different region sizes).

Wires body_radius_km (D-204) through BodyParams + the reader: the single
body-specific input to the elastic seam.

No behavior change — foundation only. The rename/re-scale of the carrier
(RegionProfile -> DistrictProfile) and on-demand district derivation follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 22:04:50 +02:00
jpmschweitzerandClaude Opus 4.8 e39ba89064 docs(governance): D-243 spatial scale ladder — resolve Q-110, Region→Province
Resolves Q-110 (region/chunk physical-scale anchoring), which had three
contradictory metres-per-scale assumptions in the cascade and no record
fixing metres-per-heightmap-pixel.

D-243 establishes a nested absolute-metre containment ladder with a single
elastic seam at planetary scale:
  voxel 1m -> chunk 64m -> block 128m -> quarter 512m -> district 2km
  -> region ~205km (100x100 districts) -> (elastic) -> planet
A body holds round(2*pi*R/204.8km) regions (the only per-body-floating
quantity); everything below is fixed integer math, so ChunkPos->RegionPos
is body-independent. The region is the largest hard block: the climate/
weather/season lockdown scale (the Q-105 cheap-dynamism source) and the
sane planetary grid. Sub-heightmap detail is invented deterministically
(interpolation + domain warp + detail-scatter, never stored, D-227); climate
is edge-fuzzed so the grid never shows ('climate does not change on a line').

Vocabulary locked and recorded in CLAUDE.md: 'region' = the 205km metric
cell only; the old 1km RegionProfile is dropped onto the 2km district; D-201
tier-4 'Region' renamed Province (the watershed/political overlay), amended
here. Refines D-239 §2 (district temperature now modulates a region baseline).

Implementation tickets: T-1077 (re-scale the code to the ladder + elastic-seam
resampling; blocks T-1046) and T-1078 (region climate stack + edge fuzz).
T-1046 is un-gated on Q-110 and now blocked only by T-1077.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 21:26:13 +02:00
jpmschweitzerandClaude Opus 4.8 8e44121391 chore(meta): update changelog
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 20:13:31 +02:00
jpmschweitzerandClaude Opus 4.8 c0d4ac89d1 feat(simulation): add Layer-2 inter-settlement road/rail graph (T-1038)
New deterministic cascade layer (CascadeLayer::RoadGraph) building the
transport topology between Layer-3 settlement placements, stored on
BodyWorldState.road_graph (session-cached, never serialized).

- MST force-connect (strict Kruskal over squared distance) + secondary
  links across a 30-60% body-scale band where the MST detours >1.5x.
- A* over the Layer-1 terrain-cost field on a coarse ~64-wide routing grid:
  ocean/lake impassable, river corridors 1/2 cost, slope >=35deg (D-210
  roughness ~0.7) 10x, else the D-210 terrain_modification_cost. Columns
  wrap (equirectangular); integer costs + index tie-break keep A*
  deterministic.
- MaintenanceAuthority per edge (new generator.rs enum) from endpoint
  political archetypes + haul length; waypoint nodes at long-edge midpoints;
  named-route identity join (designed-for, pool empty post-D-223); junction
  detection (high_connectivity_junctions, degree>=3).

Wired into the cascade (gen_queue requests CascadeLayer::RoadGraph). Adds
Copy to PoliticalArchetype. 10 road_graph unit tests + a cascade e2e test;
full suite + clippy --all-targets -D warnings green.

Deferred to T-1076 (gated on the D-242 settlement model): the RailHeadFacing
junction pass (needs a D-213 FoundingOrientation amendment + Layer-4 handling)
and the hub-selection refinement (needs baked population/specialization).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 20:13:26 +02:00
jpmschweitzerandClaude Opus 4.8 301be77b49 docs(governance): file D-242 corp-HQ settlement model + T-1074/1075/1076
Reviewing the T-1038 road-graph hub model surfaced that corp HQs are
cross-referenced into atlas_city_names as reserved rows — one per corp —
producing duplicate co-named "cities" (e.g. 10 'Groombridge' rows on
GJ380c) that the spatial layers place as separate settlements.

D-242 resolves the data model: corp HQs are not cities. The HQ relationship
lives with the corp; placement is a baked, specialization-keyed preference
(CityTenant vs Standalone, since corp_type is degenerate); population and
settlement_class are install-baked with only position seed-derived. This
supersedes the D-223 corp-HQ-cross-ref and deferred-pop/class notes.

Companion tickets under T-750: T-1074 (corp-HQ model / remove the cross-ref /
specialization map / standalone HQ settlements), T-1075 (bake per-settlement
population + settlement_class), T-1076 (road-graph hub refinement — scaled-cap
hubs, co-location collapse, hybrid minor attach, deferred RailHeadFacing pass;
blocked on T-1074 + T-1075). T-1038 annotated with shipped-vs-deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 20:13:10 +02:00
jpmschweitzerandClaude Fable 5 1044939748 chore(meta): close T-1067
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 20:15:04 +02:00
jpmschweitzerandClaude Fable 5 3c3fd0d0df chore(db): regen systems.db — stamp refresh after the T-1067 importer split
Content byte-identical (proven by the empty table-dump diff); the regen
records the new source-set SHA (registry + economy_import modules).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 20:13:41 +02:00
jpmschweitzerandClaude Fable 5 4f73624eff refactor(db): split import_economics.py; single generator-source registry (T-1067)
import_economics.py 2,620 → 309 lines — a thin orchestrator keeping the
exact CLI, single-transaction/rollback contract, and exit codes. The 16
import steps, MIGRATION_SQL, brands shell-out, validators, and stamp
write now live in tooling/economy-db/economy_import/ (db, migration,
economy, corporations, brands, bodies, atlas, specialization, traits,
validators, stamp, paths, errors). Full type hints throughout.

tooling/generator_sources.py replaces the triplicated source registry
(importer / stamp checker / pr-process watch list — the skill now derives
its list via --list). The registry stamps itself, and economy_import/
modules are globbed fail-closed, so a future module is stamped the moment
it exists — closing the silently-weakened-stamp failure mode.

Rider: connector config helpers centralized in tooling/db/common.py.

Byte-identical behavior proven: full-import table dump diff EMPTY over
107,843 lines / 37 tables (volatile timestamp fields excluded); dry-run
output parity; generated_brands.toml sha unchanged. make test-tooling
PASS; ruff clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 20:13:28 +02:00
jpmschweitzerandClaude Fable 5 5b3f18da65 chore(meta): close T-1062
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 17:08:41 +02:00
jpmschweitzerandClaude Fable 5 257d979aed refactor(simulation): split the input.rs and dialogue.rs dispatchers (T-1062)
input.rs 2,739 → 858 lines: per-domain action handlers moved to their
owning modules (inventory, movement, stance, examine, follow, interaction,
save_io, settings, bridge::debug, economy, vision_cone, bookmark,
test_world reset + new teleport.rs); input.rs keeps the queue, the thin
dispatch table, and pause/cooldown glue. All 9 type_complexity allows
dissolved via one PlayerInputQuery alias.

dialogue.rs → dialogue/ directory module: selection (631), response
(1,473), confrontation (714), mod.rs (226, shared session components +
re-exports — public paths preserved). Documented seam deviation:
process_walk_away lives with confrontation (D-064/D-063 share the same
world-response shape).

Mechanical, zero behavior change: determinism + golden_suite byte-identical
(independently re-verified); 1,504 lib tests unchanged — 23 input tests
moved with their subjects, 53 dialogue tests redistributed, zero deleted.
System scheduling registrations untouched (input_plugin.rs 0-line diff).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 17:07:36 +02:00
jpmschweitzerandClaude Fable 5 3a23378a88 style(engine): rustfmt — workers/pool.rs test module (gate fixup)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:32:14 +02:00
jpmschweitzerandClaude Fable 5 3a3e7c72fe chore(config): blocking client-test gate in pre-push (T-1065); amend D-067 chime duration
pre-push now runs the full gdUnit4 suite via tests/run-godot when client/
changed — blocking, ~100s, suite made green by T-973 and independently
re-verified. The tooling gate (make test-tooling on TOOLING_CHANGED, T-1066)
rides in the same hook. D-067 amended: the shipped chime is a deliberate
800ms synthesis (#327, ui.md UI-005); prose said 300-400ms. Ticket closes
for the maintenance wave in the changelog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:24:34 +02:00
jpmschweitzerandClaude Fable 5 eadbc5b24d chore(db): regen systems.db — stamp refresh after surname-corpus extraction
Generator output is byte-identical (verified on the full generated TOMLs);
the regen refreshes the meta stamp after generate_brands sources changed
(shared surname_corpus.rs) and import_economics.py registry/lint edits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:23:33 +02:00
jpmschweitzerandClaude Fable 5 b4919c659b chore(meta): wiki sweep — 2,131 dead heightmap links, nav refresh, GOVERNANCE reality (T-1070, T-1071)
- T-1070: scaffold_bodies.py heightmap link now conditional (bake criteria
  per import_heightmaps.py); surgical removal of the dead image line from
  all 2,131 body pages lacking the file (267 with the file keep theirs)
- T-1071: 26 real link breaks fixed (knowledge/→concepts/, pre-governance
  decision anchors, 9 phantom catalog companions unlinked, cygni relink to
  the corporation page, wrong design-doc path); wiki/index.md counts fixed
  (301 systems) + Economics nav section; corporations/index.md regenerated
  from frontmatter (all 155, tier1.toml grouping — corrects 4 misfiled
  tier-1 corps); 25 orphaned station GTTRs linked from 11 system pages
  (own ##-heading so atlas sync cannot absorb it); GOVERNANCE.md +
  star-system template rewritten to the generated model (DB owns
  structured fields, wiki owns prose); triangles/index.md added
- Sol markers conversion REVERTED before commit: atlas_viewer.gd:433 still
  renders the legacy geometry schema, so conversion would drop Sol's Atlas
  overlays — split to T-1073 (convert together with the client read path)

Broken relative links: 2,180 → 25 (all remaining are intentional
_templates/ placeholders).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:23:16 +02:00
jpmschweitzerandClaude Fable 5 346d87df7a chore(meta): docs/build sweep + tooling test gate (T-1069, T-1066)
- make test-tooling: planet-gen determinism guard + import_economics
  --dry-run, wired into pre-push on TOOLING_CHANGED; ruff widened to
  E4/E7/E9/F/W (90 safe auto-fixes applied; E402/E702/F841 ignored with
  documented counts)
- one-generator reality fixed in DEVOPS.md, asset-pipeline rule, CLAUDE.md
  (import_economics sole generator since #951/D-223); dead check-protocol
  target deleted; DEVOPS hook/config sections rewritten from the actual
  hook sources; team-patterns gate description updated (client+tooling)
- project.yaml: 0.2.0 → 0.4.0 per the 0.{phase}.{n} scheme, description
  refreshed from the v0.1 Sova narration to cascade reality
- stale comment sweep: voxel.rs stub claims (all 8 families implemented),
  cascade.rs TODO recited to T-1044, main.rs D-192 handshake claim,
  relationships.rs/chunk_streaming.rs version targets → phase language
- gitignore: client/settings.db* e2e-run artifacts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:22:55 +02:00
jpmschweitzerandClaude Fable 5 0bd895fcac chore(engine): server hygiene batch — workers tests, surname dedup, save pin (T-1063, T-1064)
- workers/pool.rs: 5 new tests; catch_unwind keeps worker threads alive on
  handler panic (in-flight request loss unchanged, pinned by test + #843
  docs); stubs.rs no longer falsely claims the pool is tested
- save/load: execute_save_load pinned .after(Storyteller) so the scheduler
  cannot legally save pre-Input state; exclusive-system exception recorded
  in tick_phases.rs rules
- surname corpus extracted to bin/shared/surname_corpus.rs (both economy
  generators import it; byte-identical output verified on 23.6MB+1.45MB
  TOMLs); all three stamp/watch registries updated
- generator_spike gated behind non-default 'generator-spike' feature
- economy.rs: 11 new D-181 signal-derivation tests on the new
  econ_sim Simulation::from_economy in-memory constructor
- perception exemption comments now state the consumer sort contract;
  unused bytemuck removed; rayon comment corrected; the 22 allow(dead_code)
  documented as serde schema enforcement

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:22:28 +02:00
jpmschweitzerandClaude Fable 5 c64231e8ee fix(client): clear the test debt — 2 production bugs, suite fully green (T-973 et al.)
Production fixes surfaced by honest test triage:
- hud_groups.gd: _set_group_z crashed on freed HUD nodes — the typed loop
  variable errors before the is_instance_valid guard runs; prune first
- fog_state.gd: _resize cleared _prev_visible (world-space keys survive
  resizes), so pre-resize tiles never decayed VISIBLE→EXPLORED (D-059)

Test debt (T-928/929/934/935/936/937/938/939, T-864, T-973): lambda
local-capture bugs rewritten with array captures (now assert exact
emission counts), e2e suites updated to the current handshake +
StartupMessage protocol and stream-aware reads against the live binary,
fog perf test measures steady state, chime test pins the shipped 800ms
catalog asset (D-067 amended separately), monologue gdUnit4 API typo,
battery-warning tests follow the MetaScreen on_open lifecycle. 3 sprint2
proof tests revived (corner_reveal had passed from the wrong tile — NPC3
blocks (18,14); route corrected). Soft-skips converted to real do_skip
reporting. T-1068: 7 orphan .gd.uid deleted, _format_pop/_format_radius
deduped into atlas_format.gd (preload, no class_name — headless cache).

Suite: 1264 cases/20 failures → 1268/0, independently re-verified
(2536/2536, exit 0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:22:01 +02:00
jpmschweitzerandClaude Fable 5 b7a8cd1876 chore(meta): close bug-run tickets T-1040/T-1041/T-1045 with fix notes
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:50:31 +02:00
jpmschweitzerandClaude Fable 5 993333facc style(engine): rustfmt — wrap long lines in bridge_tcp test + chunk_context gate (gate fixup)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:48:53 +02:00
jpmschweitzerandClaude Fable 5 408bd39e63 fix(simulation): region-anchor channels and linear landforms (T-1040, T-1041)
derive_chunk_context now derives channel_anchor_m and coast_anchor_m from
the Region-or-higher seed path (D-239 §10); all five voxel placement sites
measure distance to these anchors in continuous world coordinates:

- T-1040: compute_channel_state / compute_meander_reach_channel /
  in_levee_band subtract the region anchor instead of measuring from the
  world origin axis — active channels now exist in their chunks anywhere
  on the body, continuous across chunk boundaries. has_active_channel is
  honest in both directions (band-crossing gate; floor covers the
  BraidedDelta belt at short wavelengths).
- T-1041: fjord/cliff/gorge/delta drop their rem_euclid(64) chunk-frame
  folds — one valley/coastline/fan per region instead of one per chunk.
  D-239 §9 chokepoint widths preserved; two i32 wall-rise overflows on
  region-scale distances fixed by clamping before multiply.

Harness: 6 new believability tests (channel presence + gate honesty at
chunk (1000,-750), cross-boundary continuity, one-landform-per-region,
braid-belt confinement); drainage sweeps strengthened with anchor-band
chunks. Voxel golden regenerated deliberately: case A now pins a genuinely
in-channel Shallow voxel on the anchor, case C a Deep trough voxel
matching its label; case B byte-identical and L0/L1 cascade golden
untouched (no upstream leak). Review: approved, three minors addressed
(truncation-convention docs, delta gate floor, case C relocation).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:46:38 +02:00
jpmschweitzerandClaude Fable 5 49a74e93d4 fix(engine): TCP partial-read frame desync + per-tick inbound drain (T-1045)
FrameAccumulator state machine in framing.rs holds partial prefix/payload
bytes across non-blocking receive() calls — a frame split across TCP
segments no longer desyncs the stream (read_exact previously discarded
partially-consumed bytes on WouldBlock). receive_bridge_inputs now drains
all ready frames per tick (capped) instead of exactly one, covering input
batches + atlas requests in the same window.

Review hardening: EOF mid-frame escalates to Disconnected like clean EOF
(peer died with a truncated stream) instead of logging an Io error every
tick. Tests: frame split inside prefix / inside payload, multi-frame
drain, mid-frame-EOF disconnect. Corrupt-stream escalation tracked as
T-1072.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:42:24 +02:00
jpmschweitzerandClaude Fable 5 eec12c1ac2 chore(docs): drop the fable-ous filing ledger
The mapping is redundant: every filed record (T-1038..T-1071, Q-110..Q-122,
D-225/D-241 amendments) cites its audit stub ID in its own body, and the
ledger itself remains in history at d23d54b3d if ever needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:54:56 +02:00
jpmschweitzerandClaude Fable 5 d23d54b3d6 chore(meta): file the fable-ous audit — 27 tickets, 11 questions, D-225 amendment; retire the report
Completes the audit→records pass; fable-ous.md deleted, full stub→record
mapping preserved in docs/audits/2026-06-12-fable-ous-filing-ledger.md.

- Questions Q-112..Q-122: storyteller f32 vs bps, cross-platform goldens,
  NPC appearance contract, garments simulated-vs-visual, gdlint gate,
  whatsinagame extraction, empty wiki categories, generic-parent first
  slice, garment-token vocabulary, dress canon home, asset sourcing policy
- Audit notes appended to Q-067 (vehicle scope vs T-750 car list) and
  Q-107 (signature-materials field in the consolidation scope)
- D-225 amendment: next inbound message type requires a tagged envelope
- Tickets T-1045..T-1071 under T-750/T-749/T-751/T-1037, each embedding
  its evidence; audit maps embedded in T-1046 (cascade), T-1049 (asset
  matrix), T-1071 (wiki survey). Headline spine ticket: T-1046
- T-982 flipped stale-in_progress → backlog with verified-scope note

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:42:29 +02:00
jpmschweitzerandClaude Fable 5 27ed13e35b chore(meta): untrack spike binaries — local-only per D-241
416 binary files (~1.7 GB: .glb/.gltf/.bin/.png) removed from the index,
kept on disk; spikes/ keeps verdict/review markdown + spike code tracked
(61 files). .gitignore extended to cover model/texture/render binaries
under spikes/ going forward. Reproducible from purchased packs in
docs/assets/downloads/ + tracked scripts; zero markdown-embedded images
in spikes/, so no docs break. History rewrite deliberately NOT done —
recorded as out of scope in D-241. Closes fable-ous.md finding S-14.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:29:43 +02:00
jpmschweitzerandClaude Fable 5 ca255dc16c chore(meta): cascade refocus — supersede v0.2 cluster, re-home backlog tree, capture workshop WIP
Governance:
- D-166 amendment (2026-06-12): outside-in build order (geo → econ-on-world →
  building templates → door boundary contracts → NPC/interiors → gameplay);
  Phase 5 ramps in parallel once outsides are walkable (gate: T-962)
- D-114/D-115/D-117/D-118/D-120 marked superseded by D-166 (inbound anchors fixed)
- D-221 amended: milestones retired, cascade-hierarchy gating is canonical
- Q-077/Q-068/Q-036 resolved (answered by events); Q-110 (scale anchoring) and
  Q-111 (live-econ coupling) opened from cascade grounding

Ticket tree (147 stray backlog tickets dispositioned):
- New parents: T-1036 (post-cascade gameplay parking), T-1037 (maintenance initiative)
- Re-homed: 15 → Phase 4 (T-750), 30 → Phase 5 (T-749), 11 → Phase 6 (T-751),
  21 → gameplay parking, 28 → maintenance; children follow their epics
- Cancelled 12 administrative shells (mirror tickets, emptied pre-cascade umbrellas,
  v0.2 pivot shell T-603); T-9/T-28 closed done; T-745 in_progress
- New grounded tickets T-1038..T-1044: inter-settlement road/rail graph, L3→L4
  dispatch threading, river-channel-anchor bug, 64m landform-repeat bug,
  region seam blending, road-entry octants, drainage re-run fix

Docs:
- CLAUDE.md cascade paragraph updated to the amended rule
- 20 v0.1-era docs/design files marked superseded with pointers;
  content-structure-canonical retitled (v0.2 label dropped)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:26:32 +02:00
jpmschweitzerandClaude Opus 4.8 5adf2b8bd7 migrate ticket changelog to record_id identity (D-26)
Rewrites the committed .pql/changelog/ from the old T-NNN-keyed format to
the record_id identity model (pql 1.10.0, D-26): tickets keyed by a ULID
record_id, the friendly T-NNN in ticket_idmap, references and hashes
recomputed. Produced by the one-off cmd/migrate-ids in the pql repo.

Other clones: install pql >= 1.10.0, then rm .pql/pql.db && pql plan
rebuild to regenerate the local DB from this changelog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 09:29:34 +02:00