Skip to content

docs(contracts): Core 作为应用契约唯一真源,补回命令表与 AI 配置章节 - #24

Merged
xiaoyumuxi merged 1 commit into
refactor/core-remove-java-special-casesfrom
docs/core-app-contracts-single-source
Nov 13, 2026
Merged

xiaoyumuxi merged 1 commit into
refactor/core-remove-java-special-casesfrom
docs/core-app-contracts-single-source

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

关联

这个 PR 做什么

Lithe-IDEA 删除副本之后,rust/contracts/ 就是唯一的一份。合入前先补齐 Core 这份里缺的内容,再删掉 Core 里本来就不属于 Core 的 fixture。

补回 #19 误删的内容

#19 把契约迁进 Core 时,rust-core-api.md 少了两块,Lithe-IDEA 的副本里还在:

内容 处理
## Commands 下的命令总表 补回。按当前解析器重新生成,共 375 行,CoreCommand::parse 接受的每个命令一行,#23 删掉的命令不在表里
### AI configuration 章节 补回,放在 ### Declarative plugins 前面。fixture 路径改成 Core 的 rust/fixtures/ai/cli-configuration-v1.json
Build systems 表 补上 build.resolveStoredOptions、build.editStoredOption 两行
第 276 行 删掉过时的 “plus MCP configuration planning”。Core 现在只做 ai.configuration.* 的确定性解析

防止命令表再次漂移

protocol/command.rs 新增测试 api_command_table_lists_exactly_the_parsed_commands:

  • 从 command.rs 源码里读出 CoreCommand::parse 匹配的全部命令名;
  • 和 rust-core-api.md 命令表第一列逐条比对;
  • 表里多了、少了或者重复,都会失败,并列出具体的命令名。

所以以后增加、改名或删除命令,必须在同一次提交里更新表格。我验证过故意删掉表里的 git.shelf 一行,测试会失败。

删除不属于 Core 的 fixture

位置 原因
rust/fixtures/i18n/(format-v1.json、native-abi-v1.json) 只有 Lithe-IDEA 的 i18n 生成器读取,Core 没有任何代码读取。配套 PR 把它们移到 Lithe-IDEA 的 shared/i18n/fixtures/,和生成器放在一起。application-boundary.md 的链接改为指向那里
rust/fixtures/phpunit-project/(5 个文件) 两个仓库都没有读取方

不改动

  • 不改命令、C ABI、JSON 字段或错误码。
  • 契约正文除上面列出的几处外,没有其他改动。

验证

  • cargo fmt --all --check:通过。
  • scripts/rust-core/verify-rust-core-comments.sh:通过。
  • node shared/plugins/scripts/verify-docs.mjs:通过。
  • cargo test --workspace:全部通过,其中 lithe-core 1744 passed / 0 failed,含新增的命令表测试。
  • Lithe-IDEA 桌面端测试读取的全部 fixture,包括 debug/、execution/、process-lifecycle/ 整个目录里实际读到的文件,在 Core 的 rust/fixtures/ 中都存在,并且字节一致。不一致的只有 feat(core)!: 删除 Java/Maven/JDT 特判与契约专属死命令,run/start 临时文件支持 base64 #23 中性化或删除的 3 个 debug fixture 和 6 个 Java 运行发现 fixture,桌面端都不读取。

后续

- rust-core-api.md 补回 #19 误删的命令总表(375 条,每个 CoreCommand::parse 接受的命令一行)
  和 AI configuration 章节;Build systems 表补上 build.resolveStoredOptions、build.editStoredOption。
- protocol::command 新增测试:命令表与解析器逐条比对,增删改命令必须同一次提交更新表格。
- 删除 rust/fixtures/i18n(归 Lithe-IDEA i18n 生成器所有,迁到 shared/i18n/fixtures)
  和无人读取的 rust/fixtures/phpunit-project。

Refs 1lck/Lithe-IDEA#1853
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 13, 2026 16:23
@xiaoyumuxi
xiaoyumuxi merged commit ef02ab8 into refactor/core-remove-java-special-cases Nov 13, 2026
5 checks passed
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