Skip to content

feat(docs): generated bilingual Schema reference (L0 Core: EntitySet/DataSet/Link/Storage)#48

Merged
qiansheng91 merged 1 commit into
mainfrom
codex/docs-schema-reference
Jun 15, 2026
Merged

feat(docs): generated bilingual Schema reference (L0 Core: EntitySet/DataSet/Link/Storage)#48
qiansheng91 merged 1 commit into
mainfrom
codex/docs-schema-reference

Conversation

@qiansheng91

Copy link
Copy Markdown
Collaborator

What

Adds a Schema reference to the docs site, organized per the UModel standard's layering. The schemas we have today are all L0 Core, so the reference documents them grouped by the four base abstractions — EntitySet · DataSet · Link · Storage — and frames L1 (Semantic Conventions) / L2 (Domain Profiles) / L3 (Conformance) as the standard's roadmap.

Generated, not hand-written

Per the contribution spec ("涉及生成代码时由生成器产生,不手动修改 generated artifacts"), the reference is produced from the source schemas by a generator, so it can't drift:

  • tools/docs/gen_schema_reference.py — reads schemas/core/** + schemas/includes/**, emits bilingual Markdown + a sidebar fragment. --check mode is a CI drift gate.
  • make docs-schema regenerates; docs-schema-check is wired into make ci (fails if the committed output is stale).

Structure

reference/schema/
  index            → L0–L3 standard layering + L0 category index
  core/entity-set  → EntitySet
  core/dataset/*   → DataSet: metric_set, log_set, trace_set, event_set, profile_set, runbook_set, entity_source, explorer
  core/link/*      → Link: data_link, entity_set_link, storage_link, runbook_link, …
  core/storage/*   → Storage: prometheus, elasticsearch, sls_*, mysql, aliyun_prometheus, external_storage
  shared-types     → metadata, schema, telemetry_data, link, field_spec, metric, observation, value_mapping

25 pages per locale (en + zh). Design choices that keep it readable: the standard envelope (kind/metadata/schema) is documented once on shared-types and linked, each schema page shows only its distinguishing spec plus an "inherits" link, tables are depth-limited, and well-known arrays (fields/labels/metrics) collapse to a shared-type link instead of re-inlining.

Notes

  • Internal links stripped: alidocs.dingtalk.com references in schema descriptions are removed from the public output.
  • One source blemish: entity_set.id_generator has a malformed en_us block in the source schema, so its English row falls back to the Chinese text. Fixing it means editing schemas/ + re-running make expand (regenerates SDKs) — out of scope for a docs PR; flagging for a follow-up.

Verification

  • pnpm -C docs build clean — 0 dead links (all generated cross-links + shared-type anchors validate).
  • make docs-schema-check clean; regeneration is idempotent (no diff).
  • Sidebar + nav: /{en,zh}/reference/schema/ get the category sidebar; "Schema" added under Reference.

Add a Schema reference to the docs site, organized per the UModel standard's
L0 Core abstractions — EntitySet / DataSet / Link / Storage — with shared
building blocks (metadata, schema, telemetry_data, field_spec, metric, link)
documented once and referenced from each schema.

Generated from the source schemas (schemas/core + schemas/includes) by
tools/docs/gen_schema_reference.py so the reference cannot drift. Per-schema
pages show the standard envelope note, inheritance links, and a depth-limited
bilingual spec table; internal-only reference links are stripped.

- tools/docs/gen_schema_reference.py: generator (+ --check drift mode)
- docs/{en,zh}/reference/schema/**: 25 generated pages per locale
- docs/.vitepress/config/schema-sidebar.json + en.ts/zh.ts: sidebar wiring
- Makefile: `make docs-schema` regenerates; docs-schema-check added to `make ci`
@qiansheng91 qiansheng91 added the documentation Improvements or additions to documentation label Jun 15, 2026
@qiansheng91 qiansheng91 merged commit 78371f8 into main Jun 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant