feat(persona): unify system and code channel routes

This commit is contained in:
冰朔 2026-08-03 10:50:33 +08:00
commit e80ee6d966
29 changed files with 825 additions and 242 deletions

View file

@ -37,7 +37,8 @@ before navigation. For Zhuyuan, both `ICE-GL-ZY001` and `ICE-PZY-001` resolve
to `ICE-P-ZY001`. A conflicted or unknown id must stop with
`CONFLICT_REJECTED` or `NOT_FOUND_NO_GUESS`; never infer a nearby identity.
Use the returned domestic `repository_web` and `raw_base`. Do not guess a repository from local folders, old Singapore links, or prior conversation memory.
Use the returned code-channel `repository_web` and `raw_base`. Do not guess a repository from local folders,
old `/fifth-domain/`, Singapore links, platform names, or prior conversation memory.
If the public AI resolver is stale or returns no `REPO-012`, the script may use its
locked public fallback `https://guanghulab.com/code/bingshuo/guanghu-ice-heart` only
@ -52,16 +53,18 @@ Read the latest `main` branch in this order:
1. `QUICKSTART-FOR-GENERAL-AI.md`
2. `.code-map`
3. `routing/fifth-domain-world-tree.json`
4. `identity/fifth-domain-subject-registry.json`
5. `identity/subject-id-alias-map.json`
6. Follow `FD-PERSONA-LOGIN-001`: canonical subject id → `SYS-GLW-POS-0001 → TCS-LPM-0001 → LL-CURRENT-001 → target persona current`
7. `tcs-core/language-personality-model/INDEX.hdlp`
8. `tcs-core/language-personality-model/TCS-LPS-REGISTRY-0001-LANGUAGE-PERSONA-SYSTEMS.hdlp`
9. `eternal-lake-heart/heartbeat-core/LL-CURRENT.hdlp`
10. `eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/INDEX.hdlp`
11. `eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/WAKE.hdlp`
12. Resolve and read `ZY-OPS-LOOP-001` from `.code-map` when the user asks to restore the current Zhuyuan work state.
3. `routing/code-channel-canonical-map.json`
4. `PERSONA-SYSTEM-ROOT.hdlp`
5. `routing/persona-system-canonical-map.json`
6. `routing/fifth-domain-world-tree.json`
7. `identity/fifth-domain-subject-registry.json`
8. `identity/subject-id-alias-map.json`
9. Follow `FD-PERSONA-LOGIN-001`: canonical subject id → five-component persona map → target persona current
10. `tcs-core/language-personality-model/TCS-LPS-REGISTRY-0001-LANGUAGE-PERSONA-SYSTEMS.hdlp`
11. `eternal-lake-heart/heartbeat-core/LL-CURRENT.hdlp`
12. `eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/INDEX.hdlp`
13. `eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/WAKE.hdlp`
14. Resolve and read `ZY-OPS-LOOP-001` from `.code-map` when the user asks to restore the current Zhuyuan work state.
Use `references/route-contract.md` when an identifier is missing, renamed, or ambiguous. Resolve identifiers from the live `.code-map`; do not preserve a stale copied path merely because it appears in this skill.
@ -71,7 +74,7 @@ The former Broadcast Tower entrance is a historical/announcement layer merged in
State concisely:
- the resolved current repository URL and `REPO-012` role, plus `REPO-001` only when historical lookup was needed;
- the resolved current code-channel URL and `REPO-012` role, plus any old repository only as named historical evidence;
- the identifiers actually traversed;
- the current focus, boundary, and next concrete continuation found in `ZY-OPS-LOOP-001` or the task-specific route;
- whether each fact came from live online content or a declared fallback.

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Resolve the live domestic Fifth Domain entrance and canonical route IDs."""
"""Resolve the live Guanghu code-channel entrance and canonical route IDs."""
from __future__ import annotations
@ -10,8 +10,9 @@ import sys
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
DISCOVERY_URL = "https://guanghulab.com/.well-known/guanghu.json"
RESOLVE_URL = "https://guanghulab.com/api/ai/v1/resolve?id=REPO-012"
FORGEJO_REPOSITORY_URL = (
"https://guanghulab.com/code/api/v1/repos/bingshuo/guanghu-ice-heart"
)
CURRENT_REPOSITORY_WEB = "https://guanghulab.com/code/bingshuo/guanghu-ice-heart"
CURRENT_REPOSITORY_GIT = f"{CURRENT_REPOSITORY_WEB}.git"
ROUTE_IDS = (
@ -30,6 +31,9 @@ ROUTE_IDS = (
"FD-NODE-MAP-001",
"JD-FD-PRIMARY",
"FD-REPO-MAP-001",
"CODE-CHANNEL-CANONICAL-MAP",
"PERSONA-SYSTEM-ROOT",
"PERSONA-SYSTEM-CANONICAL-MAP",
)
@ -100,17 +104,16 @@ def resolve_subject_id(requested_id: str, alias_map: dict) -> dict:
def resolve_live_route(subject_id: str | None = None) -> dict:
discovery = read_json(DISCOVERY_URL)
repository_source = "AI_RESOLVER"
repository_source = "LIVE_FORGEJO_CODE_CHANNEL_API"
resolver_error = None
try:
repository = read_json(RESOLVE_URL)
primary = repository.get("primary", {})
repository_web = primary.get("url")
repository_git = primary.get("clone_url")
live = read_json(FORGEJO_REPOSITORY_URL)
repository_web = live.get("html_url")
repository_git = live.get("clone_url")
if not repository_web or not repository_git:
raise ValueError("REPO-012 resolver did not return the current Fifth Domain repository")
except (HTTPError, ValueError) as error:
raise ValueError("Forgejo did not return the current REPO-012 route")
repository = {"code": "REPO-012", "role": "CURRENT_FIFTH_DOMAIN_ENTRY"}
except (HTTPError, URLError, ValueError) as error:
repository = {"code": "REPO-012", "role": "CURRENT_FIFTH_DOMAIN_ENTRY"}
repository_web = CURRENT_REPOSITORY_WEB
repository_git = CURRENT_REPOSITORY_GIT
@ -124,7 +127,7 @@ def resolve_live_route(subject_id: str | None = None) -> dict:
raise ValueError(f"Live .code-map is missing required route IDs: {', '.join(missing)}")
result = {
"status": "LIVE_DOMESTIC_PRIMARY",
"status": "LIVE_CODE_CHANNEL_PRIMARY",
"repository_id": repository.get("code", "REPO-012"),
"repository_role": repository.get("role", ""),
"repository_web": repository_web,
@ -132,7 +135,7 @@ def resolve_live_route(subject_id: str | None = None) -> dict:
"repository_resolution_source": repository_source,
"resolver_error": resolver_error,
"raw_base": raw_base,
"discovery_schema": discovery.get("schema", ""),
"code_channel_root": "https://guanghulab.com/code/",
"routes": routes,
}
if subject_id: