Skip to content

feat(ledger): instrument review and apply actions - #512

Merged
vincentkoc merged 17 commits into
mainfrom
feat/action-ledger-review-apply
Jul 12, 2026
Merged

vincentkoc merged 17 commits into
mainfrom
feat/action-ledger-review-apply

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • dual-write immutable action receipts for review batches/items/retries, review logs/comments, apply actions/batches, and publication phases
  • bind operation and idempotency identities to immutable review/apply inputs, keeping retry and comment-publication keys stable and separate
  • recover start-only review attempts deterministically on timeout before sealing/publishing ledger state
  • reserve published for externally durable receipts; local review records, logs, and apply reports terminate as completed
  • wire explicit workflow activation, proof artifacts, and focused identity, retry, interruption, timeout, and workflow coverage

Validation

  • pnpm --config.verify-deps-before-run=false run check
    • unit: 1,097 passed, 2 platform skips, 0 failed
    • repair: 884 passed, 0 failed
    • changed coverage: 100% lines, 86.90% branches, 100% functions
    • full coverage: 74.58% lines, 73.28% branches, 84.48% functions
    • all 362 files matched formatting
  • pnpm --config.verify-deps-before-run=false run build:all
  • focused runtime/workflow suites: 135 passed, 2 platform skips
  • test/sweep-workflow.test.ts: 57 passed
  • git diff --check

The branch is rebased onto current main; hosted CI and exact-head autoreview are the remaining gates.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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 12, 2026, 6:39 PM ET / 22:39 UTC.

Summary
The PR adds immutable action receipts, stable operation and idempotency identities, interruption recovery, and ledger finalization and publication across review, retry, comment-sync, apply, and workflow paths.

Reproducibility: yes. Source inspection and focused workflow tests establish the deliberate path where primary work succeeds, required ledger publication fails, and primary-result gates still allow required continuations; this reproduces the operational tradeoff rather than a current-main bug.

Review metrics: 4 noteworthy metrics.

  • Changed surface: 14 files, +7,536/-430. The branch spans the central runtime, production workflow, documentation, and focused tests.
  • Workflow expansion: 1 workflow, +567/-27. Job conditions, failure propagation, publication, and continuation behavior carry the main merge risk.
  • Review continuity: 12 completed cycles. The earlier P1 apply-independence blocker was repaired, and the current head has no remaining line-level finding.
  • Focused tests: 7 test files, +2,656/-75. The branch includes extensive identity, retry, interruption, timeout, mutation-ordering, and workflow coverage.

Root-cause cluster
Relationship: canonical
Canonical: #512
Summary: This PR is the canonical review/apply integration base for the ledger stack; the merged core precedes it, while command and repair instrumentation depend on its runtime and lifecycle semantics.

Members:

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

Merge readiness
Overall: 🦀 challenger crab
Proof: 🦀 challenger crab
Patch quality: 🦀 challenger crab
Result: ready for maintainer review.

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

Risk before merge

  • [P1] Required ledger publication can intentionally leave the workflow red after successful primary work, potentially triggering alerts, retries, or operator intervention even though business mutations and required continuations proceed.
  • [P1] The dependent work in feat(ledger): record command action lifecycles #520 and feat(ledger): record ClawSweeper action lifecycles #521 will inherit these receipt identities and lifecycle semantics, increasing the cost of changing the contract after this base lands.
  • [P1] The final repository-wide exact-head check is still running, so merge should wait for its result even though check state does not change the item priority.

Maintainer options:

  1. Approve the tested split contract (recommended)
    Merge after exact-head checks, accepting red jobs for required publication failures while primary outcomes and required continuations remain preserved.
  2. Convert publication to warning-only
    Revise publication steps and focused workflow tests so successful primary work leaves the overall job green when only ledger publication fails.
  3. Pause the stacked rollout
    Hold this PR and its dependent ledger branches until maintainers choose a uniform availability and audit-durability contract.

Next step before merge

  • [P2] A maintainer should approve or revise the intentional split between primary availability and job-level audit-durability failure after the final exact-head check completes; no narrow automated repair is justified without that choice.

Maintainer decision needed

  • Question: Should required immutable-ledger publication failures deliberately fail the workflow job after successful primary work, while primary-result gates still permit required continuations?
  • Rationale: The code and tests intentionally implement this split availability contract; deciding whether audit-durability failure should produce a red production job requires explicit maintainer intent rather than a mechanical repair.
  • Likely owner: vincentkoc — The branch history and focused tests show direct ownership of the ledger architecture and this exact failure contract.
  • Options:
    • Approve split contract (recommended): Keep primary actions and continuations independent, but fail the job when required ledger publication is not durable.
    • Make publication warning-only: Preserve a green job after successful primary work and report ledger publication failure through warnings and recovery signals.
    • Pause the stacked rollout: Hold this base and its dependent PRs until one lifecycle contract is selected for all ledger operation families.

Security
Cleared: No concrete security or supply-chain regression was found: the patch adds no third-party action or dependency source, does not broaden workflow permissions, uses the existing GitHub token, and stages ledger data under runner-temporary storage before controlled publication.

Review details

Best possible solution:

Adopt one explicit production contract across the ledger stack: preserve primary actions and required continuations, record ambiguous mutation outcomes conservatively, and either deliberately retain red job status for required audit-publication failures or consistently downgrade those failures to warning-only.

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

Yes. Source inspection and focused workflow tests establish the deliberate path where primary work succeeds, required ledger publication fails, and primary-result gates still allow required continuations; this reproduces the operational tradeoff rather than a current-main bug.

Is this the best way to solve the issue?

Yes, technically: stable business identities, pre-mutation receipts, explicit unknown outcomes, and independent primary-result gates form a coherent implementation. Product acceptance still depends on approving the red-job versus availability contract.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦀 challenger crab: Overall readiness is 🦀 challenger crab; proof is 🦀 challenger crab and patch quality is 🦀 challenger crab.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🦀 challenger crab, so this older rating label is no longer current.

Label justifications:

  • P2: This is a substantial automation and auditability improvement with meaningful but bounded operational risk.
  • merge-risk: 🚨 automation: The PR changes review, retry, apply, artifact, finalization, publication, and continuation control flow.
  • merge-risk: 🚨 availability: The intentional split contract can leave a production workflow red after successful primary work when required audit publication fails.
  • rating: 🦀 challenger crab: Overall readiness is 🦀 challenger crab; proof is 🦀 challenger crab and patch quality is 🦀 challenger crab.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. Replay-stable immutable receipts across review and apply actions materially improve automation auditability, crash recovery, and post-incident reconstruction.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; its exact-head full-check report and focused runtime and workflow validation remain strong supplemental evidence.
Evidence reviewed

What I checked:

  • Prior blocker repaired: The final hardening commits track the primary command result separately from ledger flushing, preserving the primary result when final ledger processing fails. (src/clawsweeper.ts:30318, f3cfa0bf81f3)
  • Best-effort activation: Ledger-producing workflow jobs invoke the local setup action with continue-on-error, and the runtime activates receipt generation only when the setup action exports the force flag. (.github/workflows/sweep.yml:443, f3cfa0bf81f3)
  • Immutable workflow context: The setup action validates the workflow-run creation time and stores ledger output under a run-, attempt-, and job-specific runner-temporary path before enabling instrumentation. (.github/actions/setup-action-ledger/action.yml:16, f3cfa0bf81f3)
  • Review continuity: The earlier P1 apply-publication coupling finding persisted across three reviewed heads and was removed only after the fail-open hardening commits; no prior finding remains unresolved at the current head. (test/clawsweeper-action-ledger.test.ts:1, f3cfa0bf81f3)
  • Feature provenance: The implementation builds on the immutable action-ledger core merged in commit 7cc5527, and the full follow-up branch was authored by Vincent Koc. (src/action-ledger-runtime.ts:1, 7cc5527f62f7)
  • Current exact-head status: GitHub reports the reviewed head as mergeable, with CodeQL and the focused platform checks successful; the repository-wide pnpm check remains in progress. (f3cfa0bf81f3)

Likely related people:

  • vincentkoc: Introduced the merged immutable action-ledger core and authored the complete review/apply instrumentation and hardening series, including the final failure-contract fixes. (role: feature owner; confidence: high; commits: 7cc5527f62f7, 09a8d2398060, f2e6e4272577; files: src/action-ledger-runtime.ts, src/clawsweeper.ts, .github/workflows/sweep.yml)
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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-12T18:17:47.658Z sha 5945389 :: needs changes before merge. :: [P1] Keep apply independent of ledger publication
  • reviewed 2026-07-12T18:46:42.941Z sha f540ac3 :: needs changes before merge. :: [P1] Keep apply independent of ledger publication
  • reviewed 2026-07-12T19:22:43.758Z sha 9fea0d5 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T19:44:30.738Z sha 2e25965 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T19:57:59.811Z sha 3c463b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T20:35:47.220Z sha 6f0c52a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T21:07:24.305Z sha deada44 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T22:16:53.098Z sha f2e6e42 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the feat/action-ledger-core-v2 branch 2 times, most recently from ff4ea59 to 6fa4b86 Compare July 12, 2026 13:36
Base automatically changed from feat/action-ledger-core-v2 to main July 12, 2026 16:20
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-review-apply branch 2 times, most recently from 66df24b to 68c5941 Compare July 12, 2026 16:50
@vincentkoc
vincentkoc marked this pull request as ready for review July 12, 2026 16:51
@vincentkoc
vincentkoc requested a review from a team as a code owner July 12, 2026 16:51
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jul 12, 2026
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-review-apply branch 2 times, most recently from 4d69a33 to 9fea0d5 Compare July 12, 2026 19:13
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. and removed merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 12, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 12, 2026
@vincentkoc
vincentkoc force-pushed the feat/action-ledger-review-apply branch from deada44 to f2e6e42 Compare July 12, 2026 22:11
@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Jul 12, 2026
@clawsweeper clawsweeper Bot added rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 12, 2026
@vincentkoc
vincentkoc merged commit 3630fff into main Jul 12, 2026
10 checks passed
@vincentkoc
vincentkoc deleted the feat/action-ledger-review-apply branch July 12, 2026 22:43
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. P2 Normal priority bug or improvement with limited blast radius. rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. 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