feat(contract): add runway merge queue contract + typed queue primitives#244
Open
behinddwalls wants to merge 2 commits into
Open
feat(contract): add runway merge queue contract + typed queue primitives#244behinddwalls wants to merge 2 commits into
behinddwalls wants to merge 2 commits into
Conversation
This was referenced Jun 15, 2026
b8f3e22 to
ddbb5ab
Compare
…trategy ## Summary ### Why? The land-merge strategy enum lived in `submitqueue/entity` as `RequestLandStrategy`, but the upcoming runway merge-conflict contract needs the same type, and runway must not import `submitqueue/entity`. Mirroring the `Change` promotion in #240, the strategy belongs in the shared top-level `entity/` so both domains reference one type with no per-domain enum or mapping. ### What? Moves `RequestLandStrategy` and its constants out of `submitqueue/entity/request.go` into a new top-level `entity/mergestrategy` package as `MergeStrategy` (`MergeStrategyUnknown/Rebase/SquashRebase/Merge`). `Request.LandStrategy` now has type `mergestrategy.MergeStrategy`. All references across the gateway and orchestrator controllers, entities, and tests are updated to the shared type. Pure mechanical refactor — no behavior change. ## Test Plan ✅ `bazel build //...` ✅ `bazel test //... --test_tag_filters=-integration,-e2e` (51 tests pass) ✅ `make gazelle` clean
ddbb5ab to
edf7ab9
Compare
20db3b8 to
bf357a5
Compare
edf7ab9 to
3e8071d
Compare
sbalabanov
approved these changes
Jun 16, 2026
| // MergeConflictCheckRequest is the payload a client publishes to the | ||
| // TopicKeyMergeConflictCheck queue. The ID is owned by the client so it can | ||
| // record the in-flight check before publishing and correlate the asynchronous | ||
| // result; runway echoes it back unchanged. |
Contributor
There was a problem hiding this comment.
nit: capitalize Runway so a reader recognizes this is the name
| QueueName string `json:"queue_name"` | ||
| // Steps is the ordered application sequence: in-flight steps first, the | ||
| // candidate last. A single-element slice expresses "candidate vs target | ||
| // branch". |
Contributor
There was a problem hiding this comment.
"A single-element slice expresses "candidate vs target
// branch""
AI generated, hard to read
| // ID echoes the client-owned correlation id from the request. | ||
| ID string `json:"id"` | ||
| // Mergeable is true if the whole ordered step sequence applied cleanly. | ||
| Mergeable bool `json:"mergeable"` |
Contributor
There was a problem hiding this comment.
may be use enum for future extensibility even if now it is binary
| // Mergeable is true if the whole ordered step sequence applied cleanly. | ||
| Mergeable bool `json:"mergeable"` | ||
| // Reason is a human-readable explanation when Mergeable is false. Empty when mergeable. | ||
| Reason string `json:"reason"` |
Contributor
There was a problem hiding this comment.
Why need if there are reasons in StepConflict ?
Introduce contract/runway/messagequeue holding runway's cross-service merge contract: the MergeRequest/MergeResult payloads and the ConflictCheck (dry-run) and Merge (committing) operations that pair each request queue with its result queue. The contract lives at a neutral top level so a client (e.g. SubmitQueue) imports it without depending on the runway domain. Add the generic typed-queue primitives it builds on to core/consumer: Topic[T] (a one-way queue bound to its payload type, with Encode/Decode) and Operation[Req, Res] (an async request/response pair of Topics), giving compile-time payload binding for any queue contract. Co-authored-by: Cursor <cursoragent@cursor.com>
3e8071d to
cd798f6
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.
Summary
Why?
Both the merge-conflict check and the merge run as asynchronous round-trips with a separate service, runway. A check is a dry run of a merge, so one contract serves both. The contract lives in a neutral top-level package so SubmitQueue can talk to runway without importing the runway domain — a domain never imports another domain.
What?
Adds the cross-service queue contract and the typed primitives it builds on:
contract/runway/messagequeue— runway's queue contract: theMergeRequest/MergeResultpayloads (MergeStep, andStepResultwith VCS-neutralOutputIDs), plus theConflictCheck(dry-run) andMerge(committing) operations that pair each request queue with its result queue. Clients (e.g. SubmitQueue) import this contract; they never import the runway domain. The ordered step list encodes base-layering so one request expresses both "candidate vs target branch" (one step) and "candidate + in-flight vs target" (N steps).core/consumer— generic typed-queue primitives:Topic[T](a one-way queue bound to its payload type, withEncode/Decode) andOperation[Req, Res](an async request/response pair ofTopics). These give compile-time payload binding for any queue — a producer can't put the wrong type on a queue, and a consumer always reads the type the queue is declared to carry.Also updates the CLAUDE.md queue-payload rule: cross-domain contracts live in a neutral
contract/{owner}package, not the owner's domain package.Test Plan
✅
bazel test //contract/... //core/consumer/...(round-trip serialization tests pass)✅
bazel build //...Issues
Stack