Persist ClawHub skill install provenance#93283
Conversation
|
Codex review: passed. Reviewed June 15, 2026, 9:03 AM ET / 13:03 UTC. Summary PR surface: Source +144, Tests +139. Total +283 across 2 files. Reproducibility: not applicable. as a bug reproduction. Source inspection shows current main lacks the richer Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this slice only if maintainers accept the Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction. Source inspection shows current main lacks the richer Is this the best way to solve the issue? Yes for this narrow local provenance slice if maintainers accept the stored metadata contract. The change sits at the existing ClawHub lifecycle boundary, preserves the telemetry shape, and leaves broader enforcement policy to the canonical follow-up issue. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 018d2794687f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +144, Tests +139. Total +283 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
@clawsweeper automerge |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
846cd0d to
65774f4
Compare
Summary: - The PR adds artifact, installed skill-file, source URL, and verification-envelope fields to ClawHub skill origin/lock metadata while keeping install telemetry restricted to the older version/registry shape. - PR surface: Source +144, Tests +139. Total +283 across 2 files. - Reproducibility: not applicable. as a bug reproduction. Source inspection shows current main lacks the richer `.clawhub` provenance fields, and the PR body provides after-patch live output from a ClawHub install. Automerge notes: - PR branch already contained follow-up commit before automerge: Persist ClawHub skill install provenance Validation: - ClawSweeper review passed for head 65774f4. - Required merge gates passed before the squash merge. Prepared head SHA: 65774f4 Review: openclaw#93283 (comment) Co-authored-by: momothemage <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: momothemage
PR openclaw#93283 began persisting install provenance (sourceUrl, artifact, skillFile) into each skill `.clawhub/origin.json`, but the shared `normalizeClawHubSkillOrigin` reader rebuilds the origin object from a fixed allowlist and only kept the identity fields (version/registry/slug/installedVersion/installedAt). The newly persisted provenance was silently dropped on every readback path (`readClawHubSkillOrigin`, `readClawHubSkillOriginStatusSync`, `readClawHubSkillOriginStrict`), so the write side and read side of origin.json were asymmetric. The workspace lockfile reader keeps these fields (raw skills passthrough); origin.json did not. Preserve the persisted provenance on readback with strict, allowlist validation (artifact.kind in {archive,clawpack}, non-empty sha256 / integrity / path; malformed fields are dropped, not promoted), and surface the restored fields through the exported `resolveClawHubSkillStatusLinkSync` linked result as backward-compatible optional fields. Old origins without these fields keep working.
PR openclaw#93283 began persisting install provenance (sourceUrl, artifact, skillFile) into each skill `.clawhub/origin.json`, but the shared `normalizeClawHubSkillOrigin` reader rebuilds the origin object from a fixed allowlist and only kept the identity fields (version/registry/slug/installedVersion/installedAt). The newly persisted provenance was silently dropped on every readback path (`readClawHubSkillOrigin`, `readClawHubSkillOriginStatusSync`, `readClawHubSkillOriginStrict`), so the write side and read side of origin.json were asymmetric. The workspace lockfile reader keeps these fields (raw skills passthrough); origin.json did not. Preserve the persisted provenance on readback with strict, allowlist validation (artifact.kind in {archive,clawpack}, non-empty sha256 / integrity / path; malformed fields are dropped, not promoted), and surface the restored fields through the exported `resolveClawHubSkillStatusLinkSync` linked result as backward-compatible optional fields. Old origins without these fields keep working.
PR openclaw#93283 began persisting install provenance (sourceUrl, artifact, skillFile) into each skill `.clawhub/origin.json`, but the shared `normalizeClawHubSkillOrigin` reader rebuilds the origin object from a fixed allowlist and only kept the identity fields (version/registry/slug/installedVersion/installedAt). The newly persisted provenance was silently dropped on every readback path (`readClawHubSkillOrigin`, `readClawHubSkillOriginStatusSync`, `readClawHubSkillOriginStrict`), so the write side and read side of origin.json were asymmetric. The workspace lockfile reader keeps these fields (raw skills passthrough); origin.json did not. Preserve the persisted provenance on readback with strict, allowlist validation (artifact.kind in {archive,clawpack}, non-empty sha256 / integrity / path; malformed fields are dropped, not promoted), and surface the restored fields through the exported `resolveClawHubSkillStatusLinkSync` linked result as backward-compatible optional fields. Old origins without these fields keep working.
Summary: - The PR adds artifact, installed skill-file, source URL, and verification-envelope fields to ClawHub skill origin/lock metadata while keeping install telemetry restricted to the older version/registry shape. - PR surface: Source +144, Tests +139. Total +283 across 2 files. - Reproducibility: not applicable. as a bug reproduction. Source inspection shows current main lacks the richer `.clawhub` provenance fields, and the PR body provides after-patch live output from a ClawHub install. Automerge notes: - PR branch already contained follow-up commit before automerge: Persist ClawHub skill install provenance Validation: - ClawSweeper review passed for head 65774f4. - Required merge gates passed before the squash merge. Prepared head SHA: 65774f4 Review: openclaw#93283 (comment) Co-authored-by: momothemage <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: momothemage
Summary: - The PR adds artifact, installed skill-file, source URL, and verification-envelope fields to ClawHub skill origin/lock metadata while keeping install telemetry restricted to the older version/registry shape. - PR surface: Source +144, Tests +139. Total +283 across 2 files. - Reproducibility: not applicable. as a bug reproduction. Source inspection shows current main lacks the richer `.clawhub` provenance fields, and the PR body provides after-patch live output from a ClawHub install. Automerge notes: - PR branch already contained follow-up commit before automerge: Persist ClawHub skill install provenance Validation: - ClawSweeper review passed for head 65774f4. - Required merge gates passed before the squash merge. Prepared head SHA: 65774f4 Review: openclaw#93283 (comment) Co-authored-by: momothemage <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: momothemage
Summary
Refs #92077.
This PR implements a narrow, local lockfile slice of the ClawHub skill provenance work:
.clawhub/lock.jsonSKILL.mdfilename and SHA256 after extractiondecision,reasons,card,artifact,provenance,security,signature)This intentionally does not close #92077. Source URL requirements, publish-time source validation, pinned install syntax, richer audit commands, and sandbox-by-default remain larger follow-up decisions.
Verification
node scripts/run-vitest.mjs src/skills/lifecycle/clawhub.test.tsnode scripts/run-vitest.mjs src/cli/skills-cli.verify.test.tspnpm tsgo:corepnpm tsgo:test:srcpnpm exec oxfmt --check --threads=1 src/skills/lifecycle/clawhub.ts src/skills/lifecycle/clawhub.test.tsnode scripts/run-oxlint.mjs src/skills/lifecycle/clawhub.ts src/skills/lifecycle/clawhub.test.tsgit diff --checkReal behavior proof
Behavior addressed: ClawHub skill installs now leave local audit data that ties the install to the downloaded artifact, installed
SKILL.md, and ClawHub verification response.Real environment tested: local macOS checkout, Node v22.18.0, pnpm v11.2.2, live
https://clawhub.ai.Exact command run after this patch:
node --import tsx -e 'const fs = await import("node:fs/promises"); const os = await import("node:os"); const path = await import("node:path"); const { installSkillFromClawHub } = await import("./src/skills/lifecycle/clawhub.ts"); const root = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-clawhub-lock-proof-")); try { const result = await installSkillFromClawHub({ workspaceDir: root, slug: "openclaw-find-skills", logger: { info: (message) => console.log(`info:${message}`) } }); console.log(`result:${JSON.stringify(result)}`); if (!result.ok) process.exit(1); const lock = JSON.parse(await fs.readFile(path.join(root, ".clawhub", "lock.json"), "utf8")); const entry = lock.skills["openclaw-find-skills"]; console.log(`lock:${JSON.stringify({ version: entry.version, artifact: entry.artifact, skillFile: entry.skillFile, verification: entry.verification && { ok: entry.verification.ok, decision: entry.verification.decision, reasons: entry.verification.reasons, provenance: entry.verification.provenance, securityStatus: entry.verification.security?.status } }, null, 2)}`); } finally { await fs.rm(root, { recursive: true, force: true }); }'Observed result after fix:
{ "version": "1.0.0", "artifact": { "kind": "archive", "sha256": "9fb2b8e43f8301560f50a4484742c51e2d02be1f6a437f4d51e345f970addaca", "integrity": "sha256-n7K45D+DAVYPUKRIR0LFHi0Cvh9qQ39NUeNF+XCt2so=" }, "skillFile": { "path": "SKILL.md", "sha256": "6895c10c93ec17ca64b2b06ff15cbfa4278e7a011cb9464d9fc4b90a029af71b" }, "verification": { "ok": false, "decision": "fail", "reasons": ["security.status_not_clean"], "provenance": { "source": "unavailable", "reason": "No server-resolved GitHub import provenance is stored for this version." }, "securityStatus": "suspicious" } }What was not tested: full
openclaw skills audit/ frozen install behavior, because this PR only persists the lock data needed for those later features.