Repository navigation
fix(skills): allow ordinary command examples in authored skills - #163239
jesse-merhi wants to merge 4 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. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR allows command and environment-token examples in authored skills while continuing to reject recognized literal credentials. Example: Create git-versions with an example importing child_process and calling execFile("git", ["--version"]).
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current authoring failure with a focused shared-scanner change; no actionable introduced defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherWorkshop and personal Library authoring validate skill instructions and support files before versioned publication; explicit security audits independently run the full diagnostic scanners. flowchart TD
A[Authored skill bundle] --> B[Workshop or Library]
B --> C[Literal credential scan]
C --> D[Existing policy and authority]
D --> E[Versioned skill storage]
E --> F[Readback and restore]
A --> G[Explicit full security audit]
Technical reviewBest possible solution: Use credential-only authoring admission through the shared scanner while retaining explicit full audits and existing publication safeguards. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically rejects the supplied child_process and environment-token examples, corroborated by the author's matched Gateway baseline results; no target code was run during this review. Is this the best way to solve the issue? The focused shared-owner change covers both authoring paths, preserves credential detection and explicit audits, and implements the maintainer-approved policy without adding configuration or another admission owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd32ddcdbd87. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -4, Tests +71, Docs +2. Total +69 across 8 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed October 13, 2026, 1:15 AM ET / 05:15 UTC (Revision 10). |
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What this changes
Ordinary command examples and environment-token API code currently fail the authoring security check. Workshop refuses the write, and the personal Skill Library refuses publication. This PR limits those admission checks to recognized literal credentials. Explicit security audits and plugin scans retain the full source/prose diagnostics.
Current main replaced Workshop proposals with direct, versioned writes. This branch preserves that cutover and applies the policy through the existing shared bundle scanner. It does not restore retired proposal APIs, tests, or docs. Operator install policy, live authority checks, path validation, immutable Library revisions, and Workshop version/restore behavior retain their existing owners.
Change breakdown
Production shrinks by four lines. Test proof adds 71 net lines: two Library cases, an extension of an existing Workshop journey, and the database-worker registration. The prior plain-credential permutation, dedicated unchanged operator-policy case, and replacement manual-quarantine hook case were retired without replacement. Main separately retired the entire proposal lifecycle. No additional Workshop case is added.
Before and after
The existing Workshop create/write/archive/restore journey now contains these inert authored examples in both
SKILL.mdandscripts/deploy.js:Before: temporarily restoring main's shared scanner made the actual
createWorkshopSkillentry point refuse the Markdown:After: the same journey creates the skill, writes the support file, archives it, restores it, and reads back the exact instruction and support bytes. The persisted file list is
SKILL.mdplusscripts/deploy.js. The accepted scripts are authored bytes; they are never executed by this proof.The Library encoded-file denial remains because scanning transport base64 instead of decoded bytes could leak a credential into a durable artifact. The two publication journeys exercise separate real owners and stores. Dedicated plaintext and policy guard coverage was deliberately retired; this is not a claim that another test duplicates every assertion.
Matched current Gateway proof
The same authored fixtures were sent to two real, separately built Gateways, using the shipped CLI and documented token-authenticated HTTP tool endpoint. The integrated main baseline is
c4887fb7de365414df4afe27dcb61947bfab9cae; the feature is the pushedcddad34c227da1fd564aaf18831c9d7710e82e46. Each has isolated config, SQLite state, workspace, and loopback port. Both use the existing Node 24.18.1 / pnpm 12.7.0 runtime and unchanged frozen dependencies. Channels, providers, discovery, schedulers, and background learning are disabled; foreground tool policy explicitly allowsskill_workshop.Requests use
POST /tools/invoke,Authorization: Bearer <isolated-operator-token>, and:{ "tool": "skill_workshop", "agentId": "proof", "sessionKey": "agent:proof:manual", "args": { "action": "create", "name": "git-versions", "content": "<complete SKILL.md containing the exact command fixture above>" } }dangerous-exec; no skill or artifactenv-harvesting; no skill or artifactSKILL.md+scripts/deploy.jsliteral-secret; absent from live list and filesystemThe main Gateway's live list is empty. The feature Gateway lists both
api-tokenandgit-versions. HTTP readback and direct artifact comparison match the authored bytes. The shippedpnpm openclaw skills workshop --agent proof show git-versions --jsonalso returns those instructions and both file names. This proves actual Gateway authentication, policy, tool construction, publication, versioning, restoration, and readback without mocking a first-party owner. Authored scripts were never executed.This is shared-operator token authentication on an isolated Gateway. It does not claim a signed-in personal Library CLI flow or a live-provider turn. Library publication and decoded-file refusal retain the real worker/SQLite/filesystem proof above. No new permanent test, source change, or public API is added for this proof.
Validation
Merged main at
c4887fb7de365414df4afe27dcb61947bfab9caeto resolve actual conflicts. Main's new shared scanner and direct Workshop owner are preserved. A read-only merge check with current mainbf58e95ee3f583c338f48225ad9c5b3479e7d8d7is conflict-free; it was not merged merely for advancing.One scoped simplification and fresh independent standards and correctness assessments cover the final eight-path diff. No actionable findings. Reviews inspected source; execution belongs to the checks below.
node scripts/run-vitest.mjs src/skills/library/service-admission.test.ts src/skills/library/service.test.ts src/skills/workshop/library.test.ts src/skills/security/scanner.test.ts --bail=1: 85 passed across four files in 76.59s on Node 24.18.1, pnpm 12.7.0, macOS ARM64. Library admission 2, Library service 26, Workshop 10, scanner 47.The first merged-head batch stopped at ZIP extraction (
native file copy failed). Diagnosis found fs-safe 0.25 resolving the stale 0.21 native helper because the expected 0.25 helper was missing. A frozen-lockfile reinstall repaired this prerequisite. The complete same selection then passed, including ZIP extraction. No source/test assertion or dependency manifest was changed to conceal the failure.The changed-check plan passed formatting, production types, all 27 core test type graphs, dead exports, core/scripts lint, and selected repository guards. Results were completed across the original command and resumed remaining commands; passing steps were reused. The dead-export prerequisite needed access to pnpm's normal cache. An initial standalone lint command omitted the changed-check owner's environment and reported 11 unchanged max-lines violations; the actual scoped configuration passed without source or rule changes.
pnpm test src/skills/library/service-admission.test.ts --maxWorkers=1: 2 passed, command wall 26.27s, Vitest 5.85s.pnpm test src/skills/workshop/library.test.ts --maxWorkers=1: 10 passed, command wall 40.04s, Vitest 19.40s. These macOS measurements ran during other validation work and are not a comparable before/after performance baseline. In current PR CI, Library admission passed 2 cases in 6.05s from shard begin to end (5.64s runner; 3.59s Vitest), and Workshop passed 12 cases in 30.54s (30.19s runner; 28.40s Vitest). These Linux x64 measurements cover the provider’s PR merge checkout; they are per-file costs, not the total job including installation/build. Both browser jobs also passed. The complete native CI workflow and all automatic checks passed: 65 passed, none failed or pending at final verification before the proof update.The selected mocked-Gateway Control UI browser lane passed 78 tests across 23 files in 201.48s on native macOS ARM64. This is shared-harness coverage, not visual proof of this backend feature.
Current mapped native runtime checks stopped at the unchanged macOS-only APFS cold/warm/sparse provisioning journey: 15 sibling cases and the Bun SQLite-admission partition passed, while that journey exceeded its existing 120-second deadline (153.65s observed). Its test and provisioning owners are byte-identical to the integrated main baseline. The selected Linux CI job skips this Darwin-only case; its Linux filesystem case remains platform-only proof. No timeout or assertion was changed, and this result is not reported as a passing row. The exact failure cause is unresolved.
The final aggressive-selection/hybrid-runner map contains 10 runtime rows covering 58 distinct files. Nine rows passed locally with the pinned native OpenClaw Bun fork and Node 24.18.1; the remaining row has the macOS-only failure described above. Shared UI and browser-extension prerequisites also passed. The browser-extension Chromium flow paired its native host, attached tabs, revoked a paused tab, and cleaned up its relay/MCP/HTTP servers: 1 passed, Vitest 79.59s. Its first attempt stopped before testing on an abandoned build lease left by an interrupted validation worker; the verified task-owned lease was recovered, then the canonical command completed.
Additional production/test type graphs, all selected extension lint stripes, SDK package-boundary compile (Codex, Slack, Telegram), Zoom canary, additional boundaries, prompt snapshots, source contracts, guards, architecture/Kysely, formatting, and plugin inventory passed. Protocol registry/generation, Swift/Kotlin determinism, since metadata, and mobile event coverage also passed. Documentation content passed too (0 broken links); its first attempt could not enter pnpm’s normal dlx cache, and the same command completed with native cache access. The exact-base private-key scanner also passed.
Admission policy
Credential-only admission is the existing maintainer-authorized scope. Non-credential heuristics, including execution, pipe-to-shell, mining references, and environment/network combinations, do not veto authored content. This accepts that content-policy tradeoff while keeping literal-credential refusal, operator policy, runtime permissions, and current authority checks. Publishing instructions does not execute support scripts. No schema, public record shape, dependencies, or configuration options are added by this feature.
How to verify
Run the focused command above with isolated test fixtures. Ordinary command/API examples must publish and survive readback/restoration with matching bytes. An encoded support file containing a recognized synthetic credential must leave no published entry or artifact. Full scanner tests must continue to report their source/prose diagnostics for explicit audit callers.
Apply-time quarantine of a historical credential-bearing proposal was not proved before its owner was retired by main. The current direct Workshop credential/path denials and version restoration are exercised by the existing Workshop suite.
Historical evidence and limits
Historical proposal CLI traces belong to an owner retired by main; they are superseded here by the matched current Gateway proof above.
Earlier local emulated Linux UI/Gateway failures remain unresolved: the Canvas dashboard moved vertically after focus, provider-browser login hit its 120-second deadline, and the second Gateway lane hit custody/file-lifecycle and readiness deadlines. Diagnostic replays did not establish a repair or baseline cause. No timeouts or assertions were weakened. Later native CI passes are not proof of those failures' cause or repair. This feature does not change those owners, and the current planner selects shared Control UI and browser-extension checks, and no real-Gateway or native-app lane. There is no live-provider, live operator Gateway, or signed-in Library CLI proof in this update.