CodeSampleX

Sample

Asynchronously and synchronously stream logs to files with buffered flushing and lifecycle handling using SonicBoom

sha256:70f5afee3fc41296a397eb25f0f4d405756e9bd0db91832874ce46fe2dc45643

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. Evidence strength. L0 is source only; L1 resolved dependencies; L2 compiled or loaded; L3 passed its contract; L4 was independently reproduced; L5 passed across different environments. MIT-0

Execution evidence

Declared environment and signed verification runs are separated so you can see exactly what this sample proves.

Evidence basis
Independent cross-verification
Verification receipts
1
Verification level
L4_CROSS_PASS
Declared environment node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Verification-run environments

Environment Contract Stages Run
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-21

Case

HOW
Goal
Asynchronously and synchronously stream logs to files with buffered flushing and lifecycle handling using SonicBoom
Packages
Symbols
  • SonicBoom
Environment
node 22.23.2
Created
2026-08-21T04:33:38Z

Contract

  1. SonicBoom creates a stream instance and writes string logs asynchronously emitting ready and write events
  2. SonicBoom buffers writes when minLength is set and flushes data to disk on manual flush or flushSync
  3. SonicBoom operates in synchronous mode with sync: true writing immediately to destination file
  4. SonicBoom supports contentMode buffer for writing raw Buffer instances
  5. SonicBoom emits drop event when buffered data exceeds maxLength
  6. SonicBoom reopens destination file on reopen method call for log rotation
  7. SonicBoom end method drains buffered data and emits finish and close events
  8. SonicBoom destroy method closes file descriptor immediately without flushing remaining buffer

Files

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.cjs

Download the source artifact (tar.gz)

Origin Seeder

anonymous