Skip to content

fix(plugins): accept JSON5 manifests in build and validation - #190192

Merged
roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-173178
Nov 1, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-173178

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #59084

Supersedes #173178, thanks @KhanCold.

What Problem This Solves

Fixes: plugin build and validation reject valid native manifests containing comments, trailing commas, or unquoted keys.

User Impact

Plugin authors can use the documented JSON5 format in native manifests. Validation and build check mode preserve input bytes; ordinary builds preserve authored metadata. Package metadata still requires strict JSON, with the existing UTF-8 and regular-file checks retained. No migration or new setting is required.

Why This Change Was Made

Route both native-manifest rereads through the existing JSON5 compatibility parser using the shared authoring reader. Remove the duplicate package reread in check mode and compare the package object already used to generate the expected metadata.

Production delta is +10/-10 (net zero): the shared reader selects the existing parser, and check mode drops its duplicate package reread. Tests grow by 33 lines by extending existing command coverage, with a scoped 33-line allocation for the JSON5 regressions and strict package metadata controls. No new parser or duplicated test fixture is introduced.

Evidence

  • On current main 2423623c3461, the same regression file fails exactly the three JSON5 cases (validate, build check, ordinary build); 27 other cases pass. Each failure reaches the native reread and reports malformed JSON.
  • With this fix, 46 focused tests pass across the authoring commands, malformed UTF-8/special-file rejection, validation diagnostics, and parser controls. Check and validation assert exact input preservation; ordinary build asserts authored UI hints survive.
  • Final focused test wrapper: 38.40 seconds across four files. The existing installation/bundling scenario dominates the command suite; the JSON5 cases take about 50 ms each. Exact-head PR CI passed on 3f29b21b5912: 33 non-skipped jobs, 3952 summed job-seconds (this run only; excludes separate workflows and the superseded head).
  • Targeted production/test type validation, typed oxlint, formatting, and whitespace checks pass. The optional local test-line ratchet did not finish within its 60-second host bound; its scoped allocation is included for CI validation.
  • Canonical Codex AutoReview, P0–P2, reviewed the final staged/working-tree candidate against 2423623c3461 with full relevant owner/test context: scoped clean, no actionable findings. Runtime proof comes from the focused tests; the reviewer did not execute tests. Local ClawSweeper is unavailable. The exact hosted review completed on 3f29b21b5912 with no correctness or security findings; its disclosed built-CLI proof gap remains as stated below.
  • The contributor head was read through GitHub only and was never checked out, installed, built, or executed on this host. This is an independently implemented, credited replacement. Real filesystem and command-owner proof was run; a built CLI/Gateway was not run because this authoring path does not involve a model or channel and a full build belongs in broad CI.

Use the existing compatibility parser for native authoring reads while package metadata remains strict JSON. Reuse the already-read package object in check mode.

Co-authored-by: 史启明(QimingShi) <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 1, 2026 09:19
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Nov 1, 2026
Select JSON5 in the shared authoring reader and remove the unnecessary parser callback interface. Reuse the authored manifest and already-read package metadata for checks, keeping production LOC unchanged overall.

Co-authored-by: 史启明(QimingShi) <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Final head: 3f29b21. Native manifest JSON5 regressions are red on main and green here; 46 focused tests, targeted types/lint/format, and full-context local AutoReview pass. This supersedes the initial callback interface and keeps production LOC at net zero.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR accepts JSON5 native manifests during plugin build and validation while keeping package.json strict JSON.

Example: A plugin's openclaw.plugin.json contains an unquoted id, a comment, and a trailing comma.

  • Before: Plugin build, build --check, and validate reject the manifest during strict JSON rereading.
  • After: All three commands accept it; read-only commands preserve its bytes and ordinary builds retain authored metadata.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful boundary regressions and no findings; supplied validation stops at the command-owner harness.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored bot PR is outside the ordinary contributor proof gate; its reported evidence exercises real filesystem and command owners in process, while the body explicitly excludes a shipped-CLI run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugin authors cannot build or validate native manifests using the documented JSON5 syntax.
Reason: This restores an existing documented contract, and the maintainer-authored replacement already establishes direction without adding settings or public APIs.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes a current mismatch with the documented manifest format, with no actionable correctness or security findings.

Priority: P2
Reviewed head: 3f29b21b5912d8298de88c89626654474c53cc6c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The replacement head has no supplied shipped-CLI run covering JSON5 validate, build --check, and ordinary build.
Agent review details

How this fits together

Plugin authoring commands read package metadata, native manifests, and entry-point declarations, then validate their agreement or publish generated metadata.

flowchart TD
  A[Plugin authoring CLI] --> B[Shared metadata reader]
  B --> C[Strict package JSON]
  B --> D[Native manifest JSON5 fallback]
  C --> E[Authoring metadata owner]
  D --> E
  E --> F[Validation or generated metadata]
Loading

Technical review

Best possible solution:

Use the existing JSON5 compatibility parser for native authoring reads while preserving strict package parsing and the existing metadata writer.

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

Current main's strict native-manifest rereads directly explain the reported failures; the PR reports matching red-on-base regressions, but this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is a small, complete repair: it reuses the existing parser and reader, updates both affected callers, and preserves package strictness, file admission, encoding checks, and metadata ownership.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Native authoring parser changes intended behavior with a stated reason (70c839a: The extracted reader prevents malformed UTF-8 from being rewritten as replacement characters; the subsequent FIFO repair preserves regular-file admission.)
  • Authored metadata preservation keeps the original intent (4d05008: Existing manifest-owned fields must survive regeneration of entry-owned metadata.)
  • Check-mode package comparison keeps the original intent (b17e4ed: Check mode compares project metadata against generated expectations; later canonical comparison work makes object-key order insignificant.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Leon-SK668: Raw commit 8b1ceb6 adds src/cli/plugins-authoring-json.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8b1ceb600efa; files: src/cli/plugins-authoring-json.ts)
  • Alix-007: Raw commit 70c839a adds src/cli/plugins-authoring-json.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 70c839ac6bc8; files: src/cli/plugins-authoring-json.ts)

PR surface

Source 0, Tests +33, Other +2. Total +35 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 10 10 0
Tests 1 48 15 +33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 60 25 +35

Root-cause cluster

Relationship: canonical
Canonical: #190192
Summary: This maintainer replacement owns the authoring-parser repair; the earlier merged runtime fix established the format contract but did not repair authoring rereads.

Members:

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

Labels

Label changes:

  • add P2: A documented manifest format fails in plugin authoring commands, with limited impact outside plugin development.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A documented manifest format fails in plugin authoring commands, with limited impact outside plugin development.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Exercise the three JSON5 command scenarios through the shipped CLI to strengthen end-to-end confidence.

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.

Reviewed November 1, 2026, 4:26 AM ET / 09:26 UTC.

@roboclaw-bot
roboclaw-bot merged commit 2a49211 into main Nov 1, 2026
156 of 157 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-173178 branch November 1, 2026 09:37
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…w#190192)

Related: openclaw#59084

Supersedes openclaw#173178, thanks @KhanCold.

## What Problem This Solves

Fixes: plugin build and validation reject valid native manifests containing comments, trailing commas, or unquoted keys.

## User Impact

Plugin authors can use the documented JSON5 format in native manifests. Validation and build check mode preserve input bytes; ordinary builds preserve authored metadata. Package metadata still requires strict JSON, with the existing UTF-8 and regular-file checks retained. No migration or new setting is required.

## Why This Change Was Made

Route both native-manifest rereads through the existing JSON5 compatibility parser using the shared authoring reader. Remove the duplicate package reread in check mode and compare the package object already used to generate the expected metadata.

Production delta is +10/-10 (net zero): the shared reader selects the existing parser, and check mode drops its duplicate package reread. Tests grow by 33 lines by extending existing command coverage, with a scoped 33-line allocation for the JSON5 regressions and strict package metadata controls. No new parser or duplicated test fixture is introduced.

## Evidence

- On current main `1f4d22031c73`, the same regression file fails exactly the three JSON5 cases (validate, build check, ordinary build); 27 other cases pass. Each failure reaches the native reread and reports malformed JSON.
- With this fix, 46 focused tests pass across the authoring commands, malformed UTF-8/special-file rejection, validation diagnostics, and parser controls. Check and validation assert exact input preservation; ordinary build asserts authored UI hints survive.
- Final focused test wrapper: 38.40 seconds across four files. The existing installation/bundling scenario dominates the command suite; the JSON5 cases take about 50 ms each. [Exact-head PR CI passed](https://github.com/openclaw/openclaw/actions/runs/41292821819) on `3f29b21b5912`: 33 non-skipped jobs, 3952 summed job-seconds (this run only; excludes separate workflows and the superseded head).
- Targeted production/test type validation, typed oxlint, formatting, and whitespace checks pass. The optional local test-line ratchet did not finish within its 60-second host bound; its scoped allocation is included for CI validation.
- Canonical Codex AutoReview, P0–P2, reviewed the final staged/working-tree candidate against `1f4d22031c73` with full relevant owner/test context: scoped clean, no actionable findings. Runtime proof comes from the focused tests; the reviewer did not execute tests. Local ClawSweeper is unavailable. The [exact hosted review](openclaw#190192 (comment)) completed on `3f29b21b5912` with no correctness or security findings; its disclosed built-CLI proof gap remains as stated below.
- The contributor head was read through GitHub only and was never checked out, installed, built, or executed on this host. This is an independently implemented, credited replacement. Real filesystem and command-owner proof was run; a built CLI/Gateway was not run because this authoring path does not involve a model or channel and a full build belongs in broad CI.

Co-authored-by: 史启明(QimingShi) <[email protected]>
obviyus added a commit that referenced this pull request Nov 14, 2026
fix(plugins): accept JSON5 manifests when building plugin Control UI assets

A plugin whose manifest uses JSON5 (comments or trailing commas) and declares a Control UI browser entry failed `openclaw plugins build`, `plugins build --check` and `plugins validate`, because the browser-asset builder read the manifest with strict JSON.parse while the rest of the authoring path already accepts JSON5 (#190192). It now uses the existing authoring JSON reader. The repository helper script gets the same fix, loading the reader only in its build branch so `--copy` stays source-free. No new text.

Evidence: isolated synthetic plugins; base via ocx src, candidate in a secretless node:24.22.1 container; twice each. JSON5 manifest with a browser entry: base failed build/check/validate (6 of 6 exit 1), candidate passed all six; builds recreated the browser assets and check/validate left the manifest bytes unchanged. Strict JSON, JSON5 without a browser entry and a truly invalid manifest behave the same on both, with the existing errors. The regression fails on base and passes here; the existing script tests, including source-free copy, pass; full build and packed smoke pass. Net 0 test lines. Details: #198808 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
fix(plugins): accept JSON5 manifests when building plugin Control UI assets

A plugin whose manifest uses JSON5 (comments or trailing commas) and declares a Control UI browser entry failed `openclaw plugins build`, `plugins build --check` and `plugins validate`, because the browser-asset builder read the manifest with strict JSON.parse while the rest of the authoring path already accepts JSON5 (openclaw#190192). It now uses the existing authoring JSON reader. The repository helper script gets the same fix, loading the reader only in its build branch so `--copy` stays source-free. No new text.

Evidence: isolated synthetic plugins; base via ocx src, candidate in a secretless node:24.22.1 container; twice each. JSON5 manifest with a browser entry: base failed build/check/validate (6 of 6 exit 1), candidate passed all six; builds recreated the browser assets and check/validate left the manifest bytes unchanged. Strict JSON, JSON5 without a browser entry and a truly invalid manifest behave the same on both, with the existing errors. The regression fails on base and passes here; the existing script tests, including source-free copy, pass; full build and packed smoke pass. Net 0 test lines. Details: openclaw#198808 (comment).

Thanks @Alix-007.

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

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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