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:
@@ -85,8 +85,10 @@ func _run() -> void:
|
||||
_expect(_sales(&"standard_room") > 0, "the same inn earns lodging revenue")
|
||||
_expect(_sales(&"reception") == 0, "three days do not depend on artificial reception revenue")
|
||||
_expect(_runtime.restore_snapshot(_runtime.create_snapshot()), "three-day supply history remains restorable")
|
||||
var evidence := {"checks": _checks, "failures": _failures, "meal_sales": _sales(&"cafeteria"), "lodging_sales": _sales(&"standard_room"), "raw_deliveries": _completed_deliveries(SupplyCatalog.RAW_FOOD), "meal_deliveries": _completed_deliveries(SupplyCatalog.BASIC_MEAL), "cash": _state.get_resource(&"gold"), "closes": _runtime.operations_coordinator.get_day_summaries(), "supply": _runtime.get_supply_management_report()}
|
||||
var evidence := {"checks": _checks, "failures": _failures, "meal_sales": _sales(&"cafeteria"), "lodging_sales": _sales(&"standard_room"), "raw_deliveries": _completed_deliveries(SupplyCatalog.RAW_FOOD), "meal_deliveries": _completed_deliveries(SupplyCatalog.BASIC_MEAL), "cash": _state.get_resource(&"gold"), "closes": _runtime.operations_coordinator.get_day_summaries(), "supply": _runtime.get_supply_management_report(), "upkeep": _runtime.upkeep_settlement.get_report(), "maintenance_expense": _runtime.economy_service.get_balance(FacilityUpkeepSettlement.EXPENSE)}
|
||||
var evidence_dir := "res://artifacts/business-management" if OS.get_environment("THE_TREE_BUSINESS_ACCEPTANCE") == "1" else "res://artifacts/supply-chain"
|
||||
if not OS.get_environment("THE_TREE_SUPPLY_EVIDENCE_DIR").is_empty():
|
||||
evidence_dir = OS.get_environment("THE_TREE_SUPPLY_EVIDENCE_DIR")
|
||||
var evidence_path := ProjectSettings.globalize_path(evidence_dir.path_join("normal-play-report.json"))
|
||||
DirAccess.make_dir_recursive_absolute(evidence_path.get_base_dir())
|
||||
var file := FileAccess.open(evidence_path, FileAccess.WRITE)
|
||||
@@ -190,6 +192,10 @@ func _start_preview() -> void:
|
||||
return
|
||||
SaveService.delete_save(_save_path)
|
||||
root.title = "The Tree · 仕入れと厨房の試遊(保存なし)"
|
||||
var load_menu := _main.find_child("SaveLoadMenu", true, false) as MenuButton
|
||||
if load_menu != null:
|
||||
load_menu.disabled = true
|
||||
load_menu.tooltip_text = "この試遊は保存・読込を行いません。"
|
||||
for node: Node in _main.find_children("*", "Button", true, false):
|
||||
var button := node as Button
|
||||
for connection: Dictionary in button.pressed.get_connections():
|
||||
|
||||
@@ -74,6 +74,8 @@ func _run() -> void:
|
||||
_expect(_crosslinks(), "loaded Request, Task, reservations and cargo agree")
|
||||
_loaded = _runtime.create_snapshot()
|
||||
_expect(_runtime.restore_snapshot(_loaded), "mid-delivery Runtime snapshot restores")
|
||||
_test_reserve_outage()
|
||||
_test_kitchen_reserve_outage()
|
||||
_test_same_floor_access()
|
||||
_test_ownership_and_replay()
|
||||
_test_capacity_wait()
|
||||
@@ -358,3 +360,45 @@ func _expect(condition: bool, message: String) -> void:
|
||||
func _finish() -> void:
|
||||
print("%s: %d checks / %d failures" % ["PASS" if _failures == 0 else "FAIL", _checks, _failures])
|
||||
quit(_failures)
|
||||
|
||||
func _test_reserve_outage() -> void:
|
||||
_expect(_runtime.restore_snapshot(_loaded), "restore physically loaded cargo for reserve outage")
|
||||
_state.set_resource(&"mana", 0)
|
||||
_clock.advance_minutes(30)
|
||||
_expect(_request().state == LogisticsRequest.State.DELIVERING and _quantity(_cargo()) == 8 and _quantity(_inventory(_destination)) == 0, "outage retains loaded cargo without delivering into stopped facility")
|
||||
_expect(_crosslinks(), "outage preserves Request Task inventory ownership")
|
||||
_expect(_runtime.restore_snapshot(_runtime.create_snapshot()), "cargo waiting through outage restores")
|
||||
_state.set_resource(&"mana", 100)
|
||||
_wait_for(LogisticsRequest.State.COMPLETED, 60)
|
||||
_expect(_request().state == LogisticsRequest.State.COMPLETED and _quantity(_cargo()) == 0 and _quantity(_inventory(_destination)) == 8, "recovered power delivers cargo exactly once")
|
||||
_expect(_crosslinks(), "recovered delivery ownership reconciles")
|
||||
_expect(_runtime.restore_snapshot(_loaded), "rewind outage drill for remaining logistics scenarios")
|
||||
|
||||
|
||||
func _test_kitchen_reserve_outage() -> void:
|
||||
_expect(_runtime.restore_snapshot(_loaded), "restore real supply for cooking outage")
|
||||
_wait_for(LogisticsRequest.State.COMPLETED, 60)
|
||||
_expect(_command(&"hire_staff_candidate", {&"candidate_id": &"staff_chika"}), "hire kitchen employee")
|
||||
_expect(_command(&"set_staff_work_assignment", {&"staff_id": &"staff_chika", &"facility_id": _destination, &"template_id": &"DAY"}), "assign kitchen employee through production command")
|
||||
_expect(_command(&"set_kitchen_production", {&"facility_id": _destination, &"enabled": true, &"target_stock": 4}), "enable one real production batch")
|
||||
for minute in range(60):
|
||||
_clock.advance_minutes(1)
|
||||
if int(_runtime.kitchen_production.get_report(_destination)[&"progress_minutes"]) >= 3: break
|
||||
var before: Dictionary = _runtime.kitchen_production.get_report(_destination)
|
||||
_expect(int(before[&"progress_minutes"]) == 3 and not before[&"active_batch"].is_empty(), "physical employee starts and advances actual cooking")
|
||||
if before[&"active_batch"].is_empty():
|
||||
_runtime.restore_snapshot(_loaded)
|
||||
return
|
||||
_state.set_resource(&"mana", 0)
|
||||
_clock.advance_minutes(30)
|
||||
var stopped: Dictionary = _runtime.kitchen_production.get_report(_destination)
|
||||
_expect(stopped[&"state"] == &"NO_POWER" and stopped[&"active_batch"] == before[&"active_batch"], "thirty stopped minutes preserve batch identity reservations and progress")
|
||||
_expect(_quantity(_inventory(_destination)) == 8 and _runtime.inventory_service.total_quantity(_inventory(_destination), SupplyCatalog.BASIC_MEAL) == 0, "outage neither consumes input nor creates meals")
|
||||
_expect(_runtime.kitchen_production.validate_crosslinks(), "stopped kitchen reservations remain owned")
|
||||
var saved: Dictionary = _runtime.create_snapshot()
|
||||
_expect(_runtime.restore_snapshot(saved) and _runtime.create_snapshot() == saved, "active cooking outage round trips through complete Runtime save")
|
||||
_state.set_resource(&"mana", 100)
|
||||
_clock.advance_minutes(30)
|
||||
_expect(_quantity(_inventory(_destination)) == 4 and _runtime.inventory_service.total_quantity(_inventory(_destination), SupplyCatalog.BASIC_MEAL) == 4, "recovery consumes exactly four raw food and produces exactly four meals")
|
||||
_expect(_runtime.kitchen_production.get_report(_destination)[&"state"] == &"TARGET_REACHED" and _runtime.kitchen_production.validate_crosslinks(), "recovered batch releases reservations and stops at target")
|
||||
_expect(_runtime.restore_snapshot(_loaded), "rewind cooking outage scenario")
|
||||
|
||||
@@ -19,7 +19,7 @@ func _run() -> void:
|
||||
source[&"clock"].advance_minutes(3)
|
||||
var canonical: Dictionary = source_runtime.create_snapshot()
|
||||
var canonical_data: Dictionary = canonical[&"systems"][&"runtime"]
|
||||
_expect(canonical_data[&"runtime_schema_version"] == 9, "current Runtime emits schema v9")
|
||||
_expect(canonical_data[&"runtime_schema_version"] == 13, "current Runtime emits schema v13")
|
||||
_expect(canonical_data[&"kitchen_production"][&"current_minute"] == source[&"clock"].absolute_minute, "production clock follows Runtime clock without existing kitchens")
|
||||
var legacy := canonical.duplicate(true)
|
||||
var legacy_data: Dictionary = legacy[&"systems"][&"runtime"]
|
||||
@@ -27,6 +27,7 @@ func _run() -> void:
|
||||
legacy_data.erase(&"kitchen_production")
|
||||
legacy_data.erase(&"elevators")
|
||||
legacy_data.erase(&"legacy_stairs")
|
||||
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(legacy_data)
|
||||
legacy_data[&"path"][&"schema_version"] = 3
|
||||
legacy_data[&"path"].erase(&"vertical_walk_blockers")
|
||||
legacy_data[&"path"].erase(&"vertical_walk_requires_connector")
|
||||
@@ -34,11 +35,13 @@ func _run() -> void:
|
||||
_expect(legacy_data.has(&"facility_infrastructure") and legacy_data.has(&"route_projection"), "v6 fixture retains infrastructure introduced in v6")
|
||||
_expect(first_runtime.restore_snapshot(legacy), "genuine v6 state restores into v9")
|
||||
var migrated: Dictionary = first_runtime.create_snapshot()
|
||||
_expect(migrated[&"systems"][&"runtime"][&"runtime_schema_version"] == 9, "v6 migration re-emits current schema")
|
||||
_expect(migrated[&"systems"][&"runtime"][&"runtime_schema_version"] == 13, "v6 migration re-emits current schema")
|
||||
var kitchen: Dictionary = migrated[&"systems"][&"runtime"][&"kitchen_production"]
|
||||
_expect(kitchen[&"plans"].is_empty() and kitchen[&"active_batches"].is_empty(), "legacy migration does not infer kitchen production plans or batches")
|
||||
_expect(kitchen[&"current_minute"] == source[&"clock"].absolute_minute, "legacy production clock binds to the restored Runtime minute")
|
||||
var expected := canonical.duplicate(true)
|
||||
expected[&"systems"][&"runtime"][&"facility_upkeep"] = preload("res://tests/fixtures/pre_upkeep_runtime.gd").migrated_accrual(source[&"clock"].absolute_minute)
|
||||
expected[&"systems"][&"runtime"][&"weather"] = preload("res://tests/fixtures/pre_upkeep_runtime.gd").migrated_weather(source[&"clock"].absolute_minute)
|
||||
expected[&"systems"][&"runtime"][&"path"][&"graph_revision"] += 1
|
||||
_expect(migrated == expected, "v6 migration preserves all state except the one-time strict topology revision")
|
||||
_expect(second_runtime.restore_snapshot(legacy) and second_runtime.create_snapshot() == migrated, "v6 migration is deterministic across Runtime instances")
|
||||
@@ -67,6 +70,7 @@ func _run() -> void:
|
||||
orphaned[&"systems"][&"runtime"].erase(&"kitchen_production")
|
||||
orphaned[&"systems"][&"runtime"].erase(&"elevators")
|
||||
orphaned[&"systems"][&"runtime"].erase(&"legacy_stairs")
|
||||
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(orphaned[&"systems"][&"runtime"])
|
||||
orphaned[&"systems"][&"runtime"][&"path"][&"schema_version"] = 3
|
||||
orphaned[&"systems"][&"runtime"][&"path"].erase(&"vertical_walk_blockers")
|
||||
orphaned[&"systems"][&"runtime"][&"path"].erase(&"vertical_walk_requires_connector")
|
||||
|
||||
Reference in New Issue
Block a user