Skip to content

Docs: add boundary AGENTS guides#56647

Merged
huntharo merged 3 commits into
mainfrom
codex/agents-boundary-guidance
Mar 29, 2026
Merged

Docs: add boundary AGENTS guides#56647
huntharo merged 3 commits into
mainfrom
codex/agents-boundary-guidance

Conversation

@huntharo

Copy link
Copy Markdown
Member

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: the repo had strong boundary rules scattered across docs and code, but not enough local AGENTS.md guidance at the boundary directories where Codex is likely to make the wrong reach-in.
  • Why it matters: recent follow-up work in #56048 showed concrete failure modes from weak boundary guidance, including core deep-importing bundled plugin internals, plugin-owned config leaking into unrelated core paths, and extension-only helper/test seams getting consumed without a stable facade.
  • What changed: I added a top-level architecture-boundary section to AGENTS.md and added focused AGENTS.md files in extensions/, src/plugin-sdk/, src/channels/, src/plugins/, and src/gateway/protocol/ that point to the existing contract docs and source-of-truth files.
  • What changed: I tightened the guidance with explicit guardrails from #56048, including "no deep-imports from bundled plugin internals into core", "keep vendor-owned tools/config/secrets in the owning plugin", "avoid ad hoc plugins.entries.<id>.config reads in unrelated core code", and "use public facades for bundled plugin helpers and tests".
  • What did NOT change (scope boundary): I did not change runtime behavior, plugin loading logic, protocol schemas, config schemas, or tests. This PR only updates repo guidance.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause / Regression History (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause: N/A
  • Missing detection / guardrail: N/A
  • Prior context (git blame, prior PR, issue, or refactor if known): N/A
  • Why this regressed now: N/A
  • If unknown, what was ruled out: N/A

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should have caught this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: N/A
  • Scenario the test should lock in: N/A
  • Why this is the smallest reliable guardrail: N/A
  • Existing test that already covers this (if any): N/A
  • If no new test is added, why not: this PR is guidance-only and does not change executable behavior.

User-visible / Behavior Changes

None for end users. For contributors and agents, the repo now has explicit local guidance at the main architecture boundaries.

Diagram (if applicable)

Before:
[core or test] -> [private extension/internal file] -> [incidental dependency]

After:
[core or test] -> [documented facade / Plugin SDK / local AGENTS guidance] -> [supported boundary]

Security Impact (required)

  • New permissions/capabilities? (Yes/No): No
  • Secrets/tokens handling changed? (Yes/No): No
  • New/changed network calls? (Yes/No): No
  • Command/tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local git branch on origin/main
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Steps

  1. Inspect the existing plugin/protocol boundary docs and contract definition files.
  2. Review the follow-up fixes in #56048 and extract the concrete boundary mistakes that were corrected later.
  3. Add root and boundary-local AGENTS.md guidance that links to the right docs and source files.
  4. Rebase the branch onto current origin/main and verify the tree is clean.

Expected

  • The repo should document the supported cross-boundary seams where agents are likely to work.
  • The PR-informed mistakes from #56048 should be encoded as explicit guardrails.

Actual

  • The new guidance is present in the root and boundary directories, the branch rebases cleanly on origin/main, and the worktree is clean.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

I reviewed the local commit range and the follow-up commit history from #56048, including fixes such as:

  • xAI: route x_search through public api seam
  • fix(xai): restore config-backed auth discovery
  • refactor(xai): move code_execution into plugin
  • fix(xai): wire plugin-owned codeExecution config
  • fix(plugins): stabilize provider contract loading
  • refactor(plugins): expose bundled onboard helpers

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: I verified the new guidance exists in AGENTS.md, extensions/AGENTS.md, src/plugin-sdk/AGENTS.md, src/channels/AGENTS.md, src/plugins/AGENTS.md, and src/gateway/protocol/AGENTS.md. I also verified the branch rebases cleanly on current origin/main and the worktree is clean after the two commits on this branch.
  • Edge cases checked: I confirmed .local/ is ignored before writing this PR body there, and I removed the unsupported CLAUDE.md symlinks before landing the branch commits.
  • What you did not verify: I did not run repo-wide gates because the changes are guidance-only and the normal pre-commit path is currently blocked by unrelated existing TypeScript errors outside this diff.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No): Yes
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: the guidance could overfit #56048 and become too prescriptive in spots where a generic seam is still evolving.
    • Mitigation: I linked the guidance back to the existing docs and source-of-truth files instead of inventing new policy surfaces.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Mar 28, 2026
@greptile-apps

greptile-apps Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is docs-only: it adds a top-level "Architecture Boundaries" section to AGENTS.md and introduces five new boundary-local AGENTS.md files in extensions/, src/plugin-sdk/, src/channels/, src/plugins/, and src/gateway/protocol/. The content accurately encodes the guardrails from follow-up work in #56048 and is well-aligned across all six files.

One P1 issue blocks merge:

  • The repo rule in AGENTS.md line 224 requires a CLAUDE.md symlink (pointing to AGENTS.md) whenever a new AGENTS.md is added. The PR author explicitly removed these symlinks before landing, which is the opposite of what the rule prescribes. Without the CLAUDE.md symlinks, Claude-based agents working inside these five directories will not discover the new boundary guidance — which defeats the stated purpose of this PR. Five symlinks need to be added: extensions/CLAUDE.md, src/plugin-sdk/CLAUDE.md, src/channels/CLAUDE.md, src/plugins/CLAUDE.md, and src/gateway/protocol/CLAUDE.md, each pointing to AGENTS.md.

Confidence Score: 4/5

Not safe to merge until the five missing CLAUDE.md symlinks are added; without them the boundary guidance is invisible to Claude-based agents working inside those directories.

The content changes are accurate and well-structured, but the PR directly violates the documented rule (AGENTS.md line 224) requiring a CLAUDE.md symlink for every new AGENTS.md. The author explicitly removed these symlinks before landing, which is the opposite of what the rule requires. This P1 defect undermines the stated goal of the PR. A one-line fix per directory resolves it.

All five new AGENTS.md files need companion CLAUDE.md symlinks: extensions/AGENTS.md, src/plugin-sdk/AGENTS.md, src/channels/AGENTS.md, src/plugins/AGENTS.md, src/gateway/protocol/AGENTS.md.

Important Files Changed

Filename Overview
AGENTS.md Adds a new Architecture Boundaries section with repo map, progressive disclosure pointers, and detailed per-boundary rules. Content is accurate and consistent with the boundary-local AGENTS.md files.
extensions/AGENTS.md New file documenting the extensions boundary, public contracts, and guardrails. Content is well-structured. Missing the required CLAUDE.md symlink.
src/channels/AGENTS.md New file documenting the channels boundary. Concise and accurate. Missing the required CLAUDE.md symlink.
src/gateway/protocol/AGENTS.md New file documenting the Gateway protocol boundary. Rules around additive evolution and schema sync are clear. Missing the required CLAUDE.md symlink.
src/plugin-sdk/AGENTS.md New file documenting the Plugin SDK boundary. Well-aligned with root guidance on backwards compatibility and facade exposure. Missing the required CLAUDE.md symlink.
src/plugins/AGENTS.md New file documenting the plugins loader/registry boundary. Correctly prohibits ad hoc config reads and private plugin backdoors. Missing the required CLAUDE.md symlink.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/AGENTS.md
Line: 1

Comment:
**Missing CLAUDE.md symlinks for all new AGENTS.md files**

`AGENTS.md` line 224 states an explicit rule:

> When adding a new `AGENTS.md` anywhere in the repo, also add a `CLAUDE.md` symlink pointing to it (example: `ln -s AGENTS.md CLAUDE.md`).

This PR adds 5 new `AGENTS.md` files but no corresponding `CLAUDE.md` symlinks. The PR description actually acknowledges they were removed: _"I removed the unsupported `CLAUDE.md` symlinks before landing the branch commits."_ However, the repo rule treats them as required — they are how Claude discovers boundary guidance when working inside these subdirectories.

The existing symlinks in the repo (`CLAUDE.md` at the root and `src/gateway/server-methods/CLAUDE.md`) confirm this is an active convention, not a dead one.

All five new directories are missing their symlink:
- `extensions/CLAUDE.md``AGENTS.md`
- `src/plugin-sdk/CLAUDE.md``AGENTS.md`
- `src/channels/CLAUDE.md``AGENTS.md`
- `src/plugins/CLAUDE.md``AGENTS.md`
- `src/gateway/protocol/CLAUDE.md``AGENTS.md`

```
ln -s AGENTS.md extensions/CLAUDE.md
ln -s AGENTS.md src/plugin-sdk/CLAUDE.md
ln -s AGENTS.md src/channels/CLAUDE.md
ln -s AGENTS.md src/plugins/CLAUDE.md
ln -s AGENTS.md src/gateway/protocol/CLAUDE.md
```

Without these symlinks, the boundary guidance added in this PR will not be visible to Claude-based agents working inside those directories, which defeats the stated purpose of the PR.

**Context Used:** AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Docs: add PR-informed boundary guardrail..." | Re-trigger Greptile

Comment thread extensions/AGENTS.md
@huntharo
huntharo merged commit fcee6fa into main Mar 29, 2026
35 of 38 checks passed
@huntharo
huntharo deleted the codex/agents-boundary-guidance branch March 29, 2026 00:22
alexcode-cc pushed a commit to alexcode-cc/clawdbot that referenced this pull request Mar 30, 2026
Alix-007 pushed a commit to Alix-007/openclaw that referenced this pull request Mar 30, 2026
alexjiang1 pushed a commit to alexjiang1/openclaw that referenced this pull request Mar 31, 2026
pgondhi987 pushed a commit to pgondhi987/openclaw that referenced this pull request Mar 31, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
Tardisyuan pushed a commit to Tardisyuan/openclaw that referenced this pull request Apr 30, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant