Skip to content

feat: add batch-capable reflex provider execution - #78

Merged
christopherjnelson merged 1 commit into
mainfrom
feat/batch-reflex-provider
Oct 2, 2026
Merged

christopherjnelson merged 1 commit into
mainfrom
feat/batch-reflex-provider

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

Worker transport previously awaited every Jev call serially. This adds optional native batch decisions and a bounded individual adapter while preserving frozen observations and the engine's seeded simultaneous action resolution.

  • Retain ReflexProvider.decide and add optional keyed decideBatch. Individual concurrency is explicitly bounded to 1–8; production Jev remains at the default of 1. Raising the production cap is a separate rollout decision. No native production provider is added.
  • Validate and attribute each worker result independently. Reordered results map by worker ID; duplicates invalidate that worker, unknown IDs are ignored, and missing, malformed, or failed results use the existing deterministic wait fallback. Non-array or oversized responses fail the dispatched group safely.
  • Stop dispatch and roll back the tick on cancellation or deadline expiry, including providers that ignore abort. Close attempt callbacks per invocation and reject late results, retries, and finalizers. Concurrent retry capacity is assigned before dispatch so completion timing cannot win scarce admission capacity. Unstarted reservations create no attempt records.
  • Record one shared attempt and charge per native batch dispatch, with explicit worker/turn membership. Export schema 14 carries that scope and allows unknown per-worker token usage. Aggregate totals count shared charges once; per-agent billing excludes them. Earlier exports require an older revision.

The existing planner-failure policy remains intact, including the 17 deterministic worker decisions covered by the regression test. Strategic options, planning cadence, replan thresholds, deterministic engine authority, and the cognition architecture are unchanged.

Architecture, security, testing, roadmap, archive documentation, and ADR 0035 describe the contract. A fresh reviewer challenged resolution order, concurrency, cancellation/deadlines, attribution, attempt finalization, billing, and compatibility; all actionable findings were addressed.

Validation on commit 674ba5c:

  • pnpm install --frozen-lockfile passed during local preparation.
  • pnpm validate passed: formatting, lint, type checks, 270 tests, and builds.
  • pnpm test:e2e passed: 2 browser tests.
  • Controlled scheduling and fake-clock tests cover the concurrency cap, reversed completion, native partial failures, cancellation, deadlines, late callbacks, queued workers, retry admission, and shared accounting. No paid providers were called.

The owner confirmed the validation gate before this draft was published.

@christopherjnelson
christopherjnelson marked this pull request as ready for review October 2, 2026 23:48
@christopherjnelson
christopherjnelson merged commit a12d3ce into main Oct 2, 2026
2 checks passed
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