Skip to content

docs: slim the root agent guide and correct stale ownership docs - #3857

Merged
bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/docs-agent-guide-accuracy
Nov 10, 2026
Merged

bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/docs-agent-guide-accuracy

Conversation

@bobleer

@bobleer bobleer commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Docs only. Brings the agent guides and two architecture documents back in line with the current workspace.

  • Root guide (AGENTS.md, AGENTS-CN.md): reorganised to hold only cross-cutting rules and stable entry points, 384 → 193 lines. The Chinese guide now mirrors the English one line for line.
  • Hook ownership: engine, registry, hook-source and dispatch ownership moves from the root guide into the agent-runtime and core guides.
  • Layer guides: crate tables completed — one row in the English adapters guide, twelve rows across the Chinese adapters, services and contracts guides.
  • product-architecture.md: the Level 0 development-view diagram and module inventory cover every Cargo and pnpm workspace member.
  • computer-use-control.md: "Ownership and execution" no longer contradicts "Native provider ownership".
  • CONTRIBUTING.md, CONTRIBUTING_CN.md: stale references to AGENTS.md corrected.

Type and Areas

Type: docs

Areas: repository contributor and agent guidance, architecture docs

Motivation / Impact

The root guide is loaded into every agent conversation, and parts of it and of the documents it points to had drifted from the code:

  • Its layer table carried a per-layer crate list that named 9 of 14 adapter crates, 7 of 10 service crates, 8 of 9 execution crates and 4 of 5 contract crates. The layer guides it delegates to were incomplete as well, mostly on the Chinese side.
  • computer-use-control.md stated in "Native provider ownership" that services/computer-use owns the native implementation and tool-contracts owns the host port, while "Ownership and execution" still said Desktop owns the native resources and Core owns the port.
  • CONTRIBUTING.md referred to a verification matrix and an i18n row in AGENTS.md that the guide does not have.

No direct user-facing change.

Verification

  • pnpm run check:repo-hygiene — passed.
  • pnpm run check:github-config — passed.
  • node --test --test-name-pattern="Rust build dependency boundary policy stays discoverable" scripts/check-core-boundaries.test.mjs — passed. This is the only test that reads the changed documents.
  • git diff --check — clean. node scripts/check-git-object-sizes.mjs — passed.
  • Scripted checks against the tree (scripts not committed):
    • all 179 relative links in the 13 changed files resolve;
    • the crate table of each of the six layer guides, English and Chinese, equals the crates on disk;
    • the product-architecture.md inventory names all 56 Cargo workspace members and all 16 pnpm workspace packages;
    • AGENTS.md and AGENTS-CN.md have the same line-by-line structure.
  • Every identifier and path named in the rewritten Computer Use section was checked against the code.
  • The 16 Mermaid diagrams in product-architecture.md parse with the repository's Mermaid version, and the changed Level 0 diagram was rendered in a browser.
  • No Rust or frontend source changed, so no build or runtime test was run and no remote scenario was exercised.

Reviewer Notes

The four commits are split by topic and can be reviewed one at a time.

Root guide: rules are regrouped and reworded, not relaxed. Content that leaves the file:

  • The per-layer crate lists. Layer guides own the crate tables.
  • Hook engine and registry ownership, now in the agent-runtime and core guides. Those guides name the actual RuntimeHookRegistry type and describe the separate remote-workspace registry; the root guide said HookRegistry.
  • The Web UI i18n namespace rule, which src/web-ui/AGENTS.md and docs/architecture/i18n.md already own.
  • "Read README.md and CONTRIBUTING.md before architecture-sensitive changes". The guide now points to CONTRIBUTING.md for commit and PR conventions.
  • The statement that the OpenCode P0 adapter remains a static-preview path. The adapter has live providers today; the rule against extending the legacy managed-package path stays.

Content that is new in the root guide:

  • "Update AGENTS.md and AGENTS-CN.md in the same change."
  • A "Must not" column in the layer table, which replaces the separate boundary-rule list.
  • src/*-market-web in the layer 1 paths, and pnpm run capabilities:generate after editing the Product Operation Registry.

Computer Use: dated evidence records that mention Desktop test suites are left as written; they describe what was run at the time.

AI-assisted with Cursor. Testing level: lightly tested (the documentation checks listed above).

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Each layer guide owns its crate table. Bring the tables in line with the
workspace:

- adapters: add opencode-plugin-host.
- adapters (CN): add miniapp-ipc, opencode-plugin-host, dsh-adapter,
  pi-adapter, claude-code-adapter, codex-adapter, zcode-adapter and
  static-hook-support; refresh opencode-adapter and transport.
- services (CN): add legacy-migration-adapters, miniapp-market-service
  and skin-market-service; refresh services-core, services-integrations
  and the legacy-migration guide link.
- contracts (CN): add config-contracts.
The root guide is loaded into every agent conversation, so it now keeps
only cross-cutting rules and stable entry points (384 -> 193 lines).

- The layer table drops its per-layer crate list, which had drifted from
  the workspace, and gains a "Must not" column that replaces the separate
  boundary-rule list. Layer guides own the crate tables.
- Rust dependency rules move from "Quick start" into their own section.
- The architecture guardrail sections become one "Read before changing"
  list with the hard constraints attached to each entry.
- Surface-specific detail already owned by a nearer guide is removed,
  such as the Web UI i18n namespace rule.
- AGENTS-CN.md now mirrors AGENTS.md line for line.

Native hook engine, registry, hook-source and dispatch ownership moves to
the agent-runtime and core guides, next to the code. They name the actual
RuntimeHookRegistry type and describe the separate remote-workspace
registry. The root guide keeps the Codex contract rule and one pointer.

Also close an unterminated code fence in the agent-runtime guide.
product-architecture.md: the Level 0 development-view diagram and the
module inventory now cover every Cargo and pnpm workspace member, and the
Computer Use notes name services/computer-use as the owner of the native
implementation.

computer-use-control.md: "Ownership and execution" still said that Desktop
owns the native resources and Core owns the host port. That contradicted
"Native provider ownership", added when the provider moved to
services/computer-use. The section now lists what each owner holds and
must not do, and points the module paths at the service.
CONTRIBUTING referred to a verification matrix and an i18n row in
AGENTS.md that the guide does not have. State the i18n commands directly,
name the Rust dependency boundary doc beside the product architecture
doc, and link AGENTS-CN.md from the Chinese guide.
@bobleer
bobleer merged commit b244c30 into openBitFun:main Nov 10, 2026
12 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