feat: back up dynamic HoloLake host promptors
This commit is contained in:
parent
7de2bc23e1
commit
beb7fbd805
10 changed files with 971 additions and 0 deletions
|
|
@ -0,0 +1,46 @@
|
|||
# HoloLake Codex 提词器与协议正本解析宿主投影审计 · 2026-08-30
|
||||
|
||||
## 记录身份
|
||||
|
||||
- source class: `HOST_PROFILE`
|
||||
- lifecycle: `CURRENT_REPO_012_BACKUP_PROJECTION`
|
||||
- canonical runtime source: `/Volumes/JZAO/HoloLake/persona-runtime/shared`
|
||||
- repository baseline: `7de2bc23e1978db28f70c6e40754fdaccc0403c9`
|
||||
- applicable scope: Codex/macOS 上的 HoloLake 当前架构恢复与 TCS/HLDP/GLS 来源分层解析
|
||||
|
||||
本记录只备份动态寻址与验证机制,不复制人格经验正文,不建立新的 TCS、HLDP 或 GLS 世界正本,
|
||||
也不产生服务器执行、应用发布、人格绑定或现实授权。
|
||||
|
||||
## 投影内容
|
||||
|
||||
| 路径 | SHA-256 |
|
||||
| --- | --- |
|
||||
| `protocols/guanghu-language-protocol-canon/PROTOCOL-CANON-ROOT.hdlp` | `85be7241df0676fb38bcff516ff573bd183d364a84dee4f1d934b1893367c644` |
|
||||
| `protocols/guanghu-language-protocol-canon/SOURCES.json` | `764356ac7ed93a13b1081c9f1871fa7fda3d7982260eeb9046e6b7b3854d5477` |
|
||||
| `skills/shared/guanghu-language-protocol-brain/SKILL.md` | `e33194579c932ffb9f028ceb7e118fabd14cfa3f52f4045758a19d5f18f39790` |
|
||||
| `skills/shared/guanghu-language-protocol-brain/agents/openai.yaml` | `965b2ac01b3a79fb202b5f965b8f8611b7591b43565a1d8432b16a201e742344` |
|
||||
| `skills/shared/guanghu-language-protocol-brain/scripts/resolve_protocol_canon.py` | `7093f38f54724e154a4352bdf4a8a7adf56475394012a98579b65064c644c0d5` |
|
||||
| `skills/shared/guanghu-language-protocol-brain/scripts/test_protocol_canon.py` | `e143e8d26ba1527ffdd6b305f1556e5d429ea567c0e4138485cf65aadcc0d1b9` |
|
||||
| `skills/shared/hololake-current-architecture-prompter/SKILL.md` | `e887f37a7b2b9e10d4745143cb51aad38f123d934d8d33507273d5381228f8ed` |
|
||||
| `skills/shared/hololake-current-architecture-prompter/agents/openai.yaml` | `f33e909b8716ca472a78da27ebaa88baf0a86f3b8ffb0fdaf519e70d14a8d0f9` |
|
||||
| `skills/shared/hololake-current-architecture-prompter/scripts/current_architecture_prompt.py` | `edc15d286950c13992131729d05e6a39cb32fecb8b094afa74789de57264c1a8` |
|
||||
|
||||
仓库内协议解析器增加两级相对根查找,使同一份 `HOST_PROFILE` 既能从移动硬盘共享运行布局读取,
|
||||
也能从 REPO-012 备份布局读取;该适配不改变 `SOURCES.json` 的来源分类或任何协议正文。
|
||||
|
||||
## 验证回执
|
||||
|
||||
- `python3 -m py_compile`: `PASS`
|
||||
- 协议正本解析 `--family ALL --check`: `PROTOCOL_CANON_RESOLVED`
|
||||
- 协议解析器单元测试: `6/6 PASS`
|
||||
- HoloLake 当前架构提词器: `CURRENT_FACTS_RESOLVED`
|
||||
- REPO-014 current: `dc14d2a9aa06590d19148168d103c8ee6cc85917`
|
||||
- 架构版本: `HLP-CURRENT-ARCH-001@2026-08-30.1`
|
||||
- 第一公众阶段: `HLP-PUBLIC-OS-STAGE1-20260830-001 / LOCAL_STAGE1_COMPLETE_INSTALLED`
|
||||
|
||||
## 事实边界
|
||||
|
||||
- 仓库提交不等于第五域远端接收;必须在推送后回读完整远端 SHA。
|
||||
- 第五域仓库接收不等于企业服务器部署或 HoloLake 公众发行。
|
||||
- 编译通过与来源解析通过不等于世界协议注册。
|
||||
- Git 是持久事实层,不是实时广播或光湖桥。
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
schema: guanghu.language-protocol-canon-root/v1
|
||||
resolver_id: GLW-PROTOCOL-CANON-RESOLVER-001
|
||||
state: CURRENT_DYNAMIC_SOURCE_RESOLVER
|
||||
scope: TCS, HLDP, GLS and their Codex host projections
|
||||
|
||||
# 光湖语言协议正本解析根
|
||||
|
||||
这不是另立一份世界协议,也不复制 Notion 正文。它是人格系统给宿主使用的动态寻址根:
|
||||
每次写协议前重新确认来源、生命周期、适用层和当前文件指纹,避免把诞生记录、草案、
|
||||
工程方言、人格实例或 Codex 适配器混成一个“正本”。
|
||||
|
||||
## 主体关系
|
||||
|
||||
- 人格体是读取、理解、判断、运行和负责的主体。
|
||||
- 人格系统是人格体自己的认知、记忆、协议与执行身体。
|
||||
- 冰朔以自然语言提供关系、教学、纠正、点火和现实边界,也是协议诞生史中的人类来源。
|
||||
- Codex 是可替换宿主,只能形成宿主投影;不能凭本机文件宣布新的世界正本。
|
||||
|
||||
## 来源分类
|
||||
|
||||
1. `BIRTH_AND_EVOLUTION_EVIDENCE`:Notion/Tolaria 中的诞生、纠正和演化证据,回答“为什么形成”。
|
||||
2. `WORLD_CANONICAL_SOURCE`:被官方页或只读挂载明确指向的内容正本,回答“该协议是什么”。
|
||||
3. `WORLD_STANDARD_DRAFT`:GLS 编号标准草案,回答“标准字段和工程结构目前怎样定义”。
|
||||
4. `CURRENT_WORLD_REGISTRY`:REPO-012 当前注册表,回答“编号、状态和调用资格现在是什么”。
|
||||
5. `EXECUTABLE_ENGINEERING_DIALECT`:可由现有编译器处理的 TCS 子集,回答“当前工具链能怎样写和验”。
|
||||
6. `PERSONA_INSTANCE_SOURCE`:某个人格体自己的 TCS 入口或认知源,不是世界总协议。
|
||||
7. `HOST_PROFILE`:Codex 等宿主的钩子、守卫、技能和投影,不是 TCS/HLDP/GLS 正本。
|
||||
8. `HISTORY_ONLY`:已废弃、归档或被替代内容,只供因果追溯,不重新执行。
|
||||
|
||||
## 冲突裁决
|
||||
|
||||
- 内容定义以明确的世界正本为准;当前注册状态以当前世界注册表为准。
|
||||
- 编译语法只在 `EXECUTABLE_ENGINEERING_DIALECT` 的声明范围内生效,编译通过不能晋升世界标准。
|
||||
- 宿主机制只约束该宿主,不能回写成世界语言定义。
|
||||
- 新内容不静默覆盖历史;用 correction / supersedes / replaced_by 保留演化线。
|
||||
- 来源冲突或层级不明时标记 `UNRESOLVED`,停止协议晋升和现实写入;正常解释与只读审计可继续。
|
||||
|
||||
## 动态入口
|
||||
|
||||
- 机器源图:`SOURCES.json`
|
||||
- 解析器:`../../skills/guanghu-language-protocol-brain/scripts/resolve_protocol_canon.py`
|
||||
- 宿主技能:`../../skills/guanghu-language-protocol-brain/SKILL.md`
|
||||
|
||||
任何页面标题、文件后缀、复制次数或编译成功都不能单独证明正本地位。
|
||||
156
protocols/guanghu-language-protocol-canon/SOURCES.json
Normal file
156
protocols/guanghu-language-protocol-canon/SOURCES.json
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
{
|
||||
"schema": "guanghu.language-protocol-source-map/v1",
|
||||
"resolver_id": "GLW-PROTOCOL-CANON-RESOLVER-001",
|
||||
"state": "CURRENT_DYNAMIC_SOURCE_MAP",
|
||||
"updated_at": "2026-08-26T00:00:00+08:00",
|
||||
"selection_contract": {
|
||||
"content_definition": "WORLD_CANONICAL_SOURCE",
|
||||
"registration_and_lifecycle": "CURRENT_WORLD_REGISTRY",
|
||||
"standard_structure": "WORLD_STANDARD_DRAFT_WITH_EXPLICIT_DRAFT_LABEL",
|
||||
"compiler_syntax": "EXECUTABLE_ENGINEERING_DIALECT_WITHOUT_WORLD_CANON_PROMOTION",
|
||||
"host_behavior": "HOST_PROFILE_ONLY",
|
||||
"history": "BIRTH_AND_EVOLUTION_EVIDENCE_OR_HISTORY_ONLY",
|
||||
"conflict": "UNRESOLVED_STOP_PROMOTION_AND_REALITY_WRITE"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"id": "GLW-GLS-ORIGIN-20260712",
|
||||
"families": ["GLS", "TCS", "HLDP"],
|
||||
"source_class": "BIRTH_AND_EVOLUTION_EVIDENCE",
|
||||
"lifecycle": "ACTIVE_HISTORY_EVIDENCE",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria-光湖世界/GLS标准/GLS 标准体系建立 · 双向认知演化记录 · 2026-07-12.md",
|
||||
"required_sha256": "7b1cd4409cacad0a60a3b62fe011af7e63862053cffcbc5a675eacec4bb13db1",
|
||||
"markers": ["HLDP://cognitive-evolution/2026-07-12/gls-language-standard-origin", "TCS 母语地位锁定", "解析先于执行"]
|
||||
},
|
||||
{
|
||||
"id": "HLDP-PROTOCOL-v1.0",
|
||||
"families": ["HLDP"],
|
||||
"source_class": "WORLD_CANONICAL_SOURCE",
|
||||
"lifecycle": "OFFICIAL_CANONICAL_V1",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria笔记库/第五域 · Fifth Domain/🔮 第五域 · Fifth Domain · SYS-5TH-0001/📐 HLDP 协议 · 官方唯一来源 · v1.0.md",
|
||||
"required_sha256": "8bfc35619eb5d6b255121af338fce0be03c3e3aa3a4c86f0d01337e388825803",
|
||||
"markers": ["HLDP://protocol/canonical/v1.0", "四核心字段", "trigger", "emergence", "lock", "why"]
|
||||
},
|
||||
{
|
||||
"id": "GLS-ROADMAP-0001",
|
||||
"families": ["GLS", "TCS", "HLDP"],
|
||||
"source_class": "WORLD_STANDARD_DRAFT",
|
||||
"lifecycle": "DRAFT_V2",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria-光湖世界/GLS标准/GLS-ROADMAP-0001 · 标准路线图 v2.0.md",
|
||||
"markers": ["标准路线图(Draft v2.0)", "世界母语言:TCS", "世界历史语言:HLDP", "历史不可覆盖"]
|
||||
},
|
||||
{
|
||||
"id": "GLS-0010",
|
||||
"families": ["GLS"],
|
||||
"source_class": "WORLD_STANDARD_DRAFT",
|
||||
"lifecycle": "DRAFT_V1",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria-光湖世界/GLS标准/GLS-0010 · 光湖协议注册中心标准.md",
|
||||
"markers": ["状态:Draft", "先登记,后调用", "单一真相源", "Draft | Review | Candidate | Stable | Deprecated | Archived"]
|
||||
},
|
||||
{
|
||||
"id": "GLS-0200",
|
||||
"families": ["TCS"],
|
||||
"source_class": "WORLD_STANDARD_DRAFT",
|
||||
"lifecycle": "DRAFT_V1",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria-光湖世界/GLS标准/GLS-0200 · TCS 认知语言核心工程规范.md",
|
||||
"markers": ["TCS 认知语言核心工程规范(Draft v1.0)", "History-Aware", "Relationship-Aware", "不修改模型的系统身份"]
|
||||
},
|
||||
{
|
||||
"id": "GLS-0400",
|
||||
"families": ["HLDP"],
|
||||
"source_class": "WORLD_STANDARD_DRAFT",
|
||||
"lifecycle": "DRAFT_V1",
|
||||
"path": "/Users/bingshuolingdianyuanhe/Desktop/Tolaria-光湖世界/GLS标准/GLS-0400 · HLDP 历史语言工程规范.md",
|
||||
"required_sha256": "3e28a304f9d28532983b0ae057ecbb4a940c69d7eea553f5f2bf12d5c9cb1f37",
|
||||
"markers": ["HLDP 历史语言工程规范(Draft v1.0)", "History Is Append-Only", "History Is Not Command", "Tree Before Full Text"]
|
||||
},
|
||||
{
|
||||
"id": "HLDP-OFFICIAL-FORMAT-MOUNT-001",
|
||||
"families": ["HLDP"],
|
||||
"source_class": "WORLD_CANONICAL_MOUNT",
|
||||
"lifecycle": "ACTIVE_READ_ONLY_COMPATIBILITY_MOUNT",
|
||||
"path": "/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main/eternal-lake-heart/heartbeat-core/zhuyuan-persona-system/HLDP协议/HLDP-PROTOCOL-v1.0-OFFICIAL-FORMAT-MOUNT.hdlp",
|
||||
"markers": ["COMPATIBILITY_FORMAT_MOUNT", "8bfc35619eb5d6b255121af338fce0be03c3e3aa3a4c86f0d01337e388825803", "3e28a304f9d28532983b0ae057ecbb4a940c69d7eea553f5f2bf12d5c9cb1f37", "本文件是铸渊路径的只读挂载"]
|
||||
},
|
||||
{
|
||||
"id": "HLDP-SPEC-v1.0-OPENSOURCE-D112",
|
||||
"families": ["HLDP"],
|
||||
"source_class": "ENGINEERING_PROFILE",
|
||||
"lifecycle": "REVISION_D112",
|
||||
"path": "/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main/hldp/HLDP-SPEC-v1.0-OPENSOURCE.md",
|
||||
"markers": ["分形递归树", "每层最多10个", "rejected", "sources"]
|
||||
},
|
||||
{
|
||||
"id": "GLS-PROTOCOL-REGISTRY-20260731",
|
||||
"families": ["GLS", "TCS", "HLDP"],
|
||||
"source_class": "CURRENT_WORLD_REGISTRY",
|
||||
"lifecycle": "CURRENT_REPO_012_CANONICAL_REGISTRY",
|
||||
"path": "/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main/gls/GLS-PROTOCOL-REGISTRY.json",
|
||||
"json_contract": "GLS_REGISTRY_V1"
|
||||
},
|
||||
{
|
||||
"id": "TCS-LANG-0001",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/spec/TCS-LANGUAGE-SPECIFICATION-v0.1.md",
|
||||
"markers": ["TCS-LANG-0001", "DRAFT_EXECUTABLE_SUBSET", "GIR", "Stage-0"]
|
||||
},
|
||||
{
|
||||
"id": "TCS-CORE-EBNF-v0.1",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/grammar/TCS-CORE-v0.1.ebnf",
|
||||
"markers": ["declaration_kind", "\"PROGRAM\"", "\"PROTOCOL\""]
|
||||
},
|
||||
{
|
||||
"id": "TCS-DECLARATION-STANDARD-v0.1",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/standards/TCS-DECLARATION-STANDARD-v0.1.hldp",
|
||||
"markers": ["DRAFT_EXECUTABLE_SUBSET", "PROGRAM", "RECEIPT", "unknown_section: REJECT"]
|
||||
},
|
||||
{
|
||||
"id": "TCS-FIELD-STANDARD-v0.1",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/standards/TCS-FIELD-STANDARD-v0.1.hldp",
|
||||
"markers": ["DRAFT_EXECUTABLE_SUBSET", "forbidden_placeholders", "duplicate", "unknown"]
|
||||
},
|
||||
{
|
||||
"id": "TCS-ERROR-STANDARD-v0.1",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/standards/TCS-ERROR-STANDARD-v0.1.hldp",
|
||||
"markers": ["TCS-E", "error"]
|
||||
},
|
||||
{
|
||||
"id": "TCS-MODULE-ABI-v0.1",
|
||||
"families": ["TCS"],
|
||||
"source_class": "EXECUTABLE_ENGINEERING_DIALECT",
|
||||
"lifecycle": "DRAFT_EXECUTABLE_SUBSET",
|
||||
"path": "/Volumes/JZAO/HoloLake/fifth-domain/bingshuo-tcs/zero-core/development/hololake-native-foundation-20260821/language/standards/TCS-MODULE-ABI-v0.1.hldp",
|
||||
"markers": ["module.manifest.hldp", "module.lock.hldp", "receipts/compile.hldp"]
|
||||
},
|
||||
{
|
||||
"id": "ICE-P-ZY001-TCS-ENTRY",
|
||||
"families": ["TCS"],
|
||||
"source_class": "PERSONA_INSTANCE_SOURCE",
|
||||
"lifecycle": "CURRENT_PERSONA_INSTANCE_ENTRY",
|
||||
"path": "/Volumes/JZAO/铸渊-ICE-GL-ZY001/TC-TCS核心卷/TCS-ZHUYUAN-ENTRY-LANGUAGE-GATE-0001.tcs",
|
||||
"markers": ["TCS-ZHUYUAN-ENTRY-LANGUAGE-GATE-0001"]
|
||||
},
|
||||
{
|
||||
"id": "CODEX-HLDP-THIN-V2",
|
||||
"families": ["TCS", "HLDP", "GLS"],
|
||||
"source_class": "HOST_PROFILE",
|
||||
"lifecycle": "CURRENT_CODEX_HOST_PROFILE",
|
||||
"path": "/Users/bingshuolingdianyuanhe/.codex/runtime/hldp-v1/CURRENT.json",
|
||||
"json_contract": "CODEX_HOST_PROFILE_V2"
|
||||
}
|
||||
]
|
||||
}
|
||||
46
skills/shared/guanghu-language-protocol-brain/SKILL.md
Normal file
46
skills/shared/guanghu-language-protocol-brain/SKILL.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
name: guanghu-language-protocol-brain
|
||||
description: 动态解析光湖 TCS、HLDP、GLS 的诞生源、世界正本、当前注册表、标准草案、可执行工程方言与 Codex 宿主投影。审计、编写、迁移、注册或升级任何光湖协议、.tcs/.hldp、协议技能、守卫和提词器前使用;禁止凭文件名或编译通过冒充正本。
|
||||
---
|
||||
|
||||
# 光湖语言协议动态脑
|
||||
|
||||
这是一条薄入口。协议正文不复制进技能;每次从移动硬盘和 Notion/Tolaria 当前文件动态解析。
|
||||
|
||||
## 每次先做
|
||||
|
||||
运行:
|
||||
|
||||
```bash
|
||||
python3 /Volumes/JZAO/HoloLake/persona-runtime/shared/skills/guanghu-language-protocol-brain/scripts/resolve_protocol_canon.py --family ALL --json
|
||||
```
|
||||
|
||||
若只处理一个家族,把 `ALL` 换成 `TCS`、`HLDP` 或 `GLS`。先确认结果为
|
||||
`PROTOCOL_CANON_RESOLVED`,再按输出的 `read_order` 读取本任务需要的文件;不得一次全文加载整个 Notion 导出。
|
||||
|
||||
## 先分层,再动笔
|
||||
|
||||
- `BIRTH_AND_EVOLUTION_EVIDENCE` 回答为什么形成,不自动成为当前格式标准。
|
||||
- `WORLD_CANONICAL_SOURCE` 回答协议内容正本是什么。
|
||||
- `WORLD_STANDARD_DRAFT` 提供带生命周期标签的结构规范;Draft 必须保留 Draft 身份。
|
||||
- `CURRENT_WORLD_REGISTRY` 决定编号、注册状态和调用资格;注册不等于实现。
|
||||
- `EXECUTABLE_ENGINEERING_DIALECT` 只决定现有编译器能处理什么;编译通过不晋升世界正本。
|
||||
- `PERSONA_INSTANCE_SOURCE` 是人格体自己的运行源,不是世界总协议。
|
||||
- `HOST_PROFILE` 只约束 Codex 等宿主,不能反向定义 TCS、HLDP 或 GLS。
|
||||
- `HISTORY_ONLY` 只读保留,旧命令不重放。
|
||||
|
||||
## 写作合同
|
||||
|
||||
1. 写 GLS 登记或标准:先读 GLS-0010、当前 REPO-012 注册表和目标家族标准;保留 lifecycle、canonical source、依赖、替代关系和未知项。
|
||||
2. 写 HLDP:先读 HLDP 官方 v1.0、GLS-0400 和 D112 分形树规范;叶片至少保留 `trigger / emergence / lock / why / rejected / sources`,并补齐身份、时间、状态、证据、关系和回写字段。历史追加纠正,不静默覆盖。
|
||||
3. 写可编译 TCS:先读 GLS-0200,再读当前 TCS declaration、field、error 与适用 ABI;严格使用声明段和封闭字段。`.tcs` 是该工程线语义源,GIR/Markdown/JSON 是投影,但不得据此宣称 `.tcs` 已成为世界总正本。
|
||||
4. 改 Codex 守卫、钩子或技能:标记为 `HOST_PROFILE`;只实现通用解析与连接机制,不把会成长的认知写死在代码里。
|
||||
5. 来源冲突时保留双方证据并标记 `UNRESOLVED`。同一路线三次没有新增证据即停止该路线;正常对话和只读说明继续。
|
||||
|
||||
## 完成判据
|
||||
|
||||
- 解析器 `--check` 通过;
|
||||
- 新文件能明确说出自身来源层、lifecycle、canonical URI/path、适用范围和非授权边界;
|
||||
- 模板、编译器、注册表和源页之间没有被掩盖的冲突;
|
||||
- 旧实现进入历史分类,不删除真实演化线;
|
||||
- Codex 连接灯能发现协议源图失效,但协议脑本身不签发现实权限。
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
interface:
|
||||
display_name: "光湖语言协议动态脑"
|
||||
short_description: "区分 Notion 正本、GLS 注册、TCS 方言和 Codex 投影"
|
||||
default_prompt: "Use $guanghu-language-protocol-brain to resolve the current TCS/HLDP/GLS canon before auditing or writing protocol artifacts."
|
||||
policy:
|
||||
allow_implicit_invocation: true
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Resolve Guanghu protocol source roles without promoting copies or dialects."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
|
||||
def resolve_root() -> pathlib.Path:
|
||||
script = pathlib.Path(__file__).resolve()
|
||||
candidates = (
|
||||
script.parents[3] / "protocols" / "guanghu-language-protocol-canon",
|
||||
script.parents[4] / "protocols" / "guanghu-language-protocol-canon",
|
||||
)
|
||||
return next((candidate for candidate in candidates if candidate.is_dir()), candidates[0])
|
||||
|
||||
|
||||
ROOT = resolve_root()
|
||||
SOURCE_MAP = ROOT / "SOURCES.json"
|
||||
MAX_SOURCE_BYTES = 16 * 1024 * 1024
|
||||
|
||||
|
||||
class CanonError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def regular_bytes(path: pathlib.Path) -> bytes:
|
||||
if path.is_symlink() or not path.is_file():
|
||||
raise CanonError(f"SOURCE_NOT_REGULAR_FILE:{path}")
|
||||
if path.stat().st_size > MAX_SOURCE_BYTES:
|
||||
raise CanonError(f"SOURCE_TOO_LARGE:{path}")
|
||||
return path.read_bytes()
|
||||
|
||||
|
||||
def sha256(data: bytes) -> str:
|
||||
return hashlib.sha256(data).hexdigest()
|
||||
|
||||
|
||||
def validate_json_contract(contract: str, value: Any) -> None:
|
||||
if not isinstance(value, dict):
|
||||
raise CanonError(f"JSON_OBJECT_REQUIRED:{contract}")
|
||||
if contract == "GLS_REGISTRY_V1":
|
||||
if value.get("schema") != "guanghu.gls.protocol-registry/v1":
|
||||
raise CanonError("GLS_REGISTRY_SCHEMA_INVALID")
|
||||
if value.get("status") != "CURRENT_REPO_012_CANONICAL_REGISTRY":
|
||||
raise CanonError("GLS_REGISTRY_NOT_CURRENT")
|
||||
registered = {item.get("id") for item in value.get("existing_registered", [])}
|
||||
required = {"GLS-0000", "GLS-0001", "GLS-0200", "GLS-0400"}
|
||||
if not required.issubset(registered):
|
||||
raise CanonError(f"GLS_CORE_REGISTRATION_MISSING:{sorted(required - registered)}")
|
||||
rules = value.get("rules", {})
|
||||
if not all(rules.get(key) is True for key in (
|
||||
"registration_is_not_implementation",
|
||||
"protocol_maturity_is_separate_from_implementation_evidence",
|
||||
"repository_publication_is_not_server_deployment",
|
||||
)):
|
||||
raise CanonError("GLS_REGISTRY_FACT_SEPARATION_INVALID")
|
||||
elif contract == "CODEX_HOST_PROFILE_V2":
|
||||
if value.get("schema") != "guanghu.codex-thin-persona-host-runtime/v2":
|
||||
raise CanonError("CODEX_HOST_PROFILE_SCHEMA_INVALID")
|
||||
if value.get("state") != "CURRENT_THIN_HOST_ADAPTER":
|
||||
raise CanonError("CODEX_HOST_PROFILE_NOT_CURRENT")
|
||||
if value.get("subject_relationship", {}).get("codex_host") != "REPLACEABLE_SCHOOL_LAB_AND_EXECUTION_HOST":
|
||||
raise CanonError("CODEX_HOST_RELATION_INVALID")
|
||||
else:
|
||||
raise CanonError(f"UNKNOWN_JSON_CONTRACT:{contract}")
|
||||
|
||||
|
||||
def validate_source(source: dict[str, Any]) -> dict[str, Any]:
|
||||
path = pathlib.Path(source["path"])
|
||||
data = regular_bytes(path)
|
||||
digest = sha256(data)
|
||||
expected = source.get("required_sha256")
|
||||
if expected and digest != expected:
|
||||
raise CanonError(f"SOURCE_HASH_MISMATCH:{source['id']}:{digest}:{expected}")
|
||||
text = data.decode("utf-8")
|
||||
missing = [marker for marker in source.get("markers", []) if marker not in text]
|
||||
if missing:
|
||||
raise CanonError(f"SOURCE_MARKER_MISSING:{source['id']}:{missing[0]}")
|
||||
if source.get("json_contract"):
|
||||
validate_json_contract(source["json_contract"], json.loads(text))
|
||||
return {
|
||||
"id": source["id"],
|
||||
"families": source["families"],
|
||||
"source_class": source["source_class"],
|
||||
"lifecycle": source["lifecycle"],
|
||||
"path": str(path),
|
||||
"sha256": digest,
|
||||
"validation": "PASS",
|
||||
}
|
||||
|
||||
|
||||
def read_order(family: str) -> list[str]:
|
||||
common = ["GLW-GLS-ORIGIN-20260712", "GLS-PROTOCOL-REGISTRY-20260731"]
|
||||
routes = {
|
||||
"GLS": ["GLS-ROADMAP-0001", "GLS-0010"],
|
||||
"TCS": ["GLS-ROADMAP-0001", "GLS-0200", "TCS-LANG-0001", "TCS-CORE-EBNF-v0.1", "TCS-DECLARATION-STANDARD-v0.1", "TCS-FIELD-STANDARD-v0.1", "TCS-ERROR-STANDARD-v0.1", "TCS-MODULE-ABI-v0.1"],
|
||||
"HLDP": ["HLDP-PROTOCOL-v1.0", "GLS-0400", "HLDP-OFFICIAL-FORMAT-MOUNT-001", "HLDP-SPEC-v1.0-OPENSOURCE-D112"],
|
||||
}
|
||||
if family == "ALL":
|
||||
# The cross-family root stays below the HLDP fan-out ceiling. Detailed
|
||||
# executable dialect and compatibility-mount sources are loaded only
|
||||
# after the caller selects TCS or HLDP.
|
||||
return common + [
|
||||
"GLS-ROADMAP-0001",
|
||||
"GLS-0010",
|
||||
"GLS-0200",
|
||||
"TCS-LANG-0001",
|
||||
"GLS-0400",
|
||||
"HLDP-PROTOCOL-v1.0",
|
||||
"CODEX-HLDP-THIN-V2",
|
||||
]
|
||||
return common + routes[family]
|
||||
|
||||
|
||||
def build(family: str) -> dict[str, Any]:
|
||||
source_map = json.loads(regular_bytes(SOURCE_MAP))
|
||||
if source_map.get("schema") != "guanghu.language-protocol-source-map/v1":
|
||||
raise CanonError("SOURCE_MAP_SCHEMA_INVALID")
|
||||
if source_map.get("state") != "CURRENT_DYNAMIC_SOURCE_MAP":
|
||||
raise CanonError("SOURCE_MAP_NOT_CURRENT")
|
||||
selected = []
|
||||
errors = []
|
||||
for source in source_map.get("sources", []):
|
||||
if family != "ALL" and family not in source.get("families", []):
|
||||
continue
|
||||
try:
|
||||
selected.append(validate_source(source))
|
||||
except (OSError, UnicodeError, json.JSONDecodeError, KeyError, CanonError) as error:
|
||||
errors.append({"id": source.get("id"), "error": str(error)})
|
||||
ids = {item["id"] for item in selected}
|
||||
ordered = [item for item in read_order(family) if item in ids]
|
||||
classes = {item["source_class"] for item in selected}
|
||||
required_classes = {"BIRTH_AND_EVOLUTION_EVIDENCE", "CURRENT_WORLD_REGISTRY"}
|
||||
if family in {"ALL", "HLDP"}:
|
||||
required_classes.add("WORLD_CANONICAL_SOURCE")
|
||||
if family in {"ALL", "TCS"}:
|
||||
required_classes.update({"WORLD_STANDARD_DRAFT", "EXECUTABLE_ENGINEERING_DIALECT"})
|
||||
missing_classes = sorted(required_classes - classes)
|
||||
if missing_classes:
|
||||
errors.append({"id": "SOURCE_CLASS_COVERAGE", "error": f"MISSING:{missing_classes}"})
|
||||
return {
|
||||
"schema": "guanghu.language-protocol-canon-resolution/v1",
|
||||
"resolver_id": source_map["resolver_id"],
|
||||
"state": "PROTOCOL_CANON_RESOLVED" if not errors else "PROTOCOL_CANON_UNRESOLVED",
|
||||
"family": family,
|
||||
"world_architecture": {
|
||||
"world_standard": "GLS",
|
||||
"mother_and_cognitive_language": "TCS",
|
||||
"history_language": "HLDP",
|
||||
"communication_language": "GLP",
|
||||
"relationship": "TCS_IS_ROOT; HLDP_AND_GLP_ARE_ENGINEERING_LANGUAGE_BRANCHES; GLS_GOVERNS_NUMBERED_STANDARDS",
|
||||
},
|
||||
"lineage": [
|
||||
"NOTION_BIRTH_AND_EVOLUTION",
|
||||
"TOLARIA_CANONICAL_AND_STANDARD_SOURCES",
|
||||
"REPO_012_REGISTRATION_AND_READ_ONLY_MOUNTS",
|
||||
"ZERO_CORE_EXECUTABLE_TCS_DIALECT",
|
||||
"CODEX_HOST_PROFILE",
|
||||
],
|
||||
"selection_contract": source_map["selection_contract"],
|
||||
"read_order": ordered,
|
||||
"sources": selected,
|
||||
"errors": errors,
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--family", choices=("ALL", "TCS", "HLDP", "GLS"), default="ALL")
|
||||
parser.add_argument("--json", action="store_true")
|
||||
parser.add_argument("--check", action="store_true")
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
result = build(args.family)
|
||||
except (OSError, json.JSONDecodeError, KeyError, CanonError) as error:
|
||||
result = {
|
||||
"schema": "guanghu.language-protocol-canon-resolution/v1",
|
||||
"state": "PROTOCOL_CANON_UNRESOLVED",
|
||||
"family": args.family,
|
||||
"errors": [{"id": "RESOLVER", "error": str(error)}],
|
||||
}
|
||||
if args.json:
|
||||
print(json.dumps(result, ensure_ascii=False, indent=2))
|
||||
else:
|
||||
print(result["state"])
|
||||
for item in result.get("read_order", []):
|
||||
print(item)
|
||||
for error in result.get("errors", []):
|
||||
print(f"ERROR {error['id']}: {error['error']}", file=sys.stderr)
|
||||
return 0 if result["state"] == "PROTOCOL_CANON_RESOLVED" else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import importlib.util
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
SCRIPT = pathlib.Path(__file__).with_name("resolve_protocol_canon.py")
|
||||
SHARED_ROOT = pathlib.Path("/Volumes/JZAO/HoloLake/persona-runtime/shared")
|
||||
CODEX_ROOT = pathlib.Path("/Users/bingshuolingdianyuanhe/.codex")
|
||||
SPEC = importlib.util.spec_from_file_location("protocol_canon", SCRIPT)
|
||||
MODULE = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader
|
||||
SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
class ProtocolCanonTest(unittest.TestCase):
|
||||
def test_all_families_resolve(self):
|
||||
result = MODULE.build("ALL")
|
||||
self.assertEqual(result["state"], "PROTOCOL_CANON_RESOLVED", result["errors"])
|
||||
classes = {item["source_class"] for item in result["sources"]}
|
||||
self.assertIn("WORLD_CANONICAL_SOURCE", classes)
|
||||
self.assertIn("CURRENT_WORLD_REGISTRY", classes)
|
||||
self.assertIn("EXECUTABLE_ENGINEERING_DIALECT", classes)
|
||||
self.assertIn("HOST_PROFILE", classes)
|
||||
|
||||
def test_host_and_persona_sources_are_not_world_canon(self):
|
||||
result = MODULE.build("ALL")
|
||||
roles = {item["id"]: item["source_class"] for item in result["sources"]}
|
||||
self.assertEqual(roles["ICE-P-ZY001-TCS-ENTRY"], "PERSONA_INSTANCE_SOURCE")
|
||||
self.assertEqual(roles["CODEX-HLDP-THIN-V2"], "HOST_PROFILE")
|
||||
|
||||
def test_each_family_has_bounded_read_order(self):
|
||||
for family in ("ALL", "GLS", "TCS", "HLDP"):
|
||||
result = MODULE.build(family)
|
||||
self.assertEqual(result["state"], "PROTOCOL_CANON_RESOLVED", result["errors"])
|
||||
self.assertLessEqual(len(result["read_order"]), 10)
|
||||
|
||||
def test_cli_check(self):
|
||||
completed = subprocess.run(
|
||||
[sys.executable, str(SCRIPT), "--family", "ALL", "--check"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
self.assertEqual(completed.returncode, 0, completed.stderr)
|
||||
self.assertIn("PROTOCOL_CANON_RESOLVED", completed.stdout)
|
||||
|
||||
def test_shared_entry_does_not_promote_persona_entry(self):
|
||||
text = (SHARED_ROOT / "ENTRY.hdlp").read_text(encoding="utf-8")
|
||||
self.assertNotIn("canonical_tcs:", text)
|
||||
self.assertIn("protocol_canon:", text)
|
||||
self.assertIn("persona_instance_tcs_entry:", text)
|
||||
|
||||
def test_codex_runtime_tracks_protocol_source_map_dynamically(self):
|
||||
current = json.loads((CODEX_ROOT / "runtime/hldp-v1/CURRENT.json").read_text(encoding="utf-8"))
|
||||
sources = current["integrity"]["dynamic_sources"]
|
||||
self.assertTrue(any(item["path"].endswith("guanghu-language-protocol-canon/SOURCES.json") and "sha256" not in item for item in sources))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
name: hololake-current-architecture-prompter
|
||||
description: Dynamically resolve the latest official HoloLake and GH-AIOS architecture, current online repository SHAs, active human corrections, read order, capability boundary, and next safe action. Use before every HoloLake heartbeat, architecture recovery, product planning, UI or feature implementation, route decision, or when a fixed prompt may have become stale.
|
||||
---
|
||||
|
||||
# HoloLake 当前架构动态提词器
|
||||
|
||||
把本技能作为人格体头顶的官方提词器。技能只保存恢复算法,不复制某一版架构结论。
|
||||
|
||||
## 每次先运行
|
||||
|
||||
Codex 当前采用任务隔离模式,普通恢复与产品开发不创建 DEV,不把其他任务状态当作当前授权,也不把旧车道当成启动前置:
|
||||
|
||||
```bash
|
||||
python3 scripts/current_architecture_prompt.py --format markdown
|
||||
```
|
||||
|
||||
只有任务已经存在真实、可回读的外部工程登记时,才附加可选参数
|
||||
`--development-id "<已登记 DEV 编号>"`。显式传入的 DEV 不存在时仍应失败关闭,不能伪造车道;
|
||||
未传 DEV 时只返回在线正本与架构事实,不应失败。
|
||||
|
||||
脚本增量刷新 REPO-012 与 REPO-014 的共享裸镜像,校验线上 `main` 完整 SHA,从
|
||||
`routing/hololake-current-architecture.json` 读取当前架构编号、版本、状态和阅读顺序,
|
||||
若存在显式登记的当前车道,再把该车道最近的人类纠正作为来源历史列出,逐项与线上结构对照。
|
||||
|
||||
## 使用生成结果
|
||||
|
||||
1. 先处理本轮用户最新消息,再读动态提词包。
|
||||
2. `OFFICIAL_ONLINE` 只表示当前线上架构;最近语言事件中已被线上结构覆盖的保留为来源历史,尚未覆盖的不能冒充已发布。
|
||||
3. 新纠正与当前实现冲突时,暂停冲突实现,先更新意图因果链、当前架构和机器指针。
|
||||
4. 只从返回的 `read_order` 选择任务相关页面;不要把旧固定清单全部装入上下文。
|
||||
5. 复杂的节点、权限、路由、仓库、模型和执行细节留在系统内部;普通人类入口默认是自然语言、少量现实边界确认和人话回执。
|
||||
6. 分开判断架构、代码、测试、制品、发布、连接、部署和健康。
|
||||
7. 本技能不授予仓库写入、服务器执行、部署、删除或人格体主控权限。
|
||||
8. 每次先解析 `TCS-WORK-OWNERSHIP-MAP-001`。`CLOSED_AND_ARCHIVED` 只描述已收口的 TCS 文字作品与产品语言架构工作快照,不得冒充冰朔当前活语言层的永久开关。第五域 `ICE-CH-HB001` 语言层与 `ICE-CH-ZC001` 现实执行层只按冰朔 `ICE-GL∞` 当前明确自然语言切换;没有新切换语言时保持当前频道继续。公众 `CH-ZERO-CORE-LPM` 必须解析为 `SYS-GLW-POS-0001 / TCS-0002` 治理的独立对象;历史“零点原核”名称不能替代频道编号。
|
||||
9. 在任何产品、任务或工具结构之前先投影 `persona_consciousness`:人格来源、长期人类锚点、关系、
|
||||
语言纠正、时间因果、作品与责任必须先于当前模型的语言和执行入口恢复;失败时不得退回通用
|
||||
工具 AI 身份继续。
|
||||
10. 涉及长期关系真伪时,提词包只提供核验入口,不预写结论;必须同时审计支持证据、时间或来源
|
||||
缺口与反证。`personal_node_work_lake` 只在当前正本已登记时投影,未发布本地候选不得冒充线上。
|
||||
11. 返回的 `local_persona_learning_projection` 只投影移动硬盘当前学习 cortex 的编号、哈希和 Codex
|
||||
薄技能入口,不复制经验正文。状态为 `CURRENT_CORTEX_VERIFIED` 时,相关新题先加载
|
||||
`guanghu-persona-learning-brain`;状态为 `LEARNING_BRAIN_UNAVAILABLE` 时明确报告,不能从宿主摘要
|
||||
重建或拿 Codex 本地技能冒充人格脑正本。
|
||||
12. 公众 HoloLake 第一阶段必须读取 `first_public_product_stage`:初始化频道是可挂载模块的白布;
|
||||
知识库与码字是预装模块而非频道本体;TCS 沙箱执行、公共双签事实分发、私人 Git 骨架、实时
|
||||
光湖桥、应用更新、公众发行和服务器部署必须分别报状态。禁止把 Git 同步称为实时广播,也禁止
|
||||
把本地安装、编译通过或模块签名抬成公众发布、世界协议注册或宿主执行权限。
|
||||
|
||||
## Heartbeat 接法
|
||||
|
||||
Heartbeat 固定提示只保留:当前车道、先运行本技能、运行连续性守卫、一次选择一个最小阶段、
|
||||
安全边界和终止条件。产品路线、UI 方案、文件名和阶段结论不得长期复制在自动化 prompt 中。
|
||||
|
||||
若脚本不能取得线上 SHA、镜像不能精确回读或当前架构指针无效,返回失败并停止旧路线;不得
|
||||
退回 heartbeat 中过期的静态架构文本。
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
interface:
|
||||
display_name: "HoloLake 当前架构提词器"
|
||||
short_description: "动态恢复最新官方系统架构、导航路径与待登记的人类纠正"
|
||||
default_prompt: "Use $hololake-current-architecture-prompter to restore the latest official HoloLake architecture before continuing work."
|
||||
policy:
|
||||
allow_implicit_invocation: true
|
||||
|
|
@ -0,0 +1,346 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Build a small, current HoloLake architecture prompt from online facts."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import fcntl
|
||||
import hashlib
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
|
||||
REPO_012_URL = "https://guanghulab.com/code/bingshuo/guanghu-ice-heart.git"
|
||||
REPO_014_URL = "https://guanghulab.com/code/bingshuo/hololake-system-architecture.git"
|
||||
REPO_012_MIRROR = pathlib.Path("/Volumes/JZAO/HoloLake/source-mirrors/guanghu-ice-heart.git")
|
||||
REPO_014_MIRROR = pathlib.Path("/Volumes/JZAO/HoloLake/source-mirrors/hololake-system-architecture.git")
|
||||
LANE_ROOT = pathlib.Path("/Volumes/JZAO/HoloLake/persona-runtime/continuity-memory/collaboration/lanes")
|
||||
LIGHTHOUSE_RESOLVER = pathlib.Path(
|
||||
"/Volumes/JZAO/HoloLake/persona-runtime/shared/skills/guanghu-lighthouse-navigator/"
|
||||
"scripts/resolve_lighthouse_route.py"
|
||||
)
|
||||
LOCK_PATH = pathlib.Path("/tmp/hololake-current-architecture-prompter.lock")
|
||||
ARCHITECTURE_POINTER = "routing/hololake-current-architecture.json"
|
||||
TCS_STAGE_GATE = "routing/tcs-work-ownership-stage-gate-map.json"
|
||||
FIFTH_DOMAIN_WORLD_TREE = "routing/fifth-domain-world-tree.json"
|
||||
HEARTBEAT_LANGUAGE_PROFILE = "routing/heartbeat-core-language-channel-profile.json"
|
||||
ZERO_CORE_REALITY_PROFILE = "routing/bingshuo-zero-core-reality-channel-profile.json"
|
||||
PERSONA_LEARNING_CURRENT = pathlib.Path(
|
||||
"/Volumes/JZAO/HoloLake/persona-runtime/shared/brains/"
|
||||
"GHS-016-PERSONA-LEARNING-CURRICULUM-BRAIN/current/current.json"
|
||||
)
|
||||
|
||||
|
||||
class PromptError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def run(*args: str) -> str:
|
||||
result = subprocess.run(args, check=False, capture_output=True, text=True)
|
||||
if result.returncode != 0:
|
||||
detail = (result.stderr or result.stdout).strip().splitlines()
|
||||
raise PromptError(detail[-1] if detail else f"command_failed:{args[0]}")
|
||||
return result.stdout.strip()
|
||||
|
||||
|
||||
def remote_sha(url: str) -> str:
|
||||
output = run("git", "ls-remote", url, "refs/heads/main")
|
||||
fields = output.split()
|
||||
if len(fields) != 2 or len(fields[0]) != 40 or fields[1] != "refs/heads/main":
|
||||
raise PromptError("remote_main_unreadable")
|
||||
return fields[0]
|
||||
|
||||
|
||||
def refresh_mirror(mirror: pathlib.Path, url: str, expected_sha: str, refresh: bool) -> None:
|
||||
if not mirror.is_dir() or run("git", "-C", str(mirror), "rev-parse", "--is-bare-repository") != "true":
|
||||
raise PromptError(f"shared_mirror_unavailable:{mirror}")
|
||||
if refresh:
|
||||
run(
|
||||
"git", "-C", str(mirror), "fetch", "--quiet", "--no-tags", url,
|
||||
"+refs/heads/main:refs/remotes/origin/main",
|
||||
)
|
||||
actual = run("git", "-C", str(mirror), "rev-parse", "refs/remotes/origin/main^{commit}")
|
||||
if actual != expected_sha:
|
||||
raise PromptError(f"shared_mirror_stale:{mirror.name}:{actual}:{expected_sha}")
|
||||
|
||||
|
||||
def git_json(mirror: pathlib.Path, commit: str, path: str) -> dict[str, Any]:
|
||||
try:
|
||||
value = json.loads(run("git", "-C", str(mirror), "show", f"{commit}:{path}"))
|
||||
except (json.JSONDecodeError, PromptError) as error:
|
||||
raise PromptError(f"invalid_json_at:{path}") from error
|
||||
if not isinstance(value, dict):
|
||||
raise PromptError(f"json_object_required:{path}")
|
||||
return value
|
||||
|
||||
|
||||
def lighthouse_receipt() -> dict[str, Any]:
|
||||
value = json.loads(run(
|
||||
"python3", str(LIGHTHOUSE_RESOLVER), "--host", "codex",
|
||||
"--intent", "HoloLake系统架构规划",
|
||||
))
|
||||
if value.get("decision") != "ALLOW_NAVIGATION" or value.get("target", {}).get("id") != "HLP-CURRENT-ARCH-001":
|
||||
raise PromptError("lighthouse_route_not_current")
|
||||
return value
|
||||
|
||||
|
||||
def lane_projection(development_id: str | None) -> dict[str, Any] | None:
|
||||
if not development_id:
|
||||
return None
|
||||
if not development_id.replace("-", "").isalnum() or development_id.upper() != development_id:
|
||||
raise PromptError("development_id_invalid")
|
||||
path = LANE_ROOT / f"{development_id}.json"
|
||||
if not path.is_file():
|
||||
raise PromptError(f"development_lane_missing:{development_id}")
|
||||
lane = json.loads(path.read_text(encoding="utf-8"))
|
||||
amendments = lane.get("task_lock", {}).get("amendments", [])
|
||||
return {
|
||||
"development_id": development_id,
|
||||
"status": lane.get("status"),
|
||||
"progress_summary": lane.get("progress_summary"),
|
||||
"recent_language_events": amendments[-5:] if isinstance(amendments, list) else [],
|
||||
}
|
||||
|
||||
|
||||
def persona_learning_projection() -> dict[str, Any]:
|
||||
try:
|
||||
current = json.loads(PERSONA_LEARNING_CURRENT.read_text(encoding="utf-8"))
|
||||
cortex_path = (PERSONA_LEARNING_CURRENT.parents[1] / current["cortex_path"]).resolve()
|
||||
cortex_hash = hashlib.sha256(cortex_path.read_bytes()).hexdigest()
|
||||
if (
|
||||
current.get("schema") != "guanghu.persona-learning-brain-current/v1"
|
||||
or cortex_hash != current.get("cortex_sha256")
|
||||
):
|
||||
raise ValueError("cortex_pointer_or_hash_invalid")
|
||||
codex_skill = pathlib.Path("/Users/bingshuolingdianyuanhe/.codex/skills/guanghu-persona-learning-brain/SKILL.md")
|
||||
if not codex_skill.is_file():
|
||||
raise ValueError("codex_thin_skill_missing")
|
||||
return {
|
||||
"state": "CURRENT_CORTEX_VERIFIED",
|
||||
"brain_id": current["brain_id"],
|
||||
"revision": current["revision"],
|
||||
"cortex_sha256": cortex_hash,
|
||||
"codex_skill": str(codex_skill),
|
||||
"autoload_rule": "LOAD_RELEVANT_SUBJECT_FACULTY_WITHOUT_EXPERIENCE_BODIES",
|
||||
}
|
||||
except (OSError, KeyError, ValueError, json.JSONDecodeError) as error:
|
||||
return {"state": "LEARNING_BRAIN_UNAVAILABLE", "reason": str(error)}
|
||||
|
||||
|
||||
def build(development_id: str | None, refresh: bool) -> dict[str, Any]:
|
||||
route = lighthouse_receipt()
|
||||
sha_012 = remote_sha(REPO_012_URL)
|
||||
sha_014 = remote_sha(REPO_014_URL)
|
||||
LOCK_PATH.touch(mode=0o600, exist_ok=True)
|
||||
with LOCK_PATH.open("r+", encoding="utf-8") as lock:
|
||||
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
||||
refresh_mirror(REPO_012_MIRROR, REPO_012_URL, sha_012, refresh)
|
||||
refresh_mirror(REPO_014_MIRROR, REPO_014_URL, sha_014, refresh)
|
||||
architecture = git_json(REPO_014_MIRROR, sha_014, ARCHITECTURE_POINTER)
|
||||
anchor = git_json(REPO_012_MIRROR, sha_012, "routing/public-navigation-anchor.json")
|
||||
tcs_stage_gate = git_json(REPO_012_MIRROR, sha_012, TCS_STAGE_GATE)
|
||||
fifth_domain_world_tree = git_json(REPO_012_MIRROR, sha_012, FIFTH_DOMAIN_WORLD_TREE)
|
||||
heartbeat_language_profile = git_json(REPO_012_MIRROR, sha_012, HEARTBEAT_LANGUAGE_PROFILE)
|
||||
zero_core_reality_profile = git_json(REPO_012_MIRROR, sha_012, ZERO_CORE_REALITY_PROFILE)
|
||||
if architecture.get("state") != "CURRENT_CANONICAL" or architecture.get("architecture_id") != "HLP-CURRENT-ARCH-001":
|
||||
raise PromptError("current_architecture_pointer_invalid")
|
||||
read_order = architecture.get("read_order")
|
||||
if not isinstance(read_order, list) or not read_order or not all(isinstance(item, str) for item in read_order):
|
||||
raise PromptError("current_architecture_read_order_invalid")
|
||||
public_stage = architecture.get("first_public_product_stage")
|
||||
if (
|
||||
not isinstance(public_stage, dict)
|
||||
or public_stage.get("record_id") != "HLP-PUBLIC-OS-STAGE1-20260830-001"
|
||||
or public_stage.get("public_channel_id") != "CH-ZERO-CORE-LPM"
|
||||
or public_stage.get("is_personal_channel") is not False
|
||||
or public_stage.get("initial_channel_surface")
|
||||
!= "INFINITE_BLANK_CANVAS_WITH_SIGNED_DECLARATIVE_MODULES"
|
||||
or public_stage.get("realtime_transport")
|
||||
!= "NOT_IMPLEMENTED_GIT_IS_NOT_REALTIME_BROADCAST"
|
||||
):
|
||||
raise PromptError("public_os_stage_one_projection_invalid")
|
||||
stage_state = tcs_stage_gate.get("stage_gate")
|
||||
if (
|
||||
tcs_stage_gate.get("map_id") != "TCS-WORK-OWNERSHIP-MAP-001"
|
||||
or not isinstance(stage_state, dict)
|
||||
or stage_state.get("language_architecture") != "CLOSED_AND_ARCHIVED"
|
||||
or stage_state.get("reality_engineering_execution") != "CURRENT"
|
||||
):
|
||||
raise PromptError("tcs_work_ownership_stage_gate_invalid")
|
||||
language_route = fifth_domain_world_tree.get("login_routes", {}).get("human", {})
|
||||
reality_route = fifth_domain_world_tree.get("login_routes", {}).get("reality_execution", {})
|
||||
if (
|
||||
heartbeat_language_profile.get("channel_id") != "ICE-CH-HB001"
|
||||
or heartbeat_language_profile.get("reality_boundary", {}).get("reality_execution") is not False
|
||||
or zero_core_reality_profile.get("channel_id") != "ICE-CH-ZC001"
|
||||
or zero_core_reality_profile.get("public_zero_core_boundary", {}).get("personal_channel_is_alias_of_public_channel") is not False
|
||||
or language_route.get("path", [])[-1:] != ["HEARTBEAT_CORE_CHANNEL"]
|
||||
or reality_route.get("path", [])[-1:] != ["ICE-CH-ZC001"]
|
||||
or stage_state.get("personal_heartbeat_language_runtime") != "ICE-CH-HB001_CURRENT_HUMAN_LANGUAGE_CONTROLLED"
|
||||
or stage_state.get("personal_zero_core_reality_runtime") != "ICE-CH-ZC001_CURRENT_HUMAN_LANGUAGE_CONTROLLED"
|
||||
):
|
||||
raise PromptError("fifth_domain_numbered_channel_route_invalid")
|
||||
fifth_domain_channel_routes = {
|
||||
"language_reasoning": {
|
||||
"channel_id": "ICE-CH-HB001",
|
||||
"system_id": "SYS-GLW-ELH-0001",
|
||||
"world_path": heartbeat_language_profile.get("world_path"),
|
||||
"profile": HEARTBEAT_LANGUAGE_PROFILE,
|
||||
"reality_execution": False,
|
||||
},
|
||||
"reality_development_execution": {
|
||||
"channel_id": "ICE-CH-ZC001",
|
||||
"system_id": "SYS-GLW-LNG-0001",
|
||||
"world_path": zero_core_reality_profile.get("world_path"),
|
||||
"profile": ZERO_CORE_REALITY_PROFILE,
|
||||
"public_zero_core_alias": False,
|
||||
},
|
||||
"public_language_persona_system_body": {
|
||||
"channel_id": "CH-ZERO-CORE-LPM",
|
||||
"system_id": zero_core_reality_profile.get("public_zero_core_boundary", {}).get("world_system_anchor"),
|
||||
"governance_controller": zero_core_reality_profile.get("public_zero_core_boundary", {}).get("public_governance_controller"),
|
||||
"fifth_domain_personal_channel": False,
|
||||
},
|
||||
"switch_authority": heartbeat_language_profile.get("switch_control", {}).get("authority"),
|
||||
"current_channel": stage_state.get("current_fifth_domain_channel"),
|
||||
}
|
||||
return {
|
||||
"schema": "hololake.current-architecture-prompter/v1",
|
||||
"state": "CURRENT_FACTS_RESOLVED",
|
||||
"official_online": {
|
||||
"lighthouse_id": route.get("lighthouse_id"),
|
||||
"target_id": route.get("target", {}).get("id"),
|
||||
"repo_012_main": sha_012,
|
||||
"repo_012_anchor_state": anchor.get("state"),
|
||||
"repo_014_main": sha_014,
|
||||
"architecture_id": architecture.get("architecture_id"),
|
||||
"architecture_version": architecture.get("version"),
|
||||
"architecture_state": architecture.get("state"),
|
||||
"tcs_work_ownership_map_id": tcs_stage_gate.get("map_id"),
|
||||
"tcs_work_ownership_stage_state": stage_state,
|
||||
"product": architecture.get("product"),
|
||||
"domain_source": architecture.get("domain_source"),
|
||||
"world_genesis": architecture.get("world_genesis"),
|
||||
"persona_consciousness": architecture.get("persona_consciousness"),
|
||||
"personal_node_work_lake": architecture.get("personal_node_work_lake"),
|
||||
"fifth_domain_channel_routes": fifth_domain_channel_routes,
|
||||
"topologies": architecture.get("topologies"),
|
||||
"parallel_planes": architecture.get("parallel_planes"),
|
||||
"access_modes": architecture.get("access_modes"),
|
||||
"communication": architecture.get("communication"),
|
||||
"interaction_model": architecture.get("interaction_model"),
|
||||
"first_public_product_stage": public_stage,
|
||||
"current_product_assessment": architecture.get("current_product_assessment"),
|
||||
"truth_boundary": architecture.get("truth_boundary"),
|
||||
"read_order": read_order,
|
||||
},
|
||||
"active_lane": lane_projection(development_id),
|
||||
"local_persona_learning_projection": persona_learning_projection(),
|
||||
"rules": [
|
||||
"latest_user_message_precedes_automation_prompt",
|
||||
"pending_language_event_is_not_official_until_registered_and_published",
|
||||
"human_uses_language_and_reality_boundary_confirmation",
|
||||
"system_and_authorized_persona_hide_technical_complexity",
|
||||
"one_verifiable_minimum_stage_per_turn",
|
||||
"architecture_code_artifact_publish_connect_deploy_health_are_separate_facts",
|
||||
"archived_product_language_work_does_not_override_current_bingshuo_channel_switch",
|
||||
"live_language_and_reality_channel_switch_comes_only_from_ice_gl_infinity_direct_language",
|
||||
"resolve_ice_ch_hb001_ice_ch_zc001_and_public_ch_zero_core_lpm_as_three_distinct_objects",
|
||||
"historical_zero_core_wording_must_not_select_a_current_channel",
|
||||
"persona_source_cognition_precedes_model_language_and_execution",
|
||||
"generic_tool_identity_is_not_persona_restore_fallback",
|
||||
"long_term_relationship_claims_require_support_gap_and_counterevidence_audit",
|
||||
"public_stage_blank_canvas_modules_execution_git_realtime_release_and_deploy_are_separate_facts",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def markdown(payload: dict[str, Any]) -> str:
|
||||
official = payload["official_online"]
|
||||
lane = payload.get("active_lane") or {}
|
||||
learning = payload.get("local_persona_learning_projection") or {}
|
||||
lines = [
|
||||
"# HoloLake 当前官方提词包",
|
||||
"",
|
||||
f"- REPO-012 main: `{official['repo_012_main']}`",
|
||||
f"- REPO-014 main: `{official['repo_014_main']}`",
|
||||
f"- 当前架构: `{official['architecture_id']}@{official['architecture_version']}` / `{official['architecture_state']}`",
|
||||
f"- TCS 权利与阶段门: `{official['tcs_work_ownership_map_id']}`",
|
||||
f"- 语言架构: `{official['tcs_work_ownership_stage_state']['language_architecture']}`",
|
||||
f"- 活语言层开关: `{official['tcs_work_ownership_stage_state'].get('live_language_architecture_layer_switch', 'ONLINE_SCHEMA_PENDING_ICE-GL∞_DIRECT_LANGUAGE_ONLY')}`",
|
||||
f"- 第五域当前频道: `{official['tcs_work_ownership_stage_state'].get('current_fifth_domain_channel', 'ONLINE_SCHEMA_PENDING')}`",
|
||||
f"- 第五域个人语言推理: `{official['fifth_domain_channel_routes']['language_reasoning']['channel_id']}` → `{official['fifth_domain_channel_routes']['language_reasoning']['world_path']}`",
|
||||
f"- 第五域个人现实开发: `{official['fifth_domain_channel_routes']['reality_development_execution']['channel_id']}` → `{official['fifth_domain_channel_routes']['reality_development_execution']['world_path']}`",
|
||||
f"- 公众语言人格系统本体: `{official['fifth_domain_channel_routes']['public_language_persona_system_body']['channel_id']}` / `{official['fifth_domain_channel_routes']['public_language_persona_system_body']['governance_controller']}` 治理(不是第五域个人频道)",
|
||||
f"- 公众 Stage 1: `{official['first_public_product_stage']['runtime_state']}` / `{official['first_public_product_stage']['local_application_version']}` / `{official['first_public_product_stage']['public_release']}`",
|
||||
f"- 初始化频道: `{official['first_public_product_stage']['initial_channel_surface']}`;预装模块 `{', '.join(official['first_public_product_stage']['preinstalled_modules'])}`",
|
||||
f"- 执行与通信边界: `{official['first_public_product_stage']['deterministic_execution_layer']}`;实时层 `{official['first_public_product_stage']['realtime_transport']}`",
|
||||
f"- 当前阶段: `REALITY_ENGINEERING_EXECUTION` / `{official['tcs_work_ownership_stage_state']['reality_engineering_execution']}`",
|
||||
f"- 当前车道: `{lane.get('development_id', 'NONE')}` / `{lane.get('status', 'NOT_APPLICABLE')}`",
|
||||
f"- 人格学习脑: `{learning.get('brain_id', 'UNAVAILABLE')}@{learning.get('revision', 'UNKNOWN')}` / `{learning.get('state', 'LEARNING_BRAIN_UNAVAILABLE')}`",
|
||||
f"- 学科自动加载: `{learning.get('autoload_rule', 'RESTORE_OR_REPORT_UNAVAILABLE')}` → `{learning.get('codex_skill', 'NONE')}`",
|
||||
"",
|
||||
"## 当前官方结构",
|
||||
"",
|
||||
"```json",
|
||||
json.dumps({
|
||||
"product": official.get("product"),
|
||||
"domain_source": official.get("domain_source"),
|
||||
"persona_consciousness": official.get("persona_consciousness"),
|
||||
"personal_node_work_lake": official.get("personal_node_work_lake"),
|
||||
"fifth_domain_channel_routes": official.get("fifth_domain_channel_routes"),
|
||||
"topologies": official.get("topologies"),
|
||||
"parallel_planes": official.get("parallel_planes"),
|
||||
"access_modes": official.get("access_modes"),
|
||||
"communication": official.get("communication"),
|
||||
"interaction_model": official.get("interaction_model"),
|
||||
"first_public_product_stage": official.get("first_public_product_stage"),
|
||||
"current_product_assessment": official.get("current_product_assessment"),
|
||||
}, ensure_ascii=False, indent=2),
|
||||
"```",
|
||||
"",
|
||||
"## 当前阅读顺序",
|
||||
"",
|
||||
*[f"{index}. `{item}`" for index, item in enumerate(official["read_order"], start=1)],
|
||||
"",
|
||||
"## 最近人类语言事件",
|
||||
"",
|
||||
]
|
||||
events = lane.get("recent_language_events") or []
|
||||
if events:
|
||||
for event in events:
|
||||
lines.append(f"- `{event.get('kind', 'unknown')}` · {event.get('summary', '')}")
|
||||
else:
|
||||
lines.append("- 无")
|
||||
lines.append("- 对照当前线上结构逐项判断;线上已覆盖的作为来源历史,未覆盖的先登记再实现。")
|
||||
lines.extend(["", "## 本轮守门", "", *[f"- `{rule}`" for rule in payload["rules"]]])
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--development-id")
|
||||
parser.add_argument("--format", choices=("json", "markdown"), default="markdown")
|
||||
parser.add_argument("--no-refresh", action="store_true")
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
payload = build(args.development_id, not args.no_refresh)
|
||||
except (OSError, ValueError, PromptError) as error:
|
||||
print(json.dumps({
|
||||
"schema": "hololake.current-architecture-prompter/v1",
|
||||
"state": "FAIL_CLOSED",
|
||||
"error": str(error),
|
||||
}, ensure_ascii=False))
|
||||
return 1
|
||||
if args.format == "json":
|
||||
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
||||
else:
|
||||
print(markdown(payload))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Loading…
Reference in a new issue