Save The Tree implementation and acceptance work in progress

Preserve production code, regression fixtures, audio assets and provenance, test infrastructure, and the original-completion plan and progress ledger. Final game and Windows acceptance remain pending; excluded local artifacts and native experiments are not part of this snapshot.
This commit is contained in:
Takeshi
2026-10-11 15:58:00 +09:00
parent 39f6068461
commit b84bade045
235 changed files with 495831 additions and 312 deletions
+26 -2
View File
@@ -1,4 +1,5 @@
extends SceneTree
const FixtureCleanup := preload("res://tests/helpers/ui_audio_fixture_cleanup.gd")
var _checks := 0
var _failures := 0
@@ -90,7 +91,11 @@ func _run() -> void:
_round_trip(&"excavation", excavations.back()[&"job_id"], "地下掘削")
_main.call("_on_facility_selected", reception_id)
_expect(_runtime.save_to_path(_path).get(&"ok", false), "save selection through Runtime without explicit metadata")
_main.queue_free()
var _audio_cleanup_transition: Dictionary = await _cleanup_fixture_owner(_main, "transition")
if not bool(_audio_cleanup_transition.get(&"passed", false)):
push_error("Ordinary fixture audio cleanup failed: %s" % str(_audio_cleanup_transition))
quit(96)
return
await process_frame
_expect(_runtime.get_signal_connection_list(&"checkpoint_presentation_requested").is_empty(), "destroyed UI leaves no presentation callback")
_expect(_runtime.save_to_path(_path + "_headless").get(&"ok", false), "Runtime still saves with no main scene")
@@ -143,8 +148,27 @@ func _test_legacy() -> void:
func _finish() -> void:
if is_instance_valid(_main):
_main.queue_free()
var _audio_cleanup_final: Dictionary = await _cleanup_fixture_owner(_main, "finish")
if not bool(_audio_cleanup_final.get(&"passed", false)):
push_error("Ordinary fixture audio cleanup failed: %s" % str(_audio_cleanup_final))
quit(96)
return
for suffix: String in ["", "_headless", "_generations"]:
SaveService.delete_save(_path + suffix)
print("Selection lifecycle: %d checks, %d failures" % [_checks, _failures])
quit(1 if _failures else 0)
## QA-only control proof routing for sequential ordinary Main owners.
## The old02cd/6be99 helpers and original Clock/Runtime values stay exact.
func _cleanup_fixture_owner(owner: Node, phase: String) -> Dictionary:
var original_control: String = OS.get_environment("THE_TREE_AUDIO_FIXTURE_CONTROL_PROOF")
if original_control.is_empty() or not original_control.is_absolute_path():
return {&"passed": false, &"reason": "fresh absolute owned control proof required"}
var phase_control: String = original_control.get_basename() + "-" + phase + ".json"
if FileAccess.file_exists(phase_control):
return {&"passed": false, &"reason": "ordinary owner control proof overwrite forbidden"}
OS.set_environment("THE_TREE_AUDIO_FIXTURE_CONTROL_PROOF", phase_control)
var report: Dictionary = await FixtureCleanup.free_owner_and_wait(self, owner)
OS.set_environment("THE_TREE_AUDIO_FIXTURE_CONTROL_PROOF", original_control)
return report