Connect paid food purchasing, kitchen production, and porter deliveries
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
extends SceneTree
|
||||
|
||||
const RUNTIME_SNAPSHOT_VERSION := 6
|
||||
const RUNTIME_SNAPSHOT_VERSION := 7
|
||||
const INFRASTRUCTURE_SNAPSHOT_KEYS: Array[StringName] = [
|
||||
&"excavation",
|
||||
&"spatial_subslots",
|
||||
@@ -61,7 +61,7 @@ func _run() -> void:
|
||||
_test_proxy_completion_projection_failure_is_atomic()
|
||||
_test_vertical_preflight_rejection()
|
||||
_test_demolition_projection_atomicity()
|
||||
_test_v6_snapshot_strictness()
|
||||
_test_current_snapshot_strictness()
|
||||
_test_v5_proxy_migration_determinism()
|
||||
_test_rank_expansion_preserves_route_union()
|
||||
_finish()
|
||||
@@ -112,12 +112,12 @@ func _test_runtime_surface(fixture: Dictionary) -> bool:
|
||||
ready = ready and service != null
|
||||
var snapshot: Dictionary = runtime.create_snapshot()
|
||||
var runtime_data: Dictionary = snapshot[&"systems"][&"runtime"]
|
||||
var v6 := int(runtime_data.get(&"runtime_schema_version", -1)) == RUNTIME_SNAPSHOT_VERSION
|
||||
_expect(v6, "Runtime emits infrastructure snapshot v6")
|
||||
ready = ready and v6
|
||||
var current_version := int(runtime_data.get(&"runtime_schema_version", -1)) == RUNTIME_SNAPSHOT_VERSION
|
||||
_expect(current_version, "Runtime emits schema v7 with infrastructure state")
|
||||
ready = ready and current_version
|
||||
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
|
||||
var valid_dictionary := runtime_data.get(key, null) is Dictionary
|
||||
_expect(valid_dictionary, "v6 stores strict %s state" % key)
|
||||
_expect(valid_dictionary, "current Runtime stores strict %s state" % key)
|
||||
ready = ready and valid_dictionary
|
||||
if not ready:
|
||||
print(" PENDING: Runtime v6 infrastructure surface is not connected yet; behavioral cases skipped.")
|
||||
@@ -290,7 +290,7 @@ func _test_excavation_tick_pause_resume_and_completion() -> void:
|
||||
_expect(
|
||||
runtime.restore_snapshot(paused_snapshot)
|
||||
and runtime.create_snapshot() == paused_snapshot,
|
||||
"paused excavation survives an exact Runtime v6 save/restore"
|
||||
"paused excavation survives an exact current Runtime save/restore"
|
||||
)
|
||||
_expect(
|
||||
runtime.excavation_service.get_job(excavation_job_id).get(&"state", &"")
|
||||
@@ -731,7 +731,7 @@ func _test_demolition_projection_atomicity() -> void:
|
||||
_free_fixture(fixture)
|
||||
|
||||
|
||||
func _test_v6_snapshot_strictness() -> void:
|
||||
func _test_current_snapshot_strictness() -> void:
|
||||
var fixture := _new_fixture(81_060)
|
||||
var runtime: Variant = fixture[&"runtime"]
|
||||
_expect(_promote_rank_two(fixture, &"infra.snapshot.rank"), "snapshot fixture reaches Rank 2")
|
||||
@@ -750,10 +750,10 @@ func _test_v6_snapshot_strictness() -> void:
|
||||
_expect(built[&"ok"], "snapshot fixture stores one completed projection")
|
||||
var snapshot: Dictionary = runtime.create_snapshot()
|
||||
var expected_digest := SimulationDigest.compute(snapshot)
|
||||
_expect(runtime.restore_snapshot(snapshot), "valid Runtime v6 snapshot restores")
|
||||
_expect(runtime.restore_snapshot(snapshot), "valid Runtime v7 snapshot restores")
|
||||
_expect(
|
||||
runtime.create_snapshot() == snapshot and runtime.latest_digest == expected_digest,
|
||||
"Runtime v6 round trip is exact"
|
||||
"Runtime v7 round trip is exact"
|
||||
)
|
||||
|
||||
_assert_runtime_restore_rejected(
|
||||
@@ -761,7 +761,7 @@ func _test_v6_snapshot_strictness() -> void:
|
||||
snapshot,
|
||||
func(candidate: Dictionary) -> void:
|
||||
candidate[&"systems"][&"runtime"][&"unknown_infrastructure"] = {},
|
||||
"unknown v6 Runtime field"
|
||||
"unknown v7 Runtime field"
|
||||
)
|
||||
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
|
||||
_assert_runtime_restore_rejected(
|
||||
@@ -837,6 +837,7 @@ func _test_v5_proxy_migration_determinism() -> void:
|
||||
var legacy_runtime: Dictionary = legacy[&"systems"][&"runtime"]
|
||||
var stripped_v6_events := _strip_v6_infrastructure_domain_history(legacy_runtime)
|
||||
legacy_runtime[&"runtime_schema_version"] = 5
|
||||
legacy_runtime.erase(&"kitchen_production")
|
||||
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
|
||||
legacy_runtime.erase(key)
|
||||
legacy_runtime[&"path"] = baseline[&"runtime"].path_service.create_snapshot()
|
||||
@@ -854,8 +855,8 @@ func _test_v5_proxy_migration_determinism() -> void:
|
||||
_expect(first_runtime.restore_snapshot(legacy), "v5 proxy snapshot migrates through Runtime restore")
|
||||
var first_migrated: Dictionary = first_runtime.create_snapshot()
|
||||
_expect(
|
||||
int(first_migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 6,
|
||||
"v5 migration is immediately re-emitted as v6"
|
||||
int(first_migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 7,
|
||||
"v5 migration is immediately re-emitted as v7"
|
||||
)
|
||||
_expect(
|
||||
first_runtime.facility_infrastructure_projector.has_projection(instance_id)
|
||||
@@ -1056,6 +1057,8 @@ func _strip_v6_infrastructure_domain_history(runtime_data: Dictionary) -> int:
|
||||
|
||||
|
||||
func _legacy_v5_infrastructure_shape_is_clean(runtime_data: Dictionary) -> bool:
|
||||
if runtime_data.has(&"kitchen_production"):
|
||||
return false
|
||||
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
|
||||
if runtime_data.has(key) or runtime_data.has(String(key)):
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user