refactor: split the 50-method workflow Store interface #447
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#447
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code-quality audit (P2).
internal/workflows/service.go:389-440— theStoreinterface declares 50 methods and has exactly one implementation (*state.DB).Why it matters
This is not an abstraction boundary — it is a verbatim copy of the concrete type's surface, so it buys no decoupling. It does impose a cost: every new query forces the test fake to grow a matching no-op method, which makes unrelated PRs touch the fake and makes the fake a poor model of real store behaviour.
Suggested fix
Split by concern and have
Servicedepend on the narrow interfaces it actually uses:versionStore— insert/get/list/activate/deactivate.runStore— run + node lifecycle (start/settle/skip/repeat/exhaust).triggerStoreresourceStore— leases, budgets.artifactStore*state.DBsatisfies all of them; tests fake only the slice they need.Acceptance criteria
Servicefields are typed to the narrow interfaces.Effort: M.