Commit graph Aetheria/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs
Author SHA1 Message Date
Meta Vens
a4e8e14718 Mining index: the index alone decides reach; tests pin what Stryker found loose
BeltTargets drops its own reach skip (TargetRegion.CanHold owns it) and an
empty-belt guard AsteroidBelt already makes unreachable. Tests add an
off-centre sun, whole-belt searches across the antipode, cost after time
passes, a late short step that re-keys nothing, and an entity search off the
origin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:25:32 +02:00
Meta Vens
6a79f87a64 Mining index tests: brute-force equality, bounds, pruning and cost
The two chunk-query tests compare sets through Zone.Targets.Within.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:02:52 +02:00
Meta Vens
83d8371e9c Mining Cut 3 tests: commit Soul's probes and the shipped field kind check
- AFirstLoadKindIsSavedFromACleanStore: FieldKinds.Ensure's kind is saved
  when the store was clean at load (ZoneData.cs:162).
- SetTargetRefusesALitChunkBeyondSight: a lit rock too far to see is
  refused (Entity.cs:345).
- TheChunkQueryMatchesBruteForce: 3000 random queries, off-origin, two
  belts, across the outer skip edge (Soul F7).
- ThePingArmIsUnchangedByTheGainExtraction: Soul's ping sweep, golden
  recorded at cb4a1dbd; kills the Sensor.cs:168 and :189 mutants.
- TheShippedCatalogHasAPickableFieldKind (Soul F2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 13:02:27 +02:00
Meta Vens
f88d1fc1b3 Mining Cut 3 fix: launchers do not count toward rock reach (Q12 A)
Weapon.CanMine is the one mining predicate; LockWeapon overrides it to
false. Entity.VisibleChunksInReach counts only weapons that can mine.

Tests: LaunchersDoNotCountTowardChunkReach (a launcher-only ship is offered
no rock; a gun of 200 beside a launcher of 400 is offered the near rock
only) and AnOfflineWeaponAddsNoReach (Soul F8: reach reads Active, not
Enabled).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 13:02:26 +02:00
Meta Vens
55ca6d3d22 Mining Cut 3 tests: non-degenerate fixtures the mutation probes exposed
- SensorGainExtractionChangesNothing traced a saturated sensor: a hull's own
  heat makes a ship ~800 bright, so the observer's info sat at 1 every tick and
  the hash pinned nothing (a hand probe dividing by the bearing response, and
  one pricing a ping as a passive tick, both survived). The scene now observes
  through a weak sensor (Dim eye, sensitivity 0.01) and asserts the trace is
  unsaturated and carries a visible ping. Golden re-recorded against the
  pre-extraction Sensor.Execute (cb4a1dbd with this scene patched in); the
  post-extraction code gives the same hash, 919B7EE7...
- Cycling reach fits its guns 250, 120, 350, so the last active gun is not the
  longest (a "last weapon wins" reach survived the old order).
- The weighted pick uses three positive weights, so a pick that falls through
  to the last kind is told apart (it survived with two).
- The chunk query runs around a belt centred off the origin.
- TargetRef hashes an entity target and None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 22:31:44 +02:00
Meta Vens
cb96f77c86 Mining Cut 3 tests: two-sensor parity, the cap at one, and a chunk's bearing
- ChunkInfoMatchesAnEntityHeldStillUnderTwoSensors pins that the settled value
  divides the summed rate by the number of sensors as well as the decay.
- ChunkInfoIsCappedAtOne pins the saturate the per-tick rule applies.
- AChunkTargetBearsThroughItsOwnPosition pins the arc gate reading a chunk's
  planar position (x and z, not swapped) and that a chunk never safes a weapon.
  The fixture's settings gain a 90-degree default arc for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 20:03:59 +02:00
Meta Vens
09d037cb41 Mining Cut 3 tests: tick a ship once before it looks, and open the shipped catalog copy scoped
A ship's equipment comes online on its first tick (UpdatePerformance), so a
sensor sees nothing before it: the chunk tests tick each observer once before
asking what it sees or picking a target. The generation test opens its copy of
the shipped catalog through a registry scoped to the shipped assembly, as
RestoredHullsTests does, so the test assembly's own catalog global is not
demanded of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 13:08:08 +02:00
Meta Vens
15723f4037 Mining Cut 3: a chunk is a target, detected by reflected light
- Entity.Target is one slot of TargetRef, read-only from outside
  (IReadOnlyReactiveProperty); Entity.SetTarget is its one writer. A chunk is
  taken only while the entity can see it, so a rock in darkness cannot be
  picked. Every handler, agent, turret and test writes through SetTarget.
- Entity.ChunkInfo (Q14 A): the value the per-tick sensor rule settles at,
  computed on demand through Sensor.PassiveRate/Sensor.Gain -- sum of the
  active sensors' passive rates over (sensors x TargetInfoDecay), capped at 1.
  Stored nowhere; no per-tick loop over chunks. ChunkVisible is the detection
  threshold through the chunk path.
- The lost-track rule reads through the chunk path: Activate's reconciliation
  and a per-tick check of the one slot drop a chunk target that has gone dark.
- Entity.VisibleChunksInReach (Q13 A): visible chunks within the longest range
  among active weapons -- the one reach rule for cycling and programmatic picks.
- Entity-only readers take .Entity: TargetedBy/TargetedByCount, target items,
  the stance gate (a chunk has no stance), lock (Q12 A: never on a chunk),
  turrets, Combat, Minion, FireControl (a chunk fires untargeted until Cut 4).
  TargetRange and the arc gate read a chunk's planar position.
- ActionGameManager: the reticle and next/previous offer visible ships and
  visible chunks in reach; nearest stays enemies-only; the target panel,
  indicator and fire-control debug take TargetRef. EntityInstance reads .Entity.
- MiningCut3Tests pin parity, darkness, monotone brightness, wear and break,
  reach, the chunk query, target survival and loss, TargetRef equality, lock,
  and field-kind assignment at generation and first load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:56:39 +02:00
Meta Vens
cb4a1dbd8a Mining Cut 3: record the per-tick detection trace before Sensor.Gain is extracted
SensorGainExtractionChangesNothing drives a fixed scene (two reflecting ships at
different ranges and bearings, a ping part way through) and pins the observer's
EntityInfoGathered trace, bit for bit, by hash. The golden value is recorded
against the pre-extraction Sensor.Execute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:55:29 +02:00