Repository navigation
fix(templates): show why downloaded manifests are invalid - #198590
borealisalastor-byte wants to merge 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as a duplicate of #198583, an open, mergeable fix for the same diagnostic-loss boundary with real CLI proof; its required workflows still await maintainer authorization. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Consolidate the repair in #198583 and retain the linked bug report until that fix merges. So I’m closing this here and keeping the remaining discussion on #198583. Review detailsBest possible solution: Consolidate the repair in #198583 and retain the linked bug report until that fix merges. Do we have a high-confidence way to reproduce the issue? Current-main source demonstrably discards manifest diagnostics, matching the linked report's CLI reproduction; no target code was executed during this read-only review. Is this the best way to solve the issue? Repairing the existing shared artifact reader is appropriate, and the canonical alternative already covers that same fix without changing accepted manifests. Security review: Security review cleared: The patch sanitizes publisher-controlled diagnostics and removes package-root paths without changing authorization or artifact integrity checks. AGENTS.md: found and applied where relevant. What I checked:
Codex review notes: model internal, reasoning medium; reviewed against 41d0dec31bfc. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Closes #198556
What Problem This Solves
Adding a downloaded Template with an invalid manifest reports only a generic failure, hiding the field and reason needed to fix it.
User Impact
Template users and authors can see the manifest diagnostic codes, paths, and explanations when a downloaded package is rejected, including through catalog reads.
Why This Change Was Made
The verified-artifact reader already receives the diagnostics but discards them. Append all diagnostics to the existing error message, using the existing terminal-text sanitizer on each diagnostic before joining the lines. Preserve the
clawhub_manifest_invaliderror code and summary.Keep diagnostic filenames package-relative at this downloaded-artifact boundary. Malformed YAML embeds the resolved filename in its parser message, so strip both the canonical package root and its caller-provided alias before sanitizing. This also covers packages reached through a directory symlink (a junction on Windows), without exposing the Gateway extraction directory through CLI or catalog errors.
The regressions read real packages with two invalid MCP server declarations, an ANSI escape in a metadata key, and malformed nested YAML through direct and linked package roots. They preserve diagnostic reasons and nested filenames while rejecting terminal controls and host-root paths.
Evidence
pnpm test src/templates/clawhub-source-artifact.test.ts --maxWorkers=1: 9 passed. The diagnostic regression failed before the original fix; the escape-character assertion failed without sanitization. Both direct-root and linked-root YAML cases failed before the path follow-up and pass with it. Final run: 3.46 seconds Vitest duration, 5.58 seconds wrapper duration.pnpm tsgo:core: passed.Targeted repository Oxlint,
pnpm format:checkfor both changed files, andgit diff --check: passed.Independent Codex subagent reviews covered the original two-file change and the complete path follow-up against
c34f48f132132fbe27c24303ad3bb10d399f2841; no remaining findings. The hosted ClawSweeper path-disclosure finding is addressed by the follow-up and its direct/linked-root regressions. Local standalone autoreview and local ClawSweeper were not run.Related
clawhub-source.test.ts: 47 passed, 2 failed on Windows withEPERMrenaming an existing source directory. Restoring the original production file from the base reproduced the same two failures; this PR does not change that operation.Official CLI proof at
7bfdd9b1b550ab66b271efae2b74de8f49818155: ranpnpm openclaw templates add @fixture/template --dry-runin text and JSON modes against real local tar artifacts with valid integrity/trust metadata and malformed manifests. All four invocations exited 1 after exactly four unauthenticated loopback GETs each. Text/JSON preserved both schema/MCP reasons (including a fixture key containing ANSI controls) and malformed YAML parse detail, along with the generic rejection headline. Emitted diagnostics contained no ANSI bytes, host-root path, or extraction-directory prefix. Isolated config was byte-for-byte unchanged; no agent, workspace, template, skill, plugin, or session was installed. Full CLI build, bootstrap import guard, plugin control-plane verification, and runtime postbuild passed. No Gateway/model endpoint was contacted. Example text output:Malformed YAML also reported
invalid_template_frontmatter $: Could not parse CLAW.md: Flow sequence in block collection must be sufficiently indented and end with a ].Hosted CI awaits maintainer approval; no broad CI pass is claimed.