You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by mi...@apache.org on 2026/10/09 06:42:11 UTC

(hugegraph-ai) branch ontogeny updated: Sync from ontogeny main

This is an automated email from the ASF dual-hosted git repository.

simon824 pushed a commit to branch ontogeny
in repository https://gitbox.apache.org/repos/asf/hugegraph-ai.git


The following commit(s) were added to refs/heads/ontogeny by this push:
     new 7f829d5c Sync from ontogeny main
7f829d5c is described below

commit 7f829d5c110fc95044fe962dbc4773bf7474c9ee
Author: simon824 <si...@users.noreply.github.com>
AuthorDate: Fri Oct 9 14:41:18 2026 +0800

    Sync from ontogeny main
    
    - bilingual docs split into docs/zh/ and docs/en/ with language-matched
      screenshots; etymology of the name told in both READMEs
    - console defaults to English (saved preference still wins)
    - chore: untrack .zcodeignore (local tooling config)
---
 .gitignore                                         |   3 ++
 .zcodeignore                                       |  47 ---------------------
 README.md                                          |  28 ++++++------
 docs/en/README.md                                  |   4 +-
 docs/en/architecture/01-overall-architecture.md    |   2 +-
 docs/en/architecture/02-ontology-model-and-dsl.md  |   2 +-
 docs/en/architecture/03-data-and-derivation.md     |   2 +-
 docs/en/architecture/04-actions-and-functions.md   |   2 +-
 docs/en/architecture/05-agent-governance.md        |   2 +-
 docs/en/architecture/06-rsi-self-evolution.md      |   2 +-
 docs/en/architecture/07-boundaries-and-quality.md  |   2 +-
 docs/en/usage/08-quickstart.md                     |   2 +-
 docs/en/usage/09-ui-tour.md                        |   2 +-
 docs/en/usage/10-function-editor.md                |   2 +-
 docs/en/usage/11-manufacturing-case.md             |   2 +-
 docs/en/usage/12-reference.md                      |   2 +-
 docs/{ => zh}/README.md                            |   4 +-
 .../architecture/01-overall-architecture.md        |   2 +-
 .../architecture/02-ontology-model-and-dsl.md      |   2 +-
 .../architecture/03-data-and-derivation.md         |   2 +-
 .../architecture/04-actions-and-functions.md       |   2 +-
 docs/{ => zh}/architecture/05-agent-governance.md  |   2 +-
 .../{ => zh}/architecture/06-rsi-self-evolution.md |   2 +-
 .../architecture/07-boundaries-and-quality.md      |   2 +-
 docs/{ => zh}/img/arch-board.png                   | Bin
 docs/{ => zh}/img/fn-editor.png                    | Bin
 docs/{ => zh}/img/fn-test.png                      | Bin
 docs/{ => zh}/img/qs-dashboard.png                 | Bin
 docs/{ => zh}/img/tour-access.png                  | Bin
 docs/{ => zh}/img/tour-audit.png                   | Bin
 docs/{ => zh}/img/tour-graph.png                   | Bin
 docs/{ => zh}/img/tour-knowledge.png               | Bin
 docs/{ => zh}/img/tour-objects.png                 | Bin
 docs/{ => zh}/img/tour-ontology.png                | Bin
 docs/{ => zh}/usage/08-quickstart.md               |   2 +-
 docs/{ => zh}/usage/09-ui-tour.md                  |   2 +-
 docs/{ => zh}/usage/10-function-editor.md          |   2 +-
 docs/{ => zh}/usage/11-manufacturing-case.md       |   2 +-
 docs/{ => zh}/usage/12-reference.md                |   2 +-
 web/src/i18n/index.tsx                             |   4 +-
 40 files changed, 50 insertions(+), 88 deletions(-)

diff --git a/.gitignore b/.gitignore
index b51f151a..2a0cc859 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,6 @@ web/.e2e-port
 # ---- editor/tooling ----
 .idea/
 .vscode/
+
+# ---- local tooling config (ZCode) ----
+.zcodeignore
diff --git a/.zcodeignore b/.zcodeignore
deleted file mode 100644
index b89bcc83..00000000
--- a/.zcodeignore
+++ /dev/null
@@ -1,47 +0,0 @@
-.venv/
-.ontogeny-*/
-.kina-*/  # legacy local state dirs from the kina era
-.oo-verify/
-__pycache__/
-*.pyc
-.pytest_cache/
-.ruff_cache/
-.DS_Store
-web/node_modules/
-web/dist/
-web/.e2e-port
-*.db
-*.log
-*.pid
-.docs/
-
-# ===== ↑ 以上同步自 .gitignore(「从 .gitignore 同步」只重写以上部分)=====
-.git/
-.hg/
-.svn/
-node_modules/
-bower_components/
-jspm_packages/
-site-packages/
-venv/
-coverage/
-htmlcov/
-lcov-report/
-cmakefiles/
-cmake-build-*/
-bazel-*/
-pods/
-deriveddata/
-storybook-static/
-playwright-report/
-test-results/
-allure-results/
-allure-report/
-cdk.out/
-*.egg-info/
-*.dist-info/
-eggs/
-pip-wheel-metadata/
-wheels/
-# ----- ↑ 以上为 ZCode 默认排除规则(自定义规则请写在本行下方,不会被同步/恢复改动)-----
-# 自定义规则写在下方(本行提示可删除)
diff --git a/README.md b/README.md
index 984e37bf..2e945d58 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 [![Backend Tests](https://img.shields.io/badge/pytest-561%20passed-brightgreen.svg)](#-contributing)
 [![Frontend Tests](https://img.shields.io/badge/vitest-245%20passed-brightgreen.svg)](#-contributing)
 
-`ontogeny` — named after the biological term for the *development of an individual organism* — is a **self-improving operational ontology platform**: it models an enterprise's business semantics (objects, properties, links) and business actions (actions, functions, policies) as declarative, Git-native YAML, and serves them to applications, analytics and AI agents through one governed API — optionally projected onto [Apache HugeGraph](https://github.com/apache/hugegraph) for deep-graph queries.
+`ontogeny` — Greek *onto-* (being, the root of *ontology*) + *genesis* (birth, development): in biology the word names the **full-life-cycle development of an individual organism**. The name is the thesis: an ontology here is not a static schema but a living thing — declared in Git, compiled into tables and a graph, and grown through use. It is a **self-improving operational ontology platform**: it models an enterprise's business semantics (objects, properties, links) and business action [...]
 
 The design references the Palantir Foundry Ontology (semantic layer + dynamic action layer) but is fully open: **the DSL is the single source of truth** — object tables and the graph schema are compiled artifacts that can be deleted and rebuilt at any time.
 
@@ -77,25 +77,25 @@ One `ServiceContext` behind three thin shells — HTTP, MCP and CLI — a single
 
 ## 📚 Documentation
 
-Docs live in [`docs/`](./docs/README.md) (Chinese; English translations welcome), in two parts:
+Docs live in [`docs/`](./docs/zh/README.md) (Chinese; English translations welcome), in two parts:
 
 **Part I · Architecture**
 
-- [Overall architecture](./docs/architecture/01-overall-architecture.md) — the four-band view, third-party components & degradation
-- [Ontology model & DSL](./docs/architecture/02-ontology-model-and-dsl.md) — the 11 resource kinds, mini-expr, validators
-- [Data & derivation](./docs/architecture/03-data-and-derivation.md) — ownership, sync engine, outbox, projection backfill
-- [Kinetic layer](./docs/architecture/04-actions-and-functions.md) — function ecosystem, functional actions & effect plans
-- [Agent governance](./docs/architecture/05-agent-governance.md) — sessions, engines, the MCP channel, the three doors
-- [RSI self-evolution](./docs/architecture/06-rsi-self-evolution.md) — signals, selection ladder, T0–T3 promotion
-- [Boundaries & quality](./docs/architecture/07-boundaries-and-quality.md) — non-goals, limits, test map
+- [Overall architecture](./docs/zh/architecture/01-overall-architecture.md) — the four-band view, third-party components & degradation
+- [Ontology model & DSL](./docs/zh/architecture/02-ontology-model-and-dsl.md) — the 11 resource kinds, mini-expr, validators
+- [Data & derivation](./docs/zh/architecture/03-data-and-derivation.md) — ownership, sync engine, outbox, projection backfill
+- [Kinetic layer](./docs/zh/architecture/04-actions-and-functions.md) — function ecosystem, functional actions & effect plans
+- [Agent governance](./docs/zh/architecture/05-agent-governance.md) — sessions, engines, the MCP channel, the three doors
+- [RSI self-evolution](./docs/zh/architecture/06-rsi-self-evolution.md) — signals, selection ladder, T0–T3 promotion
+- [Boundaries & quality](./docs/zh/architecture/07-boundaries-and-quality.md) — non-goals, limits, test map
 
 **Part II · Usage**
 
-- [Quick start](./docs/usage/08-quickstart.md) — one command, first login
-- [UI tour](./docs/usage/09-ui-tour.md) — six high-frequency pages
-- [Function editor](./docs/usage/10-function-editor.md) — sandboxed Python in the console
-- [Manufacturing case](./docs/usage/11-manufacturing-case.md) — a full operational loop
-- [Reference](./docs/usage/12-reference.md) — CLI, env vars, API endpoints, routes, error codes
+- [Quick start](./docs/zh/usage/08-quickstart.md) — one command, first login
+- [UI tour](./docs/zh/usage/09-ui-tour.md) — six high-frequency pages
+- [Function editor](./docs/zh/usage/10-function-editor.md) — sandboxed Python in the console
+- [Manufacturing case](./docs/zh/usage/11-manufacturing-case.md) — a full operational loop
+- [Reference](./docs/zh/usage/12-reference.md) — CLI, env vars, API endpoints, routes, error codes
 
 ## 🔗 HugeGraph Ecosystem
 
diff --git a/docs/en/README.md b/docs/en/README.md
index 6d1c917e..e565590a 100644
--- a/docs/en/README.md
+++ b/docs/en/README.md
@@ -1,8 +1,10 @@
 # Ontogeny Architecture & Usage Docs
 
 > Ontogeny · Self-improving operational ontology · an ontology that grows
+>
+> *Ontogeny* — Greek **onto-** (being, the root of *ontology*) + **genesis** (birth, development): in biology, the full-life-cycle development of an individual organism. Here, the thesis is the name: an ontology is not a static schema but a living thing — declared in Git, compiled into tables and a graph, and grown through use.
 
-**[中文版](../README.md)** | English
+**[中文版](../zh/README.md)** | English
 
 Ontogeny models an enterprise's **nouns** (objects · properties · links) and **verbs** (actions · functions · permissions) as declarative YAML in Git, compiled into strongly-typed object tables and one unified API shared by apps, analytics and AI agents. The write path runs a five-stage pipeline — rules → Cedar policy → transaction → immutable audit — with side effects riding a transactional outbox; and a **RSI self-evolution loop** recursively improves the model itself inside the govern [...]
 
diff --git a/docs/en/architecture/01-overall-architecture.md b/docs/en/architecture/01-overall-architecture.md
index fbeb07de..9b05288a 100644
--- a/docs/en/architecture/01-overall-architecture.md
+++ b/docs/en/architecture/01-overall-architecture.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture) · Sources: `api/app.py` · `mcp_server.py` · `cli.py` · `engine/service.py` · `action/runtime.py` · `action/outbox.py` etc.
 
-**[中文](../../architecture/01-overall-architecture.md)** | English
+**[中文](../../zh/architecture/01-overall-architecture.md)** | English
 
 ## The architecture board at a glance
 
diff --git a/docs/en/architecture/02-ontology-model-and-dsl.md b/docs/en/architecture/02-ontology-model-and-dsl.md
index 30946eea..5fd5de45 100644
--- a/docs/en/architecture/02-ontology-model-and-dsl.md
+++ b/docs/en/architecture/02-ontology-model-and-dsl.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/02-ontology-model-and-dsl.md)** | English
+**[中文](../../zh/architecture/02-ontology-model-and-dsl.md)** | English
 
 **11 resources**, all `apiVersion: ontogeny/v1` YAML — the directory is the package, Git is the source of truth; `${VAR}` references are injected at runtime, no secrets inside the package. The semantic layer (objects · links) pairs with the kinetic layer (actions · functions · policies), plus the derived layer (projections), the agent layer (plugins) and the evolution layer (eval suite / constitution).
 
diff --git a/docs/en/architecture/03-data-and-derivation.md b/docs/en/architecture/03-data-and-derivation.md
index 1f4b2d92..38b40cf4 100644
--- a/docs/en/architecture/03-data-and-derivation.md
+++ b/docs/en/architecture/03-data-and-derivation.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/03-data-and-derivation.md)** | English
+**[中文](../../zh/architecture/03-data-and-derivation.md)** | English
 
 ## 3.1 Property-level ownership (who is the real source)
 
diff --git a/docs/en/architecture/04-actions-and-functions.md b/docs/en/architecture/04-actions-and-functions.md
index 513f6dd6..a2711f91 100644
--- a/docs/en/architecture/04-actions-and-functions.md
+++ b/docs/en/architecture/04-actions-and-functions.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/04-actions-and-functions.md)** | English
+**[中文](../../zh/architecture/04-actions-and-functions.md)** | English
 
 **Actions change the world, functions compute answers** — Palantir's Ontology also makes these first-class citizens of the kinetic layer; Ontogeny inherits that faithfully and completes the function ecosystem to four capabilities (LLM access · derivation substrate · published APIs · streaming in design).
 
diff --git a/docs/en/architecture/05-agent-governance.md b/docs/en/architecture/05-agent-governance.md
index 1d3eeae7..6f86d408 100644
--- a/docs/en/architecture/05-agent-governance.md
+++ b/docs/en/architecture/05-agent-governance.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/05-agent-governance.md)** | English
+**[中文](../../zh/architecture/05-agent-governance.md)** | English
 
 An agent is a **first-class resource declared in the DSL**: the plugin carries a frozen identity (the permission surface), a tool allowlist, an approval stance and a budget.
 The MCP tool surface mounts at **`/mcp`** when the service starts (streamable HTTP · JSON mode). Every tool carries the reserved parameters `plugin` + `session_id` — sessionful calls funnel into **the broker.call_tool single gate** and execute inside the plugin identity, that session's budget and the tool catalog, leaving a trace; sessionless calls are **read-only** (writes return `WRITE_REQUIRES_SESSION`; the default `mcp-agent` shared identity is rejected wholesale by role-gated polici [...]
diff --git a/docs/en/architecture/06-rsi-self-evolution.md b/docs/en/architecture/06-rsi-self-evolution.md
index 5ce3f661..324c82a3 100644
--- a/docs/en/architecture/06-rsi-self-evolution.md
+++ b/docs/en/architecture/06-rsi-self-evolution.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/06-rsi-self-evolution.md)** | English
+**[中文](../../zh/architecture/06-rsi-self-evolution.md)** | English
 
 What recurses is the **model layer** (ontology + action); the platform constitution is never touched by the loop. Mutation is outsourced to the LLM, **selection never is** — the dividing line from unbounded RSI.
 There is no mysticism in the loop: every beat is deterministic code plus a persisted artifact. **Signals** come from rule-based scanners over telemetry (`ontogeny_evolve_signal`); **mutations** come only from the whitelist (`ontogeny_evolve_proposal`, rationale mandatory); **evaluation** is entirely deterministically evaluable (no LLM-judge); **promotion** runs the T0–T3 tiers against an ISO-week budget (`ontogeny_evolve_budget`). Every beat's products are database rows and a Git diff —  [...]
diff --git a/docs/en/architecture/07-boundaries-and-quality.md b/docs/en/architecture/07-boundaries-and-quality.md
index 15f31745..01e28ed0 100644
--- a/docs/en/architecture/07-boundaries-and-quality.md
+++ b/docs/en/architecture/07-boundaries-and-quality.md
@@ -2,7 +2,7 @@
 
 > Part of [Part I · Architecture](../README.md#part-i--architecture)
 
-**[中文](../../architecture/07-boundaries-and-quality.md)** | English
+**[中文](../../zh/architecture/07-boundaries-and-quality.md)** | English
 
 ## Explicitly out of scope
 
diff --git a/docs/en/usage/08-quickstart.md b/docs/en/usage/08-quickstart.md
index ff55c386..7fd3f8da 100644
--- a/docs/en/usage/08-quickstart.md
+++ b/docs/en/usage/08-quickstart.md
@@ -2,7 +2,7 @@
 
 > Part of [Part II · Usage](../README.md#part-ii--usage)
 
-**[中文](../../usage/08-quickstart.md)** | English
+**[中文](../../zh/usage/08-quickstart.md)** | English
 
 ## 8.1 One command
 
diff --git a/docs/en/usage/09-ui-tour.md b/docs/en/usage/09-ui-tour.md
index 57056b2f..6d3bfbb5 100644
--- a/docs/en/usage/09-ui-tour.md
+++ b/docs/en/usage/09-ui-tour.md
@@ -2,7 +2,7 @@
 
 > Part of [Part II · Usage](../README.md#part-ii--usage)
 
-**[中文](../../usage/09-ui-tour.md)** | English
+**[中文](../../zh/usage/09-ui-tour.md)** | English
 
 Six high-frequency pages covering the daily path "model → data → trace → govern". All screenshots come from a real running demo instance (`ontogeny serve --demo`, the product-manufacturing sample domain).
 
diff --git a/docs/en/usage/10-function-editor.md b/docs/en/usage/10-function-editor.md
index 4bbf3329..e3809588 100644
--- a/docs/en/usage/10-function-editor.md
+++ b/docs/en/usage/10-function-editor.md
@@ -2,7 +2,7 @@
 
 > Part of [Part II · Usage](../README.md#part-ii--usage)
 
-**[中文](../../usage/10-function-editor.md)** | English
+**[中文](../../zh/usage/10-function-editor.md)** | English
 
 Only functions with a **python** runtime show the "Run code" section (declarative functions encode their logic as step orchestration, edited in the Steps area above). The editor reads and writes the real file inside the package:
 **Test run** executes the current code once — nothing written, nothing traced; only **Save & publish** writes the file, producing a new version and a revision record.
diff --git a/docs/en/usage/11-manufacturing-case.md b/docs/en/usage/11-manufacturing-case.md
index d5a3854a..04bb3b9f 100644
--- a/docs/en/usage/11-manufacturing-case.md
+++ b/docs/en/usage/11-manufacturing-case.md
@@ -2,7 +2,7 @@
 
 > Part of [Part II · Usage](../README.md#part-ii--usage)
 
-**[中文](../../usage/11-manufacturing-case.md)** | English
+**[中文](../../zh/usage/11-manufacturing-case.md)** | English
 
 15 objects · 15 links · 12 actions · 5 functions · 6 policies · 1 projection · 2 eval suites · 2 agent plugins, with its own seeds (`seed/*.sql` nouns + `demo-story.yaml` verbs). The demo story replayed by --demo at startup is exactly the path below.
 
diff --git a/docs/en/usage/12-reference.md b/docs/en/usage/12-reference.md
index 634f01d1..6d403bf7 100644
--- a/docs/en/usage/12-reference.md
+++ b/docs/en/usage/12-reference.md
@@ -2,7 +2,7 @@
 
 > Part of [Part II · Usage](../README.md#part-ii--usage)
 
-**[中文](../../usage/12-reference.md)** | English
+**[中文](../../zh/usage/12-reference.md)** | English
 
 ## 12.2 CLI (ontogeny)
 
diff --git a/docs/README.md b/docs/zh/README.md
similarity index 91%
rename from docs/README.md
rename to docs/zh/README.md
index 1c79b88b..01e182df 100644
--- a/docs/README.md
+++ b/docs/zh/README.md
@@ -1,8 +1,10 @@
 # Ontogeny 架构与使用文档
 
 > Ontogeny · Self-improving operational ontology · an ontology that grows
+>
+> *Ontogeny*(个体发育)—— 希腊语 **onto-**(存在,即 *ontology* 本体论的词根)+ **genesis**(诞生、发育):生物学术语,指一个个体从胚胎到成体的**全生命周期发育**。这个名字就是产品主张:本体不是静态的 schema,而是一个活物——在 Git 里被定义,编译成表与图,再在使用中成长。
 
-**中文** | [English](./en/README.md)
+**中文** | [English](../en/README.md)
 
 
 把企业的**名词**(对象·属性·链接)与**动词**(动作·函数·权限)建模成 Git 里的声明式 YAML,编译为强类型对象表与统一 API,供应用、分析与 AI Agent 共用;写路径经「规则 → Cedar 策略 → 事务 → 不可变审计」五段式,副作用走事务性 outbox;并以 **RSI 自进化闭环**在治理轨道内递归改进模型本身(LLM 出变异 · 确定性评测做选择 · T0–T3 分层晋升)。
diff --git a/docs/architecture/01-overall-architecture.md b/docs/zh/architecture/01-overall-architecture.md
similarity index 99%
rename from docs/architecture/01-overall-architecture.md
rename to docs/zh/architecture/01-overall-architecture.md
index fa642223..be20dabc 100644
--- a/docs/architecture/01-overall-architecture.md
+++ b/docs/zh/architecture/01-overall-architecture.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture) · 源:`api/app.py` · `mcp_server.py` · `cli.py` · `engine/service.py` · `action/runtime.py` · `action/outbox.py` 等
 
-**中文** | [English](../en/architecture/01-overall-architecture.md)
+**中文** | [English](../../en/architecture/01-overall-architecture.md)
 
 ## 架构总览图
 
diff --git a/docs/architecture/02-ontology-model-and-dsl.md b/docs/zh/architecture/02-ontology-model-and-dsl.md
similarity index 98%
rename from docs/architecture/02-ontology-model-and-dsl.md
rename to docs/zh/architecture/02-ontology-model-and-dsl.md
index 957834c1..f55530fe 100644
--- a/docs/architecture/02-ontology-model-and-dsl.md
+++ b/docs/zh/architecture/02-ontology-model-and-dsl.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/02-ontology-model-and-dsl.md)
+**中文** | [English](../../en/architecture/02-ontology-model-and-dsl.md)
 
 
 **11 种资源**全部是 `apiVersion: ontogeny/v1` 的 YAML,目录即包,Git 即真源;环境引用 `${VAR}` 运行期注入,包内无密钥。语义层(对象·链接)与动力学层(动作·函数·策略)配对,外加派生层(投影)、Agent 层(插件)与自进化层(评测/宪法)。
diff --git a/docs/architecture/03-data-and-derivation.md b/docs/zh/architecture/03-data-and-derivation.md
similarity index 97%
rename from docs/architecture/03-data-and-derivation.md
rename to docs/zh/architecture/03-data-and-derivation.md
index cb4cd4d5..277dd8b1 100644
--- a/docs/architecture/03-data-and-derivation.md
+++ b/docs/zh/architecture/03-data-and-derivation.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/03-data-and-derivation.md)
+**中文** | [English](../../en/architecture/03-data-and-derivation.md)
 
 
 ## 3.1 属性级所有权(谁是真的源)
diff --git a/docs/architecture/04-actions-and-functions.md b/docs/zh/architecture/04-actions-and-functions.md
similarity index 97%
rename from docs/architecture/04-actions-and-functions.md
rename to docs/zh/architecture/04-actions-and-functions.md
index 9ef6a71f..9d80718c 100644
--- a/docs/architecture/04-actions-and-functions.md
+++ b/docs/zh/architecture/04-actions-and-functions.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/04-actions-and-functions.md)
+**中文** | [English](../../en/architecture/04-actions-and-functions.md)
 
 
 **Action 改世界、Function 算答案**——Palantir Ontology 同为动力学层一等公民,Ontogeny 忠实继承,并把函数生态补齐到四项能力(LLM 注册 · 派生底层 · 发布 API · 流式规划中)。
diff --git a/docs/architecture/05-agent-governance.md b/docs/zh/architecture/05-agent-governance.md
similarity index 99%
rename from docs/architecture/05-agent-governance.md
rename to docs/zh/architecture/05-agent-governance.md
index a5373b74..76c4a3de 100644
--- a/docs/architecture/05-agent-governance.md
+++ b/docs/zh/architecture/05-agent-governance.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/05-agent-governance.md)
+**中文** | [English](../../en/architecture/05-agent-governance.md)
 
 
 Agent 是 **DSL 里声明的一等资源**:插件自带冻结身份(权限面)、工具白名单、审批模式与预算。
diff --git a/docs/architecture/06-rsi-self-evolution.md b/docs/zh/architecture/06-rsi-self-evolution.md
similarity index 99%
rename from docs/architecture/06-rsi-self-evolution.md
rename to docs/zh/architecture/06-rsi-self-evolution.md
index 240a043b..a7ed3f56 100644
--- a/docs/architecture/06-rsi-self-evolution.md
+++ b/docs/zh/architecture/06-rsi-self-evolution.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/06-rsi-self-evolution.md)
+**中文** | [English](../../en/architecture/06-rsi-self-evolution.md)
 
 
 递归改进的对象是**模型层**(ontology + action),平台宪法永不被循环触碰。变异外包给 LLM,**选择函数不外包**——这是与无界 RSI 的分界线。
diff --git a/docs/architecture/07-boundaries-and-quality.md b/docs/zh/architecture/07-boundaries-and-quality.md
similarity index 96%
rename from docs/architecture/07-boundaries-and-quality.md
rename to docs/zh/architecture/07-boundaries-and-quality.md
index abfc375a..7846aefd 100644
--- a/docs/architecture/07-boundaries-and-quality.md
+++ b/docs/zh/architecture/07-boundaries-and-quality.md
@@ -2,7 +2,7 @@
 
 > 所属:[架构文档](../README.md#第一部分--架构文档part-i--architecture)
 
-**中文** | [English](../en/architecture/07-boundaries-and-quality.md)
+**中文** | [English](../../en/architecture/07-boundaries-and-quality.md)
 
 
 ## 明确不做
diff --git a/docs/img/arch-board.png b/docs/zh/img/arch-board.png
similarity index 100%
rename from docs/img/arch-board.png
rename to docs/zh/img/arch-board.png
diff --git a/docs/img/fn-editor.png b/docs/zh/img/fn-editor.png
similarity index 100%
rename from docs/img/fn-editor.png
rename to docs/zh/img/fn-editor.png
diff --git a/docs/img/fn-test.png b/docs/zh/img/fn-test.png
similarity index 100%
rename from docs/img/fn-test.png
rename to docs/zh/img/fn-test.png
diff --git a/docs/img/qs-dashboard.png b/docs/zh/img/qs-dashboard.png
similarity index 100%
rename from docs/img/qs-dashboard.png
rename to docs/zh/img/qs-dashboard.png
diff --git a/docs/img/tour-access.png b/docs/zh/img/tour-access.png
similarity index 100%
rename from docs/img/tour-access.png
rename to docs/zh/img/tour-access.png
diff --git a/docs/img/tour-audit.png b/docs/zh/img/tour-audit.png
similarity index 100%
rename from docs/img/tour-audit.png
rename to docs/zh/img/tour-audit.png
diff --git a/docs/img/tour-graph.png b/docs/zh/img/tour-graph.png
similarity index 100%
rename from docs/img/tour-graph.png
rename to docs/zh/img/tour-graph.png
diff --git a/docs/img/tour-knowledge.png b/docs/zh/img/tour-knowledge.png
similarity index 100%
rename from docs/img/tour-knowledge.png
rename to docs/zh/img/tour-knowledge.png
diff --git a/docs/img/tour-objects.png b/docs/zh/img/tour-objects.png
similarity index 100%
rename from docs/img/tour-objects.png
rename to docs/zh/img/tour-objects.png
diff --git a/docs/img/tour-ontology.png b/docs/zh/img/tour-ontology.png
similarity index 100%
rename from docs/img/tour-ontology.png
rename to docs/zh/img/tour-ontology.png
diff --git a/docs/usage/08-quickstart.md b/docs/zh/usage/08-quickstart.md
similarity index 96%
rename from docs/usage/08-quickstart.md
rename to docs/zh/usage/08-quickstart.md
index 8958fe99..379f48b4 100644
--- a/docs/usage/08-quickstart.md
+++ b/docs/zh/usage/08-quickstart.md
@@ -2,7 +2,7 @@
 
 > 所属:[使用文档](../README.md#第二部分--使用文档part-ii--usage)
 
-**中文** | [English](../en/usage/08-quickstart.md)
+**中文** | [English](../../en/usage/08-quickstart.md)
 
 
 ## 8.1 一条命令启动
diff --git a/docs/usage/09-ui-tour.md b/docs/zh/usage/09-ui-tour.md
similarity index 97%
rename from docs/usage/09-ui-tour.md
rename to docs/zh/usage/09-ui-tour.md
index 72bfdfb2..fc413b2d 100644
--- a/docs/usage/09-ui-tour.md
+++ b/docs/zh/usage/09-ui-tour.md
@@ -2,7 +2,7 @@
 
 > 所属:[使用文档](../README.md#第二部分--使用文档part-ii--usage)
 
-**中文** | [English](../en/usage/09-ui-tour.md)
+**中文** | [English](../../en/usage/09-ui-tour.md)
 
 
 六个高频页面,覆盖「建模 → 数据 → 追溯 → 治理」的日常动线。全部截图取自真实运行的演示实例(`ontogeny serve --demo`,product-manufacturing 样例域)。
diff --git a/docs/usage/10-function-editor.md b/docs/zh/usage/10-function-editor.md
similarity index 97%
rename from docs/usage/10-function-editor.md
rename to docs/zh/usage/10-function-editor.md
index 49cd72a4..f9b01d82 100644
--- a/docs/usage/10-function-editor.md
+++ b/docs/zh/usage/10-function-editor.md
@@ -2,7 +2,7 @@
 
 > 所属:[使用文档](../README.md#第二部分--使用文档part-ii--usage)
 
-**中文** | [English](../en/usage/10-function-editor.md)
+**中文** | [English](../../en/usage/10-function-editor.md)
 
 
 Runtime 为 **python** 的函数才显示「运行代码」区(declarative 函数的逻辑就是步骤编排,在上方 Steps 区编辑)。编辑器直接读写包内真实文件:
diff --git a/docs/usage/11-manufacturing-case.md b/docs/zh/usage/11-manufacturing-case.md
similarity index 97%
rename from docs/usage/11-manufacturing-case.md
rename to docs/zh/usage/11-manufacturing-case.md
index 73f0600d..6144bc74 100644
--- a/docs/usage/11-manufacturing-case.md
+++ b/docs/zh/usage/11-manufacturing-case.md
@@ -2,7 +2,7 @@
 
 > 所属:[使用文档](../README.md#第二部分--使用文档part-ii--usage)
 
-**中文** | [English](../en/usage/11-manufacturing-case.md)
+**中文** | [English](../../en/usage/11-manufacturing-case.md)
 
 
 15 对象 · 15 链接 · 12 动作 · 5 函数 · 6 策略 · 1 投影 · 2 评测套件 · 2 Agent 插件 + 自带种子(`seed/*.sql` 名词 + `demo-story.yaml` 动词)。启动时 --demo 自动重放的演示剧本即以下链路。
diff --git a/docs/usage/12-reference.md b/docs/zh/usage/12-reference.md
similarity index 99%
rename from docs/usage/12-reference.md
rename to docs/zh/usage/12-reference.md
index 2eee0f4b..931e2e72 100644
--- a/docs/usage/12-reference.md
+++ b/docs/zh/usage/12-reference.md
@@ -2,7 +2,7 @@
 
 > 所属:[使用文档](../README.md#第二部分--使用文档part-ii--usage)
 
-**中文** | [English](../en/usage/12-reference.md)
+**中文** | [English](../../en/usage/12-reference.md)
 
 
 ## 12.2 CLI(ontogeny)
diff --git a/web/src/i18n/index.tsx b/web/src/i18n/index.tsx
index 13d154a5..1c283a0f 100644
--- a/web/src/i18n/index.tsx
+++ b/web/src/i18n/index.tsx
@@ -32,7 +32,9 @@ const STORAGE_KEY = 'ontogeny.lang'
 function detectLanguage(): Language {
   const saved = localStorage.getItem(STORAGE_KEY)
   if (saved === 'zh' || saved === 'en') return saved
-  return navigator.language?.toLowerCase().startsWith('zh') ? 'zh' : 'en'
+  // first-time visitors default to EN; an explicit 中文 pick (or a saved
+  // choice) wins over browser locale
+  return 'en'
 }
 
 function interpolate(template: string, params?: Record<string, string | number>): string {