Skip to content

docs(agents): define OS_ env-var naming structure rule - #2493

Merged
os-zhuang merged 1 commit into
mainfrom
docs/env-var-naming-rule
Jun 30, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
docs/env-var-naming-rule

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

背景

Prime Directive #9 只规定了 OS_ 前缀,结构没定义。结果新变量飘:讨论 #2486(通用拼音搜索)时取了个裸名 OS_PINYIN_SEARCH 当布尔开关,既无域分组也无 _ENABLED 后缀,跟现有 OS_SSO_ENABLED / OS_CORS_ENABLED 一类不一致。

改动

把现有变量里已经存在的规律固化进 #9(grounded in actual usage,非凭空造):

  • OS_{DOMAIN}_{FEATURE}[_QUALIFIER] —— 域分组(AUTH/CORS/SSO/CLOUD/DATABASE/…)
  • 布尔开关 → _ENABLED 后缀(OS_SSO_ENABLED、OS_SEARCH_PINYIN_ENABLED),不要裸名
  • 配置值 → OS_{DOMAIN}_{NAME}(OS_CLOUD_URL、OS_LOG_LEVEL)
  • 逃生阀 → OS_ALLOW_{X}(故意不分组、显眼);opt-out → OS_SKIP_/OS_DISABLE_
  • 测试专用 → OS_TEST_*/OS_EXPECT_*
  • 现存不合规的(OS_METADATA_WRITABLE/OS_EAGER_SCHEMAS/OS_SERVER_TIMING)标为 债,非先例

关联

🤖 Generated with Claude Code

Prime Directive #9 only mandated the `OS_` prefix; the *shape* was
undocumented, so new vars drifted (e.g. a bare `OS_PINYIN_SEARCH` for a
boolean flag). Codify the structure observed across the existing vars:

- `OS_{DOMAIN}_{FEATURE}[_QUALIFIER]` — domain-grouped (AUTH/CORS/SSO/…)
- boolean flags → `_ENABLED` suffix (OS_SSO_ENABLED, OS_SEARCH_PINYIN_ENABLED)
- config values → `OS_{DOMAIN}_{NAME}` (OS_CLOUD_URL, OS_LOG_LEVEL)
- escape hatches → `OS_ALLOW_{X}`; opt-outs → `OS_SKIP_/OS_DISABLE_`
- test-only → `OS_TEST_*`/`OS_EXPECT_*`

Pre-existing non-conforming vars (OS_METADATA_WRITABLE, OS_EAGER_SCHEMAS,
OS_SERVER_TIMING) flagged as debt, not precedent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 30, 2026 3:20pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/xs labels Jun 30, 2026
@os-zhuang
os-zhuang merged commit d50b28e into main Jun 30, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the docs/env-var-naming-rule branch June 30, 2026 20:42

This branch was successfully deployed

1 active deployment
Preview — 227c7d3c Deployed Jun 30, 2026 by vercel[bot]
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 size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant