Skip to content

feat: per-flow-type concurrency + granular autoProvision + env-aware pathwayMode#75

Merged
jbiskur merged 5 commits intomainfrom
feat/command-poller
Apr 17, 2026
Merged

feat: per-flow-type concurrency + granular autoProvision + env-aware pathwayMode#75
jbiskur merged 5 commits intomainfrom
feat/command-poller

Conversation

@jbiskur
Copy link
Copy Markdown
Contributor

@jbiskur jbiskur commented Apr 17, 2026

Summary

  • Per-flow-type concurrency on startPump() via new PumpConcurrencyConfig (was hardcoded to 1).
  • Granular autoProvision on builder + startPump() via new AutoProvisionConfig (dataCore/flowType/eventType/pathway). Legacy defaultAutoProvision: boolean kept as deprecated alias.
  • Env-aware pathwayMode default — production → managed, development/test → virtual. Managed is the safe default for serverless runtimes (Next.js/Vercel/Cloudflare Workers).
  • Provisioner gained skipDataCore / skipFlowTypes / skipEventTypes to support id-resolution-only passes.
  • README + fmt-only fixes (CHANGELOG, cluster-manager, router).

Breaking changes

  • Production pathwayMode default flips from virtualmanaged. Explicit pathwayMode: "virtual" still wins.
  • startPump() concurrency may now exceed 1 per flow type — handlers should be idempotent.

Test plan

  • deno fmt --check green
  • deno lint green
  • deno check src/mod.ts green
  • deno test -A --ignore=tests/postgres-pathway-state.test.ts — all green
  • CI green

jbiskur and others added 5 commits April 17, 2026 13:42
Apply deno fmt to three files that accumulated formatting drift — unrelated
to the pathways config work that follows in subsequent commits. Keeps
deno fmt --check green in CI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pump concurrency was hardcoded to 1 event at a time per flow type, blocking
real-world throughput. Introduce PumpConcurrencyConfig accepting either a
shared numeric default or per-flow-type overrides keyed by flow type name.

Usage:
  startPump({ concurrency: 4 })                               // shared
  startPump({ concurrency: { default: 2, byFlowType: { ... } } })

Omitted flow types fall back to the shared default (or 1 when unset), so the
feature is additive and backward compatible. Breaking-change marker only
reflects the option-surface type widening.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Auto-provisioning was all-or-nothing — each of dataCore, flowType, and
eventType stages ran together, making it impossible to manage resources
with a mix of pre-provisioned and managed items. Add optional skip flags
that short-circuit the create/update path while still resolving resource
ids for downstream stages:

- skipDataCore:  fetches the data core id but never writes it; rethrows the
  existing missing-data-core error if the core doesn't exist.
- skipFlowTypes: reads the flow-type list so event types can still resolve
  their parent id; errors loudly if a named flow type is missing.
- skipEventTypes: short-circuits the event type loop entirely (and the
  flow-type list fetch too, when both are skipped).

Ownership semantics from fragment 79a08d39-e7b5-44ec-a3c0-262f292a1b22
still hold — the description-missing errors from the non-skip path still
fire when a skip flag is set but the resource is required.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two correlated changes that together make Pathways usable across Next.js /
Vercel and traditional cluster-mode deployments without footguns:

1. AutoProvisionConfig replaces the all-or-nothing defaultAutoProvision
   boolean. Toggle each of dataCore/flowType/eventType/pathway
   independently; most deployments want resources on + pathway off, which
   is the new default. startPump({ autoProvision: ... }) accepts the same
   object for per-call override.

2. pathwayMode now defaults to "managed" in production and "virtual" in
   development/test. Virtual cluster mode breaks serverless runtimes
   (port 9090 collisions, instrumentation hook not firing, non-leader pod
   timeouts — see solutions 27e83406-8d57-4e95-a464-7df9bf0b9d06 and
   8780b9c4-ec26-4921-8a6f-23ca7e8ee0a3). Managed routes event delivery
   through the control plane and is safe everywhere.

defaultAutoProvision is kept as a deprecated alias that maps to the new
shape; existing apps keep working. The "!" marks the behavioral default
change — prod deployments that relied on pathwayMode being "virtual"
must now set it explicitly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…urrency

Runtime Defaults section now shows the env-aware pathwayMode table
(production → managed, development/test → virtual), explains why managed
is the default in production, and demonstrates granular AutoProvisionConfig
with a deprecated-mapping note for defaultAutoProvision.

Adds a new Pump Concurrency section with shared-default and per-flow-type
override examples, and notes the per-call autoProvision override at
startPump() call time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jbiskur jbiskur force-pushed the feat/command-poller branch from 36d95e0 to de04e56 Compare April 17, 2026 12:42
@jbiskur jbiskur merged commit 7602908 into main Apr 17, 2026
1 check passed
@jbiskur jbiskur deleted the feat/command-poller branch April 17, 2026 12:43
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