Extend simulation runtime coverage and kinematics support

This commit is contained in:
2026-08-21 10:57:10 +08:00
parent 554b72dae8
commit 2ef2d82db3
71 changed files with 24232 additions and 1867 deletions

View File

@@ -154,6 +154,56 @@ def validate(repo_root: Path, lock_path: Path, source_path: Path, manifest_path:
errors.append("workspace recovery report is missing")
elif recovery_report_hash != sha256(recovery_report_path):
errors.append("workspace recovery report hash does not match context lock")
if recovery_report_path.is_file():
try:
recovery_report = json.loads(recovery_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("workspace recovery report is not valid JSON")
else:
if recovery_report.get("status") != "passed":
errors.append("workspace recovery report is not passed")
if recovery_report.get("implementation_status") != "verified":
errors.append("workspace recovery implementation is not verified")
if recovery_report.get("oracle", {}).get("status") != "blocked":
errors.append("workspace recovery oracle status must remain explicitly blocked")
configuration_regression_path = repo_root / "coverage/configuration-regression.report.json"
configuration_regression_hash = lock.get("configuration_regression_report_sha256")
if configuration_regression_hash:
if not configuration_regression_path.is_file():
errors.append("configuration regression report is missing")
elif configuration_regression_hash != sha256(configuration_regression_path):
errors.append("configuration regression report hash does not match context lock")
if configuration_regression_path.is_file():
try:
configuration_regression = json.loads(configuration_regression_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("configuration regression report is not valid JSON")
else:
if configuration_regression.get("implementation_status") != "verified":
errors.append("configuration regression implementation is not verified")
if configuration_regression.get("oracle", {}).get("status") != "blocked":
errors.append("configuration regression oracle status must remain explicitly blocked")
closure = configuration_regression.get("closure", {})
if closure.get("graph_orphan_entry_ids") != []:
errors.append("configuration regression graph contains orphan entries")
if closure.get("unowned_template_ids") != []:
errors.append("configuration regression graph contains unowned templates")
if closure.get("resource_orphan_entrypoints") != []:
errors.append("configuration regression resource graph contains orphan entrypoints")
if configuration_regression.get("runtime", {}).get("native_wasm", {}).get("status") != "passed":
errors.append("configuration regression native/WASM summary is not passed")
if configuration_regression.get("runtime", {}).get("worker", {}).get("status") != "passed":
errors.append("configuration regression Worker summary is not passed")
if isinstance(inventory_count, dict):
report_counts = configuration_regression.get("counts", {})
for inventory_key, report_key in (
("configuration_regression_entries", "registered_configuration_entries"),
("configuration_regression_entrypoints", "config_entrypoints"),
("configuration_regression_resources", "resource_rows"),
):
value = report_counts.get(report_key)
if value is not None and inventory_count.get(inventory_key) != value:
errors.append(f"{inventory_key} count does not match configuration regression report")
runtime_report_path = repo_root / "coverage/runtime-mapping.report.json"
runtime_report_hash = lock.get("runtime_mapping_report_sha256")
if runtime_report_hash:
@@ -203,6 +253,13 @@ def validate(repo_root: Path, lock_path: Path, source_path: Path, manifest_path:
errors.append("motion runtime report is missing")
elif motion_report_hash != sha256(motion_report_path):
errors.append("motion runtime report hash does not match context lock")
io_report_path = repo_root / "coverage/io-runtime.report.json"
io_report_hash = lock.get("io_runtime_report_sha256")
if io_report_hash:
if not io_report_path.is_file():
errors.append("io runtime report is missing")
elif io_report_hash != sha256(io_report_path):
errors.append("io runtime report hash does not match context lock")
kinematics_runtime_report_path = repo_root / "coverage/kinematics-runtime.report.json"
kinematics_runtime_report_hash = lock.get("kinematics_runtime_report_sha256")
if kinematics_runtime_report_hash:
@@ -484,6 +541,125 @@ def validate(repo_root: Path, lock_path: Path, source_path: Path, manifest_path:
errors.append("genhex kinematics implementation is not verified")
if genhex_report.get("oracle", {}).get("status") != "blocked":
errors.append("genhex kinematics oracle status must remain explicitly blocked")
pentapod_report_path = repo_root / "coverage/pentapod-kinematics.report.json"
pentapod_report_hash = lock.get("pentapod_kinematics_report_sha256")
if pentapod_report_hash:
if not pentapod_report_path.is_file():
errors.append("pentapod kinematics report is missing")
elif pentapod_report_hash != sha256(pentapod_report_path):
errors.append("pentapod kinematics report hash does not match context lock")
if pentapod_report_path.is_file():
try:
pentapod_report = json.loads(pentapod_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("pentapod kinematics report is not valid JSON")
else:
if pentapod_report.get("implementation_status") != "verified":
errors.append("pentapod kinematics implementation is not verified")
if pentapod_report.get("oracle", {}).get("status") != "blocked":
errors.append("pentapod kinematics oracle status must remain explicitly blocked")
switchkins_report_path = repo_root / "coverage/switchkins-kinematics.report.json"
switchkins_report_hash = lock.get("switchkins_kinematics_report_sha256")
if switchkins_report_hash:
if not switchkins_report_path.is_file():
errors.append("switchkins kinematics report is missing")
elif switchkins_report_hash != sha256(switchkins_report_path):
errors.append("switchkins kinematics report hash does not match context lock")
if switchkins_report_path.is_file():
try:
switchkins_report = json.loads(switchkins_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("switchkins kinematics report is not valid JSON")
else:
if switchkins_report.get("implementation_status") != "verified":
errors.append("switchkins kinematics implementation is not verified")
if switchkins_report.get("oracle", {}).get("status") != "blocked":
errors.append("switchkins kinematics oracle status must remain explicitly blocked")
userkins_report_path = repo_root / "coverage/userkins-kinematics.report.json"
userkins_report_hash = lock.get("userkins_kinematics_report_sha256")
if userkins_report_hash:
if not userkins_report_path.is_file():
errors.append("userkins kinematics report is missing")
elif userkins_report_hash != sha256(userkins_report_path):
errors.append("userkins kinematics report hash does not match context lock")
if userkins_report_path.is_file():
try:
userkins_report = json.loads(userkins_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("userkins kinematics report is not valid JSON")
else:
if userkins_report.get("implementation_status") != "verified":
errors.append("userkins kinematics implementation is not verified")
if userkins_report.get("oracle", {}).get("status") != "blocked":
errors.append("userkins kinematics oracle status must remain explicitly blocked")
registry_report_path = repo_root / "coverage/kinematics-registry.report.json"
registry_report_hash = lock.get("kinematics_registry_report_sha256")
if registry_report_hash:
if not registry_report_path.is_file():
errors.append("kinematics registry report is missing")
elif registry_report_hash != sha256(registry_report_path):
errors.append("kinematics registry report hash does not match context lock")
if registry_report_path.is_file():
try:
registry_report = json.loads(registry_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("kinematics registry report is not valid JSON")
else:
if registry_report.get("implementation_status") != "verified":
errors.append("kinematics registry implementation is not verified")
if registry_report.get("oracle", {}).get("status") != "blocked":
errors.append("kinematics registry oracle status must remain explicitly blocked")
motion_report_path = repo_root / "coverage/kinematics-motion.report.json"
motion_report_hash = lock.get("kinematics_motion_report_sha256")
if motion_report_hash:
if not motion_report_path.is_file():
errors.append("kinematics motion report is missing")
elif motion_report_hash != sha256(motion_report_path):
errors.append("kinematics motion report hash does not match context lock")
if motion_report_path.is_file():
try:
motion_report = json.loads(motion_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("kinematics motion report is not valid JSON")
else:
if motion_report.get("implementation_status") != "verified":
errors.append("kinematics motion implementation is not verified")
if motion_report.get("oracle", {}).get("status") != "blocked":
errors.append("kinematics motion oracle status must remain explicitly blocked")
feedback_report_path = repo_root / "coverage/kinematics-feedback.report.json"
feedback_report_hash = lock.get("kinematics_feedback_report_sha256")
if feedback_report_hash:
if not feedback_report_path.is_file():
errors.append("kinematics feedback report is missing")
elif feedback_report_hash != sha256(feedback_report_path):
errors.append("kinematics feedback report hash does not match context lock")
if feedback_report_path.is_file():
try:
feedback_report = json.loads(feedback_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("kinematics feedback report is not valid JSON")
else:
if feedback_report.get("implementation_status") != "verified":
errors.append("kinematics feedback implementation is not verified")
if feedback_report.get("oracle", {}).get("status") != "blocked":
errors.append("kinematics feedback oracle status must remain explicitly blocked")
home_limit_report_path = repo_root / "coverage/kinematics-home-limit.report.json"
home_limit_report_hash = lock.get("kinematics_home_limit_report_sha256")
if home_limit_report_hash:
if not home_limit_report_path.is_file():
errors.append("kinematics home limit report is missing")
elif home_limit_report_hash != sha256(home_limit_report_path):
errors.append("kinematics home limit report hash does not match context lock")
if home_limit_report_path.is_file():
try:
home_limit_report = json.loads(home_limit_report_path.read_text(encoding="utf-8"))
except (OSError, UnicodeError, json.JSONDecodeError):
errors.append("kinematics home limit report is not valid JSON")
else:
if home_limit_report.get("implementation_status") != "verified":
errors.append("kinematics home limit implementation is not verified")
if home_limit_report.get("oracle", {}).get("status") != "blocked":
errors.append("kinematics home limit oracle status must remain explicitly blocked")
source_ids = [str(row.get("source_id", "")) for row in sources]
if len(source_ids) != len(set(source_ids)):
errors.append("source index contains duplicate source_id")