Skip to content

Add grouped Claw schema and read-only add plan - #101328

Merged
giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claws-pr2-schema-plan
Jul 21, 2026
Merged

giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claws-pr2-schema-plan

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the first read-only slice of merged RFC 0016 behind OPENCLAW_EXPERIMENTAL_CLAWS=1:

  • Defines the strict grouped Claw v1 schema for one new agent plus its workspace files, packages, MCP servers, and cron jobs.
  • Enforces portable exact SemVer, canonical ClawHub names, cross-platform workspace paths, managed avatars, five-field timezone-qualified cron schedules, pinned package-manager MCP commands, safe spawn environment keys, and HTTPS/loopback remote MCP URLs.
  • Reads local package or standalone sources into one deterministic bounded snapshot that binds exact package metadata, the manifest, and every referenced workspace source.
  • Produces a complete read-only add plan with expected state, stable diagnostics, local readiness requirements, capability disclosures, and a planIntegrity digest that later mutation must bind to explicit consent.
  • Blocks agent, workspace, MCP, cron, source-snapshot, and unsafe-source ambiguity instead of merging into existing state or assuming inaccessible paths are absent.
  • Exposes only openclaw claws inspect <source> and openclaw claws add <source> --dry-run; without the process opt-in, claws is absent from registration and help.

This PR does not mutate config or disk, run package installers, configure MCP, create cron jobs, or persist provenance. Package actions remain explicit blockers until the package-owner lifecycle slice later in the stack.

Review fixes

Fresh maintainer review on 2026-07-21 identified and fixed three fail-closed gaps:

  1. Planning now consumes the exact bounded source snapshot used for source integrity instead of reopening package/workspace files.
  2. Only ENOENT and ENOTDIR prove workspace absence; permission, I/O, and other probe failures block the workspace and dependent actions.
  3. Secret-safe MCP capability effects bind and display both destination environment keys and referenced local environment names.

The repair is signed at exact head 4cd28a6c490c8bd3dc0c1a0e9a30b8c0ed5c1c67.

Stack

  • RFC: openclaw/rfcs#27, merged as 13819ef73d3a
  • This PR: schema, source identity, diagnostics, readiness, and read-only planning
  • Next: #101755 creates the new agent/workspace and root provenance record

Validation

Focused exact-head proof:

node scripts/run-vitest.mjs src/claws/schema.test.ts src/claws/schema-conformance.test.ts src/cli/claws-cli.test.ts
# 58 tests passed

node_modules/.bin/oxlint src/claws/types.ts src/claws/reader.ts src/claws/lifecycle.ts \
  src/claws/schema.test.ts src/cli/claws-cli.runtime.ts src/cli/claws-cli.test.ts --deny-warnings
# 0 warnings, 0 errors

pnpm tsgo:core
git diff --check
# passed

pnpm build passes. Local pnpm check reaches only the npm shrinkwrap guard for root, extensions/llama-cpp, and extensions/twitch; latest origin/main reproduces those same unrelated failures and additionally reports extensions/msteams. The PR does not touch dependency manifests or shrinkwraps.

The broad local pnpm test run completed 294 shards but reported unrelated failures across 46 non-Claws files. Focused Claws schema/conformance/CLI tests pass, and fresh exact-head hosted CI is the merge gate.

Documentation

Introduces the public experimental Claws guide and CLI navigation with the opt-in flag, grouped JSON authoring, inspect, and read-only add --dry-run. Later lifecycle behavior is intentionally not documented yet.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L maintainer Maintainer-authored PR labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 4:39 PM ET / 20:39 UTC.

Summary
Adds an OPENCLAW_EXPERIMENTAL_CLAWS-gated openclaw claws CLI that validates grouped Claw manifests and emits deterministic, read-only agent-add plans.

PR surface: Source +2056, Tests +1216, Docs +108. Total +3380 across 25 files.

Reproducibility: not applicable. This PR adds a new experimental capability rather than fixing a reported current-main defect. Its submitted isolated CLI transcript and lifecycle E2E cover the proposed inspect, dry-run, and fail-closed paths.

Review metrics: 1 noteworthy metric.

  • Experimental operator surfaces: 1 environment gate, 1 root command group, 2 versioned JSON result schemas. These new user-facing contracts are intentionally gated but become compatibility and documentation obligations if merged.

Stored data model
Persistent data-model change detected: database schema: src/claws/fixtures/incident-response.claw.json, database schema: src/claws/schema-conformance.test.ts, database schema: src/claws/schema.test.ts, database schema: src/cli/claws-cli.test.ts, serialized state: src/claws/lifecycle.e2e.test.ts, serialized state: src/claws/schema-conformance.test.ts, and 6 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #101328
Summary: This PR is the proposed read-only base contract for a linked stack; the downstream PRs add distinct mutation and lifecycle stages rather than duplicate this branch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain an explicit owner decision on the core Claws contract and the later lifecycle-stack ownership boundary.

Risk before merge

  • [P1] Merging establishes a new experimental CLI, environment-variable gate, grouped-manifest schema, and versioned JSON outputs that downstream lifecycle PRs already treat as their base contract.
  • [P1] The branch is intentionally read-only, but its plan output describes future agent, workspace, package, MCP, and cron effects; maintainers should confirm that this core-owned contract is the intended foundation before accepting its compatibility burden.

Maintainer options:

  1. Confirm the experimental contract before merge (recommended)
    Merge only after an owner explicitly accepts the new CLI, environment gate, schema, and downstream lifecycle ownership as an intentional experimental public surface.
  2. Decline the core surface
    Close or redirect the stack if maintainers decide grouped Claw lifecycle management should use existing external plugin, skill, or ClawHub seams instead.

Next step before merge

  • [P2] No narrow automated repair remains; the protected PR needs a human product and ownership decision on adopting this experimental core contract.

Maintainer decision needed

  • Question: Should OpenClaw adopt this experimental, core-owned grouped Claw manifest and read-only planning contract as the base for the dependent lifecycle stack?
  • Rationale: The patch is a coherent implementation, but choosing a new core CLI, environment gate, schema, and lifecycle abstraction is a maintainer product and ownership decision rather than a mechanical correctness question.
  • Likely owner: Patrick-Erichsen — The current-head update and prior detailed review connect this person most directly to the final contract and its implementation boundary.
  • Options:
    • Sponsor the experimental core base (recommended): Accept the gated read-only contract and use it as the reviewed base for the dependent creation, workspace, package, and removal slices.
    • Keep the concept outside core: Decline the new core lifecycle contract and route any portable package or workflow ideas through existing plugin, ClawHub, or skill seams.
    • Request a narrower RFC-backed base: Keep this PR open while maintainers specify a smaller core contract or explicit lifecycle ownership boundaries before merge.

Security
Cleared: The patch validates and plans potentially sensitive future operations but does not execute package installation, MCP configuration, cron creation, or state mutation in this slice.

Review details

Best possible solution:

Accept or reject the core-owned experimental Claws contract as a deliberate product boundary; if accepted, merge this read-only base before reviewing its dependent mutation slices.

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

Not applicable: this PR adds a new experimental capability rather than fixing a reported current-main defect. Its submitted isolated CLI transcript and lifecycle E2E cover the proposed inspect, dry-run, and fail-closed paths.

Is this the best way to solve the issue?

Unclear: the patch is a coherent read-only implementation, but whether this grouped lifecycle belongs in OpenClaw core rather than existing external seams requires maintainer product direction.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a substantial but experimental feature proposal whose bounded blast radius is gated behind an explicit environment variable.
  • merge-risk: 🚨 compatibility: The PR introduces a CLI, environment variable, manifest schema, and stable-looking plan result formats that downstream work depends on.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. The idea offers a cohesive, consent-oriented way to preview a portable one-agent setup before any mutation, with a deliberately staged lifecycle design.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up discussion provide isolated real CLI output for opt-in visibility, manifest inspection, dry-run planning, and the non-dry-run fail-closed path; private state paths and values should remain redacted in any future proof updates.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up discussion provide isolated real CLI output for opt-in visibility, manifest inspection, dry-run planning, and the non-dry-run fail-closed path; private state paths and values should remain redacted in any future proof updates.
Evidence reviewed

PR surface:

Source +2056, Tests +1216, Docs +108. Total +3380 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 13 2068 12 +2056
Tests 6 1216 0 +1216
Docs 6 108 0 +108
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 3392 12 +3380

What I checked:

  • Current PR scope: The current branch adds a gated root CLI, strict grouped-manifest schema, source reader, deterministic planning output, CLI tests, lifecycle E2E coverage, and public experimental CLI documentation. (src/cli/claws-cli.ts:18, 087500a80942)
  • Real behavior evidence: The PR discussion records isolated direct CLI results for disabled help, enabled help, valid inspection, dry-run planning, and non-dry-run fail-closed behavior; the item is also labeled proof: sufficient. (src/claws/lifecycle.e2e.test.ts:56, 087500a80942)
  • Prior review blockers addressed: Earlier review comments requested canonical agent/workspace collision handling, canonical heartbeat validation, deferred package blockers, removal of a parallel feed contract, and canonical path handling; the supplied follow-up discussion describes corresponding fixes and the latest completed ClawSweeper cycle has no remaining findings. (src/claws/lifecycle.ts:1, 087500a80942)
  • Product-boundary signal: Repository policy treats new CLI/config surfaces and bundled lifecycle behavior as compatibility-sensitive, and the PR is explicitly labeled maintainer; its stacked downstream PRs depend on this base contract. (AGENTS.md:121, a52eb2134b25)
  • Current-main status: The reviewed feature is proposed by this open PR rather than already present in the supplied current-main context; no merged implementation or release provenance establishes the requested Claws contract on current main. (src/claws/experimental.ts:1, 087500a80942)

Likely related people:

  • Patrick-Erichsen: Submitted the detailed planning/CLI review that shaped the current design and force-pushed the current reviewed head in the supplied timeline. (role: current-head contributor and prior reviewer; confidence: high; commits: 087500a80942; files: src/claws/lifecycle.ts, src/cli/claws-cli.runtime.ts, src/cli/claws-cli.ts)
  • omarshahine: Provided the consumer-boundary review that required preview/apply path-policy parity, bounded source reads, and deferred install-identity direction. (role: adjacent product reviewer; confidence: high; files: src/claws/reader.ts, src/claws/lifecycle.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (29 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-17T15:46:06.023Z sha 81f01f1 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T14:08:50.796Z sha a590c21 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T14:51:39.123Z sha a590c21 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T17:53:51.926Z sha e0aed39 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T18:13:50.646Z sha e0aed39 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T21:20:42.004Z sha 5b12660 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T21:39:41.314Z sha 38c3942 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T22:22:25.402Z sha 38c3942 :: needs maintainer review before merge. :: none

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr2-schema-plan branch from cfcd818 to 061a2f2 Compare July 7, 2026 04:20
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 7, 2026
@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr2-schema-plan branch 2 times, most recently from 01402aa to 7dd8468 Compare July 7, 2026 14:55
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 7, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 7, 2026
@giodl73-repo giodl73-repo changed the title Add Claws manifest schema and read-only plan CLI Add non-mutating Claws validation lifecycle Jul 7, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Consolidated the Claws validation stack into this single PR and aligned the CLI surface with the RFC: no public \claws plan\ / \claws feed plan; dry-run apply emits the lifecycle plan.

@clawsweeper

clawsweeper Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Fresh maintainer review repairs are pushed at signed head 4cd28a6c490c8bd3dc0c1a0e9a30b8c0ed5c1c67.

  • Planning consumes the exact bounded source snapshot used for integrity.
  • Non-not-found workspace probe failures block the workspace and dependent file actions.
  • MCP capability previews bind destination and referenced environment names without exposing values.

Focused schema/conformance/CLI proof passes 58 tests, targeted Oxfmt/Oxlint and pnpm tsgo:core pass, and pnpm build passes. The PR body records the unrelated local shrinkwrap and broad-suite baseline noise. Fresh hosted CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr2-schema-plan branch from 4cd28a6 to 203391e Compare July 21, 2026 21:32
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Add grouped Claw schema and read-only add plan This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@giodl73-repo
giodl73-repo merged commit 138d2a5 into openclaw:main Jul 21, 2026
186 of 188 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
* Add grouped Claw schema and read-only add plan

* test(claws): cover grouped schema and preview

* docs(claws): document experimental preview

* fix(claws): harden preview consent

* fix(claws): satisfy tool filter lint

* fix(claws): bind plans to validated sources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

3 participants