Skip to content

feat: Notiflo v0.1.0 — Real-time alerting pipeline with sub-100ns evaluation#2

Merged
rajatady merged 11 commits into
mainfrom
claude/ai-marketing-orchestrator-GDkBq
Feb 20, 2026
Merged

feat: Notiflo v0.1.0 — Real-time alerting pipeline with sub-100ns evaluation#2
rajatady merged 11 commits into
mainfrom
claude/ai-marketing-orchestrator-GDkBq

Conversation

@rajatady
Copy link
Copy Markdown
Owner

@rajatady rajatady commented Feb 20, 2026

Summary

  • Rust hot-path runtime (notiflo-runtime): ingest → evaluate → render → deliver → event log pipeline with Drift Sentinel algorithm achieving 7.19M ticks/sec and ~75ns per evaluation
  • NestJS control plane API: REST API for managing organizations, subscribers, alerts, templates, and channels with Redis Streams delivery event tracking
  • Next.js dashboard UI: real-time metrics, alert management, notification history
  • Full test suite: 241 NestJS unit tests, 26 Rust unit tests, E2E tests against real MongoDB + Redis, Criterion benchmarks, built-in Rust load test binary
  • Open-source publishing files: LICENSE (Apache 2.0), CONTRIBUTING.md, CHANGELOG.md, CODE_OF_CONDUCT.md, SECURITY.md, GitHub templates, Docker setup, CI pipeline

Performance

Metric Value
Throughput 7.19M ticks/sec (10K conditions)
Evaluate latency (1K) 75ns
Evaluate latency (100K) 73ns (flat O(1) scaling)
Template render 1.08μs
HTTP delivery ~52μs

Test plan

  • cargo test --workspace --no-default-features — 26 Rust tests pass
  • npx nx test notiflo — 241 NestJS tests pass
  • cargo bench --bench pipeline_bench --no-default-features — benchmarks run
  • cargo run --release --bin load-test --no-default-features — load test completes with 0 errors
  • CI pipeline validates all 5 jobs (Rust, Rust integration, Node, NestJS E2E, load test smoke)

🤖 Generated with Claude Code

rajatady and others added 11 commits February 19, 2026 02:01
…rategies

Implements Phase 0-1 of the Rust re-architecture: a napi-rs native addon
that evaluates real-time conditions in-process with NestJS, targeting
sub-microsecond latency for the common case.

Three pluggable evaluation strategies via the EvaluationStrategy trait:
- ThresholdCrossing: sentinel-based B-tree (~18ns no-match, O(1) for 99%+ of ticks)
- Expression DSL: user-defined conditions parsed to AST ("value > 150 AND volume > 1M")
- Rhai Script: sandboxed scripting for advanced logic with resource limits

New Rust crates (libs/engine/):
- shared-types: core types + EvaluationStrategy trait
- engine-core: condition store, strategy registry, napi exports, benchmarks

New NestJS modules:
- libs/bridge/napi-bridge: @Injectable service wrapping napi calls
- apps/notiflo/src/app/alerts: CRUD controller/service with MongoDB + engine sync

18 Rust unit tests passing, Criterion benchmarks included.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…analytics, E2E

- Engine bridge: IEngineBridge interface, MockEngineBridgeService, DI token pattern
- Alert delivery: AlertDeliveryListener reacting to engine.condition.match events
- Tick ingestion: POST /alerts/ticks endpoint with SubmitTickDto
- Orchestrator: processAlertMatch() dual-path for real-time alert delivery
- Dashboard: engine metrics endpoint, aggregation service
- Pipeline library: 4-stage workers, resilience (CircuitBreaker, RateLimiter, RetryHandler),
  Kafka services, Redis cache services, full test coverage
- Analytics library: event tracking, aggregation, retention services
- MCP tools: create_price_alert, get_engine_status, submit_tick, list_alerts
- Channel providers: real tests for all 7 providers + registry
- Plugins system: plugin registry, hook executor, CRUD endpoints
- Webhooks system: webhook entity, delivery service, CRUD endpoints
- DI fixes: proper Mongoose model registration across 8 modules
- E2E integration test: full alert lifecycle with MongoMemoryServer
- Demo script: scripted REST API walkthrough

540+ tests across napi-bridge, notiflo, and pipeline-pipeline suites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d lib docs

- CLAUDE.md: comprehensive project onboarding with context recovery protocol
- .claude/rules/: path-specific rules for rust-engine, testing, nestjs-patterns,
  pipeline, and bridge (load conditionally based on files touched)
- .claude/commands/: custom slash commands — /context-save, /verify, /progress,
  /recover-context
- Nested CLAUDE.md files in libs/engine/ and libs/bridge/ for on-demand context
- .gitignore: exclude CLAUDE.local.md and .claude/settings.local.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tests, and publishing files

- Add real-DB E2E tests: NestJS against MongoMemoryServer + Redis, Rust integration tests against real MongoDB + Redis
- Replace k6 load tests with Rust-native hot-path load test binary (7.19M ticks/sec)
- Add Criterion pipeline benchmarks: evaluate throughput, template render, HTTP delivery, full hot-path chain
- Add open-source files: LICENSE (Apache 2.0), CONTRIBUTING.md, CHANGELOG.md, CODE_OF_CONDUCT.md, SECURITY.md
- Add GitHub templates: issue templates (bug report, feature request), PR template
- Add Docker setup: docker-compose.yml, Dockerfile.api, Dockerfile.runtime
- Add CI pipeline: 5 jobs (Rust tests, Rust integration, NestJS tests, NestJS E2E, load test smoke)
- Add Next.js dashboard UI scaffold
- Clean up dead modules (campaigns, workflows, events, plugins, webhooks, analytics, pipeline libs)
- Fix package.json license field (MIT → Apache-2.0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@inquirer/prompts@8.2.1 requires Node >= 20.12.0. Also add
--no-default-features to load-test-smoke CI job to avoid NAPI link errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… detection

- Fix clippy::should_implement_trait: implement FromStr for Channel
- Fix clippy::derivable_impls: derive Default for ThresholdAlgorithm
- Fix clippy::new_without_default: add Default impl for HttpProvider, PipelineStats
- Fix clippy::manual_is_multiple_of: use is_multiple_of()
- Fix clippy::useless_conversion: remove redundant .into()
- Add bench CI job: runs criterion benchmarks, fails if evaluate latency > 500ns
- Post benchmark results as sticky PR comment on pull requests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… rust cache

- Pin MongoMemoryServer to MongoDB 7.0.0 (Ubuntu 24.04 doesn't have 6.0.9)
- Guard redis-stream afterEach against undefined redis/db
- Add shared-key 'rust-ci' to Swatinem/rust-cache across all Rust jobs
- Remove unnecessary MongoDB service from node job (uses MongoMemoryServer)
- Set MONGOMS_VERSION env var in CI as fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…l workers

- alerts-mongo: use PATCH instead of PUT (matches controller route)
- redis-stream: ensure consumer group exists before XADD, use XTRIM
  instead of DEL to preserve consumer group between tests
- alert-lifecycle: same consumer group + XTRIM fix
- jest config: maxWorkers=1 — E2E tests share a Redis stream consumer
  group so parallel workers steal each other's events
- Delete empty notiflo.spec.ts stub

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MongoMemoryServer handles downloading the correct binary for any
platform automatically. No need for service containers or conditional
logic in Node test jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move app.e2e.spec.ts from apps/notiflo/ to apps/notiflo-e2e/
- Rewrite to use shared app-factory instead of standalone MongoMemoryServer
- Set MONGOMS_VERSION=8.0.4 in CI for Ubuntu 24.04 compatibility
- Unit tests no longer download MongoDB binaries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rajatady rajatady merged commit bab2ad0 into main Feb 20, 2026
6 checks passed
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