Skip to content

Support live ordered OFCA streams - #1

Merged
MichalCz merged 1 commit into
mainfrom
recovery/ofca-core-streaming
Sep 9, 2026
Merged

MichalCz merged 1 commit into
mainfrom
recovery/ofca-core-streaming

Conversation

@MichalCz

@MichalCz MichalCz commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

  • make ordered concurrency progress with live async sources
  • bound reorder buffering while preserving rolling refill
  • make cancellation prompt and prevent late input dispatch

Validation

@scramjet/ofca@0.1.0 test
npm run build && node --test test/*.test.js

@scramjet/ofca@0.1.0 build
npm run clean && npm run build:ts && npm run build:pkg

@scramjet/ofca@0.1.0 clean
node -e "const fs=require('node:fs');for(const d of ['dist','.build'])fs.rmSync(d,{recursive:true,force:true})"

@scramjet/ofca@0.1.0 build:ts
tsc --project tsconfig.json

@scramjet/ofca@0.1.0 build:pkg
node scripts/build-package.js

Built publishable package in dist/ (index.js, index.d.ts, README.md, LICENSE, scramjet_sheep_vector.svg, package.json)
TAP version 13

Subtest: ofca accepts array, sync iterable, async iterable, and Readable sources

ok 1 - ofca accepts array, sync iterable, async iterable, and Readable sources

duration_ms: 4.886351
type: 'test'
...

Subtest: ofca bounds concurrency and emits out-of-order completion in input order

ok 2 - ofca bounds concurrency and emits out-of-order completion in input order

duration_ms: 41.317566
type: 'test'
...

Subtest: ofca distinguishes DROP from undefined and stops dispatch after an error

ok 3 - ofca distinguishes DROP from undefined and stops dispatch after an error

duration_ms: 0.895827
type: 'test'
...

Subtest: ofca closes a source iterator when the consumer exits early

ok 4 - ofca closes a source iterator when the consumer exits early

duration_ms: 1.513039
type: 'test'
...

Subtest: ofca emits a live result without waiting for the next source item

ok 5 - ofca emits a live result without waiting for the next source item

duration_ms: 1.691206
type: 'test'
...

Subtest: ofca refills a rolling window while an earlier item is delayed

ok 6 - ofca refills a rolling window while an earlier item is delayed

duration_ms: 10.752708
type: 'test'
...

Subtest: ofca keeps a stalled first source read bounded

ok 7 - ofca keeps a stalled first source read bounded

duration_ms: 10.73803
type: 'test'
...

Subtest: ofca cancellation closes a blocked input without dispatching late values

ok 8 - ofca cancellation closes a blocked input without dispatching late values

duration_ms: 3.405333
type: 'test'
...

Subtest: compose preserves a plain sync return

ok 9 - compose preserves a plain sync return

duration_ms: 1.137943
type: 'test'
...

Subtest: compose accepts array, async, and mixed stages in order

ok 10 - compose accepts array, async, and mixed stages in order

duration_ms: 0.989775
type: 'test'
...

Subtest: compose awaits an all-async chain

ok 11 - compose awaits an all-async chain

duration_ms: 0.116038
type: 'test'
...

Subtest: compose enforces its documented stage contract

ok 12 - compose enforces its documented stage contract

duration_ms: 0.586975
type: 'test'
...

Subtest: dist deliverable is complete and sanitized (manifest + exact file set)

ok 13 - dist deliverable is complete and sanitized (manifest + exact file set)

duration_ms: 2.281256
type: 'test'
...

Subtest: dist manifest propagates allowlisted metadata from the development manifest

ok 14 - dist manifest propagates allowlisted metadata from the development manifest

duration_ms: 0.535097
type: 'test'
...

Subtest: dist manifest strips development-only fields

ok 15 - dist manifest strips development-only fields

duration_ms: 0.240563
type: 'test'
...

Subtest: generated declarations and compiled entry are shipped at the dist root

ok 16 - generated declarations and compiled entry are shipped at the dist root

duration_ms: 0.871421
type: 'test'
...

Subtest: ofcaSync uses array order and preserves undefined while dropping DROP

ok 17 - ofcaSync uses array order and preserves undefined while dropping DROP

duration_ms: 1.969198
type: 'test'
...

Subtest: ofcaSync accepts synchronous iterables and rejects async behavior

ok 18 - ofcaSync accepts synchronous iterables and rejects async behavior

duration_ms: 0.351743
type: 'test'
...
1..18

tests 18

suites 0

pass 18

fail 0

cancelled 0

skipped 0

todo 0

duration_ms 276.451425 (18 passing)

@MichalCz
MichalCz merged commit 72e6ae6 into main Sep 9, 2026
1 check passed
@MichalCz
MichalCz deleted the recovery/ofca-core-streaming branch September 9, 2026 09:30
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