Real CONTRABAND development case

Keros arrival distance: two paths, two positions

A Martinez AI Studios education product

Last Run taught a real Keros ↔ Belu warp. The return jump did not share the scripted near-dock pose.

CONTRABAND’s tutorial (Last Run) has two distinct arrivals at Keros. The first is a scripted teleport. The second is a player map warp from Belu. Those are not the same function. Treating a station-local offset as a world position parked the return near the origin — about 795–798 m HUD from the dock — instead of the intended near-dock band.

Category
State ownership
Project
CONTRABAND
Recorded
2026-08-19
Status
Verified · published

1. Symptom

After the Belu → Keros map jump, the ship was not next to the Keros station. HUD distance sat near ~798 m. The first scripted arrival at Keros still used a vista pose. Opening the map and selecting Belu did not count as arriving; only a physical system change did.

2. Player impact

The map lesson ended with a ship stranded far from the dock it had just “arrived” at. Chapter 1 handoff and the “basic training complete” beat depended on physically being at Keros, so a wrong pose made the tutorial feel broken even when the system id was correct.

3. Reproduction

Play Last Run through the map lesson: jump Keros → Belu for real, reopen the map, jump Belu → Keros. Compare HUD metres to the station with the first scripted Keros placement. Regression tests reconstruct the fault by adding the station local offset (190, 72, 0) as if it were world space.

4. System ownership

Last Run map/flight rules live in last-run-map-lesson.js (pure, no warp of their own). Actual placement is owned by galaxy arrival / Last Run runtime. Generic warp uses _computeWarpArrivalPosition. Scripted first Keros uses _teleportToKeros. Comments in source name those two arrivals as different functions.

5. Incorrect assumption

If currentSystemId === "keros", the ship is “at Keros” in a way the player can use. Also: a station-local offset can be applied as a world sample. Also: one warp-arrival helper is enough for tutorial and campaign.

6. Root cause

The Belu → Keros near-dock used the station’s local offset as if it were already in world space, which parked the ship near the origin (~795 m HUD in the reconstruction). The map warp path did not reuse the scripted near-dock anchor. Later entries record the generic warp helper still placing the second jump outside the 80–100 m HUD dock band until Last Run applied the same near-dock hook (~90 m).

7. Minimal fix

Rebuild the dock anchor on Keros’s visual host, discard an untrusted local sample, and apply near-dock on complete even if a flag was already set. Keep first-Keros vista, generic warp, and death respawn unchanged. The second Last Run arrival (Belu → Keros, map leg to_keros, outbound already arrived) is the only path that must use the near-dock hook.

8. Regression test

last-run-map-warps.test.mjs asserts: selecting Belu without arrival does not complete Last Run; warping is not physical arrival; the local-offset-as-world reconstruction is too far; trusted dock samples produce the 80–100 m HUD band; lastRunSecondKerosArrivalUsesNearDock is true only for the Belu → Keros Last Run return.

9. Release validation

Recorded in the CONTRABAND development log for 19 August 2026 across v0.4.155–v0.4.157 (near-dock rebuild, 80–100 m band, second jump also ~90 m). Last Run Electron QA remains part of the later qa:release gate; this incident’s contract is the unit file above.

10. Generalized lesson

System id is not pose. Two entry paths that share a label still need a shared placement contract. Mixing local and world spaces looks like a “warp bug” to the player and like a one-line vector add to an AI assistant. Own one arrival policy per intent (vista vs near-dock) and test metres, not only flags.

Before / after

Before: return jump ~795–798 m from dock (local offset treated as world); first arrival still vista. After: Belu → Keros Last Run return uses the near-dock anchor (~80–100 m HUD, log ~90 m); first scripted Keros vista unchanged; generic warp and respawn unchanged.

Simplified excerpt

Simplified / pseudocode for teaching. Not a dump of production files.

The test reconstruction of the world/local mix-up. Not production source.

// Simplified teaching excerpt — not CONTRABAND production source.
const stationLocal = { x: 190, y: 72, z: 0 };

// Wrong: treat local dock offset as a world sample (~795 m HUD in the test).
const wrongWorld = stationLocal;

// Right: rebuild dock on the Keros visual host, then apply near-dock offsets.
const dockWorld = kerosHost.position.clone().add(stationLocal);
placeNearDock(kerosStar, dockWorld);

// Arrival #1 = scripted teleport. Arrival #2 = Belu→Keros map warp.
// lastRunSecondKerosArrivalUsesNearDock is true only for #2.

Public evidence

  • CONTRABAND development log, 19 Aug 2026, v0.4.155–v0.4.157 (Keros near-dock / second jump).
  • last-run-map-warps.test.mjs (dock metres, two arrival paths, map completion rules).
  • last-run-map-lesson.js comments and lastRunSecondKerosArrivalUsesNearDock; galaxy-arrival trusted dock samples.

Related flagship modules

Related notes