Skip to content

refactor: simplify action-ledger command wiring - #1888

Merged
obviyus merged 1 commit into
mainfrom
cleanup/row3-command-factory
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
cleanup/row3-command-factory

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Action-ledger CLI changes currently require editing a dependency factory and its runtime wiring even though the implementation has one production owner.

User Impact

No user-visible behavior or stored-format change. Publication and finalization retain their existing command interfaces.

Why This Change Was Made

First bounded slice of the dependency-lattice cleanup: remove createActionCommands and its dependency interface, import the filesystem root from its existing owner, and import production commands directly. The unrelated dashboard callback stays with runtime dispatch. Remove the test-only manifest parser export; its behavior now runs through the built CLI, real files, and a loopback Worker HTTP receiver.

The wider map and ordered migration plan are retained at ~/Developer/.agents/handoffs/clawsweeper-row3/PLAN.md (local handoff, not a deployed document). This slice does not touch report readers or apply workflow files.

OpenClaw Bay Impact

Unaffected: no lifecycle, queue, telemetry, dashboard data contract, or public display changes.

Documentation Impact

Added one changelog fragment. Existing CLI and state-storage contracts remain accurate; no command, HTTP, or stored-schema change. The local design handoff is proposed migration guidance, grounded in base f9f7db87c.

Real Behavior Proof

  • Head: 96e082abbef04c7399eaad995cba1136abaaa8cb.
  • Claim: publication rejects invalid manifests before sending data, then publishes canonical paths in order with unchanged upload accounting.
  • Surface/environment: node dist/clawsweeper.js publish-action-event-paths, Node 24.21.0 on macOS; isolated copied CLI root and loopback HTTP receiver. No production credentials or endpoints are required by the fixture.
  • Scenario: real files for all five canonical event/binding path families; empty, reversed, duplicate, and private-path manifests; valid sorted manifest with one unchanged response.
  • Observed: invalid child commands reject and send zero HTTP requests. Valid input sends matching file bytes and SHA-256 values through POST /internal/state/blobs/put in manifest order; CLI summary reports four uploads and one unchanged blob.
  • Command: node --test test/clawsweeper-action-ledger.test.ts through pueue task 1150. All 24 tests passed, including the new CLI/filesystem/HTTP proof.
  • Other checks: pnpm run build:all, pnpm run lint, pnpm run format:check passed in task 1150. codex review --base origin/main completed in task 1151 with no actionable findings.
  • Limits: local receiver proves the outbound Worker interface, not deployed Worker authentication/R2 persistence. No live apply or mutation, no stored-record growth/reads, and no full-suite run. Full-corpus memory proof is not applicable to this command-only wiring change.

Evidence

Pueue tasks 1150 (checks/proof) and 1151 (review) retain logs locally. Review independently repeated the focused build/tests and reported no actionable defects. CI remains the integration gate. Do not merge as part of this task.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces the action-command dependency factory with direct imports and replaces parser-only coverage with a built-CLI publication test.

Example: Publish a sorted manifest containing five canonical ledger files.

  • Before: The CLI reports five paths, four uploads, and one unchanged blob through factory-created handlers.
  • After: The CLI reports the same result through directly imported handlers.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and source-consistent, but the supplied test summary does not satisfy the required real-behavior proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: Removing the sole-use factory reduces maintenance work, preserves behavior, and improves publication coverage without adding configuration or public capability.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes redundant command wiring while preserving existing behavior, and current main still contains the factory. No introduced correctness defect was found.

Priority: P3
Reviewed head: 96e082abbef04c7399eaad995cba1136abaaa8cb

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide inspectable current-head CLI output and a receiver trace showing invalid manifests send no requests and the valid five-file manifest publishes in order with four uploads and one unchanged blob.
Agent review details

How this fits together

The CLI dispatcher sends publication and finalization arguments to action-ledger commands, which import local shards, finalize receipts, or upload canonical files through the signed Worker client.

flowchart LR
  A[CLI arguments] --> B[Runtime dispatcher]
  B --> C[Action commands]
  C --> D[Local ledger files]
  C --> E[Signed blob client]
  E --> F[Worker blob endpoint]
Loading

Technical review

Best possible solution:

Use the direct command exports while preserving existing CLI, provenance, publication, and finalization contracts.

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

No runtime bug is claimed; source inspection confirms the redundant factory and its sole production wiring.

Is this the best way to solve the issue?

Direct imports remove the redundant layer without creating a competing owner, and moving dashboard dispatch preserves its existing dependencies.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e8717ba669e.

Provenance checked

  • Action-command factory and runtime dispatch keeps the original intent (4b5246a: The merged runtime extraction placed action commands in a focused module; this PR retains that module and removes its dependency plumbing.)
  • Producer-attempt validation keeps the original intent (d7f1836: Retained shards from earlier workflow attempts may be imported under an explicit maximum-attempt constraint while other producer fields remain exact.)
  • Manifest validation coverage keeps the original intent (unknown: Base coverage checks sorted canonical paths and rejects private paths; targeted blame identifies earlier receipt-hardening work, but its original source diff was unavailable.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 0dfb4a4 adds test/clawsweeper-action-ledger.test.ts:119 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0dfb4a47fd25; files: test/clawsweeper-action-ledger.test.ts)

Review metrics

Metric Value Why it matters
Introduced code size Production +154/-189; tests +71/-11; changelog +1 Production shrinks by 35 lines while test growth replaces an isolated parser check with CLI and HTTP boundary coverage.

Labels

Label changes:

  • add P3: This is a bounded maintenance refactor with no intended user-visible behavior change.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a bounded maintenance refactor with no intended user-visible behavior change.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 10, 2026, 6:03 AM ET / 10:03 UTC.

@obviyus
obviyus merged commit 32cc9ab into main Oct 10, 2026
27 checks passed
@obviyus
obviyus deleted the cleanup/row3-command-factory branch October 10, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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