Goal
Make pipes a native AIENOS execution primitive, not merely OSH syntax: two independently scheduled operations can exchange ordered bytes without intermediate files. This issue owns the bounded stream primitive only; task execution and shell dispatch are separate child issues.
Scope: OSH workstream architecture #158; P0 proposed within that finite workstream, NOT A MASTER PLAN or a change to CURRENT_EXECUTION_PLAN.md.
Verified source baseline (2026-10-18)
native/kernel/core/ipc.handipc.cimplement fixed-size 56-byte typed IPC messages and a bounded ring (CK_CHAN_CAP=8), not an ordered byte pipe with stream semantics.native/kernel/core/sched.hprovides a host-tested queue scheduler; scheduling wake/sleep integration is not demonstrated by that header.native/kernel/core/osh_op.his TEST-ONLY; it must not be mistaken for a production pipeline service.- OSH Platform ABI §8.1, §8.5, §9 already defines stream operations, capacity and per-effect authority checks.
Work
- Reuse capability-table/IPC ownership and generation checks; introduce a distinct pipe/byte-stream abstraction (do not silently reinterpret
ck_msgqueues as byte pipes). - Expose
PIPE_CREATE, boundedSTREAM_READ/WRITE,STREAM_CLOSE, and necessary endpoint transfer/duplication through versioned platform ops; distinguish read versus write capabilities. - Define stream epoch, reader/writer reference lifetimes, capability attenuation and revocation, and wakeups on close/revoke/cancel. Validate authority at point of effect, not only at parse/connection time.
- Implement FIFO byte ordering, partial I/O, a finite buffer and observable backpressure (
WOULD_BLOCKor blocking with scheduler progress); last-writer-close => eventual EOF, no readers =>BROKEN_PIPE. Never allocate unbounded memory. - Handle races: both ends closed, writer blocked at capacity, reader blocked with no data, revoke while waiting, stalled consumer, handle reuse after close, and interrupted I/O.
- Include host tests, QEMU negative tests, and testable metrics (max resident bytes, wakeups, waits, cancellations). No hardware or production-completion claims from host-only tests.
Definition of done
- Producer -> consumer transfers a binary payload (including NUL) byte-for-byte without a temporary file.
- Actual concurrent producer/consumer with bounded memory; slow consumer backpressures producer.
- EOF, BROKEN_PIPE, cancellation, revocation, and exhaustion are demonstrated with deterministic tests; no data emitted after revocation.
- All capability and stream handles are released across both success and failure paths.
- Exact source SHA, harness/compiler version, QEMU result and signed Spark judge evidence linked.
Follow-on dependencies
- Native task lifecycle/parallel stages, native OSH adapter, and durability/qualification need this stream primitive.
- Preserve kernel recovery path independent of OSH. Follow active architectural and execution authorities.
No code changes are included in this issue.