Skip to content

feat(ledger): record ClawSweeper action lifecycles - #521

Merged
vincentkoc merged 354 commits into
mainfrom
feat/action-ledger-repair-ops
Jul 14, 2026
Merged

vincentkoc merged 354 commits into
mainfrom
feat/action-ledger-repair-ops

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add an immutable, privacy-bounded action ledger for all six ClawSweeper families: Review, Command, Repair, Apply, Operations, and Evidence
  • instrument review batches/items/retries, Codex log publication, durable review comments, command routing, repair execution, apply mutations, notifications, status/dashboard/session updates, proof handling, and target fanout
  • make external mutations replay-safe with pre-request attempt/outcome receipts, stable business idempotency, authenticated producer shards, exact finalization, and fail-closed mutable state publication
  • recover target-fanout reruns only from the original run's complete accepted receipt batch, avoid duplicate dispatches, and anchor cursor progress to repository identity so inventory or default-branch changes cannot shift work
  • define Gitcrawl snapshot/query/evidence-binding events plus provider-neutral evidence-service request/deploy/rollback phases; the Cloudflare Gitcrawl service can emit this contract in the follow-up integration, but this PR does not deploy or modify that service
  • harden review context byte budgets and reject worker receipt-capability downgrade, unreadable-marker, and removed-marker paths before credential-bearing publication

Validation

  • pnpm run check
  • focused review/action/workflow suite: 198 passed
  • focused target-fanout and mutation suite: 36 passed
  • high-reasoning local ClawSweeper reviews for review-context, capability-boundary, and fanout-replay slices: no correctness or security findings
  • git diff --check
  • private-path/address scrub across the complete diff

Notes

  • CHANGELOG.md is release-owned and intentionally unchanged
  • no external service deployment is included
  • the production Gitcrawl/Cloudflare adapter and hydration verification remain a separately reviewable follow-up built on the Evidence-family contract landed here

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 13, 2026, 11:06 PM ET / July 14, 2026, 03:06 UTC.

Summary
The branch extends the immutable action ledger across review, command, repair, apply, operations, and evidence workflows, adding replay-safe mutation receipts, artifact and state handoffs, recovery logic, schemas, documentation, and focused tests.

Reproducibility: not applicable. This PR adds a new cross-family audit and recovery capability rather than fixing one established failing behavior. The relevant validation target is exact-head workflow and trust-boundary behavior.

Review metrics: 3 noteworthy metrics.

  • Patch surface: 197 files; +53,271/-3,658. The change spans nearly every automation family, so review and rollout cannot be treated as a narrow ledger helper update.
  • Commit surface: 354 commits. The long force-pushed history and accumulated fixes make exact-head review more important than relying on earlier cycle conclusions.
  • Security alerts: 3 CodeQL review alerts. All three identify workflow_run artifact-poisoning paths that require explicit trust-boundary disposition before merge.

Root-cause cluster
Relationship: canonical
Canonical: #521
Summary: This PR is the canonical remaining all-family lifecycle-ledger change; the two related merged PRs are prerequisite implementation slices rather than competing fixes.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🌊 off-meta tidepool
Patch quality: 🦐 gold shrimp
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Provide an alert-by-alert security disposition for the three CodeQL artifact-poisoning paths.
  • Complete the exact-head repository check and preserve its result on the final reviewed SHA.
  • Define the monitored rollout and rollback owner for the first production lifecycle runs.

Risk before merge

  • [P1] Three CodeQL review alerts identify potential poisoning of artifacts consumed by workflow_run-triggered automation; the validation chain needs alert-by-alert maintainer confirmation before privileged state publication is accepted.
  • [P1] The branch changes core review, repair, apply, notification, dashboard, state-hydration, and fanout paths together, so a rollout defect could stall several production automation families rather than one isolated lane.
  • [P1] Fail-closed ledger finalization and publication are intentional, but maintainers must confirm that secondary ledger outages cannot unnecessarily suppress or misreport the primary workflow outcome.

Maintainer options:

  1. Prove artifact provenance before merge (recommended)
    Document and verify each CodeQL-flagged handoff from the exact trusted producer through digest validation to the first credentialed publication step.
  2. Separate the privileged handoff
    Split workflow_run artifact collection and credentialed publication into a smaller follow-up while retaining independently safe lifecycle instrumentation here.
  3. Pause the all-family rollout
    Keep the PR open until the security-boundary review and exact-head validation make the broad automation rollout supportable.

Next step before merge

  • [P2] A maintainer should resolve the artifact security-boundary alerts and approve the broad production rollout; there is no single narrow mechanical repair to queue.

Maintainer decision needed

  • Question: Do the current workflow_run artifact validation and capability checks sufficiently prevent attacker-controlled artifact bytes from reaching credentialed state publication in every CodeQL-flagged path?
  • Rationale: The PR deliberately creates new trust boundaries between credential-isolated producers and privileged collectors; static alerts cannot determine whether the repository-specific run identity, artifact binding, and schema checks are sufficient for the intended threat model.
  • Likely owner: Peter Steinberger — The available history most strongly connects this person to repair workflow credentials, artifact handling, publication boundaries, and operational rollout behavior.
  • Options:
    • Verify each trust chain (recommended): Require an alert-by-alert walkthrough or focused proof showing producer SHA, run attempt, artifact identity, manifest, digest, and schema checks all complete before any credentialed mutation.
    • Split privileged collectors: Land non-privileged ledger instrumentation first and move workflow_run artifact import and state publication into a narrower security-reviewed follow-up.
    • Accept monitored rollout: Accept the current mitigations and merge with explicit monitoring and rollback ownership for the first production lifecycle runs.

Security
Needs attention: The current head adds substantial credential and artifact trust-boundary code, and three CodeQL artifact-poisoning review alerts need explicit maintainer disposition before merge.

Review details

Best possible solution:

Land the ledger through a staged, monitored rollout after every privileged artifact consumer has an explicit producer/run-attempt/name/manifest/digest trust proof and failure-path coverage showing ledger outages preserve the primary workflow result.

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

Not applicable: this PR adds a new cross-family audit and recovery capability rather than fixing one established failing behavior. The relevant validation target is exact-head workflow and trust-boundary behavior.

Is this the best way to solve the issue?

Unclear pending security review: immutable replay-safe lifecycle receipts are a coherent solution, but the privileged artifact handoffs must be proven safe and operationally isolated enough for the repository's production automation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3ab249b8c043.

Label changes

Label changes:

  • add merge-risk: 🚨 security-boundary: Credentialed workflow_run collectors consume artifacts produced across a lower-trust execution boundary, and CodeQL flagged three potential poisoning paths.
  • add merge-risk: 🚨 availability: New fail-closed finalization and publication gates could stall multiple automation lanes if recovery or ledger infrastructure misbehaves.

Label justifications:

  • P2: This is substantial automation and reliability work with broad but non-emergency production impact.
  • merge-risk: 🚨 automation: The PR changes review, repair, apply, proof, notification, fanout, and publication automation across many workflows.
  • merge-risk: 🚨 security-boundary: Credentialed workflow_run collectors consume artifacts produced across a lower-trust execution boundary, and CodeQL flagged three potential poisoning paths.
  • merge-risk: 🚨 availability: New fail-closed finalization and publication gates could stall multiple automation lanes if recovery or ledger infrastructure misbehaves.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The external-contributor proof gate does not apply because the author association is MEMBER; the reported checks remain useful supplemental validation, while production rollout proof is a maintainer merge-risk decision.
Evidence reviewed

Security concerns:

  • [high] Resolve the workflow_run artifact-poisoning alerts
    Credentialed collectors consume artifacts originating in separate workflow runs. Confirm for each flagged path that exact trusted producer identity, run attempt, artifact name, manifest, expected paths, and content digests are validated before extraction results can influence commands or state publication.
    Confidence: 0.86

What I checked:

  • Current unique implementation: Against current main, the PR still changes 197 files with 53,271 additions and 3,658 deletions, including new recovery/runtime code and extensive workflow instrumentation; the central work is therefore not already implemented on main. (src/action-ledger-recovery.ts:1, b37f1f0a1e45)
  • Merged ledger foundations: The review/apply foundation from feat(ledger): instrument review and apply actions #512 and command lifecycle work from feat(ledger): record command action lifecycles #520 are merged, but they are prerequisite slices rather than replacements for this PR's remaining repair, operations, evidence, and cross-workflow work. (src/action-ledger.ts:74, 3630fff1700f)
  • Command foundation provenance: The merged command-ledger pull request provides another established base for the current branch's broader lifecycle model. (src/action-ledger.ts:74, f1b69ea5be2a)
  • Prior finding resolved: The previous ClawSweeper cycle requested removal of release-owned changelog edits; CHANGELOG.md is absent from the current changed-file set, and the current PR body explicitly records that it remains unchanged. (CHANGELOG.md, b37f1f0a1e45)
  • Artifact trust alerts: GitHub Advanced Security posted three current-head review comments identifying potential artifact-poisoning paths in workflow_run artifact consumption. The PR adds validation and capability binding, but each alert still needs maintainer-visible confirmation that untrusted artifact bytes cannot influence privileged publication before complete producer, run-attempt, name, manifest, and digest checks. (.github/workflows/repair-publish-results.yml, b37f1f0a1e45)
  • Repository policy: The supplied full AGENTS.md requires member-authored items to remain open for explicit judgment and directs conservative review of workflow, state-publication, and repair automation changes. (AGENTS.md:20, 3ab249b8c043)

Likely related people:

  • vincentkoc: Authored the merged review/apply and command-ledger foundations and has established current-main history in the shared ledger runtime beyond merely proposing this PR. (role: action-ledger feature owner and recent area contributor; confidence: high; commits: 3630fff1700f, f1b69ea5be2a, 99774a5914e8; files: src/action-ledger.ts, src/action-ledger-runtime.ts, src/repair/action-session.ts)
  • Peter Steinberger: Repository history cited by the prior review ties sustained repair workflow, credential isolation, artifact handling, state publication, and error-path work to this contributor. (role: repair workflow owner and recent area contributor; confidence: high; commits: 54ead181ad1e, 0dc8a96fbdae, a3eb40061db9; files: .github/workflows/repair-cluster-worker.yml, .github/workflows/repair-publish-results.yml, src/repair/issue-implementation-status.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 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.
Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-12T18:36:00.396Z sha 0f07ef0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T20:49:12.894Z sha b03a99b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T21:15:38.878Z sha 203dfa4 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T21:47:59.146Z sha 84a9a95 :: needs changes before merge. :: [P2] Remove the release-owned changelog entries
  • reviewed 2026-07-13T00:34:40.405Z sha 84a9a95 :: found issues before merge. :: [P2] Remove the release-owned changelog entries
  • reviewed 2026-07-13T00:45:36.437Z sha dddd6e9 :: found issues before merge. :: [P2] Remove the release-owned changelog entries
  • reviewed 2026-07-13T01:53:49.456Z sha 057682d :: needs changes before merge. :: [P2] Remove the release-owned changelog entries
  • reviewed 2026-07-13T02:20:41.100Z sha e14118a :: needs changes before merge. :: [P2] Remove the release-owned changelog entries

@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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 12, 2026
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-command-actions branch from 97b6a0b to 3bc9189 Compare July 12, 2026 18:25
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-repair-ops branch from 0ebc44e to 0f07ef0 Compare July 12, 2026 18:31
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 12, 2026
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-command-actions branch 2 times, most recently from 306e643 to 2508b86 Compare July 12, 2026 23:48
Base automatically changed from feat/action-ledger-command-actions to main July 13, 2026 00:29
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 13, 2026
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-repair-ops branch 2 times, most recently from dddd6e9 to 057682d Compare July 13, 2026 01:49
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-repair-ops branch from e14118a to 029db9d Compare July 14, 2026 02:51
@vincentkoc vincentkoc changed the title feat(ledger): record repair operation lifecycles feat(ledger): record ClawSweeper action lifecycles Jul 14, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 14, 2026 02:51
@vincentkoc
vincentkoc requested a review from a team as a code owner July 14, 2026 02:51
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 14, 2026
@vincentkoc
vincentkoc merged commit b30773a into main Jul 14, 2026
9 checks passed
@vincentkoc
vincentkoc deleted the feat/action-ledger-repair-ops branch July 14, 2026 03:10
steipete added a commit that referenced this pull request Jul 14, 2026
Reverts merge commit b30773a while preserving follow-up #539 and #545 behavior.
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…ir-ops

feat(ledger): record ClawSweeper action lifecycles
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Reverts merge commit c0aa0bc while preserving follow-up openclaw#539 and openclaw#545 behavior.
valkyriweb added a commit to valkyriweb/clawsweeper that referenced this pull request Oct 24, 2026
* fix(repair): harden Codex debug artifact redaction (port upstream openclaw#521 series)

Ports the collect-codex-debug.ts redaction hardening from the upstream
openclaw/clawsweeper openclaw#521 branch (bec62b7, e78ad90, 05be322,
bb63b8b, 63379b3, 435f1a7, 01bb8fd, 18ae1be, 964322a,
3ae9782). Upstream reverted all of openclaw#521 in 29ee3d3 together with
the action-ledger work, so this is not on upstream main.

Left out: upstream's internal-model redaction, which belongs to their
private-inference setup. Adds codexSensitiveEnvValues() to codex-env.ts
without changing codexEnv().

* docs(upstream): record #256 adoption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants