feat(control): unit-of-work and checkpoint-locator ports; placement-resolved image - #39
Merged
Merged
Conversation
…esolved image O8 left the application with no way to say "these writes commit together" and no portable answer to "where can this checkpoint boot", so an event could outlive the mutation it describes and a cached snapshot pinned its session to one runner. Add the three additive pieces the rest of the plan builds on: a UnitOfWork port that carries the host's atomicity without any transaction type crossing the seam, a CheckpointLocator answering with a CheckpointLocation (portable, named runners, or nowhere), and TransitionOpts.Image so a placement can record the image it actually resolved. The runner event and the application event gain the session's placement generation, per the hosted PRD §9, and ApplyRunnerEvent fences on it now: a non-zero value that differs from the row's is ErrStale before any effect, while zero — an old runner that carries nothing — fences nothing. No sender puts a non-zero value on the wire yet. Every controlapp service now requires the new ports and stores them; nothing calls Run or LocateCheckpoint in this change. controld composes a direct unit of work (the self-hosted stores have no transactions yet) and a locator that names the runner holding a snapshot, which is exactly the affinity the stores derive today. Behavior on the wire and in every existing test is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiKRhqhzgJ1UDaLBynMyj3
Merged
4 tasks
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.
Summary
Task 1 of
docs/superpowers/plans/2026-08-30-control-outbox-checkpoint-capabilities.md(O9 plan 8) — the plan's one coordinatedcontrolchange. Additive, and non-behavioral on the wire.control.UnitOfWork: the application will say "these writes commit together"; the host carries its transaction in the context, and no transaction type crosses the seam.control.CheckpointLocator+CheckpointLocation: the host's knowledge of where a checkpoint can boot (portable, named runners, or nowhere).TransitionOpts.Image: a placement records the image it resolved.RunnerEventandEventcarry the session'sPlacementGeneration, andApplyRunnerEventalready fences on it: non-zero and different from the row isErrStalebefore any effect; zero fences nothing. Nothing sends a non-zero value yet (Task 5).controlappservice requires the new ports and stores them; nothing callsRunorLocateCheckpointyet (Tasks 3 and 4). controld composes a direct unit of work and a locator that names the snapshot's holder — exactly today's affinity.Test plan
TestIdealCallSitebuilds both ports from the external package; the fence test (TestApplyRunnerEventFencesOnPlacementGeneration: match, mismatch, zero) fails when the guard is removed and passes with it; every constructor rejects a nil portgofmt,go vet ./...,go test ./control ./controlapp -race,go test ./internal/controld/... -racewith the pgstore suite against a real PostgreSQL 16,scripts/check-public-control.sh(silent, allowlist empty),make verify,git diff --check— run by the worker and rerun by the reviewer🤖 Generated with Claude Code
https://claude.ai/code/session_01GiKRhqhzgJ1UDaLBynMyj3