0034. ConfigurePool — an explicit command to set a path's pool mode and WIP limit
Status
Accepted. Decision taken 2026-10-06 on the 2026-10-05 audit finding "no code
path creates a flow-fed pool". Builds on
ADR-0003 (release-fed vs flow-fed)
and ADR-0029 (versioned
WorkPool).
Context
A WorkPool has a feed mode (ReleaseFed: this service enforces a hard WIP
limit; FlowFed: priority only, the limit is merely an alarm) and a WIP limit.
Until now the only code that created a pool was EnqueueWorkUnit, which seeds a
missing pool as ReleaseFed with a limit of 1000. Nothing could create a
flow-fed pool, and nothing could change a limit, so the flow-fed branch of the
domain was unreachable in production and every path ran with the arbitrary
default.
Operators must be able to configure a path's pool without coupling this context to process-path-management (which owns the path catalogue, not admission policy).
Decision
- We add an explicit
ConfigurePoolcommand, exposed asPUT /paths/{pathId}/poolwith body{"mode": "ReleaseFed"|"FlowFed", "wipLimit": <integer>}. It sets the pool's mode and WIP limit and creates the pool when none exists. The response is the pool as configured plus its livewipandbacklogDepth. - Validation.
modemust be one of the existingFeedModevalues andwipLimitmust be a positive integer, otherwise400(unknown-feed-mode,invalid-wip-limit).pathIdis validated against the process-path catalogue like every other write that can seed an aggregate (ADR-0012). A rejected command changes nothing and creates no pool. - Lowering a limit never evicts or cancels work. Configuring a limit below
the pool's current WIP is accepted. No entry changes state; the pool is simply
saturated,
ReleaseNextWorkanswers409 wip-limit-reached(the existingWIP >= limitcheck) until completions bring WIP strictly below the new limit, andRemainingCapacityreports0(ADR-0018 already clamps at zero). Raising a limit takes effect on the next release. This is the standard WIP semantics; it needs no new release rule. - Idempotent, optimistically concurrent.
PUTstates the desired configuration, so the same body gives the same result, and an identical repeat on an existing pool writes nothing (no version bump). The read-modify-write runs inside the sameretryOnPoolConflictas every other pool writer (ADR-0029), so it can never overwrite a concurrent enqueue/release/completion and vice versa; exhausting the retry budget is the existing409 concurrent-modification. - Scope. Only mode and WIP limit are set; the alarm threshold and the pool's
entries are never touched (a newly created pool takes the existing alarm
default of 1000). The fallback stays: a path nobody configured still gets
ReleaseFedwith limit 1000 on firstEnqueueWorkUnit. - No event, no auth, no MCP tool. Configuration is operational state, not a business fact other contexts react to, and the fleet CloudEvents standard requires no audit event for it, so none is published and the integration contract is unchanged. REST/MCP stay unauthenticated (fleet decision, see ADR-0016). No MCP tool is added: that would need its own decision under the MCP governance charter.
- Contract. The REST change is purely additive (a new route and two new problem types); no existing request, response or event changes.
Consequences
- Flow-fed pools are now reachable;
RebalanceDecision'sThrottleUpstreambranch and the backlog alarm can fire in a running system once an operator configures a pathFlowFed. - An operator can raise or lower a path's admission ceiling at runtime without a deploy and without touching the path catalogue.
- A lowered limit does not make the system "catch up" by cancelling work: the
overshoot (
wip > wipLimit) is visible in the response and in telemetry and drains only as work completes. This is deliberately conservative and reversible — raising the limit again restores throughput at once. - Switching a pool
ReleaseFed → FlowFedstops enforcing the limit immediately; entries keep their state. Switching back re-enforces it against whatever WIP is then outstanding (same pause semantics as lowering). - Verified by unit tests (domain rule incl. lowering below WIP, use case, HTTP) and testcontainers Postgres integration tests (create/update/idempotency, lowering below WIP without eviction, configure racing enqueue loses no entry).
- The configuration is not audited as an event. If auditability is later required it would be an analytics-topic-only event (a new ADR); nothing here prevents it.