Add explicit stairs and measure elevator congestion with real actors
This commit is contained in:
@@ -381,8 +381,11 @@ func _test_v3_migration_and_v4_tamper_guards() -> void:
|
||||
v3_runtime[&"runtime_schema_version"] = 3
|
||||
v3_runtime.erase(&"kitchen_production")
|
||||
v3_runtime.erase(&"elevators")
|
||||
v3_runtime.erase(&"legacy_stairs")
|
||||
v3_runtime[&"path"][&"schema_version"] = 3
|
||||
v3_runtime[&"path"].erase(&"vertical_walk_blockers")
|
||||
v3_runtime[&"path"].erase(&"vertical_walk_requires_connector")
|
||||
v3_runtime[&"path"].erase(&"transit_actor_ids")
|
||||
v3_runtime.erase(&"operations")
|
||||
v3_runtime.erase(&"catalog_manifest")
|
||||
v3_runtime.erase(&"progression")
|
||||
@@ -399,10 +402,10 @@ func _test_v3_migration_and_v4_tamper_guards() -> void:
|
||||
_expect(int(_runtime.progression_service.metrics[&"guest_lifetime"]) == 2, "v3 migration derives lifetime Guests from active plus persistent records")
|
||||
_expect(_runtime.get_mvp_guest_definition_ids().size() == 32, "v3 migration registers the current 32 catalog definitions")
|
||||
var migrated: Dictionary = _runtime.create_snapshot()
|
||||
_expect(int(migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 8, "v3 migration emits canonical Runtime schema v8")
|
||||
_expect(int(migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 9, "v3 migration emits canonical Runtime schema v9")
|
||||
var digest := SimulationDigest.compute(migrated)
|
||||
_expect(_runtime.restore_snapshot(migrated), "canonical v8 snapshot restores")
|
||||
_expect(SimulationDigest.compute(_runtime.create_snapshot()) == digest, "canonical v8 restore is exact")
|
||||
_expect(_runtime.restore_snapshot(migrated), "canonical v9 snapshot restores")
|
||||
_expect(SimulationDigest.compute(_runtime.create_snapshot()) == digest, "canonical v9 restore is exact")
|
||||
|
||||
var progressed_legacy: Dictionary = v3.duplicate(true)
|
||||
progressed_legacy[&"game_state"][&"world_tree_rank"] = 2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends SceneTree
|
||||
|
||||
const FOURTEEN_DAYS_MINUTES := 14 * SimulationKernel.MINUTES_PER_DAY
|
||||
const RUNTIME_SNAPSHOT_VERSION := 8
|
||||
const RUNTIME_SNAPSHOT_VERSION := 9
|
||||
|
||||
var _checks := 0
|
||||
var _failures := 0
|
||||
@@ -15,7 +15,7 @@ func _run() -> void:
|
||||
print("MVP: production Operations acceptance")
|
||||
_test_waiting_choice_and_command_exactly_once()
|
||||
_test_twenty_four_hour_actual_tick_smoke()
|
||||
_test_full_partial_payroll_bankruptcy_and_v8_tamper()
|
||||
_test_full_partial_payroll_bankruptcy_and_v9_tamper()
|
||||
_test_fourteen_day_boundary_snapshot_determinism()
|
||||
await process_frame
|
||||
if _failures == 0:
|
||||
@@ -39,7 +39,7 @@ func _new_fixture(seed: int, enable_operations := true) -> Dictionary:
|
||||
int(initial_snapshot[&"systems"][&"runtime"].get(
|
||||
&"runtime_schema_version", -1
|
||||
)) == RUNTIME_SNAPSHOT_VERSION,
|
||||
"fixture emits Runtime snapshot schema v8"
|
||||
"fixture emits Runtime snapshot schema v9"
|
||||
)
|
||||
if enable_operations:
|
||||
var enabled: Dictionary = runtime.enable_production_operations()
|
||||
@@ -217,7 +217,7 @@ func _test_waiting_choice_and_command_exactly_once() -> void:
|
||||
var command_snapshot: Dictionary = runtime.create_snapshot()
|
||||
_expect(
|
||||
runtime.restore_snapshot(command_snapshot),
|
||||
"command history survives an exact v8 snapshot round trip"
|
||||
"command history survives an exact v9 snapshot round trip"
|
||||
)
|
||||
var restored_retry: CommandResult = runtime.submit_command(
|
||||
&"change_resources",
|
||||
@@ -257,12 +257,12 @@ func _test_twenty_four_hour_actual_tick_smoke() -> void:
|
||||
_expect(
|
||||
runtime.restore_snapshot(snapshot)
|
||||
and runtime.latest_digest == SimulationDigest.compute(snapshot),
|
||||
"24-hour actual-tick v8 snapshot round trip is exact"
|
||||
"24-hour actual-tick v9 snapshot round trip is exact"
|
||||
)
|
||||
_free_fixture(fixture)
|
||||
|
||||
|
||||
func _test_full_partial_payroll_bankruptcy_and_v8_tamper() -> void:
|
||||
func _test_full_partial_payroll_bankruptcy_and_v9_tamper() -> void:
|
||||
var fixture := _new_fixture(73_002, false)
|
||||
var runtime: Variant = fixture[&"runtime"]
|
||||
var clock: Variant = fixture[&"clock"]
|
||||
@@ -349,7 +349,7 @@ func _test_full_partial_payroll_bankruptcy_and_v8_tamper() -> void:
|
||||
var terminal_digest := SimulationDigest.compute(terminal_snapshot)
|
||||
_expect(
|
||||
runtime.restore_snapshot(terminal_snapshot),
|
||||
"BANKRUPT terminal v8 snapshot restores without clearing terminal state"
|
||||
"BANKRUPT terminal v9 snapshot restores without clearing terminal state"
|
||||
)
|
||||
clock.advance_minutes(180)
|
||||
_expect(
|
||||
@@ -362,32 +362,32 @@ func _test_full_partial_payroll_bankruptcy_and_v8_tamper() -> void:
|
||||
"BANKRUPT cannot be acknowledged away"
|
||||
)
|
||||
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
tampered[&"systems"][&"runtime"][&"operations"][&"personal_action_points"] = 99,
|
||||
"v8 rejects an out-of-range Operations action-point total"
|
||||
"v9 rejects an out-of-range Operations action-point total"
|
||||
)
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
tampered[&"systems"][&"runtime"][&"next_command_id"] = int(
|
||||
tampered[&"systems"][&"runtime"][&"next_command_id"]
|
||||
) + 1,
|
||||
"v8 rejects command high-water gaps"
|
||||
"v9 rejects command high-water gaps"
|
||||
)
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
var accepted: Array = tampered[&"systems"][&"runtime"][&"command_queue"][&"accepted"]
|
||||
if not accepted.is_empty():
|
||||
accepted[0][&"idempotency_key"] = &"tampered.accepted.key",
|
||||
"v8 rejects accepted-command/idempotency cross-link tampering"
|
||||
"v9 rejects accepted-command/idempotency cross-link tampering"
|
||||
)
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
@@ -395,26 +395,26 @@ func _test_full_partial_payroll_bankruptcy_and_v8_tamper() -> void:
|
||||
summaries[0][&"category_totals"][&"wages"] = int(
|
||||
summaries[0][&"category_totals"][&"wages"]
|
||||
) + 1,
|
||||
"v8 rejects DaySummary/payroll wage reconciliation tampering"
|
||||
"v9 rejects DaySummary/payroll wage reconciliation tampering"
|
||||
)
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
tampered[&"systems"][&"runtime"][&"unexpected_v8_field"] = true,
|
||||
"v8 rejects unknown Runtime fields"
|
||||
tampered[&"systems"][&"runtime"][&"unexpected_v9_field"] = true,
|
||||
"v9 rejects unknown Runtime fields"
|
||||
)
|
||||
_assert_v8_tamper_rejected(
|
||||
_assert_v9_tamper_rejected(
|
||||
runtime,
|
||||
terminal_snapshot,
|
||||
func(tampered: Dictionary) -> void:
|
||||
tampered[&"systems"][&"runtime"][&"operations"][&"coordinator"][&"unexpected_field"] = true,
|
||||
"v8 rejects unknown Coordinator fields"
|
||||
"v9 rejects unknown Coordinator fields"
|
||||
)
|
||||
_free_fixture(fixture)
|
||||
|
||||
|
||||
func _assert_v8_tamper_rejected(
|
||||
func _assert_v9_tamper_rejected(
|
||||
runtime: Variant,
|
||||
canonical: Dictionary,
|
||||
mutator: Callable,
|
||||
@@ -463,7 +463,7 @@ func _test_fourteen_day_boundary_snapshot_determinism() -> void:
|
||||
var resumed_clock: Variant = resumed[&"clock"]
|
||||
var resumed_runtime: Variant = resumed[&"runtime"]
|
||||
var restored: bool = resumed_runtime.restore_snapshot(midpoint)
|
||||
_expect(restored, "fresh Runtime restores the enabled v8 midpoint snapshot")
|
||||
_expect(restored, "fresh Runtime restores the enabled v9 midpoint snapshot")
|
||||
var resumed_advanced := 0
|
||||
if restored:
|
||||
resumed_advanced = _advance_operations_boundary_slice(
|
||||
|
||||
@@ -57,7 +57,7 @@ func _test_disabled_compatibility_and_enable() -> void:
|
||||
_expect(not disabled[&"enabled"], "Operations remain disabled for existing Runtime tests")
|
||||
var disabled_snapshot: Dictionary = _runtime.create_snapshot()
|
||||
var disabled_runtime: Dictionary = disabled_snapshot[&"systems"][&"runtime"]
|
||||
_expect(int(disabled_runtime[&"runtime_schema_version"]) == 8, "Runtime snapshot advances to schema v8")
|
||||
_expect(int(disabled_runtime[&"runtime_schema_version"]) == 9, "Runtime snapshot advances to schema v9")
|
||||
_expect(
|
||||
disabled_runtime[&"operations"] == {
|
||||
&"wrapper_version": 1,
|
||||
@@ -362,8 +362,14 @@ func _test_daily_payroll_financials_and_crosslink_tamper() -> void:
|
||||
downgraded[&"systems"][&"runtime"][&"runtime_schema_version"] = 4
|
||||
downgraded[&"systems"][&"runtime"].erase(&"kitchen_production")
|
||||
downgraded[&"systems"][&"runtime"].erase(&"elevators")
|
||||
downgraded[&"systems"][&"runtime"].erase(&"legacy_stairs")
|
||||
for infrastructure_key: StringName in [&"excavation", &"spatial_subslots", &"route_projection", &"facility_infrastructure"]:
|
||||
downgraded[&"systems"][&"runtime"].erase(infrastructure_key)
|
||||
downgraded[&"systems"][&"runtime"][&"path"][&"schema_version"] = 3
|
||||
downgraded[&"systems"][&"runtime"][&"path"].erase(&"vertical_walk_blockers")
|
||||
downgraded[&"systems"][&"runtime"][&"path"].erase(&"vertical_walk_requires_connector")
|
||||
downgraded[&"systems"][&"runtime"][&"path"].erase(&"transit_actor_ids")
|
||||
_expect(_runtime._legacy_infrastructure_history_is_absent(downgraded[&"systems"][&"runtime"]), "Operations downgrade fixture excludes unrelated later infrastructure owners")
|
||||
_expect(
|
||||
_rejects_atomically(downgraded),
|
||||
"relabelled enabled v5 cannot discard Operations history through v4 migration"
|
||||
|
||||
Reference in New Issue
Block a user