Files
TheTree_mock/tools/regression/bootstrap-scripts.json
T
Takeshi b84bade045 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.
2026-10-11 15:58:00 +09:00

13 lines
3.5 KiB
JSON

{
"profile_guard.gd": {
"text": "extends RefCounted\n## External runtime-only bootstrap; changes neither source nor immutable PCK.\nstatic func activate() -> bool:\n\tvar custom_name := OS.get_environment(\"THE_TREE_PACK_PROFILE_NAME\")\n\tvar expected := OS.get_environment(\"THE_TREE_PACK_PROFILE_EXPECTED\")\n\tvar report_path := OS.get_environment(\"THE_TREE_PACK_PROFILE_REPORT\")\n\tvar before := OS.get_user_data_dir()\n\tvar name_regex := RegEx.new()\n\tvar regex_ok: bool = name_regex.compile(\"^TheTree-PCK-tests-[0-9a-f]{32}-[a-z0-9-]+$\") == OK\n\tvar fresh: bool = not expected.is_empty() and not DirAccess.dir_exists_absolute(expected) and not FileAccess.file_exists(expected)\n\tProjectSettings.set_setting(\"application/config/use_custom_user_dir\", true)\n\tProjectSettings.set_setting(\"application/config/custom_user_dir_name\", custom_name)\n\tvar actual := OS.get_user_data_dir()\n\tvar globalized := ProjectSettings.globalize_path(\"user://guard-probe\")\n\tvar conditions: Array[bool] = [regex_ok and name_regex.search(custom_name) != null,\n\t\tnot expected.is_empty() and expected.is_absolute_path() and actual == expected,\n\t\tglobalized == expected.path_join(\"guard-probe\"),\n\t\tbool(ProjectSettings.get_setting(\"application/config/use_custom_user_dir\", false)) and String(ProjectSettings.get_setting(\"application/config/custom_user_dir_name\", \"\")) == custom_name,\n\t\tfresh]\n\tvar valid: bool = not conditions.has(false)\n\tvar report := {\"verified\": valid, \"conditions\": conditions, \"conditions_checked\": 5,\n\t\t\"before\": before, \"actual_user_data_dir\": actual, \"expected_user_data_dir\": expected,\n\t\t\"globalized_probe\": globalized, \"custom_user_dir_name\": custom_name,\n\t\t\"fresh_before_parent_initialize\": fresh, \"runtime_settings_only\": true,\n\t\t\"project_settings_persisted\": false, \"profile_writes_before_guard\": 0}\n\tvar file: FileAccess = null\n\tif report_path.is_absolute_path() and not FileAccess.file_exists(report_path):\n\t\tfile = FileAccess.open(report_path, FileAccess.WRITE)\n\tif file == null:\n\t\tpush_error(\"PACK_PROFILE_GUARD cannot create fresh external evidence\")\n\t\treturn false\n\tfile.store_string(JSON.stringify(report, \"\\t\", true, true) + \"\\n\")\n\tfile.close()\n\tif not valid:\n\t\tpush_error(\"PACK_PROFILE_GUARD refused before parent save-writing initializer\")\n\tprint(\"PACK_PROFILE_GUARD verified=%s\" % str(valid))\n\treturn valid\n",
"sha256": "597696c705cc8f0e79a35265ca3ef8df55f7fc3c4e0e5a2ce9a4e20e29e29a6f",
"source_materialized_only_in_external_owned_output": true
},
"parse_full_dependencies.gd": {
"text": "extends SceneTree\n\nconst Guard := preload(\"profile_guard.gd\")\n\nfunc _initialize() -> void:\n\tif not Guard.activate():\n\t\tquit(97)\n\t\treturn\n\tvar file := FileAccess.open(OS.get_environment(\"THE_TREE_FULL_PARSE_PATHS\"), FileAccess.READ)\n\tassert(file != null)\n\tvar paths: Array = JSON.parse_string(file.get_as_text())\n\tfile.close()\n\tvar unique := {}\n\tvar failures := 0\n\tfor path: String in paths:\n\t\tassert(not unique.has(path))\n\t\tunique[path] = true\n\t\tvar resource: Resource = load(path)\n\t\tif not resource is GDScript or not (resource as GDScript).can_instantiate():\n\t\t\tfailures += 1\n\t\t\tpush_error(\"FULL_DEPENDENCY_PARSE cannot instantiate: \" + path)\n\tprint(\"FULL_DEPENDENCY_PARSE checks=%d failures=%d\" % [unique.size(), failures])\n\tquit(0 if failures == 0 else 1)\n",
"sha256": "585a0c1da5c050e3bebc5f66793a625419d2db27299f1131cf3a62ffd3236126",
"source_materialized_only_in_external_owned_output": true
}
}