From the 2026-08 architecture review (recommendation: speculative).
What is wrong:storecontract.TaskStore composes 8 sub-interfaces (91 methods across 31 interfaces), but internal/daemon and internal/webui's Server take the whole thing while each uses a fraction. The daemon already splits BindingTaskCreator off ad hoc, which shows the composed seam is wider than any one consumer needs.
Wanted: consumers declare exactly the sub-interfaces they consume (structural typing makes this free); TaskStore stays as the production composition, not the consumer's dependency.
Done when:
daemon and webui depend on named sub-interfaces, not the composed TaskStore
task check green
From the 2026-08 architecture review (recommendation: speculative).
**What is wrong:** `storecontract.TaskStore` composes 8 sub-interfaces (91 methods across 31 interfaces), but `internal/daemon` and `internal/webui`'s `Server` take the whole thing while each uses a fraction. The daemon already splits `BindingTaskCreator` off ad hoc, which shows the composed seam is wider than any one consumer needs.
**Wanted:** consumers declare exactly the sub-interfaces they consume (structural typing makes this free); `TaskStore` stays as the production composition, not the consumer's dependency.
**Done when:**
- daemon and webui depend on named sub-interfaces, not the composed `TaskStore`
- `task check` green
sam
added the discovery label 2026-11-02 14:53:56 +00:00
Follow-up from review of the Deps wiring (app/statestore/server.go stateStoreDeps/executionDeps/accessDeps, staterpc/server.go Deps, daemon wireWebStoreSurfaces): the Deps struct re-lists every storecontract surface as a field, and each composition root re-asserts it (if x, ok := b.st.(I); ok { deps.X = x }) — three places that must agree per surface (contract, Deps field, assertion block), plus the nil→Unavailable error var in the RPC handler.
Proposal (design fix, not codegen — per the no-compensating-tools rule a Go-from-Go generator would just move the list): shrink staterpc.Deps to non-store deps (Grants, Log, ControlPlane, OrgModels, OrgInstructions, ScheduleSettings, LogFeed) plus one Store any; each per-contract server type asserts its own storecontract surface once at construction, nil → codes.Unavailable (current behavior). A new store surface then touches exactly two places: the contract and the server that serves it. Same fix on the daemon client side.
Done when: Deps has no per-store-interface fields; assertion blocks live only in the per-contract server constructors; adding a surface no longer requires editing a central field list; task check green.
Follow-up from review of the Deps wiring (app/statestore/server.go stateStoreDeps/executionDeps/accessDeps, staterpc/server.go Deps, daemon wireWebStoreSurfaces): the Deps struct re-lists every storecontract surface as a field, and each composition root re-asserts it (`if x, ok := b.st.(I); ok { deps.X = x }`) — three places that must agree per surface (contract, Deps field, assertion block), plus the nil→Unavailable error var in the RPC handler.
Proposal (design fix, not codegen — per the no-compensating-tools rule a Go-from-Go generator would just move the list): shrink staterpc.Deps to non-store deps (Grants, Log, ControlPlane, OrgModels, OrgInstructions, ScheduleSettings, LogFeed) plus one `Store any`; each per-contract server type asserts its own storecontract surface once at construction, nil → codes.Unavailable (current behavior). A new store surface then touches exactly two places: the contract and the server that serves it. Same fix on the daemon client side.
Done when: Deps has no per-store-interface fields; assertion blocks live only in the per-contract server constructors; adding a surface no longer requires editing a central field list; `task check` green.
Maintainer direction from review: contract-first codegen is preferred where a single IDL contract exists (protobuf, sqlc). Applied to the store seam, the candidate is to make proto/state/v1 the single source of truth and generate the Go port (storecontract) + staterpc Deps plumbing from it, eliminating the hand-maintained storecontract↔proto mirror. Open cost: generated signatures are wire-typed (pb.*) rather than domain-typed (task.Task); keeping domain types means generating only the plumbing, not the signatures. Exploration only — the Deps per-server-assertion fix from the previous comment stands as the no-codegen alternative.
Maintainer direction from review: contract-first codegen is preferred where a single IDL contract exists (protobuf, sqlc). Applied to the store seam, the candidate is to make proto/state/v1 the single source of truth and generate the Go port (storecontract) + staterpc Deps plumbing from it, eliminating the hand-maintained storecontract↔proto mirror. Open cost: generated signatures are wire-typed (pb.*) rather than domain-typed (task.Task); keeping domain types means generating only the plumbing, not the signatures. Exploration only — the Deps per-server-assertion fix from the previous comment stands as the no-codegen alternative.
Correction to my earlier comment: internal/daemon has no wireWebStoreSurfaces symbol; the phrase appears only in a comment at internal/app/statestore/server.go:259. TaskStore embeds 8 sub-interfaces, not 12 (issue body corrected).
Correction to my earlier comment: `internal/daemon` has no `wireWebStoreSurfaces` symbol; the phrase appears only in a comment at internal/app/statestore/server.go:259. `TaskStore` embeds 8 sub-interfaces, not 12 (issue body corrected).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From the 2026-08 architecture review (recommendation: speculative).
What is wrong:
storecontract.TaskStorecomposes 8 sub-interfaces (91 methods across 31 interfaces), butinternal/daemonandinternal/webui'sServertake the whole thing while each uses a fraction. The daemon already splitsBindingTaskCreatoroff ad hoc, which shows the composed seam is wider than any one consumer needs.Wanted: consumers declare exactly the sub-interfaces they consume (structural typing makes this free);
TaskStorestays as the production composition, not the consumer's dependency.Done when:
TaskStoretask checkgreenFollow-up from review of the Deps wiring (app/statestore/server.go stateStoreDeps/executionDeps/accessDeps, staterpc/server.go Deps, daemon wireWebStoreSurfaces): the Deps struct re-lists every storecontract surface as a field, and each composition root re-asserts it (
if x, ok := b.st.(I); ok { deps.X = x }) — three places that must agree per surface (contract, Deps field, assertion block), plus the nil→Unavailable error var in the RPC handler.Proposal (design fix, not codegen — per the no-compensating-tools rule a Go-from-Go generator would just move the list): shrink staterpc.Deps to non-store deps (Grants, Log, ControlPlane, OrgModels, OrgInstructions, ScheduleSettings, LogFeed) plus one
Store any; each per-contract server type asserts its own storecontract surface once at construction, nil → codes.Unavailable (current behavior). A new store surface then touches exactly two places: the contract and the server that serves it. Same fix on the daemon client side.Done when: Deps has no per-store-interface fields; assertion blocks live only in the per-contract server constructors; adding a surface no longer requires editing a central field list;
task checkgreen.Maintainer direction from review: contract-first codegen is preferred where a single IDL contract exists (protobuf, sqlc). Applied to the store seam, the candidate is to make proto/state/v1 the single source of truth and generate the Go port (storecontract) + staterpc Deps plumbing from it, eliminating the hand-maintained storecontract↔proto mirror. Open cost: generated signatures are wire-typed (pb.*) rather than domain-typed (task.Task); keeping domain types means generating only the plumbing, not the signatures. Exploration only — the Deps per-server-assertion fix from the previous comment stands as the no-codegen alternative.
Correction to my earlier comment:
internal/daemonhas nowireWebStoreSurfacessymbol; the phrase appears only in a comment at internal/app/statestore/server.go:259.TaskStoreembeds 8 sub-interfaces, not 12 (issue body corrected).