Skip to content

Share repository receipt attempt locking - #5541

Merged
freeqaz-openai merged 2 commits into
mainfrom
refactor/share-receipt-attempt-lock
Nov 14, 2026
Merged

freeqaz-openai merged 2 commits into
mainfrom
refactor/share-receipt-attempt-lock

Conversation

@freeqaz-openai

Copy link
Copy Markdown
Collaborator

What changed

Receipt admission, bind, fence, and dispose now share the attempt lock and admission check. Each operation awaits the helper inside its transaction before reading or writing a receipt. Status still uses the read-only view.

Validation

  • Workspace boundaries, typecheck, lint, format, and build passed.
  • Eight native cutover cases, 182 source boundary cases, and 12 detached-package tests passed.
  • Nine PostgreSQL receipt and restart records passed across the two maintained files. Scoped cleanup passed.

@clawsweeper

clawsweeper Bot commented Nov 11, 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR combines attempt locking and admission validation in one shared helper and extends PostgreSQL recovery coverage.

Example: A recovery request overlaps an attempt's invalidation transaction.

  • Before: Recovery waits for the attempt lock, then refuses the invalidated attempt.
  • After: The same behavior is preserved through the shared helper and explicitly checked by the integration test.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and appears correct; validation is supported by integration source and successful exact-head checks rather than independently inspected execution traces.
Proof confidence 🦐 gold shrimp (3/6) This internal refactor has no changed user-visible behavior; supplied validation and the extended real-PostgreSQL integration case support the preserved contract, without constituting independent live-workflow proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction consolidates a repeated safety-sensitive sequence without adding contracts, configuration, or runtime machinery.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for maintainer triage: it preserves transaction-scoped locking, adds meaningful concurrent-recovery coverage, and has no identified blocking defect.

Priority: P3
Reviewed head: 5958932d3f286adfa874efdf6b4b8246d6762e7a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The worker-owned receipt listener receives broker requests over a private socket, validates persisted attempt ownership, and reads or updates receipt evidence inside State transactions.

flowchart LR
  A[Repository Driver] --> B[Broker control]
  B --> C[Private receipt listener]
  C --> D[Receipt store]
  D --> E[State transaction]
  E --> F[PostgreSQL attempts and receipts]
Loading

Technical review

Best possible solution:

Retain the shared helper and focused contention coverage while preserving the existing transaction and receipt contracts.

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

This PR preserves existing behavior rather than fixing a reported bug; source inspection confirms the same lock, validation, and transaction sequence before and after.

Is this the best way to solve the issue?

Combining the existing lock and guard in one private helper is a proportionate simplification, and the added test checks a distinct persistence-ordering invariant.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4ecdd59c5a64.

Provenance checked

  • Receipt attempt locking and binding validation keeps the original intent (Share the broker receipt binding guard #5433: Share persisted binding validation while retaining each operation's existing transaction, recovery, and disposal rules.)
  • Durable receipt recovery and invalidation keeps the original intent (Recover confirmed repository credential disposal #534: Retain exact broker disposal evidence and durable missing-admission fences without inferring cleanup from uncertain outcomes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit 6b4e851 adds apps/controller/src/backends/repository-credentials/receipt-store.ts:31 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6b4e85174966; files: apps/controller/src/backends/repository-credentials/receipt-store.ts)
  • kevinlin-openai: Raw commit 24ae029 adds apps/controller/src/backends/repository-credentials/receipt-store.ts:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 24ae029557b3; files: apps/controller/src/backends/repository-credentials/receipt-store.ts)
  • stevenlee-oai: Raw commit ba3bf4a adds apps/controller/src/backends/repository-credentials/receipt-store.ts:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ba3bf4a62e72; files: apps/controller/src/backends/repository-credentials/receipt-store.ts)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a small internal refactor with additional integration coverage and no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-11T21:01:02.472Z sha 5ee7c15 :: needs maintainer review before merge. :: none

Reviewed November 14, 2026, 12:03 PM ET / 17:03 UTC (Revision 2).

@freeqaz-openai
freeqaz-openai marked this pull request as ready for review November 14, 2026 16:40
@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner November 14, 2026 16:40
@freeqaz-openai

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review
Please review commit 5958932. The PostgreSQL regression now checks recovery while attempt invalidation commits.

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@freeqaz-openai
freeqaz-openai merged commit f665e81 into main Nov 14, 2026
45 checks passed
@freeqaz-openai
freeqaz-openai deleted the refactor/share-receipt-attempt-lock branch November 14, 2026 17:05
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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