Skip to content

fix(plugins): compare authoring metadata by canonical JSON semantics - #117486

Merged
steipete merged 1 commit into
mainfrom
codex/qa402-plugin-authoring-canonical-json
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa402-plugin-authoring-canonical-json

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw plugins validate and openclaw plugins build --check incorrectly reject valid plugin metadata when equivalent nested JSON objects have different key insertion orders. Their existing whole-object string comparisons mistake ordering for a meaningful metadata change.

A comparator-only change would also break TypeBox-authored plugins: real generated schemas can contain enumerable description: undefined options at root or nested properties, while persisted manifest JSON correctly omits those values.

Why This Change Was Made

The plugin-authoring owner now projects generated manifests once into their exact persisted JSON representation. Both command paths then reuse the existing @openclaw/normalization-core/json-schema structural comparator at all three manifest/package comparison boundaries.

The regression fixture also uses the existing typed expectDefined invariant for its first tool. This explicitly fixes the genuine hosted test-type failure from the revoked earlier candidate; the replacement passed the complete hosted-equivalent test-type shard before review.

Object keys become order-insensitive; arrays remain ordered; meaningful differences and missing manifests still fail. No fallback, configuration key, SDK surface, protocol field, storage format, dependency, or compatibility shim was added.

User Impact

Plugin authors can reorder equivalent manifest or package JSON fields without false stale-metadata failures in local validation or CI. TypeBox schemas with legitimate explicit undefined options continue to match their real persisted representation. Neither validation nor --check rewrites plugin files.

Evidence

  • Tests-first parent baseline: 3 failures, 20 unaffected cases passing.
  • Frozen corrected commit a85892447372fd3d89a5518d8e07172fe222bce4: dedicated trusted Blacksmith Testbox ran pnpm check:test-types && pnpm tsgo:scripts && pnpm tsgo:test:root && pnpm test src/cli/plugins-authoring-command.test.ts; all core, plugin-extension, root, and script type checks passed; all 23 tests passed; exit 0. The dedicated lease was stopped.
  • Actual unmocked Commander plugins validate: baseline exits 1 with stale generated metadata; corrected production code exits 0 and reports a valid plugin.
  • Actual unmocked Commander plugins build --check: baseline exits 1 with out-of-date generated metadata; corrected production code exits 0 and reports metadata up to date.
  • The real plugin imports installed TypeBox, has root and nested explicit undefined descriptions, and contains reordered nested manifest/package fields. Both on-disk file hashes remain identical before and after validation/check.
  • Regression coverage includes ordered tool arrays, genuinely changed schemas, missing manifests, read-only checks, and distinct or matching own __proto__ keys.
  • Configured two-file formatting/lint checks: passed. Seven refreshed independent hostile source reviews: no P0–P3 findings.
  • Exactly one fresh formal gpt-5.6-sol high-reasoning P0–P3 autoreview: zero findings, patch correct, confidence 0.96. Genuine native TruffleHog 3.96.0: clean.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 12:40 PM ET / 16:40 UTC.

ClawSweeper review

What this changes

The PR makes tool-plugin manifest and package metadata checks compare persisted JSON values structurally rather than rejecting equivalent object-key orders.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for explicit maintainer handling because it carries the protected maintainer label. The exact-head patch appears correct: it repairs order-sensitive stale-metadata checks at the plugin-authoring owner boundary, preserves ordered arrays, and includes strong command-level proof with no actionable review finding.

Priority: P2
Reviewed head: a85892447372fd3d89a5518d8e07172fe222bce4
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) This is a focused, well-covered repair with direct CLI proof and no identified correctness or security defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides exact-head unmocked command-level before/after proof for both changed CLI paths, including unchanged file hashes and focused hosted validation evidence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides exact-head unmocked command-level before/after proof for both changed CLI paths, including unchanged file hashes and focused hosted validation evidence.
Evidence reviewed 6 items Current failure mechanism: Current main compares manifest and package metadata through JSON.stringify, so semantically equivalent object properties in a different insertion order produce false stale-metadata errors.
Canonical comparator contract: The existing normalization-core helper accepts only acyclic JSON values and delegates equality to TypeBox Value.Equal, providing order-insensitive object comparison while retaining array-value semantics.
Exact-head implementation: The PR serializes generated manifest data before comparison and replaces all three authoring metadata string comparisons with the shared structural comparator.
Findings None None.
Security None None.

How this fits together

Plugin authoring commands load a tool plugin, derive openclaw.plugin.json and package.json metadata, and compare that output with the project files. The comparison determines whether plugins validate and the read-only plugins build --check report valid, current metadata or a stale-metadata failure.

flowchart LR
  A[Tool plugin module] --> B[Plugin authoring CLI]
  B --> C[Generate manifest and package metadata]
  C --> D[Project manifest to persisted JSON]
  E[Manifest and package JSON on disk] --> F[Structural JSON comparison]
  D --> F
  F --> G[Validate or build-check result]
Loading

Decision needed

Question Recommendation
Should this protected maintainer-label PR be accepted after the remaining exact-head CI jobs complete? Approve after CI completes: Accept the focused comparison repair if the remaining exact-head required checks finish successfully.

Why: The code review finds no discrete defect, but repository policy keeps protected-label items open for explicit maintainer handling rather than automated cleanup.

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +226. Total +230 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 4 +4
Tests 1 226 0 +226
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 234 4 +230

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/cli/plugins-authoring-command.test.ts, serialized state: src/cli/plugins-authoring-command.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Retain the canonical persisted-JSON projection and shared structural comparator, then merge after the protected-label maintainer review and normal exact-head checks complete.

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

Yes. Current main’s whole-object JSON.stringify comparisons provide a high-confidence source path: reserializing equivalent nested object keys differently makes validation and --check report stale metadata.

Is this the best way to solve the issue?

Yes. Projecting generated metadata into its persisted JSON representation and using the existing structural JSON comparator fixes the owner boundary without adding configuration, a parallel API, or a compatibility path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This repair prevents false plugin-authoring validation and CI failures, with limited blast radius and no evidence of urgent runtime or security impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides exact-head unmocked command-level before/after proof for both changed CLI paths, including unchanged file hashes and focused hosted validation evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head unmocked command-level before/after proof for both changed CLI paths, including unchanged file hashes and focused hosted validation evidence.

Evidence

What I checked:

  • Current failure mechanism: Current main compares manifest and package metadata through JSON.stringify, so semantically equivalent object properties in a different insertion order produce false stale-metadata errors. (src/cli/plugins-authoring-command.ts:241, 5db7e1c4ecae)
  • Canonical comparator contract: The existing normalization-core helper accepts only acyclic JSON values and delegates equality to TypeBox Value.Equal, providing order-insensitive object comparison while retaining array-value semantics. (packages/normalization-core/src/json-schema.ts:266, 5db7e1c4ecae)
  • Exact-head implementation: The PR serializes generated manifest data before comparison and replaces all three authoring metadata string comparisons with the shared structural comparator. (src/cli/plugins-authoring-command.ts:180, a85892447372)
  • Regression coverage and user contract: The exact-head test adds command-level coverage for reordered manifest objects, preserves read-only validation/check behavior, and adds negative cases for ordered tool arrays, changed schemas, and missing manifests. The public tool-plugin documentation defines plugins build --check as a non-rewriting stale-metadata check. (src/cli/plugins-authoring-command.test.ts:274, a85892447372)
  • Exact-head proof and checks: The PR body records unmocked before/after plugins validate and plugins build --check outcomes, unchanged on-disk file hashes, and an exact-head focused type/test run; the supplied current check state also shows check-test-types and Real behavior proof successful. (a85892447372)
  • Feature provenance: The current authoring manifest builder and stale-metadata comparison path are blamed to the current-main commit, identifying the present owner surface for follow-up routing. (src/cli/plugins-authoring-command.ts:153, 39cc0a3199f5)

Likely related people:

  • Dallin Romney: Current-main blame attributes the central manifest-building and validation area to this commit; the behavior appears to date to that active authoring-file revision. (role: recent area contributor; confidence: medium; commits: 39cc0a3199f5; files: src/cli/plugins-authoring-command.ts)
  • steipete: Git history shows repeated contributions in the plugin-authoring command, and the exact PR commit implements the focused comparison repair. (role: feature-history contributor; confidence: medium; commits: a85892447372; files: src/cli/plugins-authoring-command.ts, src/cli/plugins-authoring-command.test.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-01T16:03:33.014Z sha 98d4d40 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/qa402-plugin-authoring-canonical-json branch from 98d4d40 to a858924 Compare August 1, 2026 16:33
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 1, 2026
@steipete
steipete merged commit 94c5b54 into main Aug 1, 2026
131 of 133 checks passed
@steipete
steipete deleted the codex/qa402-plugin-authoring-canonical-json branch August 1, 2026 17:00
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

pull Bot pushed a commit to mcx/moltbot that referenced this pull request Aug 1, 2026
* origin/main: (44 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
abdulrahman305 pushed a commit to qenex-ai/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (41 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (44 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (27 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (41 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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