Skip to content

refactor(reef): drop hand-maintained manifest schema copies - #131292

Merged
steipete merged 2 commits into
mainfrom
claude/reef-manifest-schema-cleanup
Aug 28, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/reef-manifest-schema-cleanup

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #131167

What Problem This Solves

Follow-up cleanup from #131167. The reef plugin manifest hand-duplicated the full channel config schema into two JSON Schema blocks (configSchema and channelConfigs.reef.schema), and the channelConfigs copy silently overrode the zod-derived generated bundled channel metadata in config validation (ensureChannelSchemas seeds from GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA, then registry channelConfigs.schema entries win). That left three surfaces to keep in sync by hand — exactly the trap that surfaced during #131167, where the new rules object had to be patched into both manifest copies after the zod schema and generated metadata were already correct.

Why This Change Was Made

Match the pattern every sibling bundled channel plugin already uses (telegram, discord, msteams, irc, …): plugin-level configSchema is the minimal required stub ({"type":"object","additionalProperties":false,"properties":{}} — channel plugins carry no plugin-level config), and there is no channelConfigs.schema copy. The channel schema is then served everywhere from the generated bundled channel metadata, which derives from the zod schema and is freshness-checked in CI (generate-bundled-channel-config-metadata --check). Reef was the only bundled plugin duplicating the full schema; slack's channelConfigs schema is a deliberate wide-open stub, not a duplicate, and is untouched.

User Impact

None at runtime: config validation, the docs example validator, and the Control UI config schema all resolve reef's channel schema from the zod-derived metadata, which is semantically identical to the deleted copies (parity was aligned in #131167). Future schema changes now need exactly one edit (zod) plus the existing generator, with CI guarding freshness — the drift class is gone. Net −175 lines of hand-maintained manifest JSON.

Evidence

  • pnpm docs:check-config-examples green — the reef docs config example (including guard.rules) validates through the plugin-aware path against the generated schema.
  • node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check green (metadata unchanged; it never derived from the manifest).
  • node scripts/run-vitest.mjs extensions/reef src/plugins/bundled-sources.test.ts src/plugins/bundled-plugin-metadata.test.ts — all green.
  • node scripts/check-changed.mjs — all lanes green.
  • Autoreview (Codex, structured): clean, no actionable findings.
  • requiresConfig derivation unchanged (no root-level required before or after).

The reef manifest duplicated the full channel config schema into both
configSchema and channelConfigs.reef.schema, and the channelConfigs copy
silently overrode the zod-derived generated bundled channel metadata in
config validation - three surfaces to keep in sync by hand (the trap that
bit #131167). Match sibling bundled channel plugins: stub plugin-level
configSchema, no channelConfigs copy; the generated metadata (from the
zod schema, CI-checked) is the single channel-schema source.
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: reef Channel integration: reef size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 00:05
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 27, 2026, 8:13 PM ET / August 28, 2026, 00:13 UTC.

ClawSweeper review

What this changes

The PR removes Reef’s duplicate manifest schemas so channel configuration is served from the generated schema derived from the Reef Zod definition.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: the cleanup regresses validation for a previously accepted Reef plugin-entry configuration and needs an explicit upgrade path before merge.

Priority: P1
Reviewed head: d8e67cf51116a42cdf0a2f0df8cd4f4344a08e95
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The canonical channel-schema consolidation is sound, but the unhandled plugin-entry upgrade break is a merge blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored cleanup is exempt from the external-contributor proof gate; the reported focused checks remain supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored cleanup is exempt from the external-contributor proof gate; the reported focused checks remain supplemental evidence.
Evidence reviewed 6 items Introduced trigger: The PR replaces Reef’s plugin-level schema with an empty strict object, so every former key under the plugin-entry config is now an additional property.
Validation consequence: Explicit plugin entries are validated against the manifest config schema whenever enabled or carrying config; validation reports the precise plugin-entry config path on failure.
Canonical channel path remains sound: Bundled channel metadata loads Reef’s exported config schema and uses it in preference to a manifest copy; generated metadata therefore remains the correct source for channels.reef.
Findings 1 actionable finding [P1] Migrate the published plugin-entry configuration
Security None None.

Live Verification

Command: node --import tsx -e 'import { validateConfigWithPlugins } from "./src/config/validation.ts"; const result = validateConfigWithPlugins({ plugins: { entries: { reef: { config: { relayUrl: "https://reefwire.ai" } } } } }); console.log(result.ok ? "accepted" : result.issues[0]?.path);'

Result: FAIL (failed) — step 1 expect_output plugins.entries.reef.config: terminal command failed with exit status 1: "node --import tsx -e 'import { validateConfigWithPlugins } from \"./src/config/validation.ts\"; const result = validateConfigWithPlugins({ plugins: { entries: { reef: { config: { relayUrl: \"https://reefwire.ai\" } } } } }); console.log(result.ok ? \"accepted\" : result.issues[0]?.path);'"

[failure]
terminal command failed with exit status 1: "node --import tsx -e 'import { validateConfigWithPlugins } from \"./src/config/validation.ts\"; const result = validateConfigWithPlugins({ plugins: { entries: { reef: { config: { relayUrl: \"https://reefwire.ai\" } } } } }); console.log(result.ok ? \"accepted\" : result.issues[0]?.path);'"

[command 1 combined output]
file:///tmp/clawsweeper-live-proof-131292-EkhqPj/target/[eval1]:1
import { validateConfigWithPlugins } from "./src/config/validation.ts"; const result = validateConfigWithPlugins({ plugins: { entries: { reef: { config: { relay
Url: "https://reefwire.ai" } } } } }); console.log(result.ok ? "accepted" : result.issues[0]?.path);
         ^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module './src/config/validation.ts' does not provide an export named 'validateConfigWithPlugins'
    at #asyncInstantiate (node:internal/modules/esm/module_job:327:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:431:5)
    at async node:internal/modules/esm/loader:224:26
    at async ModuleLoader.executeModuleJob (node:internal/modules/esm/loader:221:20)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Node.js v24.19.0

Assertions:

  • FAIL expect_output: plugins.entries.reef.config

How this fits together

Reef configuration reaches OpenClaw through two surfaces: channel settings for runtime behavior and plugin-entry settings for plugin activation metadata. Generated bundled-channel metadata supplies the channel schema to validation and the Control UI.

flowchart LR
  A[Operator configuration] --> B[Plugin manifest]
  A --> C[Channel settings]
  B --> D[Plugin-entry validation]
  C --> E[Generated channel metadata]
  E --> F[Channel validation and Control UI]
  D --> G[Gateway startup validation]
Loading

Decision needed

Question Recommendation
Should previously accepted plugins.entries.reef.config values be migrated into channels.reef, and what should happen when both locations contain values? Add a conservative migration: Move legacy values only when the canonical channel configuration is absent, and surface conflicts without overwriting canonical settings.

Why: The cleanup changes a published validation contract; only maintainers can choose the conflict and precedence policy for existing operator configuration.

Before merge

  • Migrate the published plugin-entry configuration (P1) - configSchema validates plugins.entries.reef.config, not channels.reef. Replacing its previously populated strict schema with {} makes any existing accepted Reef entry (for example relayUrl or guard) invalid during config validation. Keep the generated channel schema, but add a doctor migration and coverage for this legacy location before removing its accepted keys.
  • Resolve merge risk (P1) - Existing configurations using the manifest-advertised plugins.entries.reef.config keys will fail validation after merge, potentially preventing normal startup until manually edited.
  • Complete next step (P2) - A concrete compatibility defect exists, but a maintainer must choose the migration and collision policy for legacy and canonical Reef settings.

Findings

  • [P1] Migrate the published plugin-entry configuration — extensions/reef/openclaw.plugin.json:28
Agent review details

Security

None.

PR surface

Source -175. Total -175 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 176 -175
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 176 -175

Review metrics

Metric Value Why it matters
Production LOC production −175, tests 0 The deletion reduces duplicate schema maintenance, but it also removes an accepted plugin configuration contract.

Merge-risk options

Maintainer options:

  1. Preserve legacy operator config (recommended)
    Add a tested Reef doctor migration for the formerly accepted plugin-entry schema before deleting it from the manifest.
  2. Intentionally break the old path
    Land only with maintainer agreement that existing users must manually move their settings to channels.reef.

Technical review

Best possible solution:

Keep generated metadata as the sole channel-schema source, while adding a Reef doctor migration that moves legacy plugin-entry values only when channels.reef is absent and preserves an explicit, non-destructive conflict path otherwise.

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

Yes, from source: validate an enabled Reef plugin entry containing config.relayUrl; the introduced empty strict schema makes that entry invalid before startup.

Is this the best way to solve the issue?

No: using generated metadata for channels.reef is the right consolidation, but deleting the plugin-entry schema without a migration breaks its existing validation contract.

Full review comments:

  • [P1] Migrate the published plugin-entry configuration — extensions/reef/openclaw.plugin.json:28
    configSchema validates plugins.entries.reef.config, not channels.reef. Replacing its previously populated strict schema with {} makes any existing accepted Reef entry (for example relayUrl or guard) invalid during config validation. Keep the generated channel schema, but add a doctor migration and coverage for this legacy location before removing its accepted keys.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Merging can make existing Reef configurations fail validation and block gateway startup.
  • add merge-risk: 🚨 compatibility: The strict empty plugin schema rejects previously accepted values under plugins.entries.reef.config.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored cleanup is exempt from the external-contributor proof gate; the reported focused checks remain supplemental evidence.

Label justifications:

  • P1: Merging can make existing Reef configurations fail validation and block gateway startup.
  • merge-risk: 🚨 compatibility: The strict empty plugin schema rejects previously accepted values under plugins.entries.reef.config.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored cleanup is exempt from the external-contributor proof gate; the reported focused checks remain supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged guard-rules feature and this follow-up cleanup. (role: introduced the current Reef configuration contract; confidence: high; commits: 7b000dba9dab, d8e67cf51116; files: extensions/reef/openclaw.plugin.json, extensions/reef/src/config-schema.ts)
  • Vyctor H. Brzezowski: Current plugin-entry and generated-channel schema handling traces to this area’s recent validation implementation. (role: recent configuration-validation contributor; confidence: medium; commits: 15f24c4bfb5f; files: src/config/validation-plugin-config.ts, src/plugins/bundled-channel-config-metadata.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a regression that validates a legacy Reef plugin-entry config before doctor repair and the canonical channel config after repair.

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.

The retired full plugin-entry schema let a Control UI plugin form park
reef settings under plugins.entries.reef.config where the runtime never
read them. Doctor now reports the location and --fix moves the keys into
channels.reef (channel values stay authoritative; the move only commits
when the merged record parses, so a fix can never corrupt valid config).
@steipete

Copy link
Copy Markdown
Contributor Author

The P1 is addressed in db8f606. Verification notes on the premise first: no repo path ever writes plugins.entries.reef.config (setup/register/enable write channels.reef and plugins.entries.reef.enabled only), and the one known production reef deployment carries plugins.entries.reef: {"enabled": true} with no config key — but the retired full plugin-entry schema did render as an editable plugin config form in the Control UI, so a hand-parked state is plausible and the compatibility doctrine applies.

Fix shape (reef's existing doctor config-repair contract, not a runtime fallback):

  • legacyConfigRules now reports non-empty plugins.entries.reef.config with a doctor-fix pointer.
  • normalizeCompatibilityConfig moves the keys into channels.reef: existing channel keys stay authoritative (conflicting stray values are removed with an explicit note), and the move only commits when the merged record parses against ReefChannelConfigSchema — an unmergeable stray config is left in place and keeps surfacing through the rule message, so a doctor fix can never turn a valid channels.reef invalid or silently discard data.
  • Three regression tests cover move, conflict, and unmergeable paths (the move/conflict tests fail on the pre-fix code).

Also note the sweeper's live-verification command in the review errored at import time (validateConfigWithPlugins is not an export of src/config/validation.ts), so its FAIL result reflects the harness, not shipped behavior; the mechanism itself (hard validation issues at plugins.entries.reef.config.*) is confirmed by reading src/config/validation-plugin-config.ts:386-409.

@steipete
steipete merged commit 4b7ae2b into main Aug 28, 2026
103 checks passed
@steipete
steipete deleted the claude/reef-manifest-schema-cleanup branch August 28, 2026 01:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…#131292)

* refactor(reef): drop hand-maintained manifest schema copies

The reef manifest duplicated the full channel config schema into both
configSchema and channelConfigs.reef.schema, and the channelConfigs copy
silently overrode the zod-derived generated bundled channel metadata in
config validation - three surfaces to keep in sync by hand (the trap that
bit openclaw#131167). Match sibling bundled channel plugins: stub plugin-level
configSchema, no channelConfigs copy; the generated metadata (from the
zod schema, CI-checked) is the single channel-schema source.

* fix(reef): doctor migration for stray plugins.entries.reef.config

The retired full plugin-entry schema let a Control UI plugin form park
reef settings under plugins.entries.reef.config where the runtime never
read them. Doctor now reports the location and --fix moves the keys into
channels.reef (channel values stay authoritative; the move only commits
when the merged record parses, so a fix can never corrupt valid config).
steipete added a commit that referenced this pull request Aug 28, 2026
…etadata (#131564)

* fix(channels): single-source bundled channel schemas from generated metadata

Hand-maintained channelConfigs schema copies in a2a, buzz, clickclack,
raft, and slack silently overrode the zod-derived generated bundled
channel metadata in config validation: stale buzz/raft copies rejected
the valid configWrites key, and the slack/clickclack additionalProperties
stubs disabled validation for those channels entirely. Delete the copies
so the CI-checked generated metadata is the single channel-schema source,
stub feishu's retired rich plugin-entry schema like every sibling, and
guard the pattern with a contract test.

The retired rich plugin-entry schemas let config UIs park channel
settings under plugins.entries.<id>.config unread; the reef doctor
migration from #131292 generalizes into the plugin SDK
(defineStrayPluginEntryConfigMigration) and feishu adopts it alongside
reef.

* fix(tests): fold channel schema-source guard into existing shard root

A new test root pushed the plugins-platform tsgo shard past its 720-root
cap; the guard lives in bundled-package-channel-metadata.test.ts instead.

* test(channels): update catalog and parity tests to single-source schemas

The official catalog regenerates without the deleted manifest schema
copies; the a2a and buzz parity tests drop their cold-manifest/catalog
surfaces (the runtime zod projection is what the generator publishes).

* test(plugins): lagging slack hydration carries no catalog schema copy

The full-suite manifest-registry test still pinned the catalog's retired
slack schema fallback; hydration now yields label/description and channel
validation falls back to the generated bundled metadata.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
…etadata (openclaw#131564)

* fix(channels): single-source bundled channel schemas from generated metadata

Hand-maintained channelConfigs schema copies in a2a, buzz, clickclack,
raft, and slack silently overrode the zod-derived generated bundled
channel metadata in config validation: stale buzz/raft copies rejected
the valid configWrites key, and the slack/clickclack additionalProperties
stubs disabled validation for those channels entirely. Delete the copies
so the CI-checked generated metadata is the single channel-schema source,
stub feishu's retired rich plugin-entry schema like every sibling, and
guard the pattern with a contract test.

The retired rich plugin-entry schemas let config UIs park channel
settings under plugins.entries.<id>.config unread; the reef doctor
migration from openclaw#131292 generalizes into the plugin SDK
(defineStrayPluginEntryConfigMigration) and feishu adopts it alongside
reef.

* fix(tests): fold channel schema-source guard into existing shard root

A new test root pushed the plugins-platform tsgo shard past its 720-root
cap; the guard lives in bundled-package-channel-metadata.test.ts instead.

* test(channels): update catalog and parity tests to single-source schemas

The official catalog regenerates without the deleted manifest schema
copies; the a2a and buzz parity tests drop their cold-manifest/catalog
surfaces (the runtime zod projection is what the generator publishes).

* test(plugins): lagging slack hydration carries no catalog schema copy

The full-suite manifest-registry test still pinned the catalog's retired
slack schema fallback; hydration now yields label/description and channel
validation falls back to the generated bundled metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: reef Channel integration: reef maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant