Skip to content

test: pin leo-sdk-nodejs behavior as the reference for rstreams-rs parity - #228

Open
mecham-lynn wants to merge 19 commits into
masterfrom
feat/TASK-002-p1-tests
Open

mecham-lynn wants to merge 19 commits into
masterfrom
feat/TASK-002-p1-tests

Conversation

@mecham-lynn

@mecham-lynn mecham-lynn commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Tests only, with no source changes. This pins leo-sdk-nodejs's behavior as the reference that rstreams-rs (Rust) is being brought to parity with.

  • New test/*.utest.ts (sinon + chai, in the style of test/lib.cron.utest.ts) cover:
    • the config provider chain and its resolution order
    • cron: lock, checkpoint, run-again, schedule, trigger, report-complete
    • write options on toLeo (Kinesis/Firehose/S3, partitioning, backoff, toCheckpoint)
    • fast_s3_read retries and read hooks
    • eid helpers
    • the fanout wrapper
    • dynamodb.js
    • event-trace
  • child_process.fork is stubbed in the fanout tests. Outside Lambda, wrappers/fanout.js forks process.argv[1], which under mocha re-runs mocha.
  • AGENTS.md and CLAUDE.md added for contributors and agents.

Evidence

  • 301 → 685 passing tests.

  • Line coverage on the files the Rust port is checked against:

    File Lines covered
    lib/cron.js 99.5%
    rstreams-config-provider-chain 97.5%
    wrappers/fanout.js 93.8%
    lib/dynamodb.js 89.0%
    lib/stream/leo-stream.js 88.8%
    event-trace 82.9%
  • Deliberate breaks of the lock condition, the stale-checkpoint condition, and config secret order are each caught by a failing test.

  • Found while writing the tests and recorded rather than changed, since this PR changes no source: a rejected combined Firehose put is retried as the first record only (leo-stream.js:876-896), so the rest of that payload is dropped.

Testing

npm ci
npx tsc --watch false
npm run coverage-all

Companion PR in Chub-Engineering/rstreams-rs uses these behaviors as its oracle.

Task: TASK-002 (no Jira yet)

🤖 Generated with Claude Code


Note

Low Risk
Tests, documentation, and CI action pinning only; runtime SDK behavior is unchanged.

Overview
Adds a large behavioral test suite (TypeScript test/*.utest.ts, run as compiled *.utest.js) to lock in leo-sdk-nodejs as the reference for rstreams-rs parity. Coverage spans config resolution order, cron lifecycle, DynamoDB helpers, leo-stream read/write paths (including fast_s3_read), event IDs, event-trace, and the fanout wrapper—with DynamoDB/AWS clients stubbed via sinon.

Also adds AGENTS.md (build/test conventions, gotchas) and CLAUDE.md (alias to AGENTS.md). CI pins actions/checkout, setup-node, and upload-artifact to specific commit SHAs instead of floating @v3/@v4 tags.

No production library code changes.

Reviewed by Cursor Bugbot for commit e26d877. Bugbot is set up for automated code reviews on this repo. Configure here.

mecham-lynn and others added 18 commits October 14, 2026 12:38
Compiled TS files were remapped to .ts keys, so per-file coverage for
lib/event-trace.js and lib/rstreams-config-provider-chain.js could not be
read by filename. Disable source-map remapping and the instrument cache.

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… flow

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nularities

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ok, load

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ich/offload

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hooks, snapshot/archive

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate listeners

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assert the kept S3 request handler, pin the single-event queue partition key,
replace wall-clock waits with deferred promises, isolate leosdk/RSTREAMS_CONFIG
env keys in the provider-chain tests, and strip plan ids from titles.
Restore .nycrc.json to master (guard passes the flags instead).

Task: TASK-002

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 5a9aca87-973f-4480-bd5f-e6518ecf9db1)

@ch-snyk-sa

ch-snyk-sa commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

LeoPlatform now rejects actions referenced by tag, so the PR's CI matrix
failed at job setup. Pins checkout v3.7.0, setup-node v3.9.1 and
upload-artifact v4.6.2 (same majors as before).

Task: TASK-002

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: c5e8132b-24dd-4ba3-866b-c295593e2e22)

This branch has not been deployed

No deployments
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.

2 participants