Skip to content

fix: plugin builds reject manifests with JSON5 syntax - #173178

Closed
KhanCold wants to merge 2 commits into
openclaw:mainfrom
KhanCold:fix/plugin-authoring-json5
Closed

KhanCold wants to merge 2 commits into
openclaw:mainfrom
KhanCold:fix/plugin-authoring-json5

Conversation

@KhanCold

@KhanCold KhanCold commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #59084

What Problem This Solves

Fixes: plugin build and validation fail when a valid native manifest contains comments, trailing commas, or unquoted keys.

User Impact

Plugin authors can use the documented JSON5 manifest format throughout build and validation. Check mode preserves input bytes, and ordinary builds retain authored metadata.

Why This Change Was Made

Both native-manifest rereads now use the existing JSON5 compatibility parser. Package metadata keeps strict JSON parsing, and both inputs keep UTF-8 validation.

Evidence

  • Real CLI and build proof: identical tests fail exactly three JSON5 scenarios on baseline 7816d8b6542af575bd67fe0eabd6393ff4f7963a; all 23 pass on head b846a7a2048a63b3ef1ccd20aed9d954b13b2d65. Fifteen existing UTF-8, validation-output and parser tests also pass.
  • Actual supported CLI, 14 scenarios per phase: baseline rejects the three valid JSON5 commands; head accepts them. Strict JSON succeeds; malformed manifests, JSON5 package.json and invalid UTF-8 remain rejected. Metadata bytes stay unchanged on refusal and read-only checks. Ordinary build preserves authored metadata.
  • Full pnpm build passed. Original-head static job passed format, typed lint, production and CLI-test types, duplicate coverage, and whitespace. Changed workflow guards passed in the final proof run.
  • Canonical P0–P2 review found a proof-script stdout issue, which was fixed. Subsequent proof reviews passed; production code remained unchanged. The original combined review retains its findings verdict. The first behavior run stopped at an incorrect expectation about hidden text diagnostics; the final run corrects that harness and uses the actual baseline commit.

Changed test file: 1.859s test execution, 6.502s wrapper wall. Successful required proof jobs: 1157 runner-seconds; preserved failed proof behavior: 760s; preflight: 42s. All use public standard Ubuntu runners, with no artifact/cache uploads. The CLI fixtures are synthetic; no performance improvement is claimed.

Follow-up 4648dd4bc6c91dfbd690c18e9fc63255761f2d90 only moves the existing SAFETY comment immediately above its type assertion. Affected-check proof reproduces the original CI failure and passes after that comment-only correction, including on the actual new head. The behavioral tests, 28 CLI invocations, full build, and earlier static evidence above were run on b846a7a2048a63b3ef1ccd20aed9d954b13b2d65 and are reused, not rerun: all other files are identical, and removing the relocated comment leaves byte-identical owner source.

@clawsweeper

clawsweeper Bot commented Oct 15, 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 cli CLI command changes size: S labels Oct 15, 2026
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head b846a7a2048a63b3ef1ccd20aed9d954b13b2d65, but the PR head is now 4648dd4bc6c91dfbd690c18e9fc63255761f2d90. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-10-15T14:07:10.036Z sha b846a7a :: needs maintainer review before merge. :: none

Copy link
Copy Markdown
Contributor Author

The assertion-safety failure is fixed in 4648dd4; the current-head baseline-ratchet job passes. The remaining CI failure is check-lint-core-5: core lint passed with zero warnings/errors, then cold plugin-SDK declaration preparation timed out after 300000 ms, before extension lint completed. The previous-head equivalent job completed that preparation in about 261 seconds. The only intervening source change relocates a comment.

Could a maintainer retry the failed job when convenient? My integration does not have permission to rerun upstream jobs. I have not changed timeouts/cache validation or classified this as an inherited main failure.

@clawsweeper clawsweeper Bot removed 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. labels Oct 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Oct 26, 2026
roboclaw-bot added a commit that referenced this pull request Nov 1, 2026
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](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 `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](#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]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @KhanCold for the fix and regression evidence. This is now merged as credited replacement #190192: native manifests accept JSON5 through build and validation, while package.json stays strict and check mode preserves input bytes. Closing this PR in favor of that merged replacement.

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]>
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. size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants