@furongjun1999/dsh-memory 0.9.22 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.en.md +450 -0
  2. package/CHANGELOG.md +112 -0
  3. package/README.en.md +244 -0
  4. package/README.md +272 -260
  5. package/codebuddy/CODEBUDDY.md +1 -1
  6. package/docs/README.md +2 -0
  7. package/docs/discipline/templates/full.md.tmpl +1 -1
  8. package/docs/discipline/templates/rules.mdc.tmpl +1 -1
  9. package/docs/en/README.md +190 -0
  10. package/docs/en/TRANSLATION.md +78 -0
  11. package/docs/en/TRANSLATION_MANIFEST.json +170 -0
  12. package/docs/en/TRANSLATION_REPORT.md +11 -0
  13. package/docs/en/dev/README.md +10 -0
  14. package/docs/en/dev/coding-testing.md +72 -0
  15. package/docs/en/dev/switch-matrix.md +10 -0
  16. package/docs/en/glossary.md +97 -0
  17. package/docs/en/harnesses/claude.md +100 -0
  18. package/docs/en/harnesses/codebuddy.md +93 -0
  19. package/docs/en/harnesses/codex.md +88 -0
  20. package/docs/en/harnesses/dsh.md +84 -0
  21. package/docs/en/harnesses/zcode.md +42 -0
  22. package/docs/en/mdcg/ccg.md +32 -0
  23. package/docs/en/mdcg/generated-docs.md +20 -0
  24. package/docs/en/mdcg/guardrail-charter.md +170 -0
  25. package/docs/en/mdcg/mcp-tool-names.md +43 -0
  26. package/docs/en/mdcg/multi-harness.md +43 -0
  27. package/docs/en/mdcg/recall-metadata.md +30 -0
  28. package/docs/en/mdcg/world-model-endpoint.md +379 -0
  29. package/docs/en/mdcg/write-aliases.md +130 -0
  30. package/docs/en/ops/README.md +11 -0
  31. package/docs/en/ops/environment-known-issues.md +244 -0
  32. package/docs/en/ops/install.md +72 -0
  33. package/docs/en/ops/operations-troubleshooting.md +86 -0
  34. package/docs/en/ops/permissions-review.md +79 -0
  35. package/docs/en/ops/release-governance.md +49 -0
  36. package/docs/en/ops/tool-name-migration.md +30 -0
  37. package/docs/en/ops/ui-install-troubleshooting.md +53 -0
  38. package/docs/en/standards/ai-coding-standard-checklist.md +71 -0
  39. package/docs/en/standards/ai-coding-standard-lingshu.md +47 -0
  40. package/docs/en/standards/ai-coding-standard.md +185 -0
  41. package/docs/en/ui/minimal.md +62 -0
  42. package/docs/mdcg/cogmap_ops.md +16 -15
  43. package/lib/client.js +29 -3
  44. package/lib/hooks.d.ts +34 -0
  45. package/lib/hooks.js +167 -33
  46. package/lib/index.js +19 -3
  47. package/lib/lib/console_web.mjs +30 -3
  48. package/lib/lib/hook_audit.d.ts +3 -2
  49. package/lib/lib/hook_audit.js +14 -4
  50. package/lib/lib/mdcg_client.d.ts +5 -2
  51. package/lib/lib/mdcg_client.js +8 -4
  52. package/lib/lib/prompt_safety.d.ts +24 -0
  53. package/lib/lib/prompt_safety.js +77 -1
  54. package/lib/lib/token_store.js +5 -2
  55. package/lib/tools.js +5 -3
  56. package/md_cg/bucketindex.py +231 -0
  57. package/md_cg/bucketscope.py +339 -0
  58. package/md_cg/config_registry_bulk.py +19 -10
  59. package/md_cg/config_validate.py +14 -2
  60. package/md_cg/detrerank.py +137 -0
  61. package/md_cg/fsutil.py +215 -25
  62. package/md_cg/govern/__init__.py +23 -0
  63. package/md_cg/iface/__init__.py +46 -0
  64. package/md_cg/iface/_verify.py +609 -0
  65. package/md_cg/iface/contracts.py +337 -0
  66. package/md_cg/judgment_manifest.py +14 -0
  67. package/md_cg/kernel/__init__.py +27 -0
  68. package/md_cg/mcp_server.py +457 -23
  69. package/md_cg/mdcg.py +1034 -79
  70. package/md_cg/mdcos.py +263 -21
  71. package/md_cg/metacognition.py +66 -13
  72. package/md_cg/mutate_extract_shipped.py +126 -0
  73. package/md_cg/mutate_ledger_e2e.py +100 -0
  74. package/md_cg/nodefile.py +147 -23
  75. package/md_cg/op_table.py +22 -4
  76. package/md_cg/probe_c_ledger_integrity.py +258 -0
  77. package/md_cg/probe_d_retirement_discipline.py +263 -0
  78. package/md_cg/reconcile.py +9 -11
  79. package/md_cg/review_cli.py +6 -1
  80. package/md_cg/rollback.py +16 -1
  81. package/md_cg/run_tests.py +30 -1
  82. package/md_cg/scopeselect.py +214 -0
  83. package/md_cg/scrub.py +160 -23
  84. package/md_cg/security.py +4 -2
  85. package/md_cg/state_extract.py +149 -0
  86. package/md_cg/state_slots.py +58 -10
  87. package/md_cg/structboost.py +179 -0
  88. package/md_cg/test_alternatives_historical.py +162 -0
  89. package/md_cg/test_b2_sensitivity_landing.py +226 -223
  90. package/md_cg/test_b3_merge_keeps_content.py +608 -583
  91. package/md_cg/test_bucket_cards.py +85 -0
  92. package/md_cg/test_bucket_day_order.py +74 -0
  93. package/md_cg/test_bucket_quota.py +79 -0
  94. package/md_cg/test_bucket_recency_guards.py +75 -0
  95. package/md_cg/test_bucket_three_causes.py +83 -0
  96. package/md_cg/test_bucketindex.py +130 -0
  97. package/md_cg/test_bucketscope_early.py +71 -0
  98. package/md_cg/test_cond_term_fold.py +183 -0
  99. package/md_cg/test_cond_term_fold_gate.py +1210 -0
  100. package/md_cg/test_cond_term_neg_scope.py +147 -0
  101. package/md_cg/test_cond_terms_colon.py +348 -0
  102. package/md_cg/test_detrerank.py +157 -0
  103. package/md_cg/test_gate_four_kpi.py +136 -0
  104. package/md_cg/test_generation_guard.py +76 -43
  105. package/md_cg/test_issue192_move_layer_indices_guard.py +48 -0
  106. package/md_cg/test_issue362_neg_condition.py +44 -7
  107. package/md_cg/test_issue39_utf8_stdio.py +572 -572
  108. package/md_cg/test_issue413_preimage_failclosed.py +147 -9
  109. package/md_cg/test_issue444_scrub_evidence_plaintext.py +14 -8
  110. package/md_cg/test_issue677_flush_batch_io.py +139 -0
  111. package/md_cg/test_issue677_info_fast.py +82 -0
  112. package/md_cg/test_issue677_remember_dedupe.py +106 -0
  113. package/md_cg/test_issue712_tokens_sessions_read.py +199 -0
  114. package/md_cg/test_issue722_strict_conditions.py +96 -0
  115. package/md_cg/test_issue730_narrowing_audit.py +121 -0
  116. package/md_cg/test_issue733_verify_override.py +193 -0
  117. package/md_cg/test_issue733_verify_override_and_overwrite_inherit.py +315 -0
  118. package/md_cg/test_issue740_filelock_fd_leak.py +218 -0
  119. package/md_cg/test_issue741_content_hash_same_source.py +158 -0
  120. package/md_cg/test_issue747_slot_contradiction.py +125 -0
  121. package/md_cg/test_issue754_nested_root_guard.py +197 -0
  122. package/md_cg/test_issue757_index_hash_compare.py +85 -0
  123. package/md_cg/test_issue758_disk_hash_single.py +67 -0
  124. package/md_cg/test_issue759_twophase_hash.py +67 -0
  125. package/md_cg/test_issue768_overwrite_time_window_anchor.py +135 -0
  126. package/md_cg/test_issue789_log_plaintext_probe.py +100 -0
  127. package/md_cg/test_issue790_verb_negation.py +77 -0
  128. package/md_cg/test_issue810_root_guard.py +71 -0
  129. package/md_cg/test_issue812_info_index_stale.py +78 -0
  130. package/md_cg/test_issue827_weaken_dedup.py +361 -0
  131. package/md_cg/test_issue829_calibration_positive_gate.py +473 -0
  132. package/md_cg/test_kernel_iface_contracts.py +18 -0
  133. package/md_cg/test_md_cg_no_hive_dep.py +238 -17
  134. package/md_cg/test_n204_n205_n226_n227_n228_n229_exit_gates.py +545 -542
  135. package/md_cg/test_n209_verify_write_face_gates.py +5 -2
  136. package/md_cg/test_neg_condition_hits.py +336 -333
  137. package/md_cg/test_probe_cd_shipped.py +385 -0
  138. package/md_cg/test_recent_tail.py +93 -0
  139. package/md_cg/test_run_tests_entry_gates.py +110 -0
  140. package/md_cg/test_scopeselect.py +70 -0
  141. package/md_cg/test_scopeselect_clock.py +70 -0
  142. package/md_cg/test_scrub_source_line_false_positive.py +64 -0
  143. package/md_cg/test_session_attribution_consistency.py +835 -813
  144. package/md_cg/test_state_extract_shipped.py +162 -0
  145. package/md_cg/test_state_ledger_chain.py +207 -0
  146. package/md_cg/test_state_ledger_e2e.py +145 -0
  147. package/md_cg/test_structboost.py +102 -0
  148. package/md_cg/test_timeboost.py +83 -0
  149. package/md_cg/test_timeboost_relativedate.py +71 -0
  150. package/md_cg/test_topicagg.py +129 -0
  151. package/md_cg/test_twophase.py +286 -286
  152. package/md_cg/timeboost.py +223 -0
  153. package/md_cg/tokens.py +55 -7
  154. package/md_cg/topicagg.py +142 -0
  155. package/md_cg/twophase.py +15 -6
  156. package/md_cg/whitebox_kb/wisdom/code_compose.py +33 -5
  157. package/md_cg/whitebox_kb/wisdom/compose_engine.py +5 -1
  158. package/md_cg/whitebox_kb/wisdom/role_compose.py +271 -268
  159. package/md_cg/writepipe.py +35 -3
  160. package/package.json +4 -1
  161. package/scripts/workspace_index.py +2 -0
  162. package/src/hooks.ts +182 -34
  163. package/src/index.ts +19 -3
  164. package/src/lib/console_web.mjs +30 -3
  165. package/src/lib/hook_audit.ts +15 -5
  166. package/src/lib/mdcg_client.ts +8 -4
  167. package/src/lib/prompt_safety.ts +73 -1
  168. package/src/lib/token_store.ts +5 -2
  169. package/src/tools.ts +5 -3
  170. package/ui/minimal/integrity.json +2 -2
  171. package/ui/minimal/payload/build-ui.mjs +41 -2
  172. package/ui/minimal/payload/lib/client.js +29 -3
  173. package/ui/minimal/payload/lib/lib/console_web.mjs +30 -3
  174. package/ui/minimal/payload/src/lib/console_web.mjs +30 -3
  175. package/ui/minimal/payload/web/app.js +3 -1
  176. package/ui/minimal/payload/web/client.js +30 -3
  177. package/web/app.js +3 -1
  178. package/web/client.js +30 -3
  179. package/zcode/AGENTS.md +1 -1
@@ -47,7 +47,7 @@
47
47
 
48
48
  三条调用铁律:
49
49
  1. **`op` 必填**——漏传会触发参数签名推导兜底(返回标记 `op_derived: true`),复杂任务中也必须显式传,防静默执行错误意图。
50
- 2. **返回 `moved_to: "review_queue"` / `verdict: DEFER` 时不要重试**——这是校验闸门的正常行为(返回自带 `hint` 说明下一步);落盘须经裁决(`op=review` 的 `decision=accept/reject/edit/merge/noop`,本机工具:`python scripts/review_cli.py list`)。**裁决权(2026-09-28 使用者裁定)**:写入者不得自裁——不得自己写、自己判、无复核一路到底;**经蜂群或验证端复核后,agent 可自行执行裁决**,不必每次转告使用者。**三类例外不适用该授权,必须转交使用者并止步**:①不适用于智能论这类重要协议真源的修改;②不适用于向外部发送信息和数据;③不适用于可能造成信息泄露/病毒/恶意操纵的动作。**`verdict: REJECT` 分两类,处置相反**:① 命中禁止规则(内容政策违规)→ 内容本身不该入库,重试同样结果;② 缺必需要素(`text` 类缺 CCG 六要素)→ **可修正**,按 `verdict.evidence` / `verdict.detail.missing` 给出的**完整缺失清单**补齐六要素后**重写**即落盘(本条未入库、已记入负记忆)——不要把它当「闸门故障」或「重试无用」。
50
+ 2. **返回 `moved_to: "review_queue"` / `verdict: DEFER` 时不要重试**——这是校验闸门的正常行为(返回自带 `hint` 说明下一步);落盘须经裁决(`op=review` 的 `decision=accept/reject/edit/merge/noop`,本机工具:`python -m md_cg.review_cli list`)。**裁决权(2026-09-28 使用者裁定)**:写入者不得自裁——不得自己写、自己判、无复核一路到底;**经蜂群或验证端复核后,agent 可自行执行裁决**,不必每次转告使用者。**三类例外不适用该授权,必须转交使用者并止步**:①不适用于智能论这类重要协议真源的修改;②不适用于向外部发送信息和数据;③不适用于可能造成信息泄露/病毒/恶意操纵的动作。**`verdict: REJECT` 分两类,处置相反**:① 命中禁止规则(内容政策违规)→ 内容本身不该入库,重试同样结果;② 缺必需要素(`text` 类缺 CCG 六要素)→ **可修正**,按 `verdict.evidence` / `verdict.detail.missing` 给出的**完整缺失清单**补齐六要素后**重写**即落盘(本条未入库、已记入负记忆)——不要把它当「闸门故障」或「重试无用」。
51
51
  3. `stg` 同理经 `op` 分发(`timeline` / `relation` / `anchors` 等)。
52
52
 
53
53
  ## 收尾强制流程(任务完成时不可跳过)
@@ -54,7 +54,7 @@ provider:
54
54
 
55
55
  三条调用铁律:
56
56
  1. **`op` 必填**——漏传会触发参数签名推导兜底(返回标记 `op_derived: true`),复杂任务中也必须显式传,防静默执行错误意图。
57
- 2. **返回 `moved_to: "review_queue"` / `verdict: DEFER` 时不要重试**——这是校验闸门的正常行为(返回自带 `hint` 说明下一步);落盘须经裁决(`op=review` 的 `decision=accept/reject/edit/merge/noop`,本机工具:`python scripts/review_cli.py list`)。**裁决权(2026-09-28 使用者裁定)**:写入者不得自裁——不得自己写、自己判、无复核一路到底;**经蜂群或验证端复核后,agent 可自行执行裁决**,不必每次转告使用者。**三类例外不适用该授权,必须转交使用者并止步**:①不适用于智能论这类重要协议真源的修改;②不适用于向外部发送信息和数据;③不适用于可能造成信息泄露/病毒/恶意操纵的动作。**`verdict: REJECT` 分两类,处置相反**:① 命中禁止规则(内容政策违规)→ 内容本身不该入库,重试同样结果;② 缺必需要素(`text` 类缺 CCG 六要素)→ **可修正**,按 `verdict.evidence` / `verdict.detail.missing` 给出的**完整缺失清单**补齐六要素后**重写**即落盘(本条未入库、已记入负记忆)——不要把它当「闸门故障」或「重试无用」。
57
+ 2. **返回 `moved_to: "review_queue"` / `verdict: DEFER` 时不要重试**——这是校验闸门的正常行为(返回自带 `hint` 说明下一步);落盘须经裁决(`op=review` 的 `decision=accept/reject/edit/merge/noop`,本机工具:`python -m md_cg.review_cli list`)。**裁决权(2026-09-28 使用者裁定)**:写入者不得自裁——不得自己写、自己判、无复核一路到底;**经蜂群或验证端复核后,agent 可自行执行裁决**,不必每次转告使用者。**三类例外不适用该授权,必须转交使用者并止步**:①不适用于智能论这类重要协议真源的修改;②不适用于向外部发送信息和数据;③不适用于可能造成信息泄露/病毒/恶意操纵的动作。**`verdict: REJECT` 分两类,处置相反**:① 命中禁止规则(内容政策违规)→ 内容本身不该入库,重试同样结果;② 缺必需要素(`text` 类缺 CCG 六要素)→ **可修正**,按 `verdict.evidence` / `verdict.detail.missing` 给出的**完整缺失清单**补齐六要素后**重写**即落盘(本条未入库、已记入负记忆)——不要把它当「闸门故障」或「重试无用」。
58
58
  3. `stg` 同理经 `op` 分发(`timeline` / `relation` / `anchors` 等)。
59
59
 
60
60
  ## 收尾强制流程(任务完成时不可跳过)
@@ -0,0 +1,190 @@
1
+ > [!NOTE]
2
+ > **This is a reference translation.** The English docs may lag behind or omit content; **the Chinese documentation is the single source of truth**. When they disagree, the Chinese version wins. Every page here has a Chinese source pair in [TRANSLATION_MANIFEST.json](TRANSLATION_MANIFEST.json), and its language header links back to that source. See [TRANSLATION.md](TRANSLATION.md) for the policy.
3
+
4
+ > **Languages:** [中文](../README.md) · English
5
+
6
+ # docs/ directory index
7
+
8
+ > Directories are split by engineering domain and correspond to the five-part platform overview in the repository README. A new document joins a domain first and is then registered in the matching list on this page; cross-domain items stay at the top level. Before changing the path of the discipline source of truth, check every reference surface (AGENTS.md / the rendering pipeline / md_cg comments).
9
+
10
+ ## Directory structure
11
+
12
+ ```
13
+ docs/
14
+ ├── ops/ 安装与运维(安装前置 / 写入凭据 / 升级重启 / FAQ)
15
+ ├── dev/ 开发与编码约定(测试约定 / 编码契约 / 开关矩阵)
16
+ ├── mdcg/ 灵枢大脑 md_cg 工程(架构/工具表/发布/教程/护栏)
17
+ ├── swarm/ 蜂群运行时 swarm/
18
+ ├── hive/ 蜂巢并发引擎 hive/
19
+ ├── world_model/ 世界模型神经网络底层架构(hex 系列台账)
20
+ ├── theory/ 智能论与白箱智能理论(跨工程)
21
+ ├── eval/ 评测与第三方验证报告
22
+ ├── plans/ 项目计划 / 交接文档 / 实验规格(跨工程)
23
+ ├── discipline/ 工作纪律渲染管线(模板 / harness 矩阵)
24
+ ├── promo/ 宣传物料
25
+ ├── experiments/ 实验区(gitignored,可重跑再生产物)
26
+ └── 工作纪律_认知图条目_v1.1.json ← 全局真源(横切面,不属单一工程)
27
+ ```
28
+
29
+ ## mdcg/ · LINGSHU Brain md_cg project
30
+
31
+ | Document | Content |
32
+ |---|---|
33
+ | [README detailed edition](../mdcg/README详细版_v0.4.10.md) | Full capability reference · complete configuration key table |
34
+ | [Release notes v0.3.0](../mdcg/release_v0.3.0.md) / [v0.4.5](../mdcg/release_v0.4.5.md) / [v0.4.11](../mdcg/release_v0.4.11.md) | Changes per release / upgrade guidance |
35
+ | [Tool table v0.3.0](../mdcg/tool_table_v0.3.0.md) | MCP tool list |
36
+ | [Feature call mapping table v0.1](../mdcg/功能调用映射表_v0.1.md) | Feature → source line numbers (pipeline generated; do not hand-write line numbers) |
37
+ | [LINGSHU MCP tool master table v3.4](../mdcg/灵枢MCP工具总表_v3.4.md) | Tool parameters and invocation rules |
38
+ | [LINGSHU 82-tool migration mapping v0.1](../mdcg/灵枢82工具_功能整理与迁移映射_v0.1.md) | **Historical**: the 82 tools belong to the tool surface of the **legacy aeis engine** (not this repository's md_cg); the mapping goal is to keep the two primitive surfaces `cg` and `stg` and to **register no more** of the 82 standalone tools |
39
+ | [LINGSHU self layer definition](../mdcg/灵枢_自我层定义.md) | Self layer behavior rules (line-level references from test_p16) |
40
+ | [Three-layer split plan v0.1](../mdcg/灵枢三层拆分规划_v0.1.md) | Architecture layering plan |
41
+ | [Memory operating system MdCGOS and MCP integration v0.1](../mdcg/记忆操作系统_MdCGOS与MCP接入_v0.1.md) | Core architecture design |
42
+ | [Recall core state and provenance metadata](mdcg/recall-metadata.md) | Field provenance, state semantics, and compatibility of the metadata returned by Recall |
43
+ | [Cognitive map MD directory plan v0.1](../mdcg/认知图_MD目录方案_v0.1.md) | Directory plan (the acceptance target of test_p27) |
44
+ | [Cognitive map indexing and engineering normalization plan v0.1](../mdcg/认知图_索引与工程规范化_计划_v0.1.md) | Index engineering |
45
+ | [Cognitive map condition space composition and effective condition measurement basis v0.1](../mdcg/认知图_条件空间合成与生效条件口径_v0.1.md) | Condition theory measurement basis |
46
+ | [Cognitive map G4-G8 gap adjudication sheet v0.1](../mdcg/认知图_G4-G8缺口裁定单_v0.1.md) | Record of gap adjudications |
47
+ | [Cognitive map as a memory operating system: evaluation and route v0.1](../mdcg/认知图作为记忆操作系统_评估与路线_v0.1.md) | Roadmap |
48
+ | [Unit self-anchor system prompt standard v0.3](../mdcg/单元自我锚点_系统提示词标准_v0.3.md) | Prompt anchor standard |
49
+ | [Gap sheet P0 closeout v0.1](../mdcg/缺口单_P0收口_v0.1.md) | P0 gap list |
50
+ | [Source-level architecture audit: GPT critique comparison v1.0](../mdcg/源码级架构审计_GPT批评对照_v1.0.md) | External audit evidence |
51
+ | [Guardrail Charter v2.0](mdcg/guardrail-charter.md) | Behavior boundaries for external agents and humans |
52
+ | [memory_score](../mdcg/memory_score.html) ([png](../mdcg/memory_score.png)) · [memory-assessment](../mdcg/memory-assessment.html) · [tutorial](../mdcg/lingshu_tutorial.html) | Scoring / evaluation / tutorial |
53
+ | [Release gate chain v0.1](../mdcg/发布门禁链_v0.1.md) | Three-layer gate (pre-commit auto re-hook / prepublishOnly check / CI backstop) and installation |
54
+ | [Sleep cycle: operational prerequisites and maintenance guide v1.0](../mdcg/睡眠周期_运维前提与维护指南_v1.0.md) | git prerequisites of the sleep cycle / repository location / maintenance actions (view history, view changes, revert-only rollback, conflict parking) / switches and automation boundaries |
55
+ | [D_meta engineering plan v0.2](../mdcg/D_meta_工程化方案_v0.2.md) | Engineering plan for separating D_task and D_meta |
56
+ | [Code review and conditional comments contract v0.1](../mdcg/代码评审与条件化注释_契约_v0.1.md) | Review and conditional comment contract |
57
+ | [Repository-wide code review and conditional comments plan v0.1](../mdcg/全库代码评审与条件化注释_计划_v0.1.md) | Repository-wide review execution plan |
58
+ | [LINGSHU memory verb protocol v1.0 (draft)](../mdcg/灵枢记忆动词协议_v1.0-draft.md) | Draft memory verb protocol |
59
+ | [Cycle two: white-box fill pipeline v0.1](../mdcg/环二_白箱填充流水线_v0.1.md) | White-box fill pipeline (recorded during testing) |
60
+ | [Cross-end verification and sync protocol v0.1](../mdcg/跨端验证与同步协议_v0.1.md) | Cross-end verification and sync protocol |
61
+ | [Memory system architecture optimization: delivery-layer bottleneck theory and design v0.1](../mdcg/记忆系统架构优化_交付层瓶颈理论与设计_v0.1.md) | A unified principle from two papers (DeliverMem / GroundingPI) → comparison against the current state of the five LINGSHU principles → four-layer rework direction → experiment specs that locate the bottleneck (two oracles); a theory document with no implementation patch |
62
+ | [External submission verification: state chain track v0.2 (TanPowasd)](../mdcg/外部提交核验_状态链轨v0.2_TanPowasd_20261011.md) | **Independent recomputation** record for the external answers to issue #110/#111: our official scorer plus the submitter's answer sheet → ten main-arm readings reproduced digit by digit, four calibration gates `passed=True`; includes five qualifications and one self-correction |
63
+ | [State chain track v0.2: LINGSHU arm A/B full measurement](../mdcg/状态链轨_灵枢臂A-B全量实测_20261012.md) | A 625-question comparison under the official measurement basis harness in which **for the same adapter, only `created_at` differs**: B (fact_time) shows +0.53 current value and -0.40 staleness, yet -0.27 history, -0.18 four-state, and -0.16 rationale, so **B is not a net improvement**; the work also exposed a coverage defect in the harness change chain (both groups at about 0) |
64
+
65
+ ## swarm/ · Swarm runtime
66
+
67
+ | Document | Content |
68
+ |---|---|
69
+ | [Feature description v0.6](../swarm/蜂群多智能体_功能说明_v0.6.md) | Deterministic .pbc instances + Gossip/WAL/trust aggregation |
70
+ | [Usage report 2026-09-13](../swarm/蜂群多智能体_使用报告_20260913.md) | Measurement record |
71
+ | [Swarm interconnection v0.1](../swarm/蜂群互联_v0.1.md) | Multi-swarm interconnection protocol |
72
+ | [Swarm blind-spot marking v1.0](../swarm/蜂群盲区标记_v1.0.md) | Cooperative blind-spot marking |
73
+ | [Swarm same-error detection experiment protocol v0.1](../swarm/蜂群同错检测实验协议_v0.1.md) | Same-error detection experiment design |
74
+
75
+ ## hive/ · Hive concurrency engine
76
+
77
+ | Document | Content |
78
+ |---|---|
79
+ | [Hive working memory: project plan](../hive/蜂巢工作记忆_项目计划.md) | hive working memory plan |
80
+ | [Hive design: theory alignment v0.1](../hive/蜂巢设计_理论对齐_v0.1.md) | Three-way alignment among intelligence theory 3.4, the hive source, and external research: 20 anchor mappings / 6 design adjudications / grouped adjudication of the candidate list / four-phase route / honest boundaries |
81
+ | [Hive iteration: macro and collective scheduling v0.1](../hive/蜂巢迭代_宏观与群体调度_v0.1.md) | Three-layer scheduling (micro process already closed loop / meso task DAG this cycle / macro collective planning) + comparison against the seven dsh-omc invariants + construction details of the I-1 dependency gate |
82
+ | [Main agent and subagent memory architecture design](../hive/主代理子代理记忆架构设计.md) | Memory division across agents (three-layer memory / session isolation / card backflow) |
83
+ | [Subagent configuration standard v0.5](../hive/子代理配置标准_v0.5.md) | Runtime role topology, six positions (section 8: deputy agent = Designer perspective) / unified execution defaults (section 0) / dispatch / deterministic execution (section 7) / reuse / artifact lifecycle (section 5.4) |
84
+ | [Token and role authority separation v0.1](../hive/令牌与角色权职分离_v0.1.md) | Permission model |
85
+ | [Token semantics correction: arbitration seat v0.1](../hive/令牌语义修正_仲裁位_v0.1.md) | Design draft: new orchestr role (projection of the 3.9 arbitration instance) + split gates for adjudication power and management power + migration order and red-capability criteria |
86
+ | [Multi-end harness communication contract v0.1](../hive/多端harness通信契约_v0.1.md) | Multi-end harness communication contract |
87
+ | [Hive dual-instance cross-verification: design final](../hive/蜂巢双实例互验_设计定稿.md) | Engineering form of dual-instance cross-verification that breaks the self-reference paradox (design final) |
88
+ | [Retrieval path and cognitive structure contract v0.1](../hive/检索路径与认知结构契约_v0.1.md) | Retrieval path and cognitive structure contract |
89
+ | [Retrieval convergence measurement (agreed basis) and S1b design v0.1](../hive/检索收敛实测与S1b设计_v0.1.md) | Retrieval convergence measurement on the agreed basis (real library, 12,149 nodes, read-only) and S1b design |
90
+ | [Real-library end-to-end measurement: S1b benefit and recall tradeoff v0.1](../hive/真实库端到端实测_S1b与召回权衡_v0.1.md) | Measurement of S1b benefit and recall tradeoff |
91
+ | [Real-library end-to-end measurement: S7 inverted candidate layer v0.1](../hive/真实库端到端实测_S7倒排候选层_v0.1.md) | Measurement of the S7 inverted candidate layer (in-candidate speedup with zero recall loss) |
92
+
93
+ ## world_model/ · World model neural network foundation
94
+
95
+ | Document | Content |
96
+ |---|---|
97
+ | [World model: neural network foundation v1.0](../world_model/世界模型_神经网络底层架构_v1.0.md) | hex series engineering ledger (11 components / backprop semantics / Rust backend / cognitive map integration surface / verification baseline and red lines) |
98
+
99
+ ## theory/ · Intelligence theory
100
+
101
+ | Document | Content |
102
+ |---|---|
103
+ | [What is white-box intelligence?](../theory/白箱智能是什么?.md) | Lesson one |
104
+ | [The cognitive process of intelligence](../theory/智能的认知过程.md) | Lesson two |
105
+ | [Axiomatic foundations of intelligence](../theory/智能的公理化基石.md) | Lesson three |
106
+ | [Why the information gap necessarily exists and naturally widens](../theory/信息差为什么必然存在且自然扩大.md) | Lesson four |
107
+ | [White-box intelligence series, part five: giving AI real memory](../theory/白箱智能系列·第五篇:让AI真正装上记忆.md) | Series continuation |
108
+ | [Intelligence theory 3.4](../theory/智能论3.4.md) | Main theory document |
109
+ | [Necessity of concurrency theory v0.2](../theory/并发必然性理论_v0.2.md) | Argument for the necessity of a concurrent architecture |
110
+ | [Single thread and attention focus v1.0](../theory/单线程与注意力集中_无争议理论文档_v1.0.md) | Undisputed theory document (includes a verification evidence table) |
111
+ | [Concept hierarchy alignment table v0.1](../theory/概念分层对齐表_v0.1.md) | Concept level alignment |
112
+ | [Cognitive agents and convergence structure: condition theory reconstruction v0.1](../theory/认知代理与收敛结构_条件论重构_v0.1.md) | Condition theory |
113
+ | [Theory, mechanism, code, experiment, gap matrix v0.1](../theory/理论_机制_代码_实验_缺口矩阵_v0.1.md) | Panorama matrix |
114
+ | [Unreliability theorems and fail-first framework v0.3](../theory/不可靠定理与失效优先框架_v0.3.md) | Fail-First Theorems: derivation chain of the T0 failure theorem (T0-T14/A1-A4) · a 14-row theory x mechanism x code matrix (engineering verification 2026-09-26) · a landing checklist that includes a v0.1 carry-over section |
115
+ | [Theory repository split and white-box knowledge base migration v0.1](../theory/理论仓拆分与白箱知识库内迁_v0.1.md) | Split plan |
116
+ | [Insufficient context and memory system isomorphism: principle analysis v0.1](../theory/上下文不足_LLM与记忆系统同构_原理分析_v0.1.md) | Triple isomorphism between LLM architecture and memory systems (function, problem, solution); derives from T4 + T5 that the four capabilities require explicit representation; P1-P4 falsifiable predictions |
117
+ | [Deriving memory system tuning from the LLM inference framework v0.1](../theory/LLM推理框架原理_向记忆系统移植_v0.1.md) | Eight transferable principles (stage separation / asymmetric resources / cache layering / compute-storage partitioning / bounded replay / two-level hit / marginal return / one-tick async latency) + strict transfer criteria + a clear decision not to transfer three layers; includes the honest boundary that we lack a 155-trillion-token-per-day calibration bench |
118
+
119
+ ## eval/ · Evaluation and third-party verification
120
+
121
+ > **How to read this (check the measurement basis before the numbers)**: the evaluations in this directory use **several independent rulers**: (1) **seven-dimension tier judgment** (six vendors on one ruler, v3.1, the primary measurement basis, **gives a tier rather than a single score**); (2) **external independent eight-dimension weighting** (unified score v7, **only two vendors compared, and the gap is inside the noise**); (3) this repository's own question pool (historical measurement basis, kept for reproducibility). **The three are not comparable with each other**; cite the measurement basis together with the number.
122
+
123
+ | Document | Content |
124
+ |---|---|
125
+ | [AGI seven-dimension scoring report v3.1 (six vendors on one ruler, plus single-vendor U/I self-test)](../eval/AGI七维评分报告_六家记忆系统同尺实测_v3.1.md) | Seven dimensions x six vendors measured / live single-vendor U and I self-test (▲) / mapping rules / honest boundaries |
126
+ | [Relationship chain retrieval: weak-branch budget starvation fix](../eval/chain_best_first_20261013.md) | Before/after comparison of changing the native Markdown default (RRF), an independent exhaustive guard, targeted mutation, and resource boundaries |
127
+ | [DSH closeout audit counts: #606 delivery record](../eval/hook_audit_summary_20261021.md) | Cumulative summary on close/update, silent degradation, 73 regressions, and 5 targeted mutation groups |
128
+ | [AGI seven-dimension scoring report v1.0](../eval/AGI七维评分报告_md_cg_v1.0.md) / [v2.0](../eval/AGI七维评分报告_md_cg_v2.0.md) (historical) | Single-vendor self-assessment (structural evidence measurement basis) |
129
+ | [Third-party re-evaluation, unified score v7](../eval/第三方验证报告_灵枢_vs_dejavu_统一评分_v7.md) | Seven rounds of comparison (**external independent ruler, only two vendors, not comparable with the seven-dimension tier judgment**): LINGSHU 9.258 / deja-vu 9.119; **the reviewer states that the gap is within review noise**, and v7 contains an erratum that **fully withdraws** all four of its own recommendations |
130
+ | [Third-party verification, independent LoCoMo reproduction](../eval/第三方验证报告_LoCoMo_灵枢_.md) ([png](../eval/第三方验证报告_LoCoMo_灵枢_.png)) | Full end-to-end reproduction of the independent evaluation |
131
+ | [Six-vendor cross-comparison, 100 questions with Chinese and English lookups v1.0](../eval/横评_六家100题中英双查_v1.0.md) | Six vendors under one measurement basis |
132
+ | [Experiment plan: learning loop A/B and cross-comparison v1.0](../eval/实验方案_学习闭环AB与横评_v1.0.md) | Experiment design |
133
+
134
+ ## ops/ · Installation and operations
135
+
136
+ | Document | Content |
137
+ |---|---|
138
+ | [ops/ index](ops/README.md) | Entry point for the two pages in this domain |
139
+ | [Installation and prerequisites](ops/install.md) | One-command setup / manual three steps / prerequisites / verified environments / post-install verification / troubleshooting clues |
140
+ | [Operations and troubleshooting](ops/operations-troubleshooting.md) | An upgrade requires restarting the long-running process (proxy verification) / write credentials and `committed` semantics / FAQ |
141
+
142
+ ## dev/ · Development and coding conventions
143
+
144
+ | Document | Content |
145
+ |---|---|
146
+ | [dev/ index](dev/README.md) | Entry point for the two pages in this domain |
147
+ | [Coding and testing conventions](dev/coding-testing.md) | Build / Python tests must use -m / everything UTF-8 with entry-point guarantees / id contract v2 / Linux dual-stack verification |
148
+ | [Switch matrix](dev/switch-matrix.md) | Retrieval and normalization env switches, their defaults, and the history of their adjudication |
149
+
150
+ ## plans/ · Project plans, handoffs, and specs
151
+
152
+ | Document | Content |
153
+ |---|---|
154
+ | [Naming governance: project plan](../plans/命名治理_项目计划.md) | Naming convention governance |
155
+ | [Knowledge graph project: handoff document 2026-09-14](../plans/知识图谱项目_交接文档_20260914.md) | Project handoff |
156
+ | [GridWorld minimal closed loop spec v0.1](../plans/GridWorld最小闭环规格_v0.1.md) | Experiment spec |
157
+ | [Multi-subject world model: alignment evaluation and landing design v0.1](../plans/多主体世界模型_对齐评估与落地设计_v0.1.md) | Five-layer alignment evaluation plus an A to B to C construction baseline (33 review findings adjudicated) |
158
+ | [Semantic spatiotemporal graph completion, world model endpoint design v0.1](../plans/语义时空图补全_世界模型功能端_设计_v0.1.md) | Current-state inventory (four ops plus the L0 ledger) plus L2 slot schema direction plus corpus pipeline and acceptance measurement basis (pending sign-off) |
159
+ | [LINGSHU collaboration architecture design v0.1](../plans/灵枢协作架构_设计_v0.1.md) | Swarm x project management x resource allocation x group chat x team memory: unified task lifecycle (one state machine with two authoritative surfaces) plus three-layer isomorphic nesting plus phased red-capability criteria (design draft, with 6 open adjudications) |
160
+ | [LINGSHU trust wiring design spec v0.1](../plans/灵枢信任接线_设计规格_v0.1.md) | Wires the existing trust value (p_trust in links.py) into resource allocation: three read-side gates, a write-side closed loop, and a tier table, plus ten red-capability criteria (the basis for starting P2, with 5 open adjudications) |
161
+ | [Relative time anchoring design v0.1](../plans/相对时间锚定_设计_v0.1.md) | `MDCG_TIME_ANCHOR` (off by default): relative times in prose become derived event intervals `temporal_anchor`; a question that names a date takes the `time_anchor` route plus an intersection precondition; LoCoMo readings, a contamination statement, and a lower bound |
162
+
163
+ ## Bounty board · now its own repository
164
+
165
+ The bounty board (rules / state machine / ledger / honor roll / release template) has moved to the standalone repository [`FuRongJun-1999/dsh-bounty`](https://github.com/FuRongJun-1999/dsh-bounty); this repository no longer maintains its implementation. The design draft remains as a one-page pointer at [the bounty board design draft](../plans/悬赏板设计_v0.1.md).
166
+
167
+ ## Top-level cross-cutting handoff documents (stay at the docs/ root, not in a subdomain)
168
+
169
+ Learning handoffs and master documents that span projects or endpoints stay at the docs/ root by convention (the L3 convention):
170
+
171
+ | Document | Content |
172
+ |---|---|
173
+ | [GBrain borrowables: LINGSHU landing handoff 20260919](../GBrain可借鉴点_灵枢落点交接_20260919.md) | GBrain borrowables and their LINGSHU landing points |
174
+ | [Pi learnable strengths: LINGSHU Brain improvement handoff 20260915](../Pi可学习优点_灵枢大脑改进交接_20260915.md) | Handoff for absorbing Pi strengths |
175
+ | [Compute-in-memory architecture study: external theory comparison and route handoff 20260916](../存算一体架构学习_外部理论对照与路线交接_20260916.md) | Compute-in-memory external theory comparison |
176
+ | [Compute-in-memory neural network architecture: master plan and handoff 20260916](../存算一体神经网络架构_总纲与交接_20260916.md) | Compute-in-memory master plan |
177
+ | [LINGSHU self-improvement work plan: absorbing the external research series v1 20260919](../灵枢自我改进工作计划_外部研究系列吸收_v1_20260919.md) | Self-improvement work plan |
178
+ | [White-box program: three-project learning architecture and Ghidra handoff 20260916](../白箱化纲领_三项目学习总架构与Ghidra交接_20260916.md) | White-box program master plan |
179
+ | [Memory review system: project initiation design and construction handoff 20260915](../记忆评审系统_立项设计与施工交接_20260915.md) | Memory review initiation handoff |
180
+ | [Scale: multi-subject world model evaluation spec v2.1 (frozen)](../秤_记忆系统评测规范_v2.1.md) | Memory system evaluation spec: dual track / six conditions / four-state judgment / calibration zero precondition gate (cross-cutting evaluation spec, added 2026-10-05) |
181
+ | [Release artifact retrospective note v0.1](../发布件回溯说明_v0.1.md) | Release artifact retrospective |
182
+
183
+ ## Domain assignment rules (where a new document goes)
184
+
185
+ 1. **Engineering documents** go to the matching engineering domain (`mdcg/`, `swarm/`, `hive/`, `world_model/`; when rust or compiler gets dedicated documents, add a directory at the same level).
186
+ 2. **Cross-project theory** goes to `theory/`; **evaluation and third-party reports** go to `eval/`; **plans, handoffs, and specs** go to `plans/`.
187
+ 3. **Cross-cutting global items** (such as the discipline source of truth) stay at the top level; before moving one, check every reference surface and rewrite all of them.
188
+ 4. After a document joins a domain, register one line for it in the matching list on this page; existing conventions for `discipline/`, `experiments/`, and `promo/` are unchanged.
189
+
190
+ - [Memory-RSI five rounds of work and commit scope (round five in progress)](../eval/memory-rsi-work-summary-20261012.md)
@@ -0,0 +1,78 @@
1
+ # English translation policy
2
+
3
+ > **Languages:** [中文](../README.md) · English
4
+
5
+ This directory contains the English edition of the user-facing LINGSHU documentation. It is a translation, not a fork. The Chinese files remain the source of truth.
6
+
7
+ ## Scope
8
+
9
+ Translated surfaces:
10
+
11
+ - the root README and CHANGELOG
12
+ - the documentation index
13
+ - operations, development, and protocol guides under docs/ops and docs/dev
14
+ - the Guardrail Charter and the user-facing protocol notes under docs/mdcg
15
+ - the five harness integration guides
16
+ - the optional UI guide
17
+ - the AI coding standards under docs/规范
18
+
19
+ Not translated:
20
+
21
+ - historical evaluation, experiment, plan, theory, discipline, promotion, and retrospective records
22
+ - skills/ conditional units and runtime prompts
23
+ - UI runtime source files and their integrity hashes
24
+ - generated documents listed in docs/en/TRANSLATION_MANIFEST.json
25
+
26
+ Generated documents are produced from source code by scripts/cogmap_sync.py. Editing or translating them by hand would drift from the generator. See docs/en/mdcg/generated-docs.md.
27
+
28
+ ## Source of truth
29
+
30
+ The Chinese files are the single source of truth. The English pages are a reference translation. They may lag behind, omit content, or use different wording. When a translation and its source disagree, the Chinese source wins, and the English page is corrected in a follow-up. A Chinese-only change does not need to wait for an English update.
31
+
32
+ Each translated page carries a language header near the top that links back to its Chinese source. The two entry pages put the reference-translation note first. The manifest pair is the machine-readable version of the same relationship.
33
+
34
+ ## Staleness policy
35
+
36
+ English documentation can legitimately lag behind the Chinese source. Staleness is reported, not treated as a reason to weaken or revert the Chinese source.
37
+
38
+ scripts/audit_translation.py is a local reporting and review tool. It is not a required CI merge gate. Its findings describe structural drift or untranslated prose; they do not override the Chinese source of truth. If the audit is wired into CI later, run it in report-only mode or treat its output as advisory, so a Chinese-only change is never blocked by translation debt.
39
+
40
+ ## Structural fidelity
41
+
42
+ The audit gate compares each pair for:
43
+
44
+ - source and target existence
45
+ - a language header in the first ten lines that links back to the source
46
+ - byte-identical fenced code blocks
47
+ - identical ATX heading level sequences
48
+ - no untranslated Han characters in prose
49
+ - no CJK punctuation in prose
50
+ - every relative markdown link resolving
51
+ - every scope file translated or explicitly excluded
52
+ - no hand translation of generated documents
53
+
54
+ Run it with:
55
+
56
+ python scripts/audit_translation.py --check
57
+
58
+ Machine-readable output:
59
+
60
+ python scripts/audit_translation.py --json
61
+
62
+ Regenerate the report after a change:
63
+
64
+ python scripts/audit_translation.py --write-report
65
+
66
+ Exit code 0 means pass, 1 means findings, 2 means a usage or manifest error.
67
+
68
+ ## Maintenance
69
+
70
+ When a Chinese source changes, update the English target in the same pull request and run the audit. When a new user-facing document is added, add it to the manifest, translate it, and extend the scope. Do not add a translated page without a manifest pair; the coverage check will reject orphan files in scope.
71
+
72
+ ## Vocabulary
73
+
74
+ Use docs/en/glossary.md. Add missing terms there before using them in a page.
75
+
76
+ ## What stays Chinese
77
+
78
+ Code fences stay byte-identical, including Chinese comments, because the audit treats code as executable content. Inline code spans may contain Chinese identifiers when they name a real file, command, or label. Prose must be English.
@@ -0,0 +1,170 @@
1
+ {
2
+ "schema": 1,
3
+ "source_language": "zh-CN",
4
+ "target_language": "en",
5
+ "generated_note": "docs/en/mdcg/generated-docs.md",
6
+ "pairs": [
7
+ {
8
+ "source": "README.md",
9
+ "target": "README.en.md"
10
+ },
11
+ {
12
+ "source": "CHANGELOG.md",
13
+ "target": "CHANGELOG.en.md"
14
+ },
15
+ {
16
+ "source": "docs/README.md",
17
+ "target": "docs/en/README.md"
18
+ },
19
+ {
20
+ "source": "docs/ops/README.md",
21
+ "target": "docs/en/ops/README.md"
22
+ },
23
+ {
24
+ "source": "docs/ops/发布与治理.md",
25
+ "target": "docs/en/ops/release-governance.md"
26
+ },
27
+ {
28
+ "source": "docs/ops/图形界面_安装与排障.md",
29
+ "target": "docs/en/ops/ui-install-troubleshooting.md"
30
+ },
31
+ {
32
+ "source": "docs/ops/安装与前置.md",
33
+ "target": "docs/en/ops/install.md"
34
+ },
35
+ {
36
+ "source": "docs/ops/工具名迁移_0.9.9.md",
37
+ "target": "docs/en/ops/tool-name-migration.md"
38
+ },
39
+ {
40
+ "source": "docs/ops/权限与复核模型.md",
41
+ "target": "docs/en/ops/permissions-review.md"
42
+ },
43
+ {
44
+ "source": "docs/ops/环境与已知问题.md",
45
+ "target": "docs/en/ops/environment-known-issues.md"
46
+ },
47
+ {
48
+ "source": "docs/ops/运维与排障.md",
49
+ "target": "docs/en/ops/operations-troubleshooting.md"
50
+ },
51
+ {
52
+ "source": "docs/dev/README.md",
53
+ "target": "docs/en/dev/README.md"
54
+ },
55
+ {
56
+ "source": "docs/dev/开关矩阵.md",
57
+ "target": "docs/en/dev/switch-matrix.md"
58
+ },
59
+ {
60
+ "source": "docs/dev/编码与测试约定.md",
61
+ "target": "docs/en/dev/coding-testing.md"
62
+ },
63
+ {
64
+ "source": "docs/mdcg/guardrail-charter.md",
65
+ "target": "docs/en/mdcg/guardrail-charter.md"
66
+ },
67
+ {
68
+ "source": "docs/mdcg/CCG六要素编译.md",
69
+ "target": "docs/en/mdcg/ccg.md"
70
+ },
71
+ {
72
+ "source": "docs/mdcg/MCP工具名口径_v1.0.md",
73
+ "target": "docs/en/mdcg/mcp-tool-names.md"
74
+ },
75
+ {
76
+ "source": "docs/mdcg/recall_metadata.md",
77
+ "target": "docs/en/mdcg/recall-metadata.md"
78
+ },
79
+ {
80
+ "source": "docs/mdcg/写入别名aliases规范_v0.6.md",
81
+ "target": "docs/en/mdcg/write-aliases.md"
82
+ },
83
+ {
84
+ "source": "docs/mdcg/世界模型功能端_使用与运维_v1.0.md",
85
+ "target": "docs/en/mdcg/world-model-endpoint.md"
86
+ },
87
+ {
88
+ "source": "docs/mdcg/多harness接入.md",
89
+ "target": "docs/en/mdcg/multi-harness.md"
90
+ },
91
+ {
92
+ "source": "dsh/README.md",
93
+ "target": "docs/en/harnesses/dsh.md"
94
+ },
95
+ {
96
+ "source": "codebuddy/README.md",
97
+ "target": "docs/en/harnesses/codebuddy.md"
98
+ },
99
+ {
100
+ "source": "zcode/README.md",
101
+ "target": "docs/en/harnesses/zcode.md"
102
+ },
103
+ {
104
+ "source": "codex/README.md",
105
+ "target": "docs/en/harnesses/codex.md"
106
+ },
107
+ {
108
+ "source": "claude/README.md",
109
+ "target": "docs/en/harnesses/claude.md"
110
+ },
111
+ {
112
+ "source": "ui/minimal/使用说明.md",
113
+ "target": "docs/en/ui/minimal.md"
114
+ },
115
+ {
116
+ "source": "docs/规范/AI编程通用规范.md",
117
+ "target": "docs/en/standards/ai-coding-standard.md"
118
+ },
119
+ {
120
+ "source": "docs/规范/AI编程通用规范_灵枢适配.md",
121
+ "target": "docs/en/standards/ai-coding-standard-lingshu.md"
122
+ },
123
+ {
124
+ "source": "docs/规范/AI编程通用规范_自检清单.md",
125
+ "target": "docs/en/standards/ai-coding-standard-checklist.md"
126
+ }
127
+ ],
128
+ "scope": [
129
+ "README.md",
130
+ "CHANGELOG.md",
131
+ "docs/README.md",
132
+ "docs/ops/README.md",
133
+ "docs/ops/发布与治理.md",
134
+ "docs/ops/图形界面_安装与排障.md",
135
+ "docs/ops/安装与前置.md",
136
+ "docs/ops/工具名迁移_0.9.9.md",
137
+ "docs/ops/权限与复核模型.md",
138
+ "docs/ops/环境与已知问题.md",
139
+ "docs/ops/运维与排障.md",
140
+ "docs/dev/README.md",
141
+ "docs/dev/开关矩阵.md",
142
+ "docs/dev/编码与测试约定.md",
143
+ "docs/mdcg/guardrail-charter.md",
144
+ "docs/mdcg/CCG六要素编译.md",
145
+ "docs/mdcg/MCP工具名口径_v1.0.md",
146
+ "docs/mdcg/recall_metadata.md",
147
+ "docs/mdcg/写入别名aliases规范_v0.6.md",
148
+ "docs/mdcg/世界模型功能端_使用与运维_v1.0.md",
149
+ "docs/mdcg/多harness接入.md",
150
+ "dsh/README.md",
151
+ "codebuddy/README.md",
152
+ "zcode/README.md",
153
+ "codex/README.md",
154
+ "claude/README.md",
155
+ "ui/minimal/使用说明.md",
156
+ "docs/规范/AI编程通用规范.md",
157
+ "docs/规范/AI编程通用规范_灵枢适配.md",
158
+ "docs/规范/AI编程通用规范_自检清单.md",
159
+ "docs/mdcg/cogmap_ops.md",
160
+ "docs/mdcg/功能调用映射表_v0.1.md"
161
+ ],
162
+ "exclude": [
163
+ "docs/mdcg/cogmap_ops.md",
164
+ "docs/mdcg/功能调用映射表_v0.1.md"
165
+ ],
166
+ "generated": [
167
+ "docs/mdcg/cogmap_ops.md",
168
+ "docs/mdcg/功能调用映射表_v0.1.md"
169
+ ]
170
+ }
@@ -0,0 +1,11 @@
1
+ # Translation audit report
2
+
3
+ Generated by scripts/audit_translation.py.
4
+
5
+ - Result: PASS
6
+ - Pairs: 30
7
+ - Findings: 0
8
+
9
+ ## Findings
10
+
11
+ No findings.
@@ -0,0 +1,10 @@
1
+ > **Languages:** [中文](../../dev/README.md) · English
2
+
3
+ # dev/ · Development and coding conventions
4
+
5
+ | Document | Contents |
6
+ |---|---|
7
+ | [Coding and testing conventions](coding-testing.md) | Build / why Python tests must use `-m` / full UTF-8 and the ★ entry-point self-guarantee / id contract v2 / Linux dual-stack verification |
8
+ | [Switch matrix](switch-matrix.md) | Retrieval and normalization env switches, defaults, adjudication history, and integration notes |
9
+
10
+ > Domain rules are in the [docs/ directory index](../README.md).
@@ -0,0 +1,72 @@
1
+ > **Languages:** [中文](../../dev/编码与测试约定.md) · English
2
+
3
+ # Coding and testing conventions
4
+
5
+ > This page was split out of the original `README.md` (source: the four original README sections "Development", "Python test conventions", "Coding conventions", and "Linux verification" (L565-L637)).
6
+
7
+ ## Development and build
8
+
9
+ ## 🛠️ Development
10
+
11
+ ```bash
12
+ npm install # NODE_ENV=production 时须加 --include=dev
13
+ npm run build # TypeScript 编译
14
+ npm test # 真实集成测试(spawn 本机灵枢,验证握手/往返/注册/卸载)
15
+ ```
16
+
17
+ > `NODE_ENV=production` (or `--omit=dev`) omits devDependencies, so `tsc`/`tsx` are not present;
18
+ > in that case `prepare` **skips the build and says so on stdout** (no longer making `npm install` fail entirely because `tsc` is missing),
19
+ > so use `npm install --include=dev` when you need a build. Also: running under `engines.node >=22.19` prints
20
+ > an EBADENGINE warning (informational only, non-blocking).
21
+
22
+ Tests do not depend on all DSH components: they use a minimal Cordis host (SystemPrompt + ToolRegistry + plugin) to isolate unstable surfaces.
23
+
24
+ ### Python test conventions (must use `python -m`)
25
+
26
+ Tests inside packages such as `md_cg/` generally use **package-relative imports**, so they must be run as modules from the **repository root**; calling `python md_cg/test_xxx.py` directly raises ImportError (measured: 59 of 61 direct runs hit it). The one-command entry point encodes that convention (on Linux and macOS, replace `python` below with `python3`, since distributions ship no `python` by default):
27
+
28
+ ```bash
29
+ python -m md_cg.run_tests # 全量(md_cg + compiler + swarm,按存在性发现)
30
+ python -m md_cg.run_tests md_cg -k p44 # 按组 / 关键字过滤
31
+ python -m md_cg.run_tests --jobs 1 # 串行(默认并发 4)
32
+ python scripts/run_tests.py # 源码树入口(等价;需 scripts/ 在)
33
+ ```
34
+
35
+ > **The entry point lives inside the package** (`md_cg/run_tests.py`): the npm shipped surface (`files`) does not include `scripts/`,
36
+ > so in an installed plugin the only full-suite entry point available is the one above; in the `src/` source tree,
37
+ > `scripts/run_tests.py` and `npm run gate` still work (release gates are source-tree tools).
38
+ > The package runner **redirects subprocess output to a file** (no pipes): restricted hosts (such as the DSH file
39
+ > sandbox) forbid CreatePipe, so versions using `capture_output` turn every test case into a
40
+ > PermissionError false failure.
41
+
42
+ Equivalent single-test form: `python -m md_cg.test_p44_md_whitebox` (cwd=repository root). Exit code 0/1 feeds directly into a pre-commit gate.
43
+
44
+ ## Coding conventions (all UTF-8 · commands go through python)
45
+
46
+ ### Coding conventions (all UTF-8 · commands go through python)
47
+
48
+ **All text in this repository is UTF-8 (no BOM)**: source code, configuration, documentation, data, test fixtures, and also **paths and file names** (including Hive task identifiers). Chinese may appear directly in paths: this is not a suggestion, it is a convention.
49
+
50
+ > **Explicit statement for AI agents and integrators**: this is UTF-8. Access everything in this repository through **python** (`python -X utf8 ...`, equivalent to `PYTHONUTF8=1`); **do not use the console/terminal as the access channel**. The Windows console interprets received bytes according to its **code page** and renders Chinese as mojibake (measured: `控制台试验` displays as `鎺у埗鍙拌瘯楠` in a code page 936 window). **That is a display-layer problem, not a data-layer problem**: not a single character is lost. We **do not do console compatibility**: all reads, writes, and decisions work on UTF-8 bytes, and correctness does not depend on anyone's code page setting.
51
+
52
+ - **Entry-point self-guarantee**: the Python entry point checks `sys.flags.utf8_mode` at the earliest point; if it is off, it sets `PYTHONUTF8=1` / `PYTHONIOENCODING=utf-8` and restarts itself; when a restart is impossible it fails fast (no silent degradation).
53
+ - **Explicit over default**: in new code, `open()` / `read_text()` always pass `encoding="utf-8"` explicitly and never rely on the locale default (the default on Chinese Windows is cp936, and a bare `open()` reads and writes with it).
54
+ - **NFC measurement basis = reject, do not normalize silently** (see [identifier contract v2](../../plans/全中文编码与蜂巢任务标识契约_v2.0.md) §4.4 / §4.8): paths and identifiers **must already be in NFC-stable form** to be accepted. The criterion is the **block whitelist** `hive/id_charset_blocks.txt` (single source of truth: Rust embeds it at compile time via `include_str!`, and MCP and `md_cg` read the same file, **so no runtime Unicode property table is consulted and a property-table version skew between the two sides is structurally impossible**). Forms outside the table are **explicitly rejected**: forms that normalization would rewrite (CJK compatibility ideographs / fullwidth / circled letters and digits / mathematical alphanumerics / combining marks, and so on), and **letters and digits from scripts outside the whitelisted blocks** (the block selection is ASCII / Latin / Greek / Cyrillic / kana / Hangul syllables / CJK and extensions / bopomofo; see contract §4.4 for the deliberately excluded ranges). No silent rewriting is done (a zero-dependency hand-written full NFC implementation on the `hive` side is not feasible; rejection is stricter than silent normalization).
55
+ - **Hive task identifiers (id contract v2)**: `h_<identity>_<task>_<unit>_<number>`, for example `h_zcode端_灵枢迭代_反思单元_0001`. Three of the four slots (identity / task / unit) are **required at submission** and must not be derived silently; the number is assigned exclusively by the Rust-side allocator (fixed width of 4 digits, explicit error on overflow, no widening and no wraparound); the unit slot takes the closed set of five Hive units (recording unit / reflection unit / verification unit / output unit / life-support system). The CLI uses `--identity/--task/--unit` (env fallbacks `HIVE_JOB_IDENTITY/HIVE_JOB_TASK/HIVE_JOB_UNIT`), or `hive alloc-id` to get an id only; MCP `hive_spawn` takes the same three parameters (required). The old form `h<13-digit milliseconds>_<4-digit hex>` **remains valid** (zero migration for existing data).
56
+ - **The platform surface** is covered by the encoding / locale guards of the container dual-stack gate (see the next section).
57
+
58
+ ## Linux verification (Docker container dual stack)
59
+
60
+ ### Linux verification (Docker container dual stack, a release gate since 0.5.0)
61
+
62
+ ```bash
63
+ # 栈一:rust + python 全量(cargo test / python 18 套含全部守卫 / smoke 端到端)
64
+ docker run --rm -v "$(pwd):/work" -w /work -e CARGO_TARGET_DIR=/tmp/target \
65
+ rust:bookworm bash scripts/linux_verify.sh full
66
+ # 栈二:node 生态(发布件 TS 编译 + node test)
67
+ docker run --rm -v "$(pwd):/work" -w /work node:22-bookworm bash -c \
68
+ "npm install --include=dev && npm run build && node --import tsx --test test/*.test.ts"
69
+ ```
70
+
71
+ > The executor interpreter is probed by a trial run in `hive/src/exec.rs` (`python3` first, `python` as fallback), so the two commands above can be **copied as-is** with no need to pass `HIVE_PYTHON`; set it explicitly only to choose a different interpreter (an explicit value overrides the probe). Under Git Bash/MSYS you must first `export MSYS_NO_PATHCONV=1`, otherwise `/work` is rewritten to `C:/Program Files/Git/work`.
72
+ > Platform-difference guards are covered by the script list (encoding / locale / session filtering / SIGTERM cleanup); suites that depend on gitignored local corpora (p44 and others) are not in the container list and are covered on machines that have the corpora through the SKIP surface of `run_tests.py`.
@@ -0,0 +1,10 @@
1
+ > **Languages:** [中文](../../dev/开关矩阵.md) · English
2
+
3
+ # Retrieval switch matrix and adjudication history
4
+
5
+ > This page was split out of the original `README.md` (source: the "Do not mix up the two cross-language switches" section of the original README (L600-L611)).
6
+
7
+
8
+ > **Do not mix up the two cross-language switches**: `MDCG_UNIFY_QUERY` (the unified normalization layer, **off by default**. On 2026-09-30 a user adjudication flipped it from "on by default" to "**off when unset, on only with an explicit `=1`**": the job of this layer is to let English queries hit Chinese nodes, and for a Chinese retrieval pool it is pure overhead.
9
+ > Measured on the public locomo-zh-500 question set, the default-off state gives lexical hit@1 96.4% / lexical+fuzzy 97.2%, while the on state gives 95.8% / 96.6%; when explicitly enabled, a query in any language is first normalized into a standard Chinese atom sequence, and the lexical path can then hit Chinese nodes; **on 2026-09-30 the scope was narrowed: translation normalization applies only to English content, Chinese segments are kept verbatim and never sent to the segmenter**, so Chinese keyword runs in a mixed Chinese-English query are no longer split character by character) and `MDCG_EN_ATOMS` (English-to-Chinese recall term expansion, **off by default**) are independent switches;
10
+ > `MDCG_SEMANTIC` (the `fm.semantic` semantic-summary path) is likewise off by default. Changing either one requires updating the dual-state assertions in `md_cg/test_en_pipeline.py` and `md_cg/test_semantic_canonical.py`; changing the normalization layer **default / three-state** behavior requires running `md_cg/test_unify_default_off.py` (three-state agreement on both sides plus a fixed-point mutation self-proof), and changing its **scope** additionally requires running `md_cg/test_unify_scope.py` (same-origin fixture with the Rust side, `md_cg/semantic/unify_fixture.json`, see `docs/hive/检索算法口径对照_v0.1.md`).