Extract PRISM block candidate submission - #76
Open
kiwidream wants to merge 1 commit into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 20, 2026 14:42
ff16f0f to
eb1743c
Compare
kiwidream
force-pushed
the
prism-audit-artifact-owner
branch
from
July 20, 2026 14:42
dbbe024 to
a0f1f78
Compare
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 20, 2026 15:28
eb1743c to
8a9d23f
Compare
kiwidream
force-pushed
the
prism-audit-artifact-owner
branch
2 times, most recently
from
July 20, 2026 15:34
290a444 to
d077088
Compare
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 20, 2026 15:34
8a9d23f to
b668e77
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b668e77. Configure here.
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 20, 2026 16:02
b668e77 to
894d810
Compare
kiwidream
force-pushed
the
prism-audit-artifact-owner
branch
2 times, most recently
from
July 20, 2026 16:58
4b5cd53 to
f12ac85
Compare
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 20, 2026 16:58
894d810 to
c621599
Compare
This was referenced Jul 20, 2026
kiwidream
force-pushed
the
prism-block-candidate-submission
branch
from
July 22, 2026 13:50
c621599 to
76e54d9
Compare
kiwidream
force-pushed
the
prism-audit-artifact-owner
branch
from
July 22, 2026 13:50
f12ac85 to
6426c85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Position in the stack
PR 4 of 9. Base:
prism-audit-artifact-owner. Depends on PR 75. Next: PR 77.Review this PR against its configured base. See the stack guide for the complete order.
Why this slice exists
The PostgreSQL outbox is the durable authority for block-worthy work, but replay, submission, retry, terminalization, and candidate-only credit were implemented inside the coordinator. This slice gives that state machine one owner while leaving the coordinator as wiring and facade.
What changes
block_candidates.BlockCandidateServiceand narrowBlockCandidatePortsfor ledger, writer admission, submission, audit preview, and credit decisions.Reading the diff
The roughly 940 additions and 520 deletions are mostly one state-machine move: the new owner is about 575 lines, while the coordinator loses about 524 lines and gains explicit wiring/delegates. Start with
block_candidates.pyand its focused tests, then confirm the removed coordinator methods map to narrow service calls.Behavior and risk
This is a medium-risk mining and payout slice. A share and its required candidate intent remain atomic in the ledger; the in-memory queue remains only a bounded wakeup. Retryable failures stay pending, terminal failures are abandoned once, and restart replay remains idempotent.
Validation
git diff --checkpassed.Operator impact
No schema or configuration action is introduced by this slice; it depends on the ledger migration in PR 75.
Note
Medium Risk
Touches mining payout paths (durable outbox, block submit, share credit on accept, retry/finalize); behavior is intended to be equivalent but regressions would affect block landing and miner credit.
Overview
Moves durable block-candidate work out of
prism_coordinatorinto newblock_candidates: intent encode/decode, bounded queue wakeups, ledger replay, submit/retry/finalize, and credit-on-accept actor handling.PrismCoordinatornow lazy-buildsBlockCandidateServiceviaBlockCandidatePorts(ledger, writer admission, submit, preview, share writer) and delegates enqueue, replay, submit loop, backoff, and metrics; legacy attribute names stay on compatibility descriptors backed by the service.Replay adopts share credit before publishing a decoded candidate for poison cleanup, and a failed adoption on one row no longer blocks replay of the rest. Tests cover standalone codec round-trip, service ownership, and replay edge cases.
Reviewed by Cursor Bugbot for commit 76e54d9. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.