Add dual sync/async runtime primitives #55

Merged
lost-rob0t merged 20 commits from agent/dual-sync-async-runtime into main 2026-08-16 05:16:42 +00:00
lost-rob0t commented 2026-08-16 05:01:49 +00:00 (Migrated from github.com)

What changed

  • add a reusable rlm_async future/task runtime with opaque futures;
  • bound async execution with a fixed worker set and finite backlog instead of one thread per future;
  • add non-blocking status, synchronous await, timeout, cancellation, cleanup, composition, and runtime counters;
  • add async completion/query wrappers while preserving the existing synchronous result shape;
  • preserve the top-level public recursion gate identically across sync and async completion calls;
  • add async provider/chain, tool, MCP, agent, and graph facades;
  • preserve tool outcome + trace through a structured async result;
  • document the dual API and scheduler semantics;
  • add deterministic PlUnit coverage for result shape, timeout, cancellation, exceptions, concurrent futures, completion behavior, public gate parity, and tool invocation.

Architecture

The async layer does not duplicate model/tool/MCP/agent/graph business logic. It schedules the existing canonical operation and returns its ordinary result through a future. Sync callers keep the existing predicates; interactive callers can submit, poll, await, cancel, and compose futures.

The generic scheduler is deliberately domain-neutral. Capability checks, budgets, recursion policy, MCP negotiation, graph semantics, and future authority policy stay inside their owning libraries.

The scheduler owns a private finite message queue and bounded worker set. The queue is not exposed to callers; the registered runtime is therefore the authority for its lifetime rather than relying on version-specific queue-probing helpers.

Validation

  • deterministic PlUnit: pass on the latest head;
  • deterministic benchmark/conformance: pass;
  • deterministic deep-recursion experiment: pass;
  • CLI/trace, persistence, artifact, and whitespace gates: pass;
  • live OpenRouter core suite: pass; remaining live integration sub-gates are still running on the latest head.

Implements the primary runtime slice of #54.

## What changed - add a reusable `rlm_async` future/task runtime with opaque futures; - bound async execution with a fixed worker set and finite backlog instead of one thread per future; - add non-blocking status, synchronous await, timeout, cancellation, cleanup, composition, and runtime counters; - add async completion/query wrappers while preserving the existing synchronous result shape; - preserve the top-level public recursion gate identically across sync and async completion calls; - add async provider/chain, tool, MCP, agent, and graph facades; - preserve tool outcome + trace through a structured async result; - document the dual API and scheduler semantics; - add deterministic PlUnit coverage for result shape, timeout, cancellation, exceptions, concurrent futures, completion behavior, public gate parity, and tool invocation. ## Architecture The async layer does not duplicate model/tool/MCP/agent/graph business logic. It schedules the existing canonical operation and returns its ordinary result through a future. Sync callers keep the existing predicates; interactive callers can submit, poll, await, cancel, and compose futures. The generic scheduler is deliberately domain-neutral. Capability checks, budgets, recursion policy, MCP negotiation, graph semantics, and future authority policy stay inside their owning libraries. The scheduler owns a private finite message queue and bounded worker set. The queue is not exposed to callers; the registered runtime is therefore the authority for its lifetime rather than relying on version-specific queue-probing helpers. ## Validation - deterministic PlUnit: pass on the latest head; - deterministic benchmark/conformance: pass; - deterministic deep-recursion experiment: pass; - CLI/trace, persistence, artifact, and whitespace gates: pass; - live OpenRouter core suite: pass; remaining live integration sub-gates are still running on the latest head. Implements the primary runtime slice of #54.
lost-rob0t (Migrated from github.com) reviewed 2026-08-16 05:16:59 +00:00
lost-rob0t (Migrated from github.com) left a comment

Merged after all deterministic and live OpenRouter CI gates passed.

Merged after all deterministic and live OpenRouter CI gates passed.
lost-rob0t (Migrated from github.com) reviewed 2026-08-16 05:17:22 +00:00
lost-rob0t (Migrated from github.com) left a comment

Issue #54 remains open intentionally: #55 lands the reusable bounded future runtime and async facades. Authority-specific async approval hooks depend on #53, MCP install/run lifecycle depends on #52, and process/network async variants depend on the external tool-pack work.

Issue #54 remains open intentionally: #55 lands the reusable bounded future runtime and async facades. Authority-specific async approval hooks depend on #53, MCP install/run lifecycle depends on #52, and process/network async variants depend on the external tool-pack work.
lost-rob0t (Migrated from github.com) reviewed 2026-08-16 05:17:29 +00:00
lost-rob0t (Migrated from github.com) left a comment

Implementation summary: rlm_async now provides opaque futures, bounded workers/backlog, status, await/timeout, cancellation and composition. Async facades exist for completion/query, chain/provider, tool invocation, MCP commands/server handling, supervised agent operations, and graph run/resume. All deterministic and live OpenRouter CI gates passed before squash merge ee9a28e.

Implementation summary: `rlm_async` now provides opaque futures, bounded workers/backlog, status, await/timeout, cancellation and composition. Async facades exist for completion/query, chain/provider, tool invocation, MCP commands/server handling, supervised agent operations, and graph run/resume. All deterministic and live OpenRouter CI gates passed before squash merge `ee9a28e`.
Sign in to join this conversation.
No description provided.