Record original-alignment implementation and traceability checkpoint

Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
Takeshi
2026-09-30 23:52:24 +09:00
parent 6077e02ebe
commit 5dde0c5ec2
490 changed files with 54051 additions and 809 deletions
+46
View File
@@ -15,6 +15,7 @@ func _initialize() -> void:
func _run() -> void:
var clock := root.get_node_or_null("GameClock")
if clock != null: clock.set_paused(true)
_test_paired_boarding()
_test_grouping()
_test_capacity_and_time()
_test_access_and_shared_cabin()
@@ -256,3 +257,48 @@ func _expect(condition: bool, label: String) -> void:
else:
_failures += 1
push_error("FAIL: %s" % label)
func _test_paired_boarding() -> void:
_setup(1)
for i: int in range(7): _request(StringName("a%d" % i), 0, 3, 1)
_expect(_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"], "rescue pair reserves two real seats")
var before := _elevators.create_snapshot()
_expect(_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"replay"] and _elevators.create_snapshot() == before, "pair retry is idempotent")
_tick()
_expect(_car()[&"passenger_count"] == 7 and _car()[&"waiting_count"] == 2, "one remaining seat never splits the rescue pair")
_expect(_elevators.get_actor_trip(&"medic")[&"state"] == _elevators.get_actor_trip(&"patient")[&"state"], "pair retains the same queued state")
var state := _elevators.create_snapshot()
var paths := _path.create_snapshot()
var arrivals := _tick(150)
var paired: Array[Dictionary] = []
for arrival: Dictionary in arrivals:
if arrival[&"actor_id"] in [&"medic", &"patient"]: paired.append(arrival)
_expect(paired.size() == 2 and paired[0][&"cell"] == paired[1][&"cell"], "both rescue passengers arrive at the same landing")
_expect(_path.restore_snapshot(paths) and _elevators.restore_snapshot(state), "queued pair and seat ownership restore")
_minute = state[&"current_minute"]
_expect(_tick(150) == arrivals, "queued pair replays exact arrivals")
_setup(1)
_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])
_expect(_elevators.cancel_actor(&"patient") and _elevators.get_report()[&"trips"].is_empty() and _path.get_active_elevator_request(&"medic").is_empty(), "queued cancellation releases both passengers")
_elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])
_tick(10)
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
_expect(not _elevators.cancel_actor(&"patient") and _elevators.create_snapshot() == state, "onboard pair cannot teleport out through cancellation")
var corrupt := state.duplicate(true)
corrupt[&"trips"][0][&"companion_id"] = &"missing"
_expect(not _elevators.restore_snapshot(corrupt) and _elevators.create_snapshot() == state, "orphan companion save is rejected atomically")
_expect(_elevators.restore_snapshot(state), "boarded pair restores")
var released := _elevators.set_powered(_config[&"shaft_id"], false, _minute)
_expect(released.size() == 2 and released[0][&"cell"] == released[1][&"cell"] and released[0][&"emergency"] and released[1][&"emergency"], "power loss unloads the pair together")
_expect(_elevators.restore_snapshot(_elevators.create_snapshot()), "emergency release leaves a valid snapshot")
_setup(1)
_request(&"patient", 0, 2, 1)
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
_expect(not _elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"] and _elevators.create_snapshot() == state and _path.create_snapshot() == paths, "conflicting pair reservation leaves all ownership unchanged")
_setup(1)
for i: int in range(ElevatorService.QUEUE_CAPACITY - 1): _request(StringName("crowd_%d" % i), 0, 3, 1)
state = _elevators.create_snapshot(); paths = _path.create_snapshot()
_expect(_car()[&"waiting_count"] == ElevatorService.QUEUE_CAPACITY - 1, "queue fixture has exactly one free request slot")
_expect(not _elevators.request_pair(&"medic", &"patient", Vector3i(0,0,1), Vector3i(0,3,1), 0, [&"staff"])[&"ok"] and _elevators.create_snapshot() == state and _path.create_snapshot() == paths, "second-member queue rejection rolls back first member and request sequence")
+13 -1
View File
@@ -16,7 +16,7 @@ func _run() -> void:
_state = load("res://autoload/game_state.gd").new()
_reset()
_expect(_runtime.path_service.get_vertical_walk_requires_connector(), "new Runtime requires explicit vertical transport")
_expect(_runtime.definition_registry.facility_count() == 18, "Runtime registers baseline16 and two staircase definitions")
_expect(_runtime.definition_registry.facility_count() == 23, "Runtime registers baseline16, stairs, infirmary and premium room/dormitory and chapel")
var before: Dictionary = _runtime.create_snapshot()
var invalid := _command(&"build_facility", {&"definition_id": &"guest_stairs", &"origin": Vector3i(4, 3, 0)})
_expect(not invalid.is_success() and invalid.details.get(&"reason") == &"STAIR_LANDING_MISSING", "stairs without a lower landing reject before any construction")
@@ -94,6 +94,7 @@ func _test_legacy() -> void:
var data: Dictionary = legacy[&"systems"][&"runtime"]
data[&"runtime_schema_version"] = 8
data.erase(&"legacy_stairs")
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(data)
data[&"path"][&"schema_version"] = 4
data[&"path"].erase(&"vertical_walk_requires_connector")
data[&"path"].erase(&"transit_actor_ids")
@@ -103,6 +104,17 @@ func _test_legacy() -> void:
var route: Array = _runtime.path_service.find_path(Vector3i(4, 0, 0), Vector3i(4, 2, 0))
_expect(route.size() == 3 and _runtime.path_service.calculate_path_cost(route) == 200, "old corridor stairs retain their original speed and reachability")
var canonical: Dictionary = _runtime.create_snapshot()
var preview := WorldPreview.new()
preview.size=Vector2(1280,720)
preview.set_runtime(_runtime)
preview.layer_mode=WorldPreview.LayerMode.BACK
preview.reset_view()
var ghost_ids: Array = []
for item: Dictionary in preview._other_layer_rooms():
if item.get(&"legacy_stair",false): ghost_ids.append(item[&"id"])
_expect(ghost_ids.size()==2 and ghost_ids.has(records[0][&"id"]) and ghost_ids.has(records[1][&"id"]), "opposite-layer view renders each actually migrated legacy connector once")
preview.free()
_expect(_runtime.create_snapshot()==canonical,"migrated legacy visualization does not alter canonical save or routes")
_expect(_runtime.restore_snapshot(canonical) and _runtime.create_snapshot() == canonical, "migrated save is canonical and migration does not repeat")
var malformed := canonical.duplicate(true)
malformed[&"systems"][&"runtime"][&"legacy_stairs"][&"stairs"].pop_back()
+45 -1
View File
@@ -93,12 +93,56 @@ func _verify_mid_ride() -> bool:
_expect(bool(_runtime.save_to_path(save_path).get(&"ok", false)), "boarded save writes isolated disk slot")
_expect(bool(_runtime.load_from_path(save_path).get(&"ok", false)), "boarded disk slot reloads")
var snapshot: Dictionary = _runtime.create_snapshot()
_expect(snapshot[&"systems"][&"runtime"][&"runtime_schema_version"] == 9, "runtime schema9 records elevator state and explicit vertical routing")
_expect(snapshot[&"systems"][&"runtime"][&"runtime_schema_version"] == 13, "runtime schema13 records elevator state and explicit vertical routing")
_expect(_runtime.restore_snapshot(snapshot), "mid-ride Runtime snapshot restores actor/cabin/Path ownership")
var shaft: Dictionary = _runtime.elevators.get_report()[&"shafts"][0]
var busy := _cmd(&"demolish_facility", {&"instance_id": shaft[&"module_ids"][1]})
_expect(not busy.is_success() and busy.details.get(&"reason") == &"ELEVATOR_BUSY", "occupied shaft demolition rejected before spending or topology changes")
_expect(_runtime.restore_snapshot(snapshot), "snapshot resets rejected command metadata")
# Diagnose total reserve depletion while a natural passenger is aboard.
var riders: Array[StringName] = []
for trip: Dictionary in _runtime.elevators.get_report()[&"trips"]:
if trip[&"state"] == PathService.ELEVATOR_REQUEST_BOARDED:
riders.append(trip[&"actor_id"])
_expect(not riders.is_empty(), "depletion drill starts with actual boarded passenger")
_state.set_resource(&"mana", 0)
_clock.advance_minutes(1)
var outage: Dictionary = _runtime.elevators.get_report()
_expect(not outage[&"shafts"][0][&"powered"] and outage[&"trips"].is_empty(), "reserve outage stops cabin and releases trip ownership")
for actor_id: StringName in riders:
_expect(_runtime.path_service.get_active_elevator_request(actor_id).is_empty(), "outage releases Path passenger request")
var safe_arrivals := 0
for event: SimulationDomainEvent in _runtime.domain_events.recent_events():
if event.event_type == &"ELEVATOR_ARRIVED" and event.absolute_minute == _clock.absolute_minute and event.payload.get(&"actor_id", &"") == actor_id and bool(event.payload.get(&"emergency", false)):
if event.payload.get(&"cell") in shaft[&"stops"]:
safe_arrivals += 1
_expect(safe_arrivals == 1, "boarded passenger alights exactly once at a valid shaft stop")
var outage_snapshot: Dictionary = _runtime.create_snapshot()
_expect(_runtime.restore_snapshot(outage_snapshot), "emergency alighting and empty reserve survive Runtime save")
_state.set_resource(&"mana", 100)
_clock.advance_minutes(1)
_expect(_runtime.elevators.get_report()[&"shafts"][0][&"powered"], "cabin supply returns when reserve recovers")
_expect(_runtime.restore_snapshot(snapshot), "rewind depletion drill to original passenger state")
for cell: Vector3i in shaft[&"stops"]:
_runtime.path_service.configure_cell_traffic(cell, 4, 0, true)
_state.set_resource(&"mana", 0)
_clock.advance_minutes(1)
for actor_id: StringName in riders:
_expect(_runtime.elevators.get_actor_trip(actor_id).get(&"state") == PathService.ELEVATOR_REQUEST_BOARDED, "no safe landing retains boarded passenger instead of teleporting")
var held_shaft: Dictionary = _runtime.elevators.get_report()[&"shafts"][0]
_clock.advance_minutes(20)
var held_after: Dictionary = _runtime.elevators.get_report()[&"shafts"][0]
_expect(held_after[&"remaining_minutes"] == held_shaft[&"remaining_minutes"], "powerless held cabin does not advance physical journey")
var held_snapshot: Dictionary = _runtime.create_snapshot()
_expect(_runtime.restore_snapshot(held_snapshot) and _runtime.create_snapshot() == held_snapshot, "no-landing outage preserves full Runtime save and passenger ownership")
for cell: Vector3i in shaft[&"stops"]:
_runtime.path_service.configure_cell_traffic(cell)
_state.set_resource(&"mana", 100)
_clock.advance_minutes(45)
for actor_id: StringName in riders:
_expect(_runtime.elevators.get_actor_trip(actor_id).is_empty() and _runtime.path_service.get_active_elevator_request(actor_id).is_empty(), "landing repair and power restoration release held trip ownership")
_expect(_runtime.restore_snapshot(_runtime.create_snapshot()), "recovered held cabin remains saveable")
_expect(_runtime.restore_snapshot(snapshot), "restore original ride after no-landing drill")
_clock.advance_minutes(45)
var expected: Dictionary = _runtime.create_snapshot()
_expect(_runtime.restore_snapshot(snapshot), "rewind boarded save for deterministic replay")
@@ -68,7 +68,7 @@ func _run() -> void:
for guest: GuestRuntime in _runtime.guest_service.get_guests():
_expect(guest.current_cell == Vector3i.ZERO and _runtime.path_service.get_actor_projected_cell(StringName("guest:" + String(guest.guest_id))) == Vector3i.ZERO, "migration preserves actual passenger's logical boarding anchor")
var canonical: Dictionary = _runtime.create_snapshot()
_expect(canonical[&"systems"][&"runtime"][&"runtime_schema_version"] == 9 and canonical[&"systems"][&"runtime"][&"path"][&"schema_version"] == 5, "resave emits current Runtime9 and Path5 only")
_expect(canonical[&"systems"][&"runtime"][&"runtime_schema_version"] == 13 and canonical[&"systems"][&"runtime"][&"path"][&"schema_version"] == 5, "resave emits current Runtime13 and Path5 only")
_expect(_runtime.restore_snapshot(canonical) and _runtime.create_snapshot() == canonical, "canonical migrated save reloads exactly without applying density or stairs twice")
forged = canonical.duplicate(true)
forged[&"systems"][&"runtime"][&"path"][&"transit_actor_ids"].pop_back()
@@ -112,6 +112,7 @@ func _as_v8_path4(current: Dictionary) -> Dictionary:
var data: Dictionary = result[&"systems"][&"runtime"]
data[&"runtime_schema_version"] = 8
data.erase(&"legacy_stairs")
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(data)
var path: Dictionary = data[&"path"]
path[&"schema_version"] = 4
path.erase(&"vertical_walk_requires_connector")
+5 -1
View File
@@ -15,12 +15,13 @@ func _run() -> void:
var clock: Variant = fixture[&"clock"]
clock.advance_minutes(3)
var current: Dictionary = runtime.create_snapshot()
_expect(current[&"systems"][&"runtime"][&"runtime_schema_version"] == 9, "Runtime emits schema9 with elevator and explicit vertical-route aggregates")
_expect(current[&"systems"][&"runtime"][&"runtime_schema_version"] == 13, "Runtime emits schema13 with elevator and explicit vertical-route aggregates")
var legacy := current.duplicate(true)
var data: Dictionary = legacy[&"systems"][&"runtime"]
data[&"runtime_schema_version"] = 7
data.erase(&"elevators")
data.erase(&"legacy_stairs")
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(data)
data[&"path"][&"schema_version"] = 3
data[&"path"].erase(&"vertical_walk_blockers")
data[&"path"].erase(&"vertical_walk_requires_connector")
@@ -28,6 +29,8 @@ func _run() -> void:
_expect(runtime.restore_snapshot(legacy), "genuine v7 without lifts migrates from Path3 into Runtime9")
var migrated: Dictionary = runtime.create_snapshot()
var expected := current.duplicate(true)
expected[&"systems"][&"runtime"][&"facility_upkeep"] = preload("res://tests/fixtures/pre_upkeep_runtime.gd").migrated_accrual(clock.absolute_minute)
expected[&"systems"][&"runtime"][&"weather"] = preload("res://tests/fixtures/pre_upkeep_runtime.gd").migrated_weather(clock.absolute_minute)
# Closing the old implicit-WALK topology bumps only the Path graph revision.
expected[&"systems"][&"runtime"][&"path"][&"graph_revision"] += 1
_expect(migrated == expected, "empty-lift migration preserves all state except the explicit topology revision")
@@ -113,6 +116,7 @@ func _test_attendance_migration() -> void:
data[&"runtime_schema_version"] = 7
data.erase(&"elevators")
data.erase(&"legacy_stairs")
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(data)
data[&"path"][&"schema_version"] = 3
data[&"path"].erase(&"vertical_walk_blockers")
data[&"path"].erase(&"vertical_walk_requires_connector")