feat: Notiflo v0.1.0 — Real-time alerting pipeline with sub-100ns evaluation#2
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
notiflo-runtime): ingest → evaluate → render → deliver → event log pipeline with Drift Sentinel algorithm achieving 7.19M ticks/sec and ~75ns per evaluationPerformance
Test plan
cargo test --workspace --no-default-features— 26 Rust tests passnpx nx test notiflo— 241 NestJS tests passcargo bench --bench pipeline_bench --no-default-features— benchmarks runcargo run --release --bin load-test --no-default-features— load test completes with 0 errors🤖 Generated with Claude Code