P18-01-CODE: 原本関係モデル・旧値保全・Runtime保存と読取経路

This commit is contained in:
Agent Control Runner
2026-10-15 20:33:19 +09:00
parent 0084760ee0
commit b7a7cc01d4
13 changed files with 2132 additions and 29 deletions
+7 -6
View File
@@ -543,7 +543,7 @@ func _parse_snapshot(snapshot: Dictionary) -> Dictionary:
static func _legacy_types_valid(raw: Dictionary) -> bool:
for key: String in ["relationship_id", "actor_a_id", "actor_b_id"]:
if not (raw.get(key) is String or raw.get(key) is StringName):
if not raw.get(key) is String:
return false
for key: String in ["shield_max", "shield_current", "last_event_at", "daily_attack_count", "attack_day", "metric_delta_day"]:
if raw.has(key) and not raw[key] is int:
@@ -559,9 +559,9 @@ static func _legacy_types_valid(raw: Dictionary) -> bool:
for value: Variant in raw.get(key, {}).values():
if not value is int:
return false
for key: String in ["action_counts", "flags"]:
for key: String in ["metrics", "action_counts", "daily_metric_deltas", "flags", "crossed_thresholds"]:
for identity: Variant in raw.get(key, {}):
if not (identity is String or identity is StringName):
if not identity is String:
return false
for value: Variant in raw.get("flags", {}).values():
if not value is bool:
@@ -572,10 +572,11 @@ static func _legacy_types_valid(raw: Dictionary) -> bool:
for threshold: Variant in value:
if not threshold is int:
return false
if raw.has("route_id") and not (raw["route_id"] is String or raw["route_id"] is StringName):
return false
if raw.has("route_lock") and not (raw["route_lock"] is int or raw["route_lock"] is String or raw["route_lock"] is StringName):
if raw.has("route_id") and not raw["route_id"] is String:
return false
if raw.has("route_lock"):
if not raw["route_lock"] is String or not RelationshipStateType.RouteLock.keys().has(raw["route_lock"]):
return false
return true