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:
Takeshi
2026-09-30 23:52:24 +09:00
parent 6077e02ebe
commit 5dde0c5ec2
490 changed files with 54051 additions and 809 deletions
@@ -1,6 +1,6 @@
extends SceneTree
const RUNTIME_SNAPSHOT_VERSION := 9
const RUNTIME_SNAPSHOT_VERSION := 13
const INFRASTRUCTURE_SNAPSHOT_KEYS: Array[StringName] = [
&"excavation",
&"spatial_subslots",
@@ -39,6 +39,22 @@ class SnapshotCountingDomainEventStream:
return super.create_snapshot()
class CountingSpatialValidation:
extends SpatialSubslotService
var validation_calls := 0
func validate_invariants() -> Dictionary:
validation_calls += 1
return super.validate_invariants()
class CountingAdapterValidation:
extends RouteSubslotPathAdapter
var validation_calls := 0
func validate_invariants() -> Dictionary:
validation_calls += 1
return super.validate_invariants()
var _checks := 0
var _failures := 0
@@ -51,8 +67,10 @@ func _run() -> void:
print("S1: Runtime infrastructure integration")
var probe := _new_fixture(81_001)
var surface_ready := _test_runtime_surface(probe)
_test_exact_cell_sets(probe[&"runtime"])
_free_fixture(probe)
if surface_ready:
_test_composed_infrastructure_validation()
_test_completion_capture_fast_path()
_test_rank_and_operations_gates()
_test_excavation_tick_pause_resume_and_completion()
@@ -75,6 +93,61 @@ func _finish() -> void:
quit(_failures)
func _test_composed_infrastructure_validation() -> void:
var fixture := _new_fixture(81_099)
var runtime: Variant = fixture[&"runtime"]
var spatial := CountingSpatialValidation.new()
var adapter := CountingAdapterValidation.new()
var path := PathService.new()
var projector := FacilityInfrastructureProjector.new()
_expect(adapter.configure(spatial, path, runtime.world_service.get_walkable_cells()), "counted route dependencies configure")
_expect(projector.configure(adapter, spatial, path), "counted projector binds authoritative dependencies")
var validate := func() -> bool:
return runtime.call("_validate_infrastructure_crosslinks", runtime.world_service, path,
runtime.construction_service, runtime.construction_resource_state, runtime.excavation_service,
spatial, adapter, projector)
spatial.validation_calls = 0
adapter.validation_calls = 0
_expect(validate.call(), "composed infrastructure validation accepts healthy graph")
_expect(spatial.validation_calls == 1 and adapter.validation_calls == 1, "one graph audit validates each dependency exactly once")
_expect(projector.is_bound_to(adapter, spatial, path) and not projector.is_bound_to(adapter, SpatialSubslotService.new(), path), "binding test requires identical dependency objects")
spatial.revision = -1
_expect(not validate.call(), "active composed check still catches raw source corruption")
spatial.revision = 0
var prior_revision := adapter.projection_revision
adapter.projection_revision = -1
_expect(not validate.call(), "active composed check still catches raw adapter corruption")
adapter.projection_revision = prior_revision
projector.set("_quarantined", true)
projector.set("_quarantine_reason", FacilityInfrastructureProjector.QUARANTINE_REASONS[0])
spatial.validation_calls = 0
adapter.validation_calls = 0
_expect(validate.call(), "canonical quarantined projector retains previous graph-validation semantics")
_expect(spatial.validation_calls == 1 and adapter.validation_calls == 1, "quarantine retains independent dependency checks")
spatial.revision = -1
_expect(not validate.call(), "quarantine never conceals malformed supplied source")
spatial.revision = 0
projector.set("_quarantined", false)
projector.set("_quarantine_reason", &"")
var original_projector: FacilityInfrastructureProjector = runtime.facility_infrastructure_projector
spatial.revision = -1
_expect(not runtime.call("_validate_infrastructure_crosslinks", runtime.world_service, path,
runtime.construction_service, runtime.construction_resource_state, runtime.excavation_service,
spatial, adapter, original_projector), "different projector binding does not bypass supplied-source validation")
_free_fixture(fixture)
func _test_exact_cell_sets(runtime: Variant) -> void:
var first := Vector3i(0, 0, 0)
var second := Vector3i(1, 0, 0)
_expect(runtime.call("_same_vector3i_set", [first, second], [second, first]), "cell equality ignores order")
_expect(not runtime.call("_same_vector3i_set", [first, second], [first, first]), "duplicate actual cell cannot conceal a missing cell")
_expect(not runtime.call("_same_vector3i_set", [first, first], [first, second]), "duplicate expected cell is rejected")
_expect(runtime.call("_same_vector3i_set", [], []), "empty cell sets match")
_expect(not runtime.call("_same_vector3i_set", [first], [Vector3i(0, 0, 1)]), "same coordinate in another layer does not match")
_expect(not runtime.call("_same_vector3i_set", [first], [Vector2i.ZERO]), "wrong cell type is rejected")
func _new_fixture(seed: int) -> Dictionary:
var clock: Variant = load("res://autoload/game_clock.gd").new()
var state: Variant = load("res://autoload/game_state.gd").new()
@@ -113,7 +186,7 @@ func _test_runtime_surface(fixture: Dictionary) -> bool:
var snapshot: Dictionary = runtime.create_snapshot()
var runtime_data: Dictionary = snapshot[&"systems"][&"runtime"]
var current_version := int(runtime_data.get(&"runtime_schema_version", -1)) == RUNTIME_SNAPSHOT_VERSION
_expect(current_version, "Runtime emits schema v9 with infrastructure state")
_expect(current_version, "Runtime emits schema v13 with infrastructure and weather state")
ready = ready and current_version
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
var valid_dictionary := runtime_data.get(key, null) is Dictionary
@@ -827,6 +900,7 @@ func _test_v5_proxy_migration_determinism() -> void:
legacy_runtime.erase(&"kitchen_production")
legacy_runtime.erase(&"elevators")
legacy_runtime.erase(&"legacy_stairs")
preload("res://tests/fixtures/pre_upkeep_runtime.gd").strip_empty_upkeep(legacy_runtime)
legacy_runtime.erase(&"staff_commute")
for key: StringName in INFRASTRUCTURE_SNAPSHOT_KEYS:
legacy_runtime.erase(key)
@@ -849,7 +923,7 @@ func _test_v5_proxy_migration_determinism() -> void:
_expect(first_runtime.restore_snapshot(legacy), "v5 proxy snapshot migrates through Runtime restore")
var first_migrated: Dictionary = first_runtime.create_snapshot()
_expect(
int(first_migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 9,
int(first_migrated[&"systems"][&"runtime"][&"runtime_schema_version"]) == 13,
"v5 migration is immediately re-emitted as v9"
)
_expect(