Skip to content

refactor: migrate async runtime and coordination to kernal-api #239

Closed

Description

@zackees

Context

Remaining direct Tokio usage is concentrated in commands.rs, test_mode.rs, server.rs and compile_stream.rs. The kernel already owns runtime construction, task handles, channels, semaphore, sleep and timeout APIs. Other call sites require broadcast/SSE integration, signal waiting and server I/O ownership.

Work

  • Migrate runtime construction and compatible sleep/timeout operations to async_engine first, preserving product deadlines and exit behavior.
  • Migrate channels, tasks and semaphore where their semantic contracts match; coordinate types across server and command boundaries.
  • Fill necessary upstream signal/broadcast/server gaps separately with generic tests in kernal-api.
  • Preserve cancellation and child containment behavior; keep FastLED test-runner policy here.
  • Enforce migrated operations with a source boundary test and run targeted/full workspace tests and strict Clippy.
  • Resolve remaining direct Tokio/tokio-stream dependencies with evidence, not a backend re-export. Kernel async_engine currently deliberately retains select!/attribute macro call sites as an unresolved macro-boundary decision; record that constraint rather than silently inventing a generic race facade.

Refs #229. HTTP predecessor: #238 / forge-ci/kernal-api#169.

Activity

  1. zackees commented on Sep 13, 2026

    @zackees
    MemberAuthor

    Commit a290632 migrates all bounded command/output channels to kernal-api; no direct Tokio mpsc imports remain. Depends on forge-ci/kernal-api#171 (stacked on HTTP #169) and a subsequent exact published release. Expanded boundary test RED before adoption / GREEN afterward; kernel generic tests cover bounded backpressure, ordering, receiver-close/drop wakeup and entered-runtime rejection. Full app validation: 255 Rust tests, strict all-target Clippy, 27 Python tests / 1 skipped, Ruff pass. Single pre-push review clean. Migration remains incomplete: broadcast, signals/timers, semaphore try-acquire, server and other dependency inventory rows are still open.

  2. zackees commented on Sep 13, 2026

    @zackees
    MemberAuthor

    Commit 97772c1 migrates remaining timers and semaphore admission to kernal-api. Depends on forge-ci/kernal-api#173 (stacked after #171/#169) and publication. No direct tokio::time or tokio::sync::Semaphore usage remains. Preserves 100ms periodic viewer checks, deadline priority and four-slot sleep endpoint; product test now verifies HTTP429 when saturated and admission after a slot is released. RED-to-GREEN boundary and upstream mechanism tests pass; final app255 Rust tests, strict Clippy, Python27 pass/1skip, Ruff pass, one-reviewer clean. Remaining Tokio operations: broadcast/SSE streaming, signals, async filesystem, server listener, select/pin/test macros. Other dependency inventory rows and exact-release adoption are still outstanding.

  3. zackees commented on Sep 13, 2026

    @zackees
    MemberAuthor

    Commit d14052a migrates broadcast senders/receivers and SSE stream adaptation to kernal-api, removing direct tokio-stream from both manifests. Depends on forge-ci/kernal-api#175. Boundary RED/GREEN, full255 Rust tests, strict Clippy, Python27pass/1skip, Ruff and one-reviewer review all pass. Generic bounded-fanout/lag/cancellation/stream tests live upstream; app retains eventJSON and SSE lag-filter policy. HTTP predecessor #169 merged as ad2269e after all CI passed, including native Windows. Blocking-channel PR#171 is retargeted to main and its CI is still running without failures. Release publication/adoption and remaining infrastructure inventory remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions