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:
@@ -63,6 +63,20 @@ func _run() -> void:
|
||||
if facility.definition_id == &"reception":
|
||||
reception_id = facility.instance_id
|
||||
_expect(not reception_id.is_empty(), "normal construction created the reception")
|
||||
var before_manager: Dictionary=_runtime.create_snapshot()
|
||||
_main.call("_hire_staff_candidate", &"heroine_anri")
|
||||
var manager_panel := _main.find_child("StaffManagementPanel", true, false) as StaffManagementPanel
|
||||
manager_panel.refresh();manager_panel.select_staff(&"heroine_anri")
|
||||
for index: int in manager_panel.facility_option.item_count:
|
||||
if StringName(manager_panel.facility_option.get_item_metadata(index))==reception_id:
|
||||
manager_panel.facility_option.select(index)
|
||||
manager_panel.facility_option.item_selected.emit(index)
|
||||
manager_panel.apply_button.pressed.emit()
|
||||
_expect(_runtime.staff_service.get_work_assignment(&"heroine_anri").get(&"facility_id")==reception_id, "normal manager placement established for opening guidance boundary")
|
||||
_guide.refresh()
|
||||
_expect(_guide.get_progress().get(&"stage")==&"staff", "manager-only reception keeps actual opening guide on staff recruitment")
|
||||
_expect(_runtime.get_floor_price_multiplier(0)==12000, "manager passive remains enabled while receptionist guidance is unmet")
|
||||
_expect(_runtime.restore_snapshot(before_manager), "restore ordinary opening scenario after manager-only boundary")
|
||||
_main.call("_hire_staff_candidate", &"staff_akane")
|
||||
var staff_members: Array = _runtime.staff_service.get_staff_members()
|
||||
_expect(staff_members.size() == 1, "normal hire button employs one receptionist")
|
||||
@@ -88,12 +102,27 @@ func _run() -> void:
|
||||
_main.call("_refresh_dashboard")
|
||||
await _capture("staffed")
|
||||
# The night is simulated naturally. No service request or guest is inserted.
|
||||
await _advance(1440 - _clock.absolute_minute)
|
||||
_expect(int(_ledger.get_report()[&"business_day"]) == 1, "midnight remains part of the first 06:00-based operating day")
|
||||
_expect(int(_ledger.get_report()[&"construction_cash_out"]) > 0, "building cash outflow remains visible at midnight")
|
||||
await _advance(1800 - _clock.absolute_minute)
|
||||
await _advance(1439 - _clock.absolute_minute)
|
||||
_expect(int(_ledger.get_report()[&"business_day"]) == 1, "23:59 remains part of the first calendar day")
|
||||
_expect(int(_ledger.get_report()[&"construction_cash_out"]) > 0, "building cash outflow remains visible before midnight")
|
||||
await _advance(1)
|
||||
_expect(int(_ledger.get_report()[&"business_day"]) == 2, "midnight rolls the cash-flow period")
|
||||
_expect(int(_ledger.get_report()[&"construction_cash_out"]) == 0, "prior-day construction is excluded from new-day cash flow")
|
||||
var summaries: Array = _runtime.operations_coordinator.get_day_summaries()
|
||||
_expect(summaries.size() == 1, "next 06:00 creates one authoritative operating-day close")
|
||||
_expect(summaries.size() == 1, "midnight creates one authoritative operating-day close")
|
||||
var full_operations: Dictionary = _runtime.get_operations_report()
|
||||
var compact_operations: Dictionary = _runtime.get_operations_dashboard_report()
|
||||
for key: StringName in [&"enabled", &"arrears_total", &"tick_blocked", &"runtime_failure_latched", &"personal_action_points", &"deferred_runtime_minute"]:
|
||||
_expect(compact_operations[key] == full_operations[key], "compact HUD matches live %s" % key)
|
||||
var compact_coordinator: Dictionary = compact_operations[&"coordinator"]
|
||||
var full_coordinator: Dictionary = full_operations[&"coordinator"]
|
||||
for key: StringName in [&"terminal_state", &"consecutive_insolvency_count", &"legacy_history_last_day"]:
|
||||
_expect(compact_coordinator[key] == full_coordinator[key], "compact HUD matches coordinator %s" % key)
|
||||
_expect(compact_coordinator[&"day_summaries"].back()[&"net_profit"] == summaries.back()[&"net_profit"], "compact HUD preserves latest operating profit")
|
||||
compact_coordinator[&"day_summaries"].back()[&"net_profit"] = -999999
|
||||
_expect(_runtime.operations_coordinator.get_day_summaries() == summaries, "editing HUD projection cannot mutate authoritative day close")
|
||||
|
||||
_expect(_ledger.is_visible_in_tree(), "daily settlement automatically presents the ledger report")
|
||||
var lodging_sales := 0
|
||||
for entry: LedgerEntry in _runtime.economy_service.get_entries():
|
||||
var facility: FacilityInstance = _runtime.facility_service.get_instance(entry.source_entity_id)
|
||||
@@ -105,7 +134,7 @@ func _run() -> void:
|
||||
_expect(int(first[&"category_totals"][&"wages"]) > 0, "the close includes real employee wages")
|
||||
_expect(bool(first[&"balanced"]), "daily close reconciles the ledger")
|
||||
_expect(_ledger.get_report()[&"selected_close"] == first, "ledger panel shows the authoritative close without reclassification")
|
||||
_expect(int(_ledger.get_report()[&"business_day"]) == 2, "cash-flow period rolls at 06:00 rather than midnight")
|
||||
_expect(int(_ledger.get_report()[&"business_day"]) == 2, "cash-flow period rolls at midnight")
|
||||
_expect(_guide.get_progress().get(&"stage") == &"complete", "first lodging and following close complete opening guidance")
|
||||
var digest: String = _runtime.latest_digest
|
||||
_guide.refresh()
|
||||
@@ -113,6 +142,8 @@ func _run() -> void:
|
||||
_expect(_runtime.latest_digest == digest, "guide and ledger refresh never mutate simulation")
|
||||
_main.call("_activate_management_mode", &"ledger")
|
||||
await _capture("first-close")
|
||||
await _advance(1800 - _clock.absolute_minute)
|
||||
_expect(_runtime.operations_coordinator.get_day_summaries().size() == 1, "06:00 morning cannot duplicate the midnight close")
|
||||
# A dedicated temp slot avoids every normal player save path.
|
||||
var save_path := "user://tests/first_operating_day_%d/restore-check" % OS.get_process_id()
|
||||
var saved: Dictionary = _runtime.save_to_path(save_path, {&"display_name": "First operating day regression"})
|
||||
@@ -124,6 +155,18 @@ func _run() -> void:
|
||||
# to String. Compare the JSON-shaped public report, preserving every value.
|
||||
_expect(JSON.stringify(_ledger.get_report()[&"selected_close"]) == JSON.stringify(close_before), "restored close preserves every financial value")
|
||||
_expect(_guide.get_progress().get(&"stage") == &"complete", "restored state preserves guide progress: %s" % _guide.get_progress())
|
||||
# Continue the loaded second morning, then replay the same complete state.
|
||||
# This checks active work after load, not only a static financial report.
|
||||
var loaded_checkpoint: Dictionary = _runtime.create_snapshot()
|
||||
await _advance(120)
|
||||
var continued_digest := SimulationDigest.compute(_runtime.create_snapshot())
|
||||
_expect(_clock.absolute_minute == 1920, "disk-loaded inn continues through the second morning")
|
||||
_expect(_runtime.restore_snapshot(loaded_checkpoint), "second-morning checkpoint restores before replay")
|
||||
await _advance(120)
|
||||
_expect(SimulationDigest.compute(_runtime.create_snapshot()) == continued_digest,
|
||||
"second-morning guests, staff, ledger and events replay exactly after load")
|
||||
_expect(_guide.get_progress().get(&"stage") == &"complete", "continued second morning preserves completed guidance")
|
||||
await _capture("second-morning")
|
||||
var evidence := {"lodging_sales": lodging_sales, "report": _ledger.get_report(), "staff_count": _runtime.staff_service.get_staff_members().size()}
|
||||
print("FIRST_OPERATING_DAY_REPORT ", JSON.stringify(evidence))
|
||||
var evidence_path := ProjectSettings.globalize_path("res://artifacts/first-operating-day/operating-report.json")
|
||||
@@ -132,9 +175,30 @@ func _run() -> void:
|
||||
if evidence_file != null:
|
||||
evidence_file.store_string(JSON.stringify(evidence, "\t") + "\n")
|
||||
SaveService.delete_save(save_path)
|
||||
_test_new_report_selection()
|
||||
_finish()
|
||||
|
||||
|
||||
func _test_new_report_selection() -> void:
|
||||
# Projection-only fixture: test navigation between two closed reports without
|
||||
# fabricating transactions in the real inn or changing its saved history.
|
||||
var original: OperationsCoordinator = _runtime.operations_coordinator
|
||||
var reports := OperationsCoordinator.new()
|
||||
reports.advance_to(2880)
|
||||
_runtime.operations_coordinator = reports
|
||||
_ledger._selected_day = 1
|
||||
_ledger.refresh()
|
||||
_expect(int(_ledger.get_report()[&"selected_close"][&"day"]) == 1, "player can inspect an earlier close")
|
||||
_main.set("_last_presented_close_minute", 1440)
|
||||
var projection := {&"systems": {&"runtime": {&"operations": {&"coordinator": reports.create_snapshot()}}}}
|
||||
_main.call("_on_snapshot_published", projection, "")
|
||||
_expect(int(_ledger.get_report()[&"selected_close"][&"day"]) == 2, "new close selects the latest report even after an earlier day was selected")
|
||||
_ledger._selected_day = 1
|
||||
_main.call("_on_snapshot_published", projection, "")
|
||||
_expect(int(_ledger.get_report()[&"selected_close"][&"day"]) == 1, "ordinary refresh preserves the player's historical selection")
|
||||
_runtime.operations_coordinator = original
|
||||
|
||||
|
||||
func _build(definition_id: StringName, origin: Vector3i) -> bool:
|
||||
var before: int = _runtime.construction_service.get_jobs().size()
|
||||
_main.call("_select_build_definition", definition_id)
|
||||
|
||||
Reference in New Issue
Block a user