Skip to content

refactor(cli): consolidate skill workshop command dispatch - #119640

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0805-cli-dmvazq
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0805-cli-dmvazq

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Skill Workshop CLI commands independently repeated workspace selection, proposal-draft construction, JSON versus text rendering, failure handling, and lifecycle-transition registration. This maintainer-requested cleanup removes 115 production lines from one CLI owner.

Why This Change Was Made

Introduce one canonical Workshop workspace/result/error dispatcher and one shared proposal-draft flow; register rejection and quarantine through the same existing lifecycle owner. Keep the Skills CLI lazy boundary, public command ordering, operator flags, help text, defaults, stdout/stderr behavior, agent/account scope, approval policy, scanner enforcement, credential handling, and Gateway-owned apply/fallback dispatch unchanged.

User Impact

No user-visible behavior change: all 24 recursive Commander command/help/option trees were identical before and after, and 100 real Commander 15 parsing/dispatch comparisons preserved JSON output, root/workshop/inferred agent precedence, draft validation, lifecycle transitions, correlation IDs, errors, credential/offline fallback, and fail-closed remote Gateway behavior.

Evidence

  • Production delta: +133/-248 across src/cli/skills-cli.ts (net -115); no config, schema, baseline, or dependency changes.
  • Direct Commander 15 baseline-versus-candidate execution: 24 identical public command/help/option/default trees and 100 identical behavior scenarios.
  • Trusted Blacksmith Testbox: 246 passing tests across 13 CLI, Workshop lifecycle/evaluation/security-policy, Gateway proposal, and unified-approval files (four Vitest projects).
  • Full remote pnpm check:changed passed, including production and test TypeScript, lint, SDK baseline, plugin boundaries, dead-code scans, native schema, webhook authentication order, pairing-account security, and runtime import cycles.
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/31011239432
  • Fresh independent structured Codex autoreview using model gpt-5.6-sol with xhigh reasoning: clean; confidence 0.98.
  • AI-assisted implementation and independent review.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 14:02
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:08 AM ET / 14:08 UTC.

ClawSweeper review

What this changes

The PR centralizes Skill Workshop CLI workspace resolution, output rendering, error handling, draft preparation, and rejection/quarantine registration without changing public commands.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Source review found no actionable correctness or security defect; this active maintainer-labeled CLI refactor should proceed through normal exact-head CI and maintainer merge handling.

Priority: P3
Reviewed head: 55f4e6f32e7a45e6bf53a23483cc63c61fd9419c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The source-level consolidation is clean and preserves the existing owner boundaries; exact-head CI is the remaining merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled behavior-neutral refactor includes command-comparison and Testbox evidence in its body; the external-contributor proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled behavior-neutral refactor includes command-comparison and Testbox evidence in its body; the external-contributor proof gate does not apply.
Evidence reviewed 6 items Exact-head dispatcher: The shared dispatcher preserves the prior order of workspace resolution, action execution, JSON/text output, and error/exit handling; each command delegates the same operation as before.
Inherited agent selection: The old handlers passed each child command's parent, which is the Workshop command; the new helper passes that same Workshop command, and inherited option lookup walks parent commands.
Lifecycle owner remains unchanged: Create, update, revise, rejection, and quarantine validation, scanning, state transitions, and event dispatch remain owned by the unchanged Workshop service.
Findings None None.
Security None None.

How this fits together

The Skills CLI resolves an agent workspace, invokes Workshop proposal lifecycle services or Gateway operations, and renders JSON or text to the operator. This refactor consolidates the CLI orchestration while leaving lifecycle enforcement in the Workshop service layer.

flowchart LR
A[Operator command] --> B[Workshop command parser]
B --> C[Shared CLI dispatcher]
C --> D[Workspace resolution]
D --> E[Workshop or Gateway operation]
E --> F[JSON or text result]
C --> G[Error and exit handling]
Loading

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled behavior-neutral refactor includes command-comparison and Testbox evidence in its body; the external-contributor proof gate does not apply.
  • Resolve merge risk (P1) - Exact-head CI is still in progress, so merge readiness remains unconfirmed despite the source-level equivalence review.
Agent review details

Security

None.

PR surface

Source -115. Total -115 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 133 248 -115
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 133 248 -115

Review metrics

Metric Value Why it matters
Production versus test delta production +133/-248 (net -115); tests 0 The patch removes repeated command orchestration, but it adds no committed regression coverage for the refactored command registrations.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one local CLI dispatcher that delegates unchanged proposal and lifecycle services, then merge after exact-head checks confirm the existing command contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one local CLI dispatcher that delegates unchanged proposal and lifecycle services, then merge after exact-head checks confirm the existing command contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR does not claim to fix a bug. Source comparison and existing CLI coverage establish the relevant behavior boundary.

Is this the best way to solve the issue?

Yes. A local shared command-boundary dispatcher removes duplicated orchestration while Workshop services continue to own validation, scanning, lifecycle transitions, and events.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 03a9e022ed83.

Labels

Label changes:

  • add P3: This is a behavior-neutral CLI cleanup with no demonstrated user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled behavior-neutral refactor includes command-comparison and Testbox evidence in its body; the external-contributor proof gate does not apply.

Label justifications:

  • P3: This is a behavior-neutral CLI cleanup with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled behavior-neutral refactor includes command-comparison and Testbox evidence in its body; the external-contributor proof gate does not apply.

Evidence

What I checked:

  • Exact-head dispatcher: The shared dispatcher preserves the prior order of workspace resolution, action execution, JSON/text output, and error/exit handling; each command delegates the same operation as before. (src/cli/skills-cli.ts:973, 55f4e6f32e7a)
  • Inherited agent selection: The old handlers passed each child command's parent, which is the Workshop command; the new helper passes that same Workshop command, and inherited option lookup walks parent commands. (src/cli/cli-utils.ts:60, 03a9e022ed83)
  • Lifecycle owner remains unchanged: Create, update, revise, rejection, and quarantine validation, scanning, state transitions, and event dispatch remain owned by the unchanged Workshop service. (src/skills/workshop/service.ts:262, 03a9e022ed83)
  • Existing behavior coverage: Current integration-style CLI coverage exercises proposal creation, listing, inspection, revision, application, workspace relocation, and missing-draft failure behavior. (src/cli/skills-cli.workshop.test.ts:155, 03a9e022ed83)
  • Current-main comparison: The PR merge base is 85fd4c9, and current main has no subsequent change to the touched CLI file; the branch being behind does not create a touched-path conflict. (src/cli/skills-cli.ts:973, 03a9e022ed83)
  • Feature history: Recent CLI behavior work includes machine-readable output preservation, supplying relevant ownership context for the shared output path. (src/cli/skills-cli.ts:565, 433bb3f954ed)

Likely related people:

  • steipete: Recent history includes fixes to Skills CLI command and JSON-output behavior, and this contributor authored the current refactor. (role: recent CLI contributor; confidence: medium; commits: 433bb3f954ed, 269bc5c89e71; files: src/cli/skills-cli.ts)
  • Shubhankar Tripathy: Available blame records the current copied-in CLI file at commit 1aeecb9; shallow history makes earlier ownership uncertain. (role: recorded current-file introducer; confidence: low; commits: 1aeecb9be64c; files: src/cli/skills-cli.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 36dbbd7 into main Aug 5, 2026
189 checks passed
@steipete
steipete deleted the codex/loc-0805-cli-dmvazq branch August 5, 2026 16:07
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant