Skip to content

feat: add exact review lifecycle projection - #952

Merged
brokemac79 merged 8 commits into
mainfrom
codex/csw-077-lifecycle-projection
Aug 1, 2026
Merged

brokemac79 merged 8 commits into
mainfrom
codex/csw-077-lifecycle-projection

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the approved post-cutover Workstream 2 slice of #898: an additive, versioned Worker lifecycle projection for each exact-review revision, with durable terminal finalization and one guarded final command acknowledgement.

Approved contract and implementation

  • The projection is keyed by canonicalTargetKey, exact fenceKey, revision, and claim provenance. It retains immutable admission/claim and review-result facts, GitHub effect identity/digest, canonical receipt, router receipt, acknowledgement attempt/observed receipt, and terminal disposition.
  • Lifecycle and final command-acknowledgement state derive only from that projection. review_completed_routed is Completed only after durable routing; command-originated work additionally requires an observed final acknowledgement receipt.
  • Target closure, requeue, superseded, dead-letter, target missing, failure, and acknowledgement-pending remain distinct. The optional high-confidence implementation dispatch is downstream of durable lifecycle receipt/router or terminal handoff and is independent of command acknowledgement.
  • Source drift creates a fresh fenced requeue revision without external enqueue while the direct lease remains active. Durable terminal decisions are fence-safe and acknowledgement retry is idempotent, including a status-ID-only receipt.

The maintainer-approved Workstream 2 contract is recorded on #898 and its explicit lifecycle-semantics addendum. CSW-076 remains the retained, unchanged read-only decision record.

Validation

Current head: ebbcb2b97ad89fa3b781729ac154ce743c51c09a, mechanically rebased on current origin/main 8fbb46bd20a9d0d67d3446a4e46e417a45314dad with no source conflict.

  • pnpm run build and pnpm run lint passed.
  • Targeted pnpm exec oxfmt --check on all changed TypeScript/workflow-adjacent source and test files passed.
  • git diff --check origin/main...HEAD and git diff --check passed.
  • Controlled Linux focused proof passed all four focused groups: 20 command-status receipt/acknowledgement cases, 10 batch workflow/Bash cases, 3 Worker lifecycle cases, and 3 exact-event publication/contract cases.
  • actionlint is unavailable on this host. The changed workflow paths are covered by the focused workflow/Bash tests; this PR adds no CI or platform support.

Real Behavior Proof

  • Claim: durable receipt/router/terminal facts control lifecycle completion, a command status is acknowledged once only after a verified receipt, and retry/requeue/supersession/closed-missing/failed paths remain distinct.
  • Surface: the Worker / R2 lifecycle surface: signed lifecycle endpoints, ExactReviewQueue completion, direct publication finalization, terminal-finalization acknowledgement, and the guarded command-status updater.
  • Scenario: controlled command and non-command revisions exercise source-drift requeue, runnerless batch admission, canonical/router receipt, acknowledgement failure release and retry, and verified status-ID-only acknowledgement observation.
  • Environment: Docker-backed Crabbox Linux local-container using mcr.microsoft.com/playwright:v1.60.0-noble, --no-hydrate, local Wrangler/Durable Object storage, and focused node --test selections. The focused lease was cbx_c33402055f0f.
  • Observed trace: the redacted current-head trace records pending after canonical receipt, two allowed guarded acknowledgement attempts separated by a released failure receipt, then completed with acknowledgement observed; the workflow trace records the direct router handoff plus terminal_context_claimed, terminal_attempt_allowed, ack_failure_receipt_recorded, ack_retry_requeued, and verified_status_id_only_receipt_observed.
  • Limits: the direct Worker/DO lifecycle used the controlled Linux runtime; GitHub router dispatch and terminal workflow curl/pnpm edges were synthetic doubles. No GitHub write, live queue replay, production-state mutation, gate change, historical backfill, or external queue was contacted.

Codex review closeout

  • Dirty-patch review after the terminal-finalizer corrections: clean; no accepted/actionable finding.
  • Actual-base review against origin/main 8fbb46bd20a9d0d67d3446a4e46e417a45314dad: no P0/P1 finding. Its one P2 is explicitly split out below rather than silently carried in this PR.

Follow-up deliberately outside this PR

CSW-086 owns the non-blocking P2 superseded-receipt versus stale artifact-terminal-plan precedence retry. It is deliberately not implemented or claimed fixed here. In that narrow collision, a post-effect may retry until the follow-up makes superseded receipt precedence explicit; this PR preserves the durable projection and does not broaden into that repair.

Maintainer proof override — known limitation only

A maintainer expressly authorizes a normal manual merge of this exact reviewed head despite ClawSweeper's remaining request for stronger inspectable real-behavior evidence. This override is limited to that known proof limitation: the current evidence is a controlled Linux Crabbox Worker/Durable Object trace with synthetic GitHub router and terminal-workflow boundaries, not a live GitHub-connected after-fix workflow run or an uploaded inspectable artifact. No unrun proof is claimed.

The status: 📣 needs proof and P1 labels remain as transparent advisory markers of this limitation; the exact-head ClawSweeper review reports Findings: None and Security: None. This override does not waive any P0/P1 code or security finding, current-head CI/check, GitHub mergeability, ruleset, or requested-changes condition; it does not authorize CI repair, gate changes, queue replay, production mutation, automerge, or a revert. The CSW-086 P2 disclosure below remains unchanged.

Boundaries

No Bay/Overview or Workstreams 4–5 work, telemetry redesign, Workstream 1 change, historical backfill/replay, Git-state restoration, key trimming, CI/platform expansion, gate change, production mutation, queue replay, or automerge. The sole exception is the separately authorized normal manual merge after the current preflight passes; it does not authorize production action or a later revert.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. 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: 🚨 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. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 9:53 PM ET / August 1, 2026, 01:53 UTC.

ClawSweeper review

What this changes

Adds a versioned Durable Object lifecycle record for each exact-review revision and uses it to coordinate canonical publication receipts, terminal outcomes, and a single guarded GitHub command-status acknowledgement.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

This PR remains necessary: it adds the proposed lifecycle projection rather than duplicating functionality already on current main. The central implementation path appears coherent and the prior roadmap-direction blocker is described as approved, but the current PR body still lacks inspectable after-fix runtime evidence for this high-impact Worker/workflow change, so it needs real behavior proof before merge.

Priority: P1
Reviewed head: ebbcb2b97ad89fa3b781729ac154ce743c51c09a

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage show useful signal, but missing inspectable current-head runtime evidence keeps this automation change below merge-ready confidence.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The PR describes a controlled Crabbox run but provides no inspectable redacted terminal output, runtime logs, or linked artifact for the current head; attach evidence of the receipt, retry, and final observed-acknowledgement path with private data redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR describes a controlled Crabbox run but provides no inspectable redacted terminal output, runtime logs, or linked artifact for the current head; attach evidence of the receipt, retry, and final observed-acknowledgement path with private data redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items New lifecycle boundary: The branch adds the lifecycle projection module and connects lifecycle states to canonical receipt, router receipt, terminal disposition, and command acknowledgement transitions.
Completion is receipt-gated: A routed review is completed only after an accepted or deduped canonical receipt plus a durable or not-required router receipt; command-originated work remains acknowledgement-pending until an observed receipt or locked-conversation skip.
Workflow retry path: The terminal-finalization workflow records a verified acknowledgement receipt only after the status updater verifies it, and otherwise requeues the terminal acknowledgement driver rather than treating the update as complete.
Findings None None.
Security None None.

How this fits together

Exact-review automation receives GitHub review work, queues it through the Cloudflare Worker, and persists canonical publication facts before workflows acknowledge command-originated work. This PR inserts a durable lifecycle projection between those queue/publication facts and the terminal GitHub status update so completion reflects the required durable receipts.

flowchart LR
  A[GitHub review request] --> B[Exact review queue]
  B --> C[Worker lifecycle projection]
  C --> D[Canonical publication receipt]
  D --> E[Terminal disposition]
  E --> F[Guarded command acknowledgement]
  E --> G[Queue completion or retry]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR describes a controlled Crabbox run but provides no inspectable redacted terminal output, runtime logs, or linked artifact for the current head; attach evidence of the receipt, retry, and final observed-acknowledgement path with private data redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The patch changes completion semantics across the Worker, queue, and GitHub workflow; a missed receipt or retry edge could leave command-originated reviews pending or cause repeated terminal work.
  • Resolve merge risk (P1) - The PR body reports controlled tests but no inspectable current-head runtime artifact, so the durable receipt-to-acknowledgement path is not independently reviewable before merge.
  • Resolve merge risk (P1) - The change touches workflow dispatch and scoped write-token use; green checks do not by themselves establish safe behavior for a real terminal acknowledgement retry.
  • Complete next step (P2) - The contributor needs to add inspectable current-head real-behavior proof; no narrow automated code repair is indicated by this review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 17 files affected; 8,657 additions and 387 deletions The PR crosses Worker persistence, queue logic, GitHub workflows, CLI status mutation, and focused tests, so runtime proof must cover the integration boundary rather than only unit behavior.
Terminal workflow 1 new terminal-finalization job path This job owns the final command acknowledgement and its retry behavior, making it the primary operational merge surface.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #898
Summary: This PR is an implementation candidate for the open exact-review lifecycle roadmap, not a duplicate of a merged fix.

Members:

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

Merge-risk options

Maintainer options:

  1. Add inspectable lifecycle proof (recommended)
    Attach redacted current-head evidence showing Worker receipt persistence, terminal acknowledgement retry behavior, and the final observed receipt before merging.
  2. Pause for narrower validation
    If real proof cannot be shared, pause this broad lifecycle change until maintainers can reproduce the Worker/workflow path in a controlled environment.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Attach redacted current-head terminal output or runtime logs showing receipt persistence, acknowledgement retry behavior, and final observed acknowledgement.

Technical review

Best possible solution:

Attach a redacted current-head terminal transcript or runtime log that visibly shows canonical/router receipt recording, an acknowledgement retry or release path, and the final observed acknowledgement receipt; then obtain a refreshed review before maintainer merge consideration.

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

Not applicable as a bug reproduction: this is a new lifecycle projection. The relevant pre-merge proof is an after-fix controlled Worker/workflow run demonstrating the claimed receipt and acknowledgement transitions.

Is this the best way to solve the issue?

Yes, conditionally: a durable projection is a coherent bounded way to keep lifecycle facts separate from transient workflow activity, and the PR preserves a separate follow-up for the stated superseded-receipt collision. The remaining requirement is inspectable runtime proof for the current head.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The patch changes active exact-review completion and command acknowledgement behavior, where a regression can strand real automation work.
  • merge-risk: 🚨 compatibility: The new lifecycle-derived completion semantics can change when existing command-originated reviews are considered complete.
  • merge-risk: 🚨 availability: A terminal receipt or retry defect can leave queued review work indefinitely pending or repeatedly retried.
  • merge-risk: 🚨 automation: The PR modifies repository-dispatch routing, terminal workflow execution, and scoped GitHub status mutation behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR describes a controlled Crabbox run but provides no inspectable redacted terminal output, runtime logs, or linked artifact for the current head; attach evidence of the receipt, retry, and final observed-acknowledgement path with private data redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • New lifecycle boundary: The branch adds the lifecycle projection module and connects lifecycle states to canonical receipt, router receipt, terminal disposition, and command acknowledgement transitions. (dashboard/exact-review-lifecycle.ts:131, ebbcb2b97ad8)
  • Completion is receipt-gated: A routed review is completed only after an accepted or deduped canonical receipt plus a durable or not-required router receipt; command-originated work remains acknowledgement-pending until an observed receipt or locked-conversation skip. (dashboard/exact-review-lifecycle.ts:684, ebbcb2b97ad8)
  • Workflow retry path: The terminal-finalization workflow records a verified acknowledgement receipt only after the status updater verifies it, and otherwise requeues the terminal acknowledgement driver rather than treating the update as complete. (.github/workflows/sweep.yml:3212, ebbcb2b97ad8)
  • Roadmap relationship: The provided PR context identifies this branch as a bounded Workstream 2 implementation candidate for the open lifecycle roadmap, while retaining a separate follow-up for the superseded-receipt precedence collision. (ebbcb2b97ad8)
  • Relevant current-main history: Current-main history includes the exact-publication identity fence repair and later queue lifecycle maintenance, making the queue/publication owners the best routing candidates for this cross-boundary change. (dashboard/exact-review-queue.ts:838, b4d1edea05cc)
  • Real proof remains uninspectable: The PR body describes a controlled Crabbox run, but it does not provide an attached redacted terminal transcript, runtime log, or linked artifact that a reviewer can inspect for the current head's lifecycle and acknowledgement behavior. (ebbcb2b97ad8)

Likely related people:

  • Peter Steinberger: Recent current-main queue lifecycle work and the current base commit both fall in the exact-review automation area affected by this PR. (role: recent queue and workflow contributor; confidence: high; commits: b4d1edea05cc, 8fbb46bd20a9; files: dashboard/exact-review-queue.ts, .github/workflows/sweep.yml)
  • Martin Cleary: Introduced the recent current-main publication identity-fencing repair that this lifecycle projection extends across canonical and queue identities. (role: exact-publication identity contributor; confidence: high; commits: 05d864b0103e; files: dashboard/exact-review-queue.ts, dashboard/exact-review-direct-publication.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted current-head Worker/workflow transcript or linked runtime artifact.
  • Ensure the added proof visibly covers a failed-or-released acknowledgement attempt followed by a verified observed receipt.

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.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-30T12:21:45.377Z sha f3f2a10 :: found issues before merge. :: [P1] Defer authoritative lifecycle semantics until the roadmap decision
  • reviewed 2026-07-30T16:06:35.529Z sha f3f2a10 :: found issues before merge. :: [P1] Defer authoritative completion semantics until approved
  • reviewed 2026-07-30T17:32:59.788Z sha f3f2a10 :: found issues before merge. :: [P1] Defer authoritative completion semantics until approved
  • reviewed 2026-07-30T23:03:29.620Z sha f3f2a10 :: found issues before merge. :: [P1] Defer authoritative completion semantics until approved
  • reviewed 2026-07-31T00:26:48.059Z sha f3f2a10 :: found issues before merge. :: [P1] Defer authoritative completion semantics until approved
  • reviewed 2026-07-31T12:14:58.977Z sha f3f2a10 :: needs real behavior proof before merge. :: [P1] Defer authoritative completion semantics until approved
  • reviewed 2026-07-31T17:41:56.879Z sha 8aa6208 :: needs real behavior proof before merge. :: [P1] Keep lifecycle completion semantics behind the approved roadmap decision
  • reviewed 2026-08-01T01:49:16.814Z sha ebbcb2b :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed 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. labels Jul 30, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 30, 2026
@brokemac79
brokemac79 force-pushed the codex/csw-077-lifecycle-projection branch from f3f2a10 to 8aa6208 Compare July 31, 2026 17:36
@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. and removed P2 Normal priority bug or improvement with limited blast radius. labels Jul 31, 2026
@brokemac79
brokemac79 force-pushed the codex/csw-077-lifecycle-projection branch from 8aa6208 to ebbcb2b Compare August 1, 2026 01:42
@brokemac79
brokemac79 marked this pull request as ready for review August 1, 2026 01:44
@brokemac79
brokemac79 requested a review from a team as a code owner August 1, 2026 01:44
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat: add exact review lifecycle projection This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@brokemac79
brokemac79 merged commit b07ab75 into main Aug 1, 2026
16 checks passed
@brokemac79
brokemac79 deleted the codex/csw-077-lifecycle-projection branch August 1, 2026 02:00
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* feat: add exact review lifecycle projection

* feat: finalize exact review lifecycle acknowledgements

* fix: recover direct lifecycle finalization

* fix: retain batch lifecycle admission during rollout

* test: cover lifecycle finalization contract

* fix: harden exact review lifecycle finalization

* fix: converge exact review lifecycle retries

* fix: guard exact review terminal delivery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant