Skip to content

refactor(core): move single-service core packages under the service that uses them - #745

Open
roychying wants to merge 1 commit into
chenghan.ying/sq-storage-3-agents-mdfrom
chenghan.ying/sq-storage-4-core
Open

roychying wants to merge 1 commit into
chenghan.ying/sq-storage-3-agents-mdfrom
chenghan.ying/sq-storage-4-core

Conversation

@roychying

@roychying roychying commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Why?

submitqueue/core/ is infra shared between the domain's services, so it should not depend on one. After the split, files there that resolve stores name a service's aggregate (the inversion raised in #740 and #741 ).

What?

Moves the packages that serve exactly one service:

From To
core/batch/* orchestrator/core/batch
core/request/{log,terminate}.go orchestrator/core/request
core/request/{materializer,request}.go gateway/core/request

core/request divides along the publish/persist line: the orchestrator publishes lifecycle events on the log topic, the gateway persists them.

core/changeset could not move for now — seven domain-level extension packages still depend on it. Relocating it would have created a new inversion. Instead it declares the slice of an aggregate it
needs:

type Stores interface {
    GetRequestStore() storage.RequestStore
    GetChangeStore()  storage.ChangeStore
}
type Resolve func(queue string) (Stores, error)

No file under submitqueue/core/ imports a service package now.

Test Plan

  • go build ./..., go vet ./..., and all four repo checks clean;
  • make test 122/122.

Issue

@roychying
roychying added this pull request to stack #742 September 23, 2026 18:02
@roychying
roychying force-pushed the chenghan.ying/sq-storage-4-core branch from a125c16 to 0780d1b Compare September 23, 2026 19:10
@roychying
roychying force-pushed the chenghan.ying/sq-storage-4-core branch from 0780d1b to a560bcb Compare September 23, 2026 19:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant