Skip to content

docs(agents): remove stale, duplicate and conflicting scoped guide rules - #176320

Merged
obviyus merged 3 commits into
mainfrom
docs/scoped-agents-md-cleanup
Oct 18, 2026
Merged

obviyus merged 3 commits into
mainfrom
docs/scoped-agents-md-cleanup

Conversation

@obviyus

@obviyus obviyus commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #176053, #176308

What Problem This Solves

Fixes: agents working in a subsystem load scoped AGENTS.md guides that name removed code and commands, repeat root rules, and in places contradict current root rules (restart the Gateway for proof, run check-changed.mjs locally, avoid importOriginal mocks that a check now requires).

User Impact

No user-visible change. Agents get shorter scoped guides with current names and commands and one owner per rule. Scoped AGENTS.md total: 98,031 → 73,215 characters (−25%). Six guides with no remaining unique rule are deleted.

Why This Change Was Made

Every line of the 28 scoped guides was checked against origin/main and its history. Edits only remove or rewrite lines that are stale, duplicated, behavior-free, or in conflict with root; conflicts resolve toward current root. Lines that encode a recent maintainer decision are unchanged.

Stale (fixed):

  • Telegram: createTelegramTransportIngressDrain (removed in refactor(channels): share durable ingress monitor #111214) → the monitor in telegram-ingress-drain-factory.ts; throttle owner → getOrCreateAccountThrottler (fix(telegram): deliver final replies through Telegram flood waits #157349).
  • src/channels: memory profile command → pnpm test:extensions:memory.
  • extensions: removed the src/plugin-sdk/<id>.ts facade allowance (the SDK guide forbids new ones) and the deleted src/plugin-sdk-internal/** path.
  • apps/macos: AppLaunchPresentationPolicy → AppLaunchRuntimePlan.
  • Embedded runner: sessionFile → sessionTarget.
  • src/gateway/server-methods: the raw JSONL transcript warning (transcripts are SQLite); its live appendMessageAsync rule moved to src/agents. The stale server-methods/CLAUDE.md entries in .gitattributes and .oxfmtrc.jsonc are removed.
  • docs: the "up to 30 pages" preview claim does not exist in scripts/docs-dev.mjs.

Conflicts with root (resolved toward root):

  • acpx "restart the gateway" → validate in an isolated Gateway.
  • Telegram "bot-to-bot QA lane" proof → the userbot e2e skill route in root.
  • scripts and apps/macos: local check-changed.mjs suggestions removed (root: PR CI is the broad proof).
  • src/agents: "avoid importOriginal partial mocks" → pass the real module or annotate // mock-isolation: (check:test-mock-exports).
  • Embedded runner "prefer focused helper tests" → aligned with root end-to-end proof.

Duplicates and owner moves:

  • scripts/AGENTS.md "Proof Rules" repeated root, the testing skill and remote-gates.md.
  • Release mechanics in apps/ios and apps/android repeated each app's VERSIONING.md; guardrails stay.
  • Rules that stylelint, lint scripts or tests already enforce now name the check instead of restating it.
  • Core ingress-drain rules moved word for word from the Telegram guide to src/channels/AGENTS.md, since five channels share that monitor.
  • src/agents/tools/AGENTS.md and src/gateway/server-methods/AGENTS.md deleted after moving their one live rule each into src/agents/AGENTS.md.
  • SDK compatibility: one bullet keeps both meanings (internal callers removed freely; third-party exports need a deprecation window and maintainer approval).

Test notes moved to their tests: the per-test ownership notes in the litellm, lmstudio, ollama and vllm guides now sit as comments in the 20 test files they describe (several live outside the plugin folders, where those guides never loaded); the four guides are deleted. One vLLM note described a test deleted in #165813 and is dropped.

Telegram test rules → test-audit: the copied test-ownership rules point at the test-audit skill; the Telegram-specific crash-window/restart-replay rule stays.

openclaw-testing skill: the worktree hint no longer suggests local check-changed.mjs.

One check instead of prose: scripts/check-test-helper-extension-import-boundary.mts now also scans src/channels/plugins/contracts/test-helpers (zero violations today), so that guide no longer restates the boundary.

Unchanged on purpose (recent maintainer decisions): the Gateway session row projection contract, the UI session roster contract, the NO_REPLY reply rules, and the SDK SQLite removal date.

Evidence

  • Every relative link in the changed guides resolves; no file links to the deleted guides.
  • test/test-helper-extension-import-boundary.test.ts passes; the script reports [] on the new root and flagged a temporary violating file during the check.
  • oxfmt and git diff --check clean; the pre-commit hook ran on this commit, including the AGENTS.md size check.
  • The 20 test files that received comments pass (318 tests, plus the shared SGLang discovery contract); comments only, no test logic changed.
  • Diff: 57 files, +191/−441.

Merge danger: two-way door; a revert restores every guide. No runtime change. Blast radius: agent instructions for work in these directories, and one repository check that now scans one more test-helper directory.

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling extensions: acpx extensions: lmstudio extensions: litellm extensions: ollama extensions: vllm extensions: agentsapi size: M labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates agent instructions, relocates test ownership notes, corrects stale references, and expands the existing test-helper import checker.

Example: An agent edits fake-timer tests under test/.

  • Before: The earlier revision recommended advanceTimers* calls that the lane classifier did not recognize.
  • After: The guide recommends vi.useFakeTimers(), which selects the fake-timer lane.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused maintenance with the prior finding fixed and no new identified defect; reported focused validation supports the source review.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored maintenance PR changes repository guidance and an existing static checker, with no product-runtime or authority-bearing behavior requiring live proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Repository agents encounter obsolete names and duplicated or conflicting subsystem instructions.
Reason: Maintainer-authored cleanup restores consistent instructions while retaining subsystem-specific contracts and existing enforcement owners.

Merge readiness

✅ Ready for maintainer review

This maintainer-authored PR provides useful scoped-guide cleanup, resolves the prior fake-timer finding, and introduces no identified actionable defect; current-head CI remains pending.

Priority: P3
Reviewed head: 60bda726830f15fba140fc8797bdcf09abf85cb0

Before merge

None.

Findings

None.

Agent review details

How this fits together

Root and scoped guides direct repository agents to subsystem contracts; the existing import checker scans shared test helpers and reports unsupported bundled-plugin imports.

flowchart TD
  A[Repository task] --> B[Root instructions]
  B --> C[Scoped guides]
  C --> D[Owning documentation]
  C --> E[Test ownership comments]
  F[Shared test helpers] --> G[Existing import checker]
  G --> H[Boundary diagnostics]
Loading

Technical review

Best possible solution:

Land the consolidated guides and existing-checker extension after the normal current-head CI gates pass.

Do we have a high-confidence way to reproduce the issue?

Source confirms stale references and the earlier classifier mismatch; no executable reproduction was run under the read-only review constraints.

Is this the best way to solve the issue?

The change uses existing documentation owners and checker machinery, preserves the important contracts inspected, and adds no unnecessary state or parallel implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5fb1a7515b3c.

Provenance checked

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9ec974a adds src/plugins/AGENTS.md:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ec974a4837e; files: src/plugins/AGENTS.md)
  • Vincent Koc: Raw commit b82fc1f adds test/helpers/AGENTS.md:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b82fc1fdad7d; files: test/helpers/AGENTS.md)
  • Ayaan Zaidi: Raw commit b2e85fa adds src/channels/AGENTS.md:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b2e85fadecb2; files: src/channels/AGENTS.md)
  • Harold Hunt: Raw commit fcee6fa adds src/channels/AGENTS.md:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: fcee6fa0474c; files: src/channels/AGENTS.md)

PR surface

Tests +27, Docs -275, Other -2. Total -250 across 57 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 23 64 37 +27
Docs 31 125 400 -275
Config 0 0 0 0
Generated 0 0 0 0
Other 3 2 4 -2
Total 57 191 441 -250

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: Repository guidance and static-boundary maintenance improve contributor ergonomics without changing product runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T18:32:44.822Z sha f68429f :: needs changes before merge. :: [P3] Name only timer calls the classifier actually recognizes

Reviewed October 18, 2026, 2:59 PM ET / 18:59 UTC (Revision 2).

@obviyus

obviyus commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations and removed size: M labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Oct 18, 2026
@obviyus
obviyus merged commit 050ea4d into main Oct 18, 2026
203 of 205 checks passed
@obviyus
obviyus deleted the docs/scoped-agents-md-cleanup branch October 18, 2026 19:38
@obviyus

obviyus commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 050ea4d. Scoped AGENTS.md guides drop from 98,031 to 73,215 characters: stale names and commands fixed, conflicts resolved toward root, per-test notes moved into their test files, and one boundary check now scans the channel contract test helpers. Proof: link check, boundary test, the 20 commented test files pass, green CI and the exact-head review.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…les (openclaw#176320)

Related: openclaw#176053, openclaw#176308

## What Problem This Solves

Fixes: agents working in a subsystem load scoped `AGENTS.md` guides that name removed code and commands, repeat root rules, and in places contradict current root rules (restart the Gateway for proof, run `check-changed.mjs` locally, avoid `importOriginal` mocks that a check now requires).

## User Impact

No user-visible change. Agents get shorter scoped guides with current names and commands and one owner per rule. Scoped `AGENTS.md` total: 98,031 → 73,215 characters (−25%). Six guides with no remaining unique rule are deleted.

## Why This Change Was Made

Every line of the 28 scoped guides was checked against `origin/main` and its history. Edits only remove or rewrite lines that are stale, duplicated, behavior-free, or in conflict with root; conflicts resolve toward current root. Lines that encode a recent maintainer decision are unchanged.

**Stale (fixed):**
- Telegram: `createTelegramTransportIngressDrain` (removed in openclaw#111214) → the monitor in `telegram-ingress-drain-factory.ts`; throttle owner → `getOrCreateAccountThrottler` (openclaw#157349).
- `src/channels`: memory profile command → `pnpm test:extensions:memory`.
- `extensions`: removed the `src/plugin-sdk/<id>.ts` facade allowance (the SDK guide forbids new ones) and the deleted `src/plugin-sdk-internal/**` path.
- `apps/macos`: `AppLaunchPresentationPolicy` → `AppLaunchRuntimePlan`.
- Embedded runner: `sessionFile` → `sessionTarget`.
- `src/gateway/server-methods`: the raw JSONL transcript warning (transcripts are SQLite); its live `appendMessageAsync` rule moved to `src/agents`. The stale `server-methods/CLAUDE.md` entries in `.gitattributes` and `.oxfmtrc.jsonc` are removed.
- `docs`: the "up to 30 pages" preview claim does not exist in `scripts/docs-dev.mjs`.

**Conflicts with root (resolved toward root):**
- acpx "restart the gateway" → validate in an isolated Gateway.
- Telegram "bot-to-bot QA lane" proof → the userbot e2e skill route in root.
- `scripts` and `apps/macos`: local `check-changed.mjs` suggestions removed (root: PR CI is the broad proof).
- `src/agents`: "avoid `importOriginal` partial mocks" → pass the real module or annotate `// mock-isolation:` (`check:test-mock-exports`).
- Embedded runner "prefer focused helper tests" → aligned with root end-to-end proof.

**Duplicates and owner moves:**
- `scripts/AGENTS.md` "Proof Rules" repeated root, the testing skill and `remote-gates.md`.
- Release mechanics in `apps/ios` and `apps/android` repeated each app's `VERSIONING.md`; guardrails stay.
- Rules that stylelint, lint scripts or tests already enforce now name the check instead of restating it.
- Core ingress-drain rules moved word for word from the Telegram guide to `src/channels/AGENTS.md`, since five channels share that monitor.
- `src/agents/tools/AGENTS.md` and `src/gateway/server-methods/AGENTS.md` deleted after moving their one live rule each into `src/agents/AGENTS.md`.
- SDK compatibility: one bullet keeps both meanings (internal callers removed freely; third-party exports need a deprecation window and maintainer approval).

**Test notes moved to their tests:** the per-test ownership notes in the litellm, lmstudio, ollama and vllm guides now sit as comments in the 20 test files they describe (several live outside the plugin folders, where those guides never loaded); the four guides are deleted. One vLLM note described a test deleted in openclaw#165813 and is dropped.

**Telegram test rules → test-audit:** the copied test-ownership rules point at the `test-audit` skill; the Telegram-specific crash-window/restart-replay rule stays.

**`openclaw-testing` skill:** the worktree hint no longer suggests local `check-changed.mjs`.

**One check instead of prose:** `scripts/check-test-helper-extension-import-boundary.mts` now also scans `src/channels/plugins/contracts/test-helpers` (zero violations today), so that guide no longer restates the boundary.

**Unchanged on purpose (recent maintainer decisions):** the Gateway session row projection contract, the UI session roster contract, the `NO_REPLY` reply rules, and the SDK SQLite removal date.

## Evidence

- Every relative link in the changed guides resolves; no file links to the deleted guides.
- `test/test-helper-extension-import-boundary.test.ts` passes; the script reports `[]` on the new root and flagged a temporary violating file during the check.
- `oxfmt` and `git diff --check` clean; the pre-commit hook ran on this commit, including the `AGENTS.md` size check.
- The 20 test files that received comments pass (318 tests, plus the shared SGLang discovery contract); comments only, no test logic changed.
- Diff: 57 files, +191/−441.

**Merge danger:** two-way door; a revert restores every guide. No runtime change. Blast radius: agent instructions for work in these directories, and one repository check that now scans one more test-helper directory.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui channel: telegram Channel integration: telegram commands Command implementations docs Improvements or additions to documentation extensions: acpx extensions: agentsapi extensions: litellm extensions: lmstudio extensions: ollama extensions: vllm gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant