Skip to content

docs(agents): 宿主方法逐个按 API 编号登记,开发者只看 docs 就能开发 - #1751

Merged
xiaoyumuxi merged 2 commits into
previewfrom
docs/agents-host-method-tables
Nov 5, 2026
Merged

xiaoyumuxi merged 2 commits into
previewfrom
docs/agents-host-method-tables

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Collaborator

背景

一个 API 编号下面常有多个宿主方法。例如 API-24 有 terminal/create、show、close、reopen、dispose、onExit 六个,可以分几个 PR 陆续加入;在函数协议 3 里向后兼容地新增方法,也不升协议版本。所以光看协议版本,查不到某个方法是哪个 PR 加的、属于哪个 API、怎么用。

lithe-plugin-docs 在 Lithe-IDEA/lithe-plugin-docs#21 里已经改成按方法登记。这个 PR 把对应规则写进 AGENTS.md,这样以后每个改宿主方法的 PR 都会照做。

改动

AGENTS.md 的“插件契约的两仓库同步”一节加了两条:

  • 宿主方法逐个登记:PR 新增或修改宿主方法、宿主通知时,即使只是给已有 API 加一个子方法,PR 描述也要附一张“原计划编号 | 方法 | 用途”表,每个方法一行,格式参照 feat(plugins): 开放原生终端 API 与有界上下文 reopen #1653。
    • 编号只用 API 实施计划里的 API-01–44,不得自编;不属于任何编号的写 —。
    • 合并后,每个方法在 lithe-plugin-docs 的两处各加一行:
      • API 总表 reference/api-catalog.md 的中英两张方法表,列为 API、方法、用途、权限、协议;
      • 更新记录的“宿主方法(按 API 编号)”索引,列为 API、方法、协议、日期、PR。
    • 时间线上这个 PR 的“API 编号”列要填。
    • 同一个 API 的方法分几个 PR 加入时,每个方法记自己的 PR。
  • 只看 docs 就能开发:开发者需要的方法参数、返回值、错误码、权限、生命周期和平台限制,要写进契约 README,经同步进入 lithe-plugin-docs 的 contract/v1/;用法说明写进 lithe-plugin-docs 的功能页。只写在实施计划、Agent Note、契约草案或宿主代码里的行为,不算已公开。

说明

验证

  • 只改了文档,不涉及构建。
  • node scripts/agent-notes/verify-agent-notes.mjs 通过(210 个 Agent Note)。
  • 确认链接目标 docs/development/macos-plugin-api-plan.md 存在。

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 5, 2026
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 5, 2026 05:00
@lithe-code-review

lithe-code-review Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Lithe Review

结论: ✅ 通过
范围: preview ← docs/agents-host-method-tables · head: 541b763

未发现需要阻塞合并的问题。

Scope Check

  • 未找到可验证的关联 Issue;按 PR 声明的两项文档目标核对,均已完成。
  • 完整审查 AGENTS.md 新增的 11 行:逐方法登记规则和开发者文档要求,与原有契约同步规则一致。
  • 已确认本地 API 实施计划包含 API-01–44。本次不涉及运行时、契约或 SDK 修改,上游能力复用检查不适用。

Summary

新增规则明确了方法级追溯要求及公开文档的内容边界,未发现本次引入的实质问题。

Verification

  • 已静态对比指定 base...head,并核对相关 API 实施计划和插件契约发布 Note。
  • PR 自述 Agent Notes 校验通过(210 个笔记);未独立复验。提供的上下文显示 head 暂无 Check Run 结果。
  • 按要求未运行仓库代码或测试,未访问网络。
  • 外部 lithe-plugin-docs#21 的合并状态及目标表格格式未核验;该依赖仍需在合并安排中确认。

@lithe-code-review

Copy link
Copy Markdown

Lithe 运行验收

版本:541b76315a6f9066bea9f886c6b3aa71a1708a34;状态:partial。
本报告独立于代码审查;只报告实际执行的场景,不代表所有问题均已修复。

对照:共同祖先 58ba044a026679bbb6ceec276ced6a61c4da811b → PR head;当前目标分支合并适用性:未运行。

  • 条件不足,未验证:Require method-level API mapping in every applicable PR description.
  • 条件不足,未验证:Make each method individually traceable across the public API catalog, method index and PR timeline.
    • Post-merge registration is a documentation workflow outside this checkout. No pinned lithe-plugin-docs snapshot or representative registration records were supplied. External access is prohibited, so docs#21's merge status and destination table formats remain unverified.
  • 条件不足,未验证:Allow plugin developers to work from lithe-plugin-docs alone.
    • Documentation completeness requires semantic review rather than an application runtime assertion. Verifying publication additionally requires a pinned lithe-plugin-docs checkout containing the synchronized contract and feature pages, which was not supplied.

未覆盖:

  • Runtime evidence for applying the PR-table requirement to new and modified host methods, notifications and existing-API additions.
  • Runtime evidence for one row per method, the required PR-table columns, API-01–44 restrictions, unmapped — handling and conformity with feat(plugins): 开放原生终端 API 与有界上下文 reopen #1653.
  • Actual per-method registration in both language API catalogs and the changelog method index, including every required column.
  • Actual timeline API entries and correct individual PR attribution when one API's methods arrive through multiple PRs without a protocol-version change.
  • External lithe-plugin-docs#21 merge status and compatibility of its published table formats with these instructions.
  • Actual public coverage of parameters, returns, errors, permissions, lifecycle and platform limitations in synchronized contract READMEs.
  • Actual public usage documentation sufficient for development without relying on implementation plans, Agent Notes, drafts or host source.

工作副本与运行状态已清理;可复用编译缓存按 12 GiB / 7 天预算保留。
详细步骤和原始证据保存在服务器受限目录(14 天、总计不超过 1 GiB);当前没有公开下载链接。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant