Skip to content

docs(rfc): propose service-scoped extensions, splitting SubmitQueue storage per service - #740

Merged
behinddwalls merged 1 commit into
mainfrom
chenghan.ying/service-scoped-extensions-rfc
Sep 25, 2026
Merged

behinddwalls merged 1 commit into
mainfrom
chenghan.ying/service-scoped-extensions-rfc

Conversation

@roychying

@roychying roychying commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Why?

Both SubmitQueue services depend on one thirteen-store Storage aggregate, so a gateway controller can resolve BatchStore and nothing objects. The split is already the documented design — status-list-api.md says the gateway owns the request log and three read models, and the orchestrator's stores are pipeline working state — but nothing expresses it.

Separating the services onto their own databases already works today; what does not is provisioning. The schema is one filegroup, so each database gets all thirteen tables, including the nine or four that service never reads.

What?

An RFC for the layout rule: when only one service of a multi-service domain resolves an extension, its Factory, aggregate, implementations, mocks and schema move to {domain}/{service}/extension/{ext}/, while the behavioural
contracts stay shared.

The split is on reachability, not declaration — what a service may resolve is decided by its aggregate's accessors, so that is the part worth scoping. Moving the contracts too would add no enforcement and cost every domain-level caller a dependency on a service package.

Scope is storage only. changeprovider, validator, conflict, buildrunner and speculation are orchestrator-only and would qualify, but none has a schema and none is the reason for this change; they wait for a later RFC. queueconfig stays shared — gateway-only today, expected in both.

Test Plan

Issue

Comment thread doc/rfc/service-scoped-extensions.md Outdated
@roychying
roychying force-pushed the chenghan.ying/service-scoped-extensions-rfc branch from fcd6c7f to ead85cc Compare September 22, 2026 22:48
@roychying
roychying added this pull request to stack #742 September 22, 2026 23:11

@behinddwalls behinddwalls left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-written.

4/9 split is right. Split Factory/Storage by service; keep store interfaces at submitqueue/extension/storage/, or the core/ inversion is in this RFC.

Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
Comment thread doc/rfc/service-scoped-extensions.md Outdated
@behinddwalls

behinddwalls commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Agent-written.

Layout

platform/extension/counter/              # shared; mysql impl; each service has its own table
submitqueue/
├── extension/
│   ├── storage/                         # errors, Config, store interfaces
│   └── queueconfig/                     # shared — stays here
├── gateway/extension/storage/
│   ├── storage.go                       # Factory/Storage (4)
│   └── mysql/schema/                    # 4 tables
└── orchestrator/extension/storage/
    ├── storage.go                       # Factory/Storage (9)
    └── mysql/schema/                    # 9 tables

No store is shared today. RequestLogStore is gateway-owned (orchestrator publishes logs; gateway persists).

A later shared store: interface in submitqueue/extension/storage/, accessor on both aggregates, explicit table ownership. Do not reassemble the 13-way Storage.

queueconfig stays at submitqueue/extension/queueconfig/. It will be used by both services; do not move it under gateway.

@behinddwalls behinddwalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-written.

Requesting changes: split Factory/Storage by service, but keep store interfaces in submitqueue/extension/storage/. Moving *_store.go inverts core/ and is in scope for this RFC. queueconfig stays domain-level (shared). Preserve a colocated schema union.

@roychying

roychying commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@behinddwalls Stack now uses your layout. contracts and their mocks stay at submitqueue/extension/storage/, only the aggregate, implementation, mocks and schema are service-scoped. Also added the union schema target and dropped the gateway schema from the orchestrator suite.

But still one more concern. Splitting contract from implementation costs some cohesion. a table's interface now sits in a different tree from its MySQL code and its .sql, and ownership reads from the two aggregates rather than the directory. If the store sets stay disjoint forever, keeping them together is probably the nicer end state?

Went with yours anyway because it avoids the inversion now. moving the contracts to service level only becomes clean after the other extensions refactor lands and core/changeset can follow them. plus it's compatible with a store both services need later if we will have such one.

so imo if the store sets stay disjoint indefinitely and the extensions move is definitely happening, cohesion wins and it's worth revisiting before this is entrenched. otherwise I'm happy here.

@roychying
roychying force-pushed the chenghan.ying/service-scoped-extensions-rfc branch from c5ec2dc to 73eb649 Compare September 23, 2026 19:10
@roychying
roychying force-pushed the chenghan.ying/service-scoped-extensions-rfc branch from 73eb649 to 5051dde Compare September 23, 2026 19:22
@behinddwalls
behinddwalls added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit b7aefe7 Sep 25, 2026
16 checks passed
@behinddwalls
behinddwalls deleted the chenghan.ying/service-scoped-extensions-rfc branch September 25, 2026 01:39

This branch was successfully deployed

1 active deployment
stack-rebase — 5051ddef Deployed Sep 25, 2026 by behinddwalls via Rebase Stack #533
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.

3 participants