Skip to content

docs: add experimental tier governance and dependency rules to AGENTS.md - #5523

Merged
wbxl2000 merged 1 commit into
feat/experimental-tiersfrom
docs/experimental-governance-rules
Nov 28, 2026
Merged

wbxl2000 merged 1 commit into
feat/experimental-tiersfrom
docs/experimental-governance-rules

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

按 AGENTS.md「新增或修改团队流程、经验性规则时,单独提 PR」的要求,将 #5333 引入 experimental / beta 两档实验开关后配套的两条开发与评审规则独立拆出评审:约束新开关默认落档与阶段可逆回退,并禁止正式功能静默依赖未转正的实验能力。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

在根 AGENTS.md 的 ## 实验特性 小节补充两条开发与评审约束(不涉及运行时代码):

  1. 默认从 'experimental' 起步,谨慎升入 'beta',且阶段流转可逆:

    • 触发案例:此前所有实验开关平铺混放且共用 KIMI_CODE_EXPERIMENTAL_FLAG=1(如 wait_for 曾设 default: true 默认暴露给全端模型、tower 需重启进程并改变会话编排、notify_user 在 TUI 与 Desktop/Web 的完成度不一致)。feat: split experimental flags into Beta and Experimental tiers #5333 引入 Beta 总开关([experimental.<profile>].beta 与 KIMI_CODE_EXPERIMENTAL_FLAG=1)后,任何标为 'beta' 的开关都会对开启 Beta 总开关的尝鲜用户自动生效;若未经可用性验证直接标为 'beta',或某 'beta' 功能在推倒重做期间仍留在 'beta',会直接破坏尝鲜用户的日常工作流。
    • 规则效果:新增开关一律默认声明为 'experimental',仅在有明确要求与验证依据时升为 'beta';当 'beta' 功能发生交互或核心实现重做时,可逆退回 'experimental'。
  2. 实验性身份传染(正式功能不得依赖未转正的实验开关):

    • 触发案例:仓库内多次出现上层入口或跨端能力建立在实验底座之上(例如 CLI -w 参数、/worktree 面板与状态栏分支提示共同依赖 worktree 开关;Desktop/Web @ 引用会话 UI 依赖会话索引实验能力;/tower 命令与多智能体视图依赖 tower 开关)。若上层入口作为无开关的正式功能暴露,而底层工具/服务仍处于 'experimental' 或 'beta'(默认关闭),默认配置用户会触发半残路径或静默失效。
    • 规则效果:建立在未转正实验能力之上的命令、UI 或子功能,必须受同一实验开关或独立实验开关门控(或先将底层能力独立转正)。

Behavior Changes and Affected Users

无运行时或构建产物行为变化(仅更新仓库根 AGENTS.md 开发规范;本分支基于 #5333 的 feat/experimental-tiers,待 #5333 合入后自动切回 main)。

受影响模块:

  • 仓库级说明文件:AGENTS.md

测试覆盖结论:已通过 node scripts/checks/instructions.mjs 引用完整性检查与 pnpm run check:duplication 检查。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T10:02:37.298091Z f45d576 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@changeset-bot

changeset-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ea4d9ab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@ea4d9ab
npx https://pkg.pr.new/@moonshot-ai/kimi-code@ea4d9ab

commit: ea4d9ab

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f45d576922

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread AGENTS.md Outdated
- 实验开关分 `beta` 与 `experimental` 两档:`KIMI_CODE_EXPERIMENTAL_<NAME>` 控制单个开关;`KIMI_CODE_EXPERIMENTAL_FLAG` 与 `config.toml` 的 `[experimental].beta` 只开启全部 `beta` 功能,不开启 `experimental` 功能。优先级:`beta` 为单项环境变量 > Beta 总开关(`KIMI_CODE_EXPERIMENTAL_FLAG` 或 `[experimental].beta`)> `[experimental].<id>` > `false`;`experimental` 为单项环境变量 > `[experimental].<id>` > `false`。
- `packages/agent-core-v2` 和 kap-server 的模块:没有集中的开关目录。在所属领域里用 `registerFlagDefinition` 声明各端 `stages` 与 `effectTiming`,再用 `IFlagService.enabled(id)` 检查。
- 新增实验开关默认设为 `'experimental'`;升入 `'beta'` 会对所有开启 Beta 总开关的用户默认生效,没有明确要求和可用性验证依据时不要直接设为 `'beta'`。阶段流转可逆:已处于 `'beta'` 的功能若推倒重做交互或核心实现,应退回 `'experimental'`。
- 正式功能不得依赖仍处于 `'experimental'` 或 `'beta'` 阶段的能力;建立在未转正实验能力之上的入口、UI 或子功能,必须受同一开关或自身的实验开关门控(除非先将底层能力独立转正)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require dependent gates to be at least as restrictive

Allowing a dependent entry to use “its own experimental flag” does not guarantee that its prerequisite is enabled: if the prerequisite remains experimental while the entry is promoted to beta, KIMI_CODE_EXPERIMENTAL_FLAG=1 enables only the entry because FlagService.evaluate() resolves each definition independently. A change following this rule can therefore expose an unusable or silently ineffective entry while still complying with the documented requirement. Specify that a dependent gate must be no easier to enable than its prerequisite and must also check or enable that prerequisite, rather than merely having a separate flag.

AGENTS.md reference: AGENTS.md:L214-L216

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 87599f3: clarified that when a dependent entry uses a separate experimental flag instead of sharing the prerequisite flag, its stage on each surface must not exceed the prerequisite's stage (so an experimental prerequisite cannot have a beta dependent enabled by the Beta master switch) and the dependent path must also check that the prerequisite flag is enabled.

Comment thread AGENTS.md Outdated
- 还没公开的功能放在实验开关后面,未配置时一律默认关闭,注册结构不设 `default` 字段;全量转正时直接移除开关(某端先行转正时可在 `stages` 中将该端设为 `'ga'`,不再出现在该端实验列表中,也不受其他端在共享 `config.toml` 里写入的关闭值影响)。
- 实验开关分 `beta` 与 `experimental` 两档:`KIMI_CODE_EXPERIMENTAL_<NAME>` 控制单个开关;`KIMI_CODE_EXPERIMENTAL_FLAG` 与 `config.toml` 的 `[experimental].beta` 只开启全部 `beta` 功能,不开启 `experimental` 功能。优先级:`beta` 为单项环境变量 > Beta 总开关(`KIMI_CODE_EXPERIMENTAL_FLAG` 或 `[experimental].beta`)> `[experimental].<id>` > `false`;`experimental` 为单项环境变量 > `[experimental].<id>` > `false`。
- `packages/agent-core-v2` 和 kap-server 的模块:没有集中的开关目录。在所属领域里用 `registerFlagDefinition` 声明各端 `stages` 与 `effectTiming`,再用 `IFlagService.enabled(id)` 检查。
- 新增实验开关默认设为 `'experimental'`;升入 `'beta'` 会对所有开启 Beta 总开关的用户默认生效,没有明确要求和可用性验证依据时不要直接设为 `'beta'`。阶段流转可逆:已处于 `'beta'` 的功能若推倒重做交互或核心实现,应退回 `'experimental'`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply stage rollbacks only to affected surfaces

The rollback instruction treats a feature as having one global stage, but FlagDefinitionInput.stages assigns stages independently to TUI, desktop, and web. If a feature is beta on multiple surfaces and only its desktop interaction is rewritten, following this wording can unnecessarily downgrade the unaffected TUI and web implementations and remove them from the Beta master switch. State that promotion and rollback decisions are made per surface, with only the surfaces whose interaction or implementation is being rebuilt moved back to experimental.

AGENTS.md reference: AGENTS.md:L123-L123

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 87599f3: clarified that stage promotion and rollback are evaluated per surface (stages[surface]), so rebuilding a feature on one surface only rolls that surface back to experimental without downgrading unaffected surfaces.

@wbxl2000
wbxl2000 force-pushed the docs/experimental-governance-rules branch 8 times, most recently from 2c5c9c2 to 651fc49 Compare November 27, 2026 15:14
@wbxl2000
wbxl2000 force-pushed the docs/experimental-governance-rules branch from 651fc49 to ea4d9ab Compare November 27, 2026 15:27
@wbxl2000
wbxl2000 merged commit 4feb39b into feat/experimental-tiers Nov 28, 2026
21 checks passed
@wbxl2000
wbxl2000 deleted the docs/experimental-governance-rules branch November 28, 2026 05:42
wbxl2000 added a commit that referenced this pull request Nov 28, 2026
* feat: split experimental flags into Beta and Experimental tiers

* fix(agent-core-v2): keep legacy master-env tower migration pending until master flag is set

* fix: harden legacy tower fallback, meta refresh ordering, and flag tier tests

* fix(flag): normalize unparseable tower env in read-only legacy fallback

* fix: preserve symlinked config during tower migration and document WaitFor default

* fix: keep tower migration pending on false master env and refresh meta on configChanged

* feat: unify Lab entry point and refine Chinese Beta/Experimental copy

* fix(flag): preserve Tower via env fallback when config.toml fails to parse

* fix(flag): scope legacy Tower migration marker per configPath and mark /lab idle-only in docs

* feat(flags): unify desktop/web Lab flags in config.toml and harden legacy migration

* fix(flags): preserve legacy local flags pre-meta and scope restart notice to pending enablement

* fix(lab): gate beta master on server metadata and refresh TUI flags on config change

* fix(flag): guard config migration hard links and concurrent updates

* fix(flag): reconcile WaitFor live toggles and preserve tower state

* test: scope WaitFor flag stub in goal tests and enable experimental flags in prompt-cache scenario

* test: start wait_for enabled before toggling it off in prompt-cache scenario

* feat(flags): isolate [experimental.cli] and [experimental.desktop] profiles

* docs: document [experimental.cli] and [experimental.desktop] in AGENTS.md

* feat(lab): add inline tier descriptions and move desktop beta switch to header

* feat(lab): refine beta and experimental tier descriptions

* feat(lab): refine experimental hint copy and drop beta-master lock noise

* feat(lab): shorten beta header switch label to All

* docs: add experimental tier governance and dependency rules to AGENTS.md (#5523)

* fix: guard unprofiled web lab toggles, lock migration stamps, and add vscode changeset

* fix: align ConfigResponse experimental event type with profile buckets

* chore: mark klient and kap-server changesets as minor bumps

* fix: stamp all experimental profiles on fresh-install migration

* refactor(agent-core-v2): fold legacy tower migration into FlagService via ConfigService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant