πŸš€ Stellwerk - Feature Roadmap

Overview

This roadmap lists proposed features for evolving the Stellwerk calculation engine. Features are grouped by priority and effort.

Status Legend: - βœ… Implemented (working in code) - 🧩 Partial (foundation exists, extensions pending) - ⏳ Open (not started)

Source of truth for behavior and syntax: - docs/formula_user_guide.md β€” formula syntax, export/return, collections - lib/flow_rate/collection_functions.rb β€” implemented helpers and coercion - app/services/flow_rate/rule_evaluator.rb β€” context seeding, join logic, projection preprocessing

Implemented Foundation (Snapshot 2025-10-02)

  • βœ… Devise-based user authentication
  • βœ… Multi-tenancy (UUID, auto tenant provisioning)
  • βœ… API key auth (Bearer / X-API-Key) + tenant resolution
  • βœ… Graph-based rule evaluation (token queue, join wait_then_pick, join_selection_expr)
  • βœ… FlowLinter warnings (conflicting end assignments)
  • βœ… Pundit policies (Tenant, Product) simple roles (admin/user)
  • βœ… Multi-line formulas with export/return semantics
  • βœ… Join config fields (join_mode, tie_breaker, join_selection_expr) in models/evaluator – βœ… Collection projection & aggregation functions (Phase 1):
    • project(), sum(), count(), min(), max(), first(), last(), take()
    • Projection syntax: items[].field with nested chains (e.g. order.items[].price)
    • Numeric coercion for aggregations; mixed-types handled safely – βœ… Export semantics: by default ONLY the last assignment per rule is exported unless explicit export/return is used (docs aligned) – βœ… Preprocessing: projection syntax rewritten to project()/deep_project; dotted chains before [*] resolved into nested calls – βœ… Templates soft-hidden by default: routes gated by FEATURE_TEMPLATES, evaluator ignores template schema unless enabled, API omits template fields when disabled

– βœ… API authentication refinements - Session + CSRF for same-origin requests to API (browser-based simulator path) - API key auth retained for machine clients - Strict tenant scoping; removed X-Tenant-ID fallback

– βœ… Visual Flow Builder improvements - Defaults sidebar hidden by default and overlays canvas correctly (fixed, z-indexed) - After saving defaults: server recomputes FlowLinter warnings and refreshes node badges - Client picks up updated available inputs via Turbo and revalidates nodes - Integrated Simulator in Visualizer: execute calculation inline using current ruleset, session-authenticated; shows result context and requirements section; single JSON textarea with scroll isolation, focus fix, and mutual exclusivity with Defaults

– βœ… API execute UX - Execute accepts empty inputs (uses defaults) - Response includes requirements (declared_types, required_without_defaults) for better guidance

Partially Present

– 🧩 Visual Flow Builder (base UI, connections, simplified anchors; Simulator integrated) β€” Missing full debugging/step trace; Context Inspector planned next - 🧩 Variable provenance (internal exported_variable_names helper, no UI yet) - 🧩 Performance heuristics (historical stop flags; path optimization without caching/metrics)

Open Core Gaps (near-term candidates)

  • ⏳ Rate limiting / throttling
  • ⏳ Audit trail & versioning (PaperTrail or similar)
  • ⏳ Inline rule testing framework + bulk tests
  • ⏳ Analytics / observability (execution metric aggregation + dashboard)
  • ⏳ Granular RBAC (viewer/editor/admin, API scopes)
  • ⏳ Conflict auto-resolution / deterministic final selection UI
  • ⏳ Webhook / integrations system
  • ⏳ Collection processing Phase 2: map(), filter(), distinct(), average()/avg(), sumif(), countif(), trace() (lightweight debug), future: group_by(), reduce()
    • Acceptance criteria:
      • Functions available in Dentaku registry with tests for mixed-type safety
      • Projection expressions accepted for collection roots (items[*].price)
      • avg() ignores non-numeric coercion failures; returns nil on empty set
      • sumif()/countif() support predicate expression; optional projection for sumif
      • trace() emits to lightweight execution trace buffer (dev-only flag)

The following sections remain the original planned feature blocks, implicitly referencing the status above.


🟒 Phase 1: Immediate (Low-hanging fruit)

(NEW) πŸ’¬ Flow Comments (Status: ⏳ Open)

Effort: 2-3 days Β· Priority: High (collaboration & AI context)

Lightweight contextual discussion + rationale capture on Flows/Rulesets.

– MVP - Polymorphic Comment(model: commentable -> Flow/Ruleset) - Plain text + optional markdown subset - Attribution (user, timestamp) - UI panel toggle in builder - Basic edit/delete (author only)

– Phase 1 Enhancements - @mention (local users) - AI summary button (generate thread digest) - Export comments into snapshot when version promoted

– Non-Goals (Initial) - Thread nesting >1 level - Reactions / emoji - External notifications

Success Metric: % flows with β‰₯1 comment & reduction in ad‑hoc doc notes.

1. πŸ“Š Advanced Analytics Dashboard (Status: ⏳ Open)

Effort: 2-3 weeks Priority: High

– Calculation performance metrics - Avg execution time per calculation - Executions per day/week/month - Performance trends over time - Slowest rulesets identification

– Rule usage statistics - Most used rules - Unused / rarely used rules - Visualize rule execution paths - Stop rule effectiveness

– Error rate monitoring - Failed calculations dashboard - Error pattern analysis - Alerts on critical errors - Error recovery suggestions

– Tenant-specific insights - Usage patterns per tenant - Resource consumption tracking - Tenant performance comparisons

2. πŸ“‹ Audit Trail & Versioning (Status: ⏳ Open)

Effort: 3-4 weeks Priority: High

Extension Scope (clarification): Incorporate flow graph snapshots & lifecycle states (see Lifecycle section addendum below). Initial implementation should expose version records (immutable JSON export of nodes + rules) and simple diff (added/removed/changed nodes & formulas).

– Complete change history - Track all rule / ruleset changes - User attribution for changes - Diff view - Timestamps & comments

– Rollback functionality - One-click rollback - Batch rollback - Preview mode - Impact-aware confirmation

– User activity logs - Login/logout tracking - API access logs - Permission changes - Compliance export

– Change notifications - Email notifications for critical changes - Slack/Teams integration - Configurable notification rules - Digest emails

3. πŸ”§ Rule Testing Framework (Status: ⏳ Open – NEXT FOCUS)

Effort: 2-3 weeks Priority: Very high

– Rule unit tests (MVP Target In Progress Planning) - Create test cases inside rule editor - Show expected vs actual - Path coverage - Automated execution

– Batch testing - CSV upload - Bulk testing across rules - Large dataset performance tests - Export results

– A/B testing framework - Parallel versions - Traffic splitting - Statistical significance tracking - Winner selection

– Regression testing - Auto tests on change - CI/CD integration - Failure notifications - Baseline comparison

4. πŸ“€ Import/Export System (Status: ⏳ Open)

Effort: 2-3 weeks Priority: Medium

– Excel/CSV import - Bulk import rules & products - Pre-import validation - Preview with error highlighting - Downloadable templates

– JSON export for backup - Complete tenant export - Selective export (rulesets) - Encrypted backups - Scheduled backups

– Template sharing - Share rule templates across tenants - Public template library - Ratings & reviews - Template version control

– Configuration-as-code - YAML/JSON config files - Git integration - IaC patterns - Environment-specific configs


🟑 Phase 2: Mid-term (Medium effort)

5. πŸ”— Webhook & Integration System (Status: ⏳ Open)

Effort: 4-5 weeks Priority: High

– Outgoing webhooks - POST on calculation events - Configurable per tenant - Retry with exponential backoff - Delivery status dashboard

– External API integration - Pre-built connectors - Custom endpoints - External call rate limiting - Response caching

– Notification channels - Slack alerts - Microsoft Teams - Email templates - SMS for critical events

– Zapier/IFTTT support - Pre-built Zapier app - IFTTT integration - Trigger/action definitions - Community templates

6. πŸ“ˆ Advanced Rule Features (Status: 🧩 Partial – some join/graph foundations exist)

Effort: 5-6 weeks Priority: Medium

– Time-based rules - Start/end validity - Timezone-aware scheduling - Recurring (daily/weekly/monthly) - Holiday calendar

– Lookup tables - External data sources - CSV-based tables - DB lookups during execution - Lookup caching

– Template inheritance - Parent-child product relationships - Inherited rules with overrides - Bulk updates propagate - Inheritance tree visualization

– Bulk operations - Multi-select - Batch edit - Preview mode - Undo / redo

7. 🎨 Enhanced UI/UX (Status: 🧩 Partial – base flow builder exists)

Effort: 6-8 weeks Priority: Medium

– Visual flow builder - Drag & drop editor - Visual condition trees - Flow chart representation - Interactive debugging

– Enhanced rule debugger - Step-by-step tracing - Variable inspector - Breakpoints - Per-rule performance profiling

– Modern UI improvements - Dark mode - Custom themes - Better mobile UX - Accessibility (WCAG 2.1)

– Advanced search & filtering - Global entity search - Saved queries - Advanced filter combinations - Highlighting

8. πŸ” Enterprise Security (Status: ⏳ Open – only basic auth & simple roles)

Effort: 4-6 weeks Priority: High (enterprise)

– SSO integration - SAML 2.0 - OAuth2 / OIDC - Active Directory - MFA

– Fine-grained permissions - RBAC - Resource level - API endpoint restrictions - Permission change audit trail

– Security hardening - Tenant IP allowlisting - Redis rate limiting - Request signing - Data encryption at rest

– Compliance features - GDPR tools - Data retention policies - Right to be forgotten - Compliance reporting


πŸ”΄ Phase 3: Long-term (High impact)

9. πŸ€– AI/ML Features (Status: ⏳ Open)

Effort: 8-12 weeks Priority: Innovation

– Automatic rule optimization - ML-based performance tuning - Simplification suggestions - Dead code detection - Auto-generated test cases

– Anomaly detection - Unusual result detection - Fraud patterns - Data quality monitoring - Alerts

– Predictive analytics - Usage forecasting - Capacity planning - Trend analysis - Impact predictions

– Smart suggestions - Rule writing autocomplete - Best practice recommendations - Similar rule detection - Optimization hints

10. πŸ“Š Business Intelligence (Status: ⏳ Open)

Effort: 10-14 weeks Priority: Medium

– Advanced reporting engine - Custom report builder - SQL query interface - Interactive charts - Export to PDF/Excel/PowerBI

– Custom dashboard builder - Drag & drop creation - Widget library - Real-time updates - Shareable links

– BI tool integration - Tableau connector - Power BI - Looker / Data Studio - REST API

– Scheduled reports - Automated generation - Email delivery - Templates - Subscriptions

11. πŸ”„ Workflow Automation (Status: ⏳ Open)

Effort: 8-10 weeks Priority: Medium

– Approval workflows - Multi-stage process - Impact-based approval rules - Email notifications - History tracking - (Future tie-in) Block promotion unless latest snapshot approved

– Automated deployment - CI/CD for rule changes - Automated testing pre-deploy - Blue-green deployments - Rollback automation

– Environment management - Dev/staging/production - Promotion workflows - Config drift detection - Sync tools

– Canary deployments - Gradual rollouts - Production A/B testing - Automatic rollback - Traffic splitting controls

12. 🌍 Multi-Region Support (Status: ⏳ Open)

Effort: 12-16 weeks Priority: Enterprise feature

– Geographic data residency - Region-specific storage - Local compliance - Cross-region replication - Cross-region disaster recovery

– Performance optimization - CDN for static assets - Edge computing for calculations - Regional API endpoints - Latency monitoring

– Multi-database support - Sharding strategies - Read replicas - Cross-DB transaction mgmt - Consistency guarantees

– Operational excellence - Global monitoring dashboard - Cross-region alerting - Centralized logging - Global load balancing


πŸ“ˆ Implementation Recommendations

Quick Wins for immediate value:

  1. Rule Testing Framework - Quality foundation
  2. Advanced Analytics - Leverage existing data
  3. Audit Trail - Enterprise expectation
  4. Flow Comments - Collaboration & rationale capture

Strategic Investments:

  1. Visual Flow Builder - UX differentiation
  2. AI/ML Features - Market differentiation
  3. Multi-Region Support - Global scalability
  4. Lifecycle & Version Promotion - Governance & controlled rollout

Revenue Drivers:

  1. Enterprise Security - Higher pricing tiers
  2. Business Intelligence - Additional revenue streams
  3. Webhook System - Integration stickiness

🎯 Success Metrics

  • Collaboration Density: Flows with β‰₯1 comment / total flows
  • Approval Lead Time: draftβ†’approved median (post lifecycle introduction)
  • Version Churn Stability: % versions rolled back within 24h (target low)

  • Adoption Rate: % tenants using new features
  • Time-to-Value: Speed to first realized benefit
  • Feature Utilization: Depth of usage per feature
  • Customer Satisfaction: NPS for new releases
  • Revenue Impact: Feature-attributed growth

πŸ’Έ Pricing & Packaging

See PRICING.md for tier details (Free, Pro, Enterprise) and gating approach. Representative paid features include: - Audit trail & versioning (Pro/Enterprise) - Advanced Analytics dashboard (Pro/Enterprise) - Rule Testing Framework (batch/regression). Note: inline testing via the integrated Simulator is Free. - Webhooks & Integrations (Pro/Enterprise) - SSO and advanced RBAC (Enterprise) - Multi-region/data residency (Enterprise)