Commit Graph
2365 Commits
Author SHA1 Message Date
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
jpmschweitzerandClaude Opus 4.8 7776d99c14 test(simulation): isolate voice::lookup cache dirs — fix flaky cache_miss (T-1035)
The four voice::lookup tests shared one on-disk cache directory (base_dir
temp/sr-voice-lookup-test + world_seed 99). VoiceCacheStore persists on Drop
(save_all) and reloads on first zone access (load_zone), and cache_hit stores
'Voiced line.' under the identical (zone_id=100, CacheKey) that cache_miss looks
up — so under parallel execution the hit test's Drop/save could leak into the
miss test's lookup, returning 'Voiced line.' instead of 'Base line.'.

Give each test a directory keyed by test label + process id, so neither parallel
tests nor concurrent cargo test runs collide. Verified clean across repeated runs.

Closes T-1035.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 08:18:58 +02:00
jpmschweitzerandClaude Opus 4.8 4984d59bf4 fix(simulation): derive_moisture_q canonical hydrosphere vocab (T-1034)
derive_moisture_q matched hydrosphere on 'ocean'/'rivers'/'subsurface', but the
real bodies.hydrosphere vocab in systems.db is dominated by 'liquid_water' (175
bodies) — so most surface-water worlds fell to the '_ => 30' default, propagating
wrong precipitation_class / glaciation_grade / vegetation. Same root cause as
D-240 (code keyed on a vocab the data doesn't use).

Align the match to the canonical vocab, grouped by available surface moisture
(mirrors the [hydrosphere_maritime] table from T-1033): surface liquid
(liquid_water/ocean/ocean-coastal/extensive) -> 80; rivers/rivers-lakes/moderate
-> 55; ice -> 20; subsurface_liquid -> 15; subsurface/subsurface_ice -> 10;
minimal/trace -> 5; none -> 0. Add a liquid_water regression test and broaden the
clamp sweep to the full vocabulary.

Closes T-1034 — last open ticket under epic T-974 (Atlas-to-tile derivation),
which is now complete.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 23:01:43 +02:00
jpmschweitzer 839ac18460 Merge verification-harness — D-239 tile-derivation harness (T-1031, closes T-974) 2026-06-08 22:37:48 +02:00
jpmschweitzerandClaude Opus 4.8 5cc4ff6c0c test(simulation): address PR #165 review (T-1031)
Hoshe review findings — close silent-pass gaps in the §8 drainage tests:
- assert_drainage_monotonicity now returns whether it actually checked (chunk
  had both wet and dry tiles); the three sweep tests (Alluvial/Meander/Braided
  Delta) assert at least one chunk exercised the law, so a regression that
  zeroes all channels fails loudly instead of passing vacuously.
- The fjord-floor test scans the full 64x64 chunk instead of a single Y=32 row
  and asserts the deep-water trough exists, so the sea-level floor law can no
  longer be skipped by a probe that missed the trough.
- Remove the unreferenced make_test_terrain_analysis helper (was behind
  #[allow(dead_code)] with a 'future use' comment — the maintenance trap the
  review flagged); make_dry_terrain_analysis covers the validation bodies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 22:27:02 +02:00
jpmschweitzerandClaude Opus 4.8 de5f0f1e58 test(simulation): align T-1031 harness with D-240 class-envelope temps
Adapt the believability/budget verification harness to the T-1033 BodyParams
strip: validation-body fixtures (Kallast/Glødberg/Marevna) no longer set the
removed orbit/star fields (orbital_period_days, axial_tilt_deg, spectral_class,
star_type). Temperature is now derived from the planet_class envelope (D-240),
so the Marevna validation note/assertion is rewritten — oceanic band [-12,28]°C
+ maritime 0.6 + standard-atmosphere greenhouse yields ~+26°C at the equator
(was a stale ~-56°C orbit-equilibrium note). Add the seed→tile golden fixture
(tests/golden/derivation_harness.json) that the determinism regression locks.

Also fmt the harness and fix one clippy lint (iter().copied().collect() ->
to_vec()) — the file predated the pre-push gate's cargo-test/clippy coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:35:58 +02:00
jpmschweitzer b8f8a5fb23 Merge remote-tracking branch 'origin/main' into verification-harness 2026-06-08 19:25:27 +02:00
jpmschweitzerandClaude Opus 4.8 a943147843 test(simulation): believability + budget verification harness (T-1031)
D-239 §1/§8/§9/§10 verification harness (server/tests/derivation_harness.rs):
golden-seed determinism regression, §8 binding-law sweeps (drainage monotonicity,
lithology->landform, glaciation->form no-glacial-U-at-grade-0, climate->vegetation
no-skip + riparian), per-family <5ms/chunk budget assertion, and validation-case
bodies (Kallast=alluvial pass; Velen/Gruenfeld skipped-not-in-wiki). Exposes
derive_morphology_zone as pub for the integration test.

NOTE: golden file not yet generated + fixtures predate the T-1033 BodyParams strip;
fixed in follow-up commits after merging main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:25:18 +02:00
jpmschweitzerandClaude Opus 4.8 1897c0b450 chore(meta): T-1031 resume note (context reset handoff)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:22:10 +02:00
jpmschweitzerandClaude Opus 4.8 f34bcb431f chore(meta): T-1033 done (PR #164 merged) — class-envelope temperature
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:17:59 +02:00
jpmschweitzer 00fcb78988 Merge remote-tracking branch 'origin/class-envelope-temperature' 2026-06-08 19:14:50 +02:00
jpmschweitzerandClaude Opus 4.8 bafed6ad9a test+docs(simulation): address PR #164 re-review (maritime)
Re-review of the maritime moderation addition (Hoshe REQUEST_CHANGES, Tyre APPROVE):

- every_planet_class_derives_within_its_band now sweeps hydrosphere
  (none/ocean/liquid_water/rivers/ice) as well, so the maritime-compressed
  gradient path is covered by the band invariant — not just the None/1.0 case.
  (Hoshe #1, Tyre #1)
- Update the BodyParams.hydrosphere doc comment to the real systems.db vocabulary
  (liquid_water/ocean-coastal/extensive/etc.) the maritime table keys on. (Hoshe #2)

cargo test passes (the band sweep now ~59k in-band assertions), clippy -D warnings
clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:09:39 +02:00
jpmschweitzerandClaude Opus 4.8 b894a721ad feat(simulation): hydrosphere maritime moderation of temperature (T-1033, D-240)
Add the D-240 hydrosphere modulator: water-rich worlds compress the equator->pole
temperature gradient toward the band midpoint (milder at both ends); dry worlds
swing the full class band.

- [hydrosphere_maritime] table in climate_constants.toml + ClimateConstants
  field/method (maritime_factor). Keyed on the ACTUAL bodies.hydrosphere vocab
  (liquid_water/ocean/extensive=0.6, rivers/moderate=0.8, ice=0.85, subsurface*
  =0.9-0.95; minimal/trace/none/NULL -> 1.0).
- derive_temperature_c step 2 now lerps across a maritime-compressed sub-band
  (mid +/- band_half*factor) instead of the full band. Clamp still guarantees the
  class-band invariant.
- New maritime_hydrosphere_compresses_the_gradient test (ocean delta < dry delta).

Verified on real worlds: liquid_water/ocean temperate worlds now delta ~24 (milder)
vs dry ~40, all in-band. cargo test passes, clippy -D warnings clean, fmt clean.

Note: discovered derive_moisture_q has the SAME vocab mismatch (expects 'ocean',
DB uses 'liquid_water' for 175 bodies -> falls to default moisture). Pre-existing,
out of scope here — filing a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:53:26 +02:00
jpmschweitzerandClaude Opus 4.8 54609eab1a test+docs(simulation): address PR #164 review (both APPROVE)
- Band-invariant test now sweeps high altitude (6 km) as well as sea level, so
  the lapse term + cold-end clamp are exercised jointly, not lat alone. (Hoshe #1, Tyre #3)
- Clarify the temp() helper comment: seed 0 is deterministic but still applies a
  constant non-zero nudge. (Hoshe #2)
- (Hoshe #3: confirmed tectonic_activity is genuinely absent from systems-schema.sql;
  the reader's 'not in schema' comment is accurate — no change.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:36:41 +02:00
jpmschweitzerandClaude Opus 4.8 970bbb715e chore(meta): T-1033 -> review (PR for class-envelope temperature)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:30:14 +02:00
jpmschweitzerandClaude Opus 4.8 b6be9f5758 feat(simulation): planet_class temperature envelope, drop orbit/star inputs (T-1033, D-240)
Replace the sun-driven Stefan-Boltzmann temperature with the D-240 class-envelope
model. Temperature derives only from authored fields — no orbit/star physics.

- [planet_class_temperature] envelope table in climate_constants.toml (approved
  bands: frozen [-90,-25] .. hot_arid [20,58] .. volcanic [30,90]); cold_/hot_/
  warm_ prefix parsing; temperate fallback for unknowns.
- derive_temperature_c(params, constants, body_seed): band = envelope(planet_class);
  latitude lerps across it (equator=warm, pole=cold); atmosphere greenhouse +
  elevation lapse modulate within; small seed nudge for per-body variety; CLAMP to
  band — a body can never escape its class. Airless -> None.
- Delete the dead astrophysics: derive_distance_au, ClimateConstants::luminosity(),
  the [star_luminosity] table. Strip orbital_period_days/spectral_class/star_type/
  axial_tilt_deg from BodyParams + BodyParamsReader (read 3 cols from bodies, no
  star_systems join). DB columns left in place (no regen).
- New every_planet_class_derives_within_its_band test (13 classes x 5 atmo x 19 lat
  x 4 seeds, all in band) — the D-240 consistency guard.

Verified on 25 diverse real bodies: the worlds that derived to +356C now sit inside
their class bands (temperate capped at 28C). cargo test passes, clippy -D warnings
clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:28:24 +02:00
jpmschweitzerandClaude Opus 4.8 bf7da1105d docs(architecture): D-240 — registry orbit/star non-canonical; class-envelope climate (T-1033)
Record D-240: a body's orbital position and stellar assignment are placeholder
registry data with no authored physical intent, so no derivation may use them as
physical inputs. Climate derives from authored planet_class (temperature envelope)
+ atmosphere + hydrosphere + seed. Supersedes the sun-driven Stefan-Boltzmann
portion of D-239 §2, which produced +356 C 'temperate' worlds (NULL spectral_class
-> G-Sun default on an M-dwarf catalog).

File T-1033 under T-974: rewrite derive_temperature_c to the class-envelope model,
drop the orbit/star inputs, regen the T-1031 golden. Audit confirmed the blast
radius is one function (derive_temperature_c).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 18:06:49 +02:00
jpmschweitzerandClaude Opus 4.8 f519dc6e76 chore(meta): T-1030 done (PR #163 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:34:05 +02:00
jpmschweitzer 66e5c7cc31 Merge remote-tracking branch 'origin/freeze-snow-model' 2026-06-08 17:32:30 +02:00
jpmschweitzerandClaude Opus 4.8 88b4323585 fix(simulation): address PR #163 review (freeze/snow model)
Hoshe found a CRITICAL coherence defect (Tyre APPROVE):

- CRITICAL: cluster_scatter received the per-voxel sub_chunk_seed as its cluster
  seed, so voxels in the same 6m cell got different scatter -> salt-and-pepper,
  not the §3-mandated clustered patches. Re-key on (world, body, cluster-cell):
  add SeedDomain::Cover=10 (pinned); cluster_scatter(world_seed, body_id, x, y)
  derives for_body(world_seed,body_id).derive(Cover, cluster_pair_id). derive_cover
  now takes (world_seed, body_id, ...). (Hoshe #1)
- The coherence test was tautological (constant seed bypassed the broken path).
  Rewritten to the production derive_cover signature in a cold-lake scatter band;
  it FAILED at 20% on the old code, passes 100% now. (Hoshe #2)
- Zigzag-encode cluster (cx,cy) before Cantor pairing (negatives were cast as u64
  directly); fix the misleading 'no collision' comment. (Hoshe #3, Tyre)
- Sea-ice band was inverted (~85% ice at the -2 onset). Now monotonic: ice grows
  ~8% (onset) -> ~92% (cold edge); leads (open gaps) layered only in the cold half
  via a 3x super-cell, passing the super-cell index directly. Dead depth==0 guard
  removed. (Hoshe #4, Tyre #1/#3)

cargo test passes, clippy -D warnings clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:30:48 +02:00
jpmschweitzerandClaude Opus 4.8 22f1fd9462 chore(meta): T-1030 -> review (PR for freeze/snow model)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:16:48 +02:00
jpmschweitzerandClaude Opus 4.8 ed7380245d feat(simulation): static scattered freeze/snow model (T-1030)
D-239 §3 — the static mean-state freeze/snow cover. New SeasonalCover
{None,Snow,Ice} overlay axis on VoxelColumn (D-228 cover, NOT TerrainMaterial),
derived after the family generator in derive_voxel_column.

- Spatially-COHERENT cluster scatter (never per-tile dice): coarse 6m cluster
  cells (div_euclid) -> Cantor pair -> splitmix64 ^ sub_chunk_seed, so voxels in
  a cell share the freeze decision -> ragged patches. All integer (D-010).
- Bands by surface (classify_surface from morphology_zone + water): freshwater
  +5..-10C; salt water (OpenOcean) -2C onset / -14C, 3x-coarser sheets+leads;
  land snow +2..-10C, moisture-gated (moisture_q<30 -> None). Linear frozen
  fraction across the band; permanent below the band (poles/glaciers).
- Airless (temperature_c None) -> cover None.
- Transient/clock-bound layer (dawn frost melting by noon) doc'd as a Q-105
  forward contract; only the static model is built.

16 new cover tests incl real spatial-coherence (>=90% intra-cluster agreement),
band edges per surface, moisture gating, determinism. cargo test passes, clippy
-D warnings clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:15:07 +02:00
jpmschweitzerandClaude Opus 4.8 8f83785c8f chore(meta): T-1029 done (PR #162 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:44:27 +02:00
jpmschweitzer 93f94f8c38 Merge remote-tracking branch 'origin/morphology-geometry' 2026-06-08 16:42:48 +02:00
jpmschweitzerandClaude Opus 4.8 fb47f144f8 fix(simulation): address PR #162 review (morphology geometry)
Hoshe + Tyre CHANGES REQUESTED (§8 laws + D-010 confirmed clean):

- FjordWall floor 4+grade -> ~12m violated D-239 §9 (<=8m). Cap to
  glacier_grade.clamp(2,4) = 4-8m (still widens with glaciation, in-spec);
  add fjord_wall_floor_width_in_spec test. (Hoshe #1)
- BraidedDelta circular-distance wrap was one-sided (edge threads invisible).
  Fix to true modular distance: d.rem_euclid(64).min(64-d). (Tyre #1)
- BraidedDelta thread centres used correlated bit-slices of one u8 -> threads
  could merge. Derive 3 centres via independent splitmix64 passes (distinct
  salts) so separation holds across all phase values. Remove dead *64/64. (Tyre #2, Hoshe #4)
- Add N/S basin-direction guard asserts to the gorge + 2 fjord cross-section
  tests (were passing by seed luck). (Hoshe #2)
- meander_reach_stronger_sinuosity test was a tautology (|| elev_q!=elev_q
  always true). Rewrite: same elev_q, only morphology_zone differs, assert
  wet-tile sets differ -> fails if MeanderReach regresses to AlluvialPlain. (Hoshe #3)
- Fix FjordWall moraine + DuneStrand comments. (Tyre #3/#4)
- Lead: fix manual RangeInclusive::contains in the new fjord test.

cargo test passes (1457 lib), clippy -D warnings clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:40:38 +02:00
jpmschweitzerandClaude Opus 4.8 7c73e68827 chore(meta): T-1029 -> review (PR for morphology geometry generators)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:20:08 +02:00
jpmschweitzerandClaude Opus 4.8 311eabc51d feat(simulation): 7 specialized morphology geometry generators (T-1029)
D-239 §5/§8/§9 — replace the AlluvialPlain-fallback stubs with real per-family
geometry on the VoxelColumn pipeline. All integer (D-010); warp is the only f64.

- LavaField: Lava shield slopes + tube depressions, immature drainage (no deep water).
- FjordWall: Rock glacial U-valley — Deep-water floor, moraine band (grade>=1),
  near-vertical walls, cirques (grade>=2); floor half-width 4..8m (§9).
- CliffCoast: Rock vertical face at the water edge; plateau -> cliff -> splash -> ocean.
- BraidedDelta: Gravel, 3 braided threads (not single-thread), capped near sea level.
- DuneStrand: Sand, wind-aligned dunes at <=32deg angle of repose (integer ratio).
- IncisedGorge: Rock gorge, floor 2..8m wide (§9), near-vertical walls, single channel.
- MeanderReach: Soil single-thread meander (higher sinuosity than AlluvialPlain),
  thalweg below / levees above the waterline (§9 ElevationDelta); Wetland sub-zone.

§8 laws honoured: drainage monotonicity (mouths at sea level), lithology->landform,
glaciation->form (FjordWall U not V; grade-0 gated upstream at classification).
New helpers: compute_meander_reach_channel, in_levee_band.

53 family tests incl real geometry assertions (gorge floor width in [2,8]m, fjord
walls > floor, braided multi-thread, dune Sand). cargo test 1595 pass, clippy
-D warnings clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:13:40 +02:00
jpmschweitzerandClaude Opus 4.8 e6600c4a90 chore(meta): T-1028 done (PR #161 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:18:37 +02:00
jpmschweitzer a0ed4fbef4 Merge remote-tracking branch 'origin/voxel-walking-skeleton' 2026-06-08 14:57:18 +02:00
jpmschweitzerandClaude Opus 4.8 841e222192 fix(simulation): address PR #161 review (VoxelColumn skeleton)
Hoshe REQUEST_CHANGES + Tyre APPROVE:

- Cache key omitted world_seed → a cache reused across worlds could return
  another seed's column. CacheKey is now (world_seed, body_id_hash, voxel_pos).
  (Hoshe #1)
- Sub-chunk voxel seed reused SeedDomain::ChunkContext (tier-collision risk vs
  the region meander seed). Add SeedDomain::Voxel = 9 (append-only, pin test
  updated) and use it. (Hoshe #2, Tyre #1)
- get_or_derive forced callers to pre-compute body_id_hash while fnv1a_64 is
  pub(crate). Drop the param; compute the hash internally. (Tyre #2)
- Fix two inaccurate comments (micro-relief range [-4,+3] not ±2; scatter mask
  is 4-bit [0,15] not bits [4:6]). (Hoshe #3/#4)
- Strengthen the LRU eviction test: add a test-only contains_voxel() helper and
  assert WHICH entry was evicted (refreshed pos survives, LRU pos evicted). (Hoshe #5)
- LRU O(capacity)-scan perf flagged on T-1031 (Tyre #3, deferred to the budget harness).

cargo test passes, clippy -D warnings clean, fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 14:48:07 +02:00
jpmschweitzerandClaude Opus 4.8 0bcbc1573a chore(meta): note VoxelCache LRU perf on T-1031 (T-1028 review)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 14:47:56 +02:00
jpmschweitzerandClaude Opus 4.8 c40631aa53 chore(meta): T-1028 -> review (PR for VoxelColumn walking skeleton)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 14:38:12 +02:00