Repository navigation
feat(packages): move Plugin Inspector to post-acceptance monitoring - #4383
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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
81e9ef6 to
a9954fd
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR moves Plugin Inspector from publication requests into targeted post-acceptance monitoring through the existing bulk-scan workflow. Example: chain-proof-public@1.0.0 is accepted after security checks.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed follow-up removes work that current main still performs during publishing. No blocking code findings; the updated evidence satisfies the prior authority-chain proof request. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherPackage publication validates uploads and finalizes releases after security checks; the new dispatcher sends eligible public releases to the existing monitoring worker, which stores findings and SDK inventories. flowchart TD
A[Package upload] --> B[Validation and security checks]
B --> C[Release finalization]
C --> D[Eligibility checked dispatch]
D --> E[Bulk scan workflow]
F[Nightly sweep] --> E
E --> G[Protected artifact and Inspector]
G --> H[Findings and SDK inventory]
Technical reviewBest possible solution: Land the focused cutover through the existing monitoring worker while preserving validation, security gating, and legacy attempt finalization. Do we have a high-confidence way to reproduce the issue? Current main visibly invokes Inspector during publication with a 120-second budget; no target code was executed during this read-only review. Is this the best way to solve the issue? Best-fix verdict: best; reusing the existing worker removes the expensive work from its problematic runtime, whereas further cache tuning or a shorter request timeout would retain it. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11e957e751a2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Review metrics
LabelsLabel 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 (1 earlier review cycle)
Reviewed November 4, 2026, 3:08 AM ET / 08:08 UTC (Revision 2). |
2d1a246 to
7835c92
Compare
Plugin Inspector no longer runs in the publish request. After a plugin release is accepted, the production deployment dispatches a targeted, persisted, email-free run of the existing Plugin Inspector Bulk Scan workflow; the nightly sweep covers anything a dispatch misses. The publish-time Node action and its ClawHub-prepared OpenClaw target are removed.
…y Inspector both landed
7835c92 to
ca48af5
Compare
Add a disposable convex-test proof that drives an accepted public plugin release through the real publish route, check completion, scheduled finalization, the scheduled release-scan dispatcher, and the monitoring worker's artifact download, then forces a dispatch failure, makes the package private before the queued retry, and shows the retry mints no GitHub App token, sends no repository_dispatch, and the protected artifact route reads no storage. GitHub is a simulated boundary; the Actions runner is replaced by evaluating the workflow's real step expressions. Setting CLAWHUB_PLUGIN_INSPECTOR_CHAIN_PROOF=1 also runs the full worker script with the real Inspector over a loopback bridge. Replace workflow tests that pinned expression source text with tests that evaluate those expressions per event, and collapse the publish-path Inspector variants into one no-invocation case.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Summary
PR 2 of 2. #4379 (advisory Inspector and entrypoint validation) has merged; this PR's base is now
main.#4379 made Plugin Inspector advisory and moved its one real check, missing declared entrypoints, into package validation. This PR takes Inspector out of the publish request entirely. It now runs as monitoring after a release is accepted, using the repo's existing
plugin-inspector-bulk-scan.ymlworkflow:Behavior
inspectorFindings. The CLI still prints them if an older server returns them.finalizePackagePublishAttemptInternalpublishes the release and records the attempt finalized.pluginInspectorDispatch:dispatchPluginInspectorReleaseScanInternal.clawhub-plugin-inspector-release-scanrepository_dispatchevent (payload:package_name,version,release_id).SECURITY_SCAN_EVENT_DISPATCH_ENABLEDswitch and GitHub App credentials (contents: writeis already required for security-scan dispatch).CLAWHUB_ENVunset orproduction, and not a preview), because the workflow scans the production site.plugin-inspector-bulk-scan.yml):repository_dispatchtrigger that mapsclient_payload.package_nametoPLUGIN_INSPECTOR_PACKAGE_NAMES.dry_runis 0) and never email owners. Notify and notification-only stay 0.clawhub-plugin-inspector-release-scan-<package>), so a burst of publishes is not collapsed into one pending run;clean/findings/tool_failure/timeoutoutcomes from fix(packages): make Plugin Inspector advisory and validate declared entrypoints #4379 are recorded by the bulk-scan ingest. A failed rescan never replaces a completed verdict, and tool failures never become findings.convex/packageInspectorNode.ts(the publish-time Node action);convex/lib/openClawInspectorTarget.ts(the ClawHub-prepared OpenClaw target cache that existed only to fit the 512 MiB action);@openclaw/plugin-inspectordependency and its version are unchanged; the bulk scan still uses it.Authority-chain proof
This answers the ClawSweeper proof request. The question: does an accepted public release go through finalization, queued dispatch and the worker, and is a release made private before its queued retry refused before any credentialed effect or artifact read?
Where:
convex/pluginInspectorReleaseScan.chain.runtime.test.ts, run in a disposable in-process convex-test backend. Nothing reaches GitHub, a ClawHub deployment or production data. No production release was created.Real in the proof:
POST /api/v1/packagespublish route (code-plugin ClawPack).claimPrePublicationChecks/completePrePublicationChecks.finalizePackagePublishAttemptInternal.dispatchPluginInspectorReleaseScanInternaland its 60 s retry.getPluginInspectorReleaseScanTargetInternal./api/v1/package-inspector/artifactroute.scripts/package-inspector-nightly-scan.ts.CLAWHUB_PLUGIN_INSPECTOR_CHAIN_PROOF=1: the full script runs as a child process, with the real Plugin Inspector and its public npm OpenClaw beta target, over a loopback HTTP bridge to the backend.resolveTargetPackageItemsanddownloadPackageArtifactForScanrun in-process.Simulated external boundary (labeled; task-only fixtures):
repository_dispatchAPI. The App key is generated per run, and the token isghs_SIMULATED_REDACTED.plugin-inspector-bulk-scan.ymlstep expressions for the captured dispatch event; onlyCLAWHUB_SITE_URL(the bridge) and the artifact directory are substituted.Any other outbound fetch fails the test.
How effects are observed:
storage/getBlobsyscall, tagged by phase.clawhub/plugin-inspector-release-scan-dispatchUser-Agent. The existing security-scan dispatch shares the App, so it shows up separately as unrelated.How privatization is applied: no owner flow switches an existing public package to private, so the proof sets
packages.channel = "private". That is the same field a private-channel publish writes, and the field every eligibility check reads.Redacted run at
f76aaf1a621abc2c6cf352d5b7c055e600e15716, clean tree, full workerNegative controls (same head, each check removed in turn, then restored)
Result:
package_name,version,release_id). The real worker downloads the protected artifact (1 storage read), runs Inspector, and records acleannightly scan state.repository_dispatch, and read no storage.Boundary limits: this proof does not exercise the real GitHub App, real GitHub Actions, or a deployed Convex backend. It also does not exercise the Convex Node runtime; convex-test runs the functions in Node.
Tests
convex/pluginInspectorReleaseScan.chain.runtime.test.ts: the chain proof above. In CI it runs without the flag.convex/packages.public.test.ts("Plugin Inspector stays out of the publish request"):convex/packageInspectorAdvisory.runtime.test.ts(convex-test):dispatchPluginInspectorReleaseScanInternal({ releaseId, retryCount: 0 }).convex/pluginInspectorDispatch.test.ts: production-only gating, the dispatch payload, bounded retries, and latest-public targeting.src/__tests__/package-publish-workflow.test.ts: the assertions that pinned YAML expression text are gone.if:,env:,timeout-minutesandconcurrencyexpressions are now evaluated forrepository_dispatch, manual-dispatch defaults, andschedule. The evaluator issrc/__tests__/helpers/githubWorkflowExpression.ts.e2e/local-auth/plugin-inspector-findings.pw.test.ts: warning findings are asserted after the targeted monitoring scan.Commands at
f76aaf1a:bunx tsc --noEmit,bunx tsc -p convex/tsconfig.json --noEmit,bun run ci:types:packages(schema, CLI, admin): pass.bun run ci:static: pass.packages.public): 510 tests pass.bun run ci:unit: all touched suites pass. The only local failures are timing-sensitive scanner and Endor wrapper tests in untouched files; they also fail onmainunder local load.DeploymentQuotaReached(300 preview deployments). That is infrastructure, not this patch.Spec:
specs/plugin-inspector-reliability.md. Docs:docs/publishing.md.Follow-ups