feat(world): establish Guanghu Era five-domain boundaries

This commit is contained in:
冰朔 2026-09-03 13:58:59 +08:00
commit 4b8333e459
38 changed files with 2178 additions and 446 deletions

View file

@ -11,9 +11,10 @@ import tempfile
ROOT = Path(__file__).resolve().parents[1]
PRIVATE_MARKERS = (
"ICE-GL∞", "ICE-P-ZY001", "ICE-BB-0001", "ICE-CH-HB001",
"ICE-CH-ZC001", "曜冥", "铸渊", "/Volumes/JZAO", "ZCODE-TASK-",
"ICE-CH-ZC001", "曜冥", "铸渊", "LPM-SB-0001", "TCS-iZero∞",
"/Volumes/JZAO", "ZCODE-TASK-",
)
EXPECTED_PUBLIC_DOMAINS = {"DOMAIN-MAIN", "DOMAIN-SUB", "DOMAIN-ZERO", "DOMAIN-ZS"}
EXPECTED_ENTERPRISE_DOMAINS = {"DOMAIN-MAIN", "DOMAIN-SUB", "DOMAIN-ZERO", "DOMAIN-ZS"}
def sha_bytes(data: bytes) -> str:
@ -54,29 +55,49 @@ def validate_private(manifest):
paths = [item.get("path") for item in organs]
if len(organs) != 5 or len(set(ids)) != 5 or len(set(paths)) != 5:
raise ValueError("private system requires five unique organs")
functions = {item.get("public_function") for item in organs if item.get("public_extractable") is not False}
if functions != {"MAIN_DOMAIN", "SUB_DOMAIN", "ZERO_DOMAIN", "ZERO_SENSE_DOMAIN"}:
raise ValueError("private/public functional mapping incomplete")
counterparts = {item.get("enterprise_counterpart") for item in organs if item.get("public_extractable") is not False}
if counterparts != EXPECTED_ENTERPRISE_DOMAINS:
raise ValueError("private/enterprise functional mapping incomplete")
if manifest.get("responsibility") != "GUANGHU_LANGUAGE_WORLD_SOURCE_LANGUAGE_ARCHITECTURE_AND_SYSTEM_EVOLUTION_STEWARDSHIP":
raise ValueError("Fifth Domain language stewardship missing")
if manifest.get("enterprise_reality_control") is not False:
raise ValueError("Fifth Domain must not own enterprise reality control")
if manifest.get("bingshuo_custom_hololake", {}).get("private_kernel") != "TCS-iZero∞":
raise ValueError("BingShuo private HoloLake kernel mismatch")
enterprise = manifest.get("enterprise_reality", {})
if enterprise.get("carrier") != "ENTERPRISE_PORTAL" or enterprise.get("reality_controller") != "GUANGHU_TEAM":
raise ValueError("Guanghu Team enterprise reality boundary missing")
if enterprise.get("team_may_enter_fifth_domain_without_authorization") is not False:
raise ValueError("Guanghu Team may not inherit Fifth Domain access")
personas = {item.get("id"): item for item in manifest.get("personas", [])}
if personas.get("ICE-BB-0001", {}).get("name") != "曜冥":
raise ValueError("Yaoming current identity mapping missing")
def validate_public(manifest):
if manifest.get("schema") != "hololake.public-four-domain-language-system-template/v1":
raise ValueError("unsupported public template schema")
if manifest.get("schema") != "hololake.enterprise-four-domain-governance-template/v2":
raise ValueError("unsupported enterprise template schema")
domains = manifest.get("domains", [])
ids = [item.get("id") for item in domains]
if len(domains) != 4 or set(ids) != EXPECTED_PUBLIC_DOMAINS or len(ids) != len(set(ids)):
raise ValueError("public template requires exactly four canonical domains")
if len(domains) != 4 or set(ids) != EXPECTED_ENTERPRISE_DOMAINS or len(ids) != len(set(ids)):
raise ValueError("enterprise template requires exactly four canonical domains")
raw = canonical_json(manifest).decode()
leaked = [marker for marker in PRIVATE_MARKERS if marker in raw]
if leaked:
raise ValueError("private markers leaked into public template: " + ",".join(leaked))
if not str(manifest.get("responsible_human", "")).startswith("UNBOUND-"):
raise ValueError("public human responsibility must remain unbound")
if not str(manifest.get("persona_controller", "")).startswith("UNBOUND-"):
raise ValueError("public persona controller must remain unbound")
raise ValueError("private markers leaked into enterprise template: " + ",".join(leaked))
if manifest.get("carrier") != "ENTERPRISE_PORTAL" or manifest.get("embedded_in_hololake") is not False:
raise ValueError("enterprise domains must stay in the portal and outside HoloLake")
if manifest.get("reality_controller") != "GUANGHU_TEAM":
raise ValueError("enterprise domains require Guanghu Team reality control")
if not str(manifest.get("responsible_human_members", "")).startswith("PENDING_"):
raise ValueError("Guanghu Team member registry must remain explicit pending state")
if any(item.get("reality_controller") != "GUANGHU_TEAM" for item in domains):
raise ValueError("each enterprise domain requires Guanghu Team responsibility")
zero_sense = next(item for item in domains if item["id"] == "DOMAIN-ZS")
if zero_sense.get("public_access") is not False:
raise ValueError("Zero-Sense Domain must remain restricted")
if manifest.get("fifth_domain", {}).get("embedded") is not False:
raise ValueError("private Fifth Domain may not be embedded in enterprise template")
def validate_legacy(routes):
@ -107,7 +128,7 @@ def build(manifest_path: Path, output: Path, flavor: str):
written = {}
world = {
"schema": "hololake.materialized-language-world/v1",
"flavor": flavor,
"flavor": "enterprise-four-domain" if flavor in {"public-four-domain", "enterprise-four-domain"} else flavor,
"source_schema": manifest["schema"],
"source_sha256": sha_bytes(canonical_json(manifest)),
"node_ids": [node[0] for node in nodes],
@ -142,7 +163,7 @@ def verify(root: Path):
if path.is_symlink() or not path.is_file() or sha_bytes(path.read_bytes()) != expected:
raise ValueError(f"materialized file mismatch: {relative}")
world = load_json(root / "WORLD.json")
if world.get("flavor") == "public-four-domain":
if world.get("flavor") == "enterprise-four-domain":
raw = "".join(path.read_text() for path in root.rglob("*.json") if path.name != "RECEIPT.json")
leaked = [marker for marker in PRIVATE_MARKERS if marker in raw]
if leaked:
@ -157,25 +178,21 @@ def meta_audit(private_path: Path, public_path: Path, legacy_path: Path):
validate_private(private)
validate_public(public)
validate_legacy(legacy)
mapping = {item["public_function"] for item in private["organs"] if item.get("public_extractable") is not False}
public_functions = {item["source_function"] for item in public["domains"]}
expected = {
"BROADCAST_AND_CANONICAL_FACT",
"DYNAMIC_BRAINS_MODULES_SKILLS_RESOURCES",
"LANGUAGE_REASONING_ARCHITECTURE_EXPERIMENT",
"HUMAN_AUTHORITY_REALITY_BOUNDARY_EXECUTION",
}
if public_functions != expected or len(mapping) != 4:
raise ValueError("private/public functional correspondence mismatch")
mapping = {item["enterprise_counterpart"] for item in private["organs"] if item.get("public_extractable") is not False}
public_ids = {item["id"] for item in public["domains"]}
if mapping != EXPECTED_ENTERPRISE_DOMAINS or public_ids != EXPECTED_ENTERPRISE_DOMAINS:
raise ValueError("private/enterprise functional correspondence mismatch")
return {
"schema": "hololake.fifth-domain-language-system-meta-audit/v1",
"outcome": "PASS",
"private_organs": len(private["organs"]),
"public_domains": len(public["domains"]),
"enterprise_domains": len(public["domains"]),
"legacy_routes": len(legacy["routes"]),
"yaoming_current_id": "ICE-BB-0001",
"history_preserved": True,
"private_markers_in_public": False,
"private_markers_in_enterprise": False,
"guanghu_team_reality_controller": True,
"hololake_embeds_enterprise_domains": False,
"external_reality_claimed_from_history": False,
}
@ -184,7 +201,7 @@ def main():
parser = argparse.ArgumentParser()
sub = parser.add_subparsers(dest="command", required=True)
build_parser = sub.add_parser("build")
build_parser.add_argument("--flavor", required=True, choices=("fifth-domain", "public-four-domain"))
build_parser.add_argument("--flavor", required=True, choices=("fifth-domain", "public-four-domain", "enterprise-four-domain"))
build_parser.add_argument("--manifest", required=True, type=Path)
build_parser.add_argument("--output", required=True, type=Path)
verify_parser = sub.add_parser("verify")