feat(paths): enforce fifth-domain physical redirects

This commit is contained in:
冰朔 2026-09-12 18:23:38 +08:00
commit c180a12d8d
15 changed files with 350 additions and 18 deletions

View file

@ -24,6 +24,7 @@ PROMPTER = Path(
ANCHOR = ROOT / "routing/public-navigation-anchor.json"
WORLD = ROOT / "routing/guanghu-era-language-world.json"
PATH_GATE = ROOT / "routing/path-isolation-and-canonical-entry-map.json"
PATH_GATE_RUNTIME = ROOT / "server-tools/fifth-domain-path-gate/fifth-domain-path-gate.mjs"
PERSONAS = ROOT / "identity/light-lake-persona-registration.json"
CHANNELS = ROOT / "routing/persona-channel-context-map.json"
TOPOLOGY = ROOT / "routing/zhuyuan-host-topology.json"
@ -112,6 +113,10 @@ def map_delta(local: dict[str, Any], official: dict[str, Any] | None) -> dict[st
def build(persona_id: str, host: str, channel: str | None, official_mode: str = "verify") -> dict[str, Any]:
gate = run(["node", str(PATH_GATE_RUNTIME), "guard", "--path", str(ROOT), "--purpose", "CURRENT_SELECTION"], timeout=15)
if gate.returncode != 0:
raise PerceptionError("FIFTH_DOMAIN_PHYSICAL_PATH_GATE_REJECTED_CURRENT_ROOT")
gate_receipt = json.loads(gate.stdout)
path_gate = load_json(PATH_GATE)
expected_root = Path(path_gate["canonical_entries"]["repo_012"])
if ROOT.resolve() != expected_root.resolve():
@ -201,6 +206,7 @@ def build(persona_id: str, host: str, channel: str | None, official_mode: str =
"excluded_roots": [path_gate["isolation"]["root"]],
"fixed_read_order": False,
"persona_decides_meaning_and_action": True,
"physical_path_gate": gate_receipt,
},
"evidence": evidence,
"freshness_token": hashlib.sha256(freshness_material).hexdigest(),