Skip to content

docs: reduce root agent policy and remove ClawSweeper rubric - #139258

Merged
steipete merged 1 commit into
mainfrom
codex/agents-root-policy
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/agents-root-policy

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The root agent instructions still consumed nearly 7,000 words after the earlier cleanup, mixing repository-wide policy with subsystem details, repeated workflows, and ClawSweeper's review rubric. Every task loaded those rules regardless of relevance.

Related: #139236 (first instruction cleanup).

Why This Change Was Made

Rewrite the root around cross-cutting decisions, safety/approval boundaries, architectural invariants, proportional validation, and scoped guidance. Remove the separate ClawSweeper policy section entirely: its prompt treats target AGENTS as optional policy, its schema does not require that section, and its rubric and deterministic mutation gates are owned in the ClawSweeper repository. Keep substantive review follow-through and maintainer product judgment as ordinary repository rules.

This intentionally removes LOC-based risk scoring, arbitrary prompt-length severity, mandatory evidence matrices, blanket screenshots for session behavior, compulsory related-item sweeps, per-comment announcements, and bot-specific scoring/re-review rituals. Detailed subsystem contracts route to existing guides; no replacement policy dump is added.

User Impact

Much less universal instruction context. The root is 2,112 words instead of 6,938 (69.6% smaller), with the requested testing guidance retained. Owner approval, source-trust isolation, operator-instance protection, schema/config/protocol gates, confidentiality, regression proof, and exact-head native landing remain explicit. No runtime or ClawSweeper enforcement code changes.

Evidence

  • Read the complete old root and checked owning agent/Gateway/storage/audit/secret guides; independent preservation review caught and restored material-change owner involvement.
  • Inspected ClawSweeper's review prompt, decision schema, loader, and protected-item apply checks. The removed heading has no required parser/schema contract; review metrics are already optional in the bot's prompt.
  • git diff --check, targeted oxfmt --check AGENTS.md, and docs MDX validation passed using canonical installed tooling.
  • All referenced owning documentation exists. CLAUDE.md remains the canonical symlink.
  • Production/test LOC deltas are zero. No runtime tests were added or run for this instruction-only change.
  • Final independent Codex autoreview passed with no actionable P0–P2 findings. Exact-head CI is recorded before landing.

@clawsweeper

clawsweeper Bot commented Sep 5, 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 size: M maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 18:01
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 2:07 PM ET / 18:07 UTC.

ClawSweeper review

What this changes

The PR shortens OpenClaw’s root agent instructions, removes the embedded ClawSweeper rubric, and directs detailed procedures to existing guides.

Merge readiness

✅ Ready for maintainer review

Keep open with no blocking findings. This remains a distinct, useful cleanup beyond the earlier merged work, and its maintainer protection excludes automatic closure.

Priority: P3
Reviewed head: d20e9c68acfefb2f76bfca480b98b041bc4731b2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported policy cleanup with no concrete correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored instruction change has no runtime behavior requiring contributor proof; document comparison, reference checks, and whitespace validation cover the changed surface.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored instruction change has no runtime behavior requiring contributor proof; document comparison, reference checks, and whitespace validation cover the changed surface.
Evidence reviewed 8 items Verified introduced scope: The complete merge-base-to-head diff changes only AGENTS.md. The verified test merge also changes only that file against its recorded main parent; unrelated endpoint drift is not attributed to this PR.
Current main still retains the longer policy: Fetched main and the pinned merge base have the same AGENTS.md blob, 7857b724eb44ea0f7fc83e3396038479b53484b2. The proposed rewrite is therefore absent from the reviewed main revision.
Safeguards and proportional validation remain explicit: The full root retains confidentiality, untrusted-code isolation, operator-instance protection, configuration/storage/protocol approvals, owner involvement, live-authority checks, meaningful regression coverage, and native landing gates. Referenced documentation and command entrypoints exist; CLAUDE.md remains a symlink to AGENTS.md.
Findings None None.
Security None None.

How this fits together

The root agent instructions guide coding agents working on OpenClaw. They establish repository-wide safeguards and route each task to relevant skills and subsystem documentation.

flowchart TD
  A[Repository task] --> B[Root agent instructions]
  B --> C[Safety and approval boundaries]
  B --> D[Relevant subsystem guides]
  D --> E[Task skills and procedures]
  C --> F[Scoped work and validation]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Docs -211. Total -211 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 86 297 -211
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 86 297 -211

Review metrics

Metric Value Why it matters
Universal instruction context 6,938 → 2,112 words; 69.6% reduction The measured reduction directly addresses the context cost paid by every repository task.

Technical review

Best possible solution:

Keep cross-cutting safeguards in the root policy and detailed procedures with their existing subsystem and automation owners.

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

Not applicable: this is an instruction rewrite; its stated size reduction is directly verifiable from the two document versions.

Is this the best way to solve the issue?

Yes. Removing duplicated rubric text at its source reduces universal context while retaining explicit safeguards and discoverable owner guidance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cf98f896d173.

Labels

Label changes:

  • add P3: This is repository instruction cleanup with no runtime, dependency, or persisted-data changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored instruction change has no runtime behavior requiring contributor proof; document comparison, reference checks, and whitespace validation cover the changed surface.

Label justifications:

  • P3: This is repository instruction cleanup with no runtime, dependency, or persisted-data changes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored instruction change has no runtime behavior requiring contributor proof; document comparison, reference checks, and whitespace validation cover the changed surface.

Evidence

What I checked:

  • Verified introduced scope: The complete merge-base-to-head diff changes only AGENTS.md. The verified test merge also changes only that file against its recorded main parent; unrelated endpoint drift is not attributed to this PR. (AGENTS.md:1, d20e9c68acfe)
  • Current main still retains the longer policy: Fetched main and the pinned merge base have the same AGENTS.md blob, 7857b724eb44ea0f7fc83e3396038479b53484b2. The proposed rewrite is therefore absent from the reviewed main revision. (AGENTS.md:1, cf98f896d173)
  • Safeguards and proportional validation remain explicit: The full root retains confidentiality, untrusted-code isolation, operator-instance protection, configuration/storage/protocol approvals, owner involvement, live-authority checks, meaningful regression coverage, and native landing gates. Referenced documentation and command entrypoints exist; CLAUDE.md remains a symlink to AGENTS.md. (AGENTS.md:36, d20e9c68acfe)
  • Detailed lifecycle rules remain with their owners: The existing agent and Gateway guides retain admission cleanup, rejection of retained handles after closure, live placement and claim checks, and rejection of incompatible or pre-restart worker authority. These were inspected as destinations for the shortened root guidance, not applied as root-scoped policy. (src/gateway/AGENTS.md:25, d20e9c68acfe)
  • Related merged cleanup and routing history: The supplied GitHub context verifies docs: slim root agent instructions and clarify testing scope #139236 as merged. Current-main history records that earlier policy cleanup and several other policy changes under Peter Steinberger; it does not establish this later rewrite as already implemented. No introducing-line attribution is claimed. (AGENTS.md, e09a265b1111)
  • Rubric ownership contract: The PR explicitly claims that removing the heading does not remove ClawSweeper enforcement, making this dependency relevant. Its verified repository defines target AGENTS.md as optional review guidance; its schema records policy-reading status without requiring a named heading, and its decision parser accepts an empty metrics array. The inspected dependency files were clean at their own revision. (prompts/review-item.md:15, 42226a81c43c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Ready to land at d20e9c6.

Root AGENTS.md is 2,112 words, down from 6,938 (69.6%). The separate ClawSweeper policy section is deleted, with no replacement policy file. The root retains repository-wide safety/approval decisions, architectural invariants, proportional testing, and routing to existing owners. Production and test LOC deltas are zero.

Validation: git diff --check, oxfmt --check AGENTS.md, docs MDX validation, reference existence, removed-heading reference search, and CLAUDE.md symlink check all passed. Canonical installed tooling was used for this dependency-free worktree. Independent preservation review and Codex autoreview found no remaining actionable findings; the latter is scoped-clean at P0–P2.

Exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/33982760046. ClawSweeper also completed exact-head review with no correctness/security findings and no requested before-merge work: #139258 (comment).

This is an explicitly maintainer-directed instruction cleanup. No runtime test or live product proof is needed, and no bot enforcement code or deployment changes.

@steipete
steipete merged commit be34413 into main Sep 5, 2026
107 checks passed
@steipete
steipete deleted the codex/agents-root-policy branch September 5, 2026 18:34
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 5, 2026
* commit '911d7d5b0c107f7274f2415ca9655dcc6105f0e8': (867 commits)
  fix(skills): deliver pending Workshop approval controls (#139248)
  fix(gateway): deliver loopback ask_user prompts to the originating channel (#138831)
  docs: keep root agent instructions focused on repository policy (#139258)
  fix(matrix): exclude archived state roots from scans and selection (#112329)
  perf(agents): prepare exact tool names once per catalog batch (#139267)
  fix: preserve Swarm progress and simplify owner plumbing (#139269)
  fix(tailscale): release claims after gateway process-group exit (#139261)
  refactor(cli): simplify lazy command registration (#139108)
  test(ui): retain synthetic widget failure evidence (#139229)
  fix(buzz): keep implicit replies at thread root (#138879)
  test(diagnostics): await graceful Gateway shutdown before cleanup (#139247)
  fix(ci): unblock releases with different tooling package managers (#139259)
  feat(ui): add social preview links for private sessions (#139250)
  fix(codex): retain failed conversations for guarded continuation (#139246)
  chore(ui): refresh control ui locales (#139200)
  fix(ci): run browser checks for real-gateway inputs (#139256)
  fix(llama-cpp): reconcile managed router state before requests (#136363)
  chore(i18n): refresh native locales (#139237)
  refactor(worker): unify inference payload handling (#139245)
  refactor(terminal): replay wrapped prefixes in one pass (#139240)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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