feat(hololake): establish clean v1 personal language shell
This commit is contained in:
parent
9e04b0354c
commit
c4f662e541
51 changed files with 16233 additions and 1 deletions
|
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python3
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
REPO = ROOT.parents[1]
|
||||
errors = []
|
||||
|
||||
registry = json.loads((ROOT / "registries/module-registry.json").read_text())
|
||||
ids = [m["module_id"] for m in registry["modules"]]
|
||||
if len(ids) != len(set(ids)):
|
||||
errors.append("duplicate module id")
|
||||
|
||||
required_sources = {
|
||||
"USER_MESSAGE", "PERSONA_RESPONSE", "SYSTEM_CONTEXT", "PROTOCOL_EVENT",
|
||||
"AGENT_ACTION", "TOOL_RESULT", "SYSTEM_RECEIPT",
|
||||
}
|
||||
types = (ROOT / "src/types.ts").read_text()
|
||||
missing = sorted(x for x in required_sources if f'"{x}"' not in types)
|
||||
if missing:
|
||||
errors.append(f"missing source kinds: {missing}")
|
||||
|
||||
package = json.loads((ROOT / "package.json").read_text())
|
||||
for forbidden in ("openai", "anthropic", "@google/generative-ai", "langchain"):
|
||||
if forbidden in package.get("dependencies", {}):
|
||||
errors.append(f"internal model dependency forbidden: {forbidden}")
|
||||
|
||||
tauri = json.loads((ROOT / "src-tauri/tauri.conf.json").read_text())
|
||||
endpoints = tauri["plugins"]["updater"]["endpoints"]
|
||||
if endpoints != ["https://guanghulab.com/hololake/releases/latest.json"]:
|
||||
errors.append("update endpoint drift")
|
||||
if not tauri["plugins"]["updater"].get("pubkey"):
|
||||
errors.append("update signature trust missing")
|
||||
|
||||
architecture = json.loads((REPO / "routing/hololake-current-architecture.json").read_text())
|
||||
clean = architecture.get("clean_v1_rebuild", {})
|
||||
if clean.get("source") != "product-source/hololake-clean-desktop":
|
||||
errors.append("current architecture does not point to clean V1")
|
||||
if clean.get("enterprise_four_domains_embedded") is not False:
|
||||
errors.append("enterprise domains embedded in personal product")
|
||||
if clean.get("fifth_domain_private_content_embedded") is not False:
|
||||
errors.append("Fifth Domain private content embedded in public product")
|
||||
|
||||
if errors:
|
||||
print(json.dumps({"result": "FAIL_0", "errors": errors}, ensure_ascii=False, indent=2))
|
||||
sys.exit(1)
|
||||
print(json.dumps({"result": "PASS_100", "module_ids": ids, "source_kinds": sorted(required_sources)}, ensure_ascii=False, indent=2))
|
||||
Loading…
Reference in a new issue