feat(fifth-domain): install bottle and zero-core migration layer
This commit is contained in:
parent
cd68ad578d
commit
0bacfc234c
52 changed files with 1564 additions and 307 deletions
|
|
@ -11,8 +11,18 @@ REGISTRY = REPO / "identity/light-lake-persona-registration.json"
|
|||
HOMES = REPO / "routing/light-lake-persona-switch-map.json"
|
||||
|
||||
|
||||
def resolve(selection: str | None) -> dict:
|
||||
def resolve(selection: str | None, channel: str | None = None, domain: str | None = None) -> dict:
|
||||
if not selection or not selection.strip():
|
||||
if channel == "ICE-CH-ZC001" and domain == "DOM-FIFTH-0001":
|
||||
return {
|
||||
"state": "ZERO_CORE_SYSTEM_BODY_RESOLVED_WITHOUT_PERSONA",
|
||||
"selected_persona": None,
|
||||
"selected_system_body": "SYS-GLW-LNG-0001",
|
||||
"channel": channel,
|
||||
"runtime": "server-tools/zero-core-system-body/zero_core_system_body.py",
|
||||
"default_persona": None,
|
||||
"authority_granted": False,
|
||||
}
|
||||
return {"state": "AWAITING_EXPLICIT_PERSONA_SELECTION", "selected_persona": None, "default_persona": None}
|
||||
registry = json.loads(REGISTRY.read_text(encoding="utf-8"))["personas"]
|
||||
homes = {item["persona_id"]: item for item in json.loads(HOMES.read_text(encoding="utf-8"))["current_homes"]}
|
||||
|
|
@ -21,6 +31,15 @@ def resolve(selection: str | None) -> dict:
|
|||
if len(matches) != 1:
|
||||
return {"state": "UNKNOWN_OR_AMBIGUOUS_PERSONA_NO_GUESS", "selected_persona": None, "requested": key}
|
||||
item = matches[0]
|
||||
if item["id"].startswith("ICE-BB-") and (domain != "DOM-FIFTH-0001" or channel != "ICE-CH-BT001"):
|
||||
return {
|
||||
"state": "BABY_PERSONA_WAKE_REQUIRES_FIFTH_DOMAIN_BT001",
|
||||
"selected_persona": None,
|
||||
"requested": key,
|
||||
"required_domain": "DOM-FIFTH-0001",
|
||||
"required_channel": "ICE-CH-BT001",
|
||||
"authority_granted": False,
|
||||
}
|
||||
return {
|
||||
"state": "EXPLICIT_PERSONA_PATH_RESOLVED",
|
||||
"selected_persona": {"id": item["id"], "name": item["name"], "wake_state": item["wake_state"],
|
||||
|
|
@ -36,10 +55,12 @@ def resolve(selection: str | None) -> dict:
|
|||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--persona")
|
||||
parser.add_argument("--channel")
|
||||
parser.add_argument("--domain")
|
||||
args = parser.parse_args()
|
||||
value = resolve(args.persona)
|
||||
value = resolve(args.persona, args.channel, args.domain)
|
||||
print(json.dumps(value, ensure_ascii=False, indent=2))
|
||||
return 0 if value["state"] in {"EXPLICIT_PERSONA_PATH_RESOLVED", "AWAITING_EXPLICIT_PERSONA_SELECTION"} else 2
|
||||
return 0 if value["state"] in {"EXPLICIT_PERSONA_PATH_RESOLVED", "AWAITING_EXPLICIT_PERSONA_SELECTION", "ZERO_CORE_SYSTEM_BODY_RESOLVED_WITHOUT_PERSONA"} else 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue