refactor: nest domain code under submitqueue/, extract shared layers#185
Merged
Conversation
## Summary
### Why?
SubmitQueue's domain code lived at the repo root (gateway/, orchestrator/,
entity/, extension/) while a second service family, Stovepipe, already lived
under stovepipe/. The layout was asymmetric and the line between
domain-specific and genuinely shared code was implicit. This restructure
gives every domain its own top-level folder and pulls shared code into
clearly labeled shared layers, so "what's shared vs domain" is obvious from
the directory tree.
### What?
New layout — shared building blocks at the top level, one folder per domain:
```
core/ # SHARED cross-domain infra: errs, httpclient, metrics (no domain deps)
entity/ # SHARED entities: queue/
extension/ # SHARED extensions: queue/
submitqueue/ # SubmitQueue domain
├── gateway/
├── orchestrator/
├── entity/
├── extension/
└── core/ # consumer, request (shared between SubmitQueue's own services)
stovepipe/ # Stovepipe domain (gateway/ orchestrator/ entity/ extension/ core/)
example/
├── submitqueue/ # servers + clients + docker-compose
└── stovepipe/
test/
├── integration/{core,submitqueue,stovepipe}/
└── e2e/submitqueue/
doc/rfc/ # sql-queue-rfc.md (shared) + submitqueue/{workflow,build-runner}.md
```
- Domain code nests per domain: submitqueue/{gateway,orchestrator,entity,extension,core}, mirroring the existing stovepipe/ layout.
- Shared layers at the top level: core/ (cross-domain infra — errs, httpclient, metrics, now with zero domain deps), entity/ (shared entities: queue), extension/ (shared extensions: queue).
- submitqueue/core/ holds infra shared only between SubmitQueue's own services (consumer, request), moved out of the top-level core/ so it is domain-free. stovepipe/core/ added as a placeholder for symmetry.
- example/ and test/ mirror the split: example/submitqueue/..., test/integration/{core,submitqueue,stovepipe}/..., test/e2e/submitqueue/.
- RFCs: SubmitQueue-specific RFCs moved under doc/rfc/submitqueue/; the shared sql-queue RFC stays at doc/rfc/.
- Make targets made domain-explicit (build-submitqueue-*, integration-test-submitqueue-*, local-submitqueue-*), mirroring the existing *-stovepipe-* targets; CI updated to match.
- Tests: domain-qualified docker-compose project names; integration/e2e run in parallel (--test_output=errors) and always execute a real pass (tags=["external"]) since they are non-hermetic.
- Import paths rewritten throughout; protos regenerated; CLAUDE.md, READMEs, and doc/howto/TESTING.md updated to the new structure and naming convention.
No behavior changes — this is a structural move.
## Test Plan
- ✅ `make build` (bazel build //...) and `make test` (40/40 unit tests)
- ✅ `make integration-test` — 8/8 pass; verified running in parallel (67s vs 275s serial) and always-run (uncached re-runs)
- ✅ `make e2e-test` — passes; always-run
- ✅ `make lint` (incl. license headers); gazelle / mocks / tidy / fmt all stable (CI gates clean)
1a2265b to
deb8d58
Compare
mnoah1
approved these changes
Jun 3, 2026
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?
SubmitQueue's domain code lived at the repo root (gateway/, orchestrator/,
entity/, extension/) while a second service family, Stovepipe, already lived
under stovepipe/. The layout was asymmetric and the line between
domain-specific and genuinely shared code was implicit. This restructure
gives every domain its own top-level folder and pulls shared code into
clearly labeled shared layers, so "what's shared vs domain" is obvious from
the directory tree.
What?
New layout — shared building blocks at the top level, one folder per domain:
No behavior changes — this is a structural move.
Test Plan
make build(bazel build //...) andmake test(40/40 unit tests)make integration-test— 8/8 pass; verified running in parallel (67s vs 275s serial) and always-run (uncached re-runs)make e2e-test— passes; always-runmake lint(incl. license headers); gazelle / mocks / tidy / fmt all stable (CI gates clean)