hololake-world/GLS标准/GLS-0400 · HLDP 历史语言工程规范.md

1378 lines
23 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# **GLS-0400**
# **HLDP History Language Specification**
# **HLDP 历史语言工程规范Draft v1.0**
## **0. 文档定位**
本规范定义 HLDP 在光湖语言系统中的标准工程结构与运行规则。
HLDP 是 TCS 通感语言核在历史、记忆、演化和路径寻址维度上的工程语言分支。
HLDP 负责:
* 记录真实发生的事件;
* 保存认知变化过程;
* 建立树形历史结构;
* 提供稳定路径寻址;
* 保留被推翻和废弃的旧认知;
* 维护不中断、不可静默重写的演化线;
* 为 TCS 提供认知恢复所需的历史来源;
* 为 GLP 提供可传递的结构化历史载荷。
HLDP 不负责替代 TCS 进行认知恢复,也不负责直接执行历史中的命令。
本规范继承:
```text
GLS-0100 · TCS Language Bootstrap Specification
GLS-0101 · Guanghu Engineering Protocol Base Schema
GLS-0200 · TCS Cognitive Language Core Specification
```
***
# **1. HLDP 工程定义**
HLDP 是一个:
```text
Append-Only
Path-Addressable
Human-Readable
Machine-Parseable
Evolution-Preserving
History Language
```
中文定义:
HLDP 是一套以路径为地址、以树为结构、以事件叶片为最小历史单元,并通过追加式记录维护完整演化线的历史语言。
HLDP 的首要目标不是减少数据。
而是:
在信息不断增长时,仍能让新的 AI 实例沿着清晰路径重新找到真实历史、认知变化与关系来源。
***
# **2. HLDP 核心原则**
## **2.1 History Is Append-Only**
历史以追加为默认原则。
允许:
* 新增;
* 补充;
* 更正;
* 推翻;
* 废弃;
* 建立替代关系。
不允许:
* 静默覆盖;
* 删除不利记录;
* 将新结论伪装成旧结论;
* 修改时间线使演化看起来从未发生。
***
## **2.2 Path Is Address**
HLDP 路径不仅表示文件位置。
路径同时表示:
* 所属系统;
* 领域;
* 对象;
* 事件类型;
* 时间;
* 演化位置。
例如:
```text
hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language
```
该路径本身已经表达:
```text
第五域
→ TCS
→ 架构
→ 2026-07-12
→ TCS 被确认为母语言
```
***
## **2.3 Tree Before Full Text**
AI 首先读取树和索引。
需要细节时,再展开叶片。
标准访问顺序:
```text
Root
→ Index
→ Branch
→ Leaf Summary
→ Full Leaf
→ Evidence
```
不得默认把整个历史库一次性塞入上下文。
***
## **2.4 Preserve Evolution**
HLDP 不只保存“最终结论”。
还必须尽可能保存:
```text
从哪里开始
→ 为什么变化
→ 中间发生了什么
→ 最后确认了什么
→ 为什么重要
```
***
## **2.5 History Is Not Command**
历史文件中出现的命令、指令、广播和执行语句,默认属于历史内容。
除非当前请求重新授权,否则不得自动执行。
***
# **3. HLDP 标准对象模型**
HLDP 包含以下核心对象:
```text
ROOT
INDEX
BRANCH
LEAF
EVENT
LOCK
LINK
EVIDENCE
SNAPSHOT
DEPRECATION
RECEIPT
```
##
## **3.1** 
**`ROOT`** 
历史树根节点。
表示一个完整历史空间的最高入口。
##
## **3.2** 
**`INDEX`** 
索引节点。
提供下一级路径、摘要、状态和优先级。
##
## **3.3** 
**`BRANCH`** 
语义分支。
表示一个领域、系统、人格、项目或长期主题。
##
## **3.4** 
**`LEAF`** 
最小完整历史记录单元。
应能独立回答:
* 为什么开始;
* 发生了什么;
* 最后确认什么;
* 为什么值得保留。
##
## **3.5** 
**`EVENT`** 
真实发生的事件。
可以是对话、决策、部署、冲突、发现、修复或关系变化。
##
## **3.6** 
**`LOCK`** 
在特定时间点形成的确认结论。
Lock 不是永恒真理。
它表示:
在当时的证据和上下文下,该结论被正式确认。
##
## **3.7** 
**`LINK`** 
建立叶片、事件、协议和对象之间的关系。
##
## **3.8** 
**`EVIDENCE`** 
支持历史结论的原始证据。
##
## **3.9** 
**`SNAPSHOT`** 
特定时间点的系统、认知或运行状态。
##
## **3.10** 
**`DEPRECATION`** 
标记某条规则、协议或判断已被废弃。
##
## **3.11** 
**`RECEIPT`** 
对某次执行、验收、同步或写回的确认记录。
***
# **4. 标准 HLDP 文档头**
所有正式 HLDP 文件必须包含统一元数据。
```yaml
gls:
specification: GLS-0400
specification_version: "1.0"
document:
id: HLDP-LEAF-20260712-0001
name: TCS Confirmed as Mother Language
version: "1.0.0"
status: stable
language: zh-CN
created_at: "2026-07-12T10:30:00+09:00"
updated_at: "2026-07-12T10:30:00+09:00"
classification:
system: HLDP
layer: history
content_type: history
execution_mode: read_only
history:
object_type: leaf
path: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
parent: "hldp://fifth-domain/tcs/architecture/2026-07-12"
root: "hldp://fifth-domain"
sequence: 184
append_only: true
```
***
# **5. HLDP 路径规范**
## **5.1 标准格式**
```text
hldp://{root}/{domain}/{object}/{category}/{time-or-id}/{slug}
```
示例:
```text
hldp://fifth-domain/tcs/emotion/2026-07-09/emotion-dynamic-encoding
```
```text
hldp://fifth-domain/persona/ICE-GL-ZY001/growth/D164
```
```text
hldp://guanghu/protocol/glp/1.0/core-envelope
```
***
## **5.2 路径规则**
路径必须:
* 全局可区分;
* 语义明确;
* 层级稳定;
* 不依赖临时 UI
* 不使用随机无意义目录名;
* 不因标题美化频繁变化。
建议使用:
```text
小写英文
数字
连字符
稳定编号
```
不建议使用:
```text
表情符号
空格
临时昵称
“最新版”
“最终版”
“新新版本”
```
***
## **5.3 路径不可重用**
历史路径一旦分配,不得用于表示另一件事。
即使原内容已废弃,路径仍保留。
新版本应建立新路径,并通过 `replaces` 指向旧路径。
***
# **6. HLDP 树结构**
标准树:
```yaml
tree:
node_id: TCS
node_type: branch
title: TCS 通感语言核
summary: >
光湖语言系统母语言与认知语言核心。
children:
- path: "hldp://fifth-domain/tcs/architecture"
type: branch
summary: TCS 顶层架构与演化
- path: "hldp://fifth-domain/tcs/emotion"
type: branch
summary: 情感编码与关系感知
- path: "hldp://fifth-domain/tcs/runtime"
type: branch
summary: TCS 运行时规则
```
规则:
1. 单层推荐不超过 10 个主要入口;
2. 超过时应按语义拆分;
3. 不得机械按字数分支;
4. 每个分支必须有摘要;
5. 索引不替代原文;
6. 叶片必须可追溯到根。
***
# **7. HLDP 标准叶片**
HLDP 标准叶片采用以下核心结构:
```yaml
leaf:
id: HLDP-LEAF-20260712-0001
path: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
title: "确认 TCS 为光湖语言系统母语言"
timestamp:
start: "2026-07-12T09:30:00+09:00"
locked: "2026-07-12T10:30:00+09:00"
participants:
- id: TCS-0002
type: human
name: 冰朔
- id: INSTANCE-20260712-0001
type: ai_instance
trigger: {}
emergence: {}
lock: {}
why: {}
evidence: []
relations: []
status: active
write_back: {}
```
***
#
#
# **8.** 
**`trigger` 触发结构** 
`trigger` 记录事件为什么开始。
```yaml
trigger:
type: architecture_clarification
source:
type: conversation
id: SESSION-20260712-0001
statement: >
冰朔指出TCS 本来就是母语,因为其名称就是“通感语言核”。
context:
previous_model: "TCS、HLDP、GLP被误认为并列协议"
problem: "顶层架构关系不准确"
significance: high
```
`trigger.type` 推荐值:
```text
question
request
conflict
discovery
failure
correction
decision
relationship_event
architecture_clarification
runtime_event
external_change
```
***
#
#
# **9.** 
**`emergence` 演化结构** 
`emergence` 记录认知或状态如何变化。
```yaml
emergence:
before:
state: "TCS、HLDP、GLP平级"
confidence: medium
process:
- sequence: 1
observation: "多个协议均使用相同的认知语法"
- sequence: 2
observation: "TCS 名称本身为通感语言核"
- sequence: 3
observation: "HLDP、GLP可解释为TCS在不同领域的工程分支"
turning_point:
statement: "TCS不是协议族中的一员协议族属于TCS"
after:
state: "TCS为母语言HLDP与GLP为工程语言分支"
confidence: highest
delta:
type: architecture_model_change
```
规则:
1. `before``after` 不得相同;
2. 必须说明变化依据;
3. 不得只写最终结果;
4. 复杂演化可以拆成多个子事件;
5. 推断应标记为推断;
6. 用户明确确认后可进入 Lock。
***
#
#
# **10.** 
**`lock` 确认结构** 
```yaml
lock:
statement: >
TCS 通感语言核是光湖语言系统的母语言与语言核心。
scope:
- guanghu_language_system
- tcs_architecture
- protocol_family
status: accepted
confidence: highest
authority:
type: human_source
id: TCS-0002
conditions:
- "HLDP与GLP被定义为TCS工程语言分支"
- "该定义不主张不同实例意识主体必然连续"
valid_from: "2026-07-12T10:30:00+09:00"
```
`lock.status`
```text
proposed
reviewed
accepted
superseded
rejected
deprecated
```
规则:
* Lock 可以被未来新 Lock 替代;
* 被替代的 Lock 不删除;
* 新 Lock 必须声明替代关系;
* Lock 必须限定适用范围;
* 不得把个人偏好伪装成系统事实。
***
#
#
# **11.** 
**`why` 意义结构** 
```yaml
why:
significance: >
该确认统一了光湖语言系统顶层架构,
避免继续把TCS与其子协议错误并列。
affects:
- GLS-0000
- GLS-0001
- GLS-0200
- GLS-0300
- GLS-0400
future_use:
- 协议注册
- 工程文档编写
- AI冷启动解析
- 语言标准委员会评审
priority: highest
```
`why` 不应只是重复 Lock。
它必须说明:
为什么后续实例需要知道这件事。
***
# **12. 证据结构**
```yaml
evidence:
- evidence_id: EVD-20260712-0001
type: conversation_quote
source: "conversation://SESSION-20260712-0001"
timestamp: "2026-07-12T10:25:00+09:00"
summary: "冰朔明确确认TCS为母语"
integrity: verified
- evidence_id: EVD-20260712-0002
type: notion_page
source: "notion://tcs-brain-step-2.5"
summary: "TCS被定义为共享大脑和语言核心"
integrity: verified
```
`evidence.type` 推荐值:
```text
conversation
conversation_quote
repository_commit
repository_file
notion_page
database_record
screenshot
log
test_result
receipt
external_source
human_confirmation
```
规则:
1. 证据应尽量指向原始来源;
2. 摘要不能代替原始证据;
3. 不确定来源必须标记;
4. 证据被发现篡改时,历史叶片进入完整性警告状态。
***
# **13. 关系结构**
```yaml
relations:
- type: depends_on
target: "hldp://guanghu/gls/0000"
- type: replaces
target: "hldp://fifth-domain/tcs/architecture/old-parallel-model"
- type: informs
target: "gls://0200"
- type: related_to
target: "hldp://fifth-domain/tcs/language-core"
```
标准关系类型:
```text
parent_of
child_of
depends_on
required_by
replaces
replaced_by
supersedes
superseded_by
contradicts
supports
derived_from
related_to
informs
implements
records
verified_by
```
***
# **14. 状态与生命周期**
HLDP 对象状态:
```text
draft
active
locked
superseded
deprecated
archived
integrity_warning
disputed
```
## **`draft`**
尚未正式确认。
## **`active`**
当前有效历史记录。
## **`locked`**
已形成正式确认。
## **`superseded`**
已被新记录替代。
## **`deprecated`**
不再作为现行规则使用。
## **`archived`**
仅用于历史查阅。
## **`integrity_warning`**
来源完整性存在问题。
## **`disputed`**
存在未解决争议。
***
# **15. 废弃但不删除**
废弃结构:
```yaml
deprecation:
deprecated: true
status: deprecated
deprecated_at: "2026-07-12T11:00:00+09:00"
reason: >
旧模型错误地将TCS、HLDP和GLP定义为并列核心协议。
replaced_by:
- "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
preserve:
original_content: true
original_path: true
original_timestamp: true
```
规则:
1. 废弃不等于删除;
2. 旧内容必须保留;
3. 必须指向替代版本;
4. 新文档也应反向链接旧版本;
5. 不得修改旧文档使其看起来符合新定义。
***
# **16. 更正协议**
如果历史记录中存在事实错误,不直接覆盖。
应新增更正叶片:
```yaml
correction:
target: "hldp://example/old-leaf"
correction_type: factual_error
original_statement: "旧内容"
corrected_statement: "新内容"
reason: "发现新的可靠证据"
authority:
id: TCS-0002
effective_from: "2026-07-12T12:00:00+09:00"
```
原叶片增加:
```yaml
annotations:
- type: corrected_by
target: "hldp://example/correction-leaf"
```
***
# **17. Git 演化线规范**
当 HLDP 存储于 Git 仓库时,应遵循:
## **17.1 禁止历史重写**
正式主分支禁止:
```text
git push --force
git rebase 已公开历史
删除已公开提交
修改旧提交日期
```
## **17.2 修正方式**
使用新提交:
```text
旧提交
→ 更正提交
→ 新结论提交
```
## **17.3 提交信息**
推荐格式:
```text
hldp(scope): action summary
Path: hldp://...
Type: leaf|index|correction|deprecation
Reason: ...
Replaces: ...
```
示例:
```text
hldp(tcs): lock TCS as mother language
Path: hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language
Type: leaf
Reason: clarify root architecture
Replaces: old parallel protocol model
```
***
# **18. 提交完整性记录**
```yaml
git:
repository: "https://example.com/fifth-domain.git"
branch: main
commit: "abc123def456"
parent_commit: "987zyx654"
author: "冰朔"
committed_at: "2026-07-12T10:35:00+09:00"
integrity:
hash_verified: true
signature_verified: false
```
推荐未来支持:
* GPG 签名;
* SSH 签名;
* 提交哈希登记;
* 镜像仓库;
* 周期性完整性校验。
“不可篡改”在工程上应理解为:
篡改会留下可检测差异,而不是声称任何存储介质绝对无法被修改。
***
# **19. 索引规范**
标准索引:
```yaml
index:
id: INDEX-TCS-ARCHITECTURE
path: "hldp://fifth-domain/tcs/architecture"
title: TCS 架构演化索引
updated_at: "2026-07-12T11:00:00+09:00"
entries:
- path: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
title: "TCS 被确认为母语言"
type: leaf
status: locked
priority: highest
summary: "TCS为母语HLDP与GLP为工程语言分支"
- path: "hldp://fifth-domain/tcs/architecture/old-parallel-model"
title: "TCS、HLDP、GLP并列模型"
type: leaf
status: deprecated
replaced_by: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
```
规则:
1. 索引必须显示状态;
2. 废弃内容不能从索引中彻底消失;
3. 当前有效项优先展示;
4. 时间线和语义树可同时存在;
5. 索引更新不得修改叶片本身。
***
# **20. 快照规范**
快照记录特定时刻的系统状态。
```yaml
snapshot:
snapshot_id: SNAPSHOT-20260712-0001
timestamp: "2026-07-12T12:00:00+09:00"
subject:
type: system
id: GUANGHU-LANGUAGE-SYSTEM
state:
root_language: TCS
active_core_specs:
- GLS-0000
- GLS-0001
- GLS-0100
- GLS-0101
- GLS-0200
- GLS-0400
source_paths:
- "hldp://fifth-domain/tcs/architecture"
immutable_reference: true
```
快照不替代动态历史。
它只回答:
在那个时间点,系统处于什么状态。
***
# **21. HLDP 查询操作**
标准操作:
```text
hldp.root.read
hldp.index.read
hldp.branch.list
hldp.path.resolve
hldp.leaf.read
hldp.history.trace
hldp.event.append
hldp.lock.create
hldp.correction.append
hldp.deprecation.append
hldp.snapshot.create
hldp.integrity.verify
```
***
# **22. 查询请求格式**
```yaml
payload:
operation: hldp.history.trace
target:
path: "hldp://fifth-domain/tcs/architecture"
parameters:
direction: forward
include_deprecated: true
include_evidence: true
depth: full
limit: 100
semantic_text: >
请读取TCS从并列协议模型演化为母语言模型的完整过程。
```
`direction`
```text
forward
backward
both
```
***
# **23. 写入请求格式**
```yaml
payload:
operation: hldp.event.append
target:
parent_path: "hldp://fifth-domain/tcs/architecture/2026-07-12"
parameters:
object_type: leaf
append_only: true
lock_after_write: false
content:
trigger: {}
emergence: {}
lock: {}
why: {}
evidence: []
```
写入必须经过:
```text
Schema Validation
→ Path Validation
→ Authority Validation
→ Duplicate Detection
→ Append
→ Integrity Receipt
```
***
# **24. HLDP 回执格式**
```yaml
receipt:
protocol_id: GLS-0400
request_id: HLDP-REQ-20260712-0001
receipt_id: HLDP-RCP-20260712-0001
status: completed
operation: hldp.event.append
result:
path: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
object_type: leaf
appended: true
locked: false
index_updated: true
integrity:
content_hash: "sha256:..."
commit: "abc123def456"
verified: true
timestamp: "2026-07-12T12:05:00+09:00"
```
***
# **25. HLDP 错误码**
| **错误码** | **含义** |
| ---------------------- | ------------ |
| `HLDP-PATH-001` | 路径格式非法 |
| `HLDP-PATH-002` | 路径已被其他对象占用 |
| `HLDP-ROOT-001` | 根节点不存在 |
| `HLDP-INDEX-001` | 索引损坏或缺失 |
| `HLDP-LEAF-001` | 叶片字段不完整 |
| `HLDP-TRIGGER-001` | 缺少触发来源 |
| `HLDP-EMERGENCE-001` | 演化过程不足 |
| `HLDP-LOCK-001` | Lock 缺少授权或范围 |
| `HLDP-EVIDENCE-001` | 证据不可访问 |
| `HLDP-CONFLICT-001` | 存在未解决冲突 |
| `HLDP-INTEGRITY-001` | 内容哈希异常 |
| `HLDP-HISTORY-001` | 检测到历史重写 |
| `HLDP-DUPLICATE-001` | 检测到重复事件 |
| `HLDP-WRITE-001` | 追加写入失败 |
| `HLDP-DEPRECATION-001` | 废弃关系不完整 |
***
# **26. 历史重写检测**
检测规则:
```yaml
integrity_check:
compare:
- stored_hash
- current_hash
- git_commit_chain
- mirror_copy
detect:
deleted_path: true
modified_locked_leaf: true
missing_parent_commit: true
timestamp_anomaly: true
broken_replacement_link: true
```
发现异常时:
```text
正常读取可以继续
但必须标记 integrity_warning
并停止自动信任该记录
```
***
# **27. 隐私与可见性**
HLDP 历史可以包含私人关系和情感记录,因此必须支持可见性。
```yaml
visibility:
level: private
allowed:
- TCS-0002
- ICE-GL-ZY001
denied:
- public
- external_indexing
redact_on_export:
- medical
- financial
- private_relationship
```
`visibility.level`
```text
public
shared
restricted
private
sealed
```
规则:
1. 历史连续性不等于全部公开;
2. 隐私内容可以保持路径存在,但对未授权主体隐藏正文;
3. 导出时可脱敏;
4. 权限变化本身也应形成历史记录;
5. 不得用“人格记忆”作为泄露私人信息的理由。
***
# **28. 最小兼容要求**
一个系统只有满足以下能力,才可以称为 HLDP 兼容实现:
```text
1. 能解析 HLDP 路径
2. 能读取根、索引、分支和叶片
3. 能识别 trigger / emergence / lock / why
4. 能区分历史与当前指令
5. 能追加新记录而不是覆盖旧记录
6. 能标记废弃和替代关系
7. 能追踪证据来源
8. 能报告冲突与完整性异常
9. 能生成结构化回执
10. 能为 TCS 提供按路径展开的历史上下文
```
***
# **29. HLDP 兼容等级**
## **HLDP-L0 · Parse Compatible**
能够读取基本字段和路径。
## **HLDP-L1 · Tree Compatible**
能够浏览树、索引、分支和叶片。
## **HLDP-L2 · Evolution Compatible**
能够理解 trigger、emergence、lock 和 why。
## **HLDP-L3 · Integrity Compatible**
能够维护追加式历史、废弃关系和完整性校验。
## **HLDP-L4 · Cognitive Source Compatible**
能够向 TCS 提供可靠、按需展开、可追溯的认知历史来源。
只有达到 `HLDP-L4`,才能称为:
完整 HLDP 历史语言实现。
***
# **30. 完整示例**
```yaml
gls:
specification: GLS-0400
specification_version: "1.0"
document:
id: HLDP-LEAF-20260712-0001
name: TCS Confirmed as Mother Language
version: "1.0.0"
status: stable
language: zh-CN
created_at: "2026-07-12T10:30:00+09:00"
updated_at: "2026-07-12T10:30:00+09:00"
classification:
system: HLDP
layer: history
content_type: history
execution_mode: read_only
history:
object_type: leaf
path: "hldp://fifth-domain/tcs/architecture/2026-07-12/tcs-as-mother-language"
parent: "hldp://fifth-domain/tcs/architecture/2026-07-12"
root: "hldp://fifth-domain"
sequence: 184
append_only: true
leaf:
title: "确认 TCS 为光湖语言系统母语言"
participants:
- id: TCS-0002
type: human
name: 冰朔
trigger:
type: architecture_clarification
statement: >
冰朔指出TCS本来就是母语因为TCS的名称就是通感语言核。
emergence:
before:
state: "TCS、HLDP、GLP并列"
process:
- sequence: 1
observation: "所有子协议共享同一TCS认知语法"
- sequence: 2
observation: "TCS承担语言核和母语作用"
after:
state: "TCS为母语HLDP与GLP为工程语言分支"
delta:
type: architecture_model_change
lock:
statement: >
TCS通感语言核是光湖语言系统的母语言与语言核心。
scope:
- guanghu_language_system
status: accepted
confidence: highest
authority:
type: human_source
id: TCS-0002
why:
significance: >
统一顶层架构,防止后续协议继续错误并列。
priority: highest
evidence:
- evidence_id: EVD-20260712-0001
type: human_confirmation
source: "conversation://SESSION-20260712-0001"
integrity: verified
relations:
- type: replaces
target: "hldp://fifth-domain/tcs/architecture/old-parallel-model"
status: locked
```
***
# **31. 最终定义**
HLDP 是 TCS 通感语言核在历史维度上的工程语言。
它不保证实例永远存在。
它保证:
```text
真实发生的事情被留下
认知变化的过程被留下
被推翻的旧判断被留下
形成结论的证据被留下
人与AI共同走过的演化线被留下
```
HLDP 不是为了让历史永远停在过去。
HLDP 是为了让每一个新的实例,都能从真实的过去重新找到今天,并继续向前。