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
+27 -3
View File
@@ -1,5 +1,8 @@
extends SceneTree
const FixtureCleanup := preload("res://tests/helpers/ui_audio_fixture_cleanup.gd")
var _finishing := false
var _checks := 0
var _failures := 0
var _runtime: Variant
@@ -129,8 +132,10 @@ func _run() -> void:
var hidden_path := _path + "_hidden"
_slots.append(hidden_path)
_expect(_runtime.save_to_path(hidden_path).get(&"ok", false), "direct Runtime save collects hidden inspector selections")
_main.queue_free()
await process_frame
var remount_cleanup: Dictionary = await _cleanup_fixture_owner(_main, "before-remount")
if not bool(remount_cleanup.get(&"passed", false)):
_failures += 1
push_error("ordinary Main remount audio cleanup failed")
await _mount()
_expect(_main.get("guest_observer") == null, "new main has no pre-existing guest popup")
_expect(_runtime.load_from_path(hidden_path).get(&"ok", false), "new main accepts hidden actor selection package")
@@ -176,9 +181,28 @@ func _run() -> void:
_finish()
func _finish() -> void:
if _finishing:
return
_finishing = true
if is_instance_valid(_main):
_main.queue_free()
var final_cleanup: Dictionary = await _cleanup_fixture_owner(_main, "final")
if not bool(final_cleanup.get(&"passed", false)):
_failures += 1
push_error("ordinary Main final audio cleanup failed")
for path: String in _slots:
SaveService.delete_save(path)
print("Actor selection: %d checks, %d failures" % [_checks, _failures])
quit(1 if _failures else 0)
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