Skip to content

Latest commit

 

History

History
330 lines (269 loc) · 33.3 KB

roadmap.md

File metadata and controls

330 lines (269 loc) · 33.3 KB

RuleLoom Roadmap

Last reviewed: 2026-10-26

The single overview of what has been built, what is next, and what is planned but not yet scheduled. Details live in GitHub issues and in specs/; this page links to them rather than repeating them.

Vision: a library-first rule engine where developers define what's possible (operators, actions, events, schemas) and end users define business logic (JSON rules) — without code changes. How it's meant to be deployed and who owns what (core library, optional packages, consumer) is in vision.md.

How work is planned

PRD → phase issues → spec → implementation (see AGENTS.md). New work is referred to by issue number. The old "Phase N.M" numbers below are kept only to connect to historical docs — they were reused inconsistently between documents.

Releases

Version Status Contents
0.1.0 Tagged v0.1.0 (release-please bootstrap; no GitHub release or NuGet package) Core engine, operators, JSON parser, Phase 1.1 stability fixes
0.2.0 Released 2026-10-02 Action results, scheduling model, action factory, schedule calculation
0.2.1 Released 2026-10-03 Nested path fix (#14), shared path cache (#15)
0.3.0 Released 2026-10-06 PRD #22 API hardening (one breaking release; migration guide follows in #6)
0.4.0 Released 2026-10-06 Action names by registration, IAction, dependency injection, upgrading guide
0.5.0 Released 2026-10-15; the first release on NuGet JSON state, ISO date comparison, required rule ids, ConsoleLogAction, ASP.NET Core sample
0.6.0 Released 2026-10-25 Event schemas (RuleLoom.Schemas), contexts, validation against schemas, the catalog, previous state from changed fields
0.7.0 Released 2026-10-26 Typed actions (IAction<TParameters>), $path parameters, parameter validation, rule-by-rule parsing (ParseEach), RuleLoom.AspNetCore (MapRuleLoom)

✅ Done

Core foundation

Abstractions (ConditionNode, IConditionOperator, IAction), RuleEngine, ConditionEvaluator, PathResolver with compiled-expression caching, operators eq changed and or not, JSON parser, LogAction.

Stability fixes (old Phase 1.1)

Priority ordering (higher first), operand-count validation, null-safe path resolution, continue-on-error per rule, integration test project.

Action scheduling & DI — PRD #1 ✅

Issue Slice PR Spec
#2 Scheduling model & ActionResult #7 scheduling-model-abstractions
#3 Action factory & per-rule results #9 action-factory-pattern
#4 Schedule calculation engine #10 schedule-calculation-engine
#55 Action names by registration, "action" in rule JSON #56 action-names
#5 Dependency injection (AddRuleLoom) #54 dependency-injection
#58 Rename IActionExecutor → IAction #59 —
#6 Integration tests, samples, upgrading guide, quick start rewrite #60 integration-samples-upgrading

Actually dispatching scheduled actions was out of scope for this PRD; see the vision's "Running scheduled actions later".

Code review bug batch (2026-10-02)

Issue Change Fixed by
#14 Unscoped nested paths (Address.City) threw #24
#15 Path accessor cache recreated per event (~290× faster now) #26
#20 Unit tests for operators, evaluator, path resolution (RuleLoom coverage 57% → 90%) #29
#21 Test packages aligned; xunit v3 on Microsoft.Testing.Platform; coverage in both projects #28
#16 · #17 · #18 · #19 changed with scoped paths · clearer errors · cancellation checks · ISO-only string dates folded into #38 · #34 · #32 · #33

API hardening — PRD #22 ✅ (ships in 0.3.0)

Shared value comparison, OperatorContext, ordering operators, complete results, case-insensitive names, typed action parameters, $current/$previous, parse-time and registry-based validation. Every slice has a spec in specs/.

Issue Slice PR
#30 Shared value comparer (ValueComparer/ValueConverter), used by eq #41
#31 Parse-time structural validation (RuleParseException) #43
#32 Complete engine results (RuleEngineResult, rule status, action identity) — HITL #44
#33 ISO 8601 string dates for schedule ReferencePath #48
#34 OperatorContext operator API — HITL #45
#35 Action parameters as CLR values, GetParameter<T> #49
#36 gt, gte, lt, lte #46
#37 Case-insensitive names #47
#38 $current / $previous scope prefixes (no migration guard: package unpublished) #50
#39 RuleValidator against registered operators and actions #51

JSON state & ASP.NET Core spike — PRD #66 ✅ (ships in 0.5.0)

Rules run on JSON state (JsonElement, JsonNode), ISO 8601 strings compare as dates, changed uses the shared comparer, rule ids are required, and the console action is ConsoleLogAction. An ASP.NET Core sample receiving JSON events from other services tried the library as intended; its findings decided the event envelope and shaped 0.6–0.8.

Issue Slice Type PR Spec
#68 Resolve paths on JSON state (JsonElement, JsonNode) AFK #72 json-state-paths
#69 ISO date strings compared as instants; changed via ValueComparer AFK #75 json-value-comparison
#70 ASP.NET Core sample (spike) HITL #76 aspnetcore-sample
#71 Spike findings and event envelope decision HITL #82 aspnetcore-sample § Findings
#77 Require a rule id (spike follow-up) AFK #79 required-rule-id
#78 Rename LogAction to ConsoleLogAction (spike follow-up) AFK #80 console-log-action

Schemas, contexts & the catalog — PRD #87 ✅ (ships in 0.6.0)

Event schemas (EventSchema<T>, inferred from DTOs, JSON Schema 2020-12) in the dependency-free RuleLoom.Schemas; contexts (@customer.Tier) declared by event schemas and loaded by context providers, once per event; previous state rebuilt from changed fields; rule paths parsed once (RulePath) and validated against the event's and contexts' schemas; and the catalog, the one vocabulary the engine, the validator and an authoring UI run on (CatalogBuilder, CatalogDocument, ICatalogStore; decisions in GLOSSARY.md and adr/). Scoped to one application first; the ASP.NET Core sample and the schemas and contexts guide show it together.

Issue Slice Type Blocked by PR Spec
#90 Rebuild the previous state from changed fields AFK — #97 previous-from-changes
#91 Contexts: related data loaded by context providers (@ paths) AFK — #99 contexts
#92 Schema builder and JSON Schema export (RuleLoom.Schemas) HITL — #100 schema-builder
#93 Schema store and registration in AddRuleLoom; context references passed to providers AFK #92 #103 schema-store
#101 Context schemas described with their providers AFK #93 #105 context-schemas
#94 Schema-aware rule validation with severities AFK #91, #92, #101 #106 schema-validation
#107 Parse rule paths once and restructure RuleValidator AFK #94 #108 path-model
#109 The catalog: one immutable registry of event schemas, context providers, operators and actions that the engine, validator and UI run on; catalog store HITL #107 #110 catalog
#95 Sample and guide for schemas and contexts, built on the catalog HITL #91, #93, #94, #101, #107, #109 #111 schemas-contexts-sample

Tooling

CI on PRs (build + test, TRX and Cobertura artifacts), release-please + MinVer versioning with squash-merged PR titles, central package management, issue/PR templates, Claude Code setup (AGENTS.md, .claude/settings.json). From 0.5.0: NuGet packages published by the release workflow with trusted publishing, packed on every PR; protected main (PRs and the CI check required).


🎯 Milestones

Agreed 2026-10-07 after settling the deployment and ownership questions in vision.md. Each milestone becomes a PRD (or a few issues) when it starts. 0.5 shipped (PRD #66), 0.6 is done (PRD #87), see Done, 0.7 is done (PRD #113, below), and 0.8 is done (PRD #134, below); the 0.5 spike's findings shaped 0.7–0.8 below.

Milestone Contents Notes
0.7: Typed actions & authoring endpoints (PRD #113) Typed actions (IAction<TParameters>, parameters described by their type and ActionDescriptor<TAction, TParameters>, in the catalog document as JSON Schema); paths in parameters ({ "$path": "@customer.Email" }, ADR 0003); parameters validated against their schema; RuleLoom.AspNetCore with MapRuleLoom (catalog, validate); rule arrays parsed rule by rule (#81); every context declaration naming its provider One application first; no rule CRUD. Detail below
0.8: Time, scheduled actions & observability (PRD #134) Time semantics (catalog time zone, calendar dates, TemporalRules; ADR 0004); event envelope RuleEvent with $event. paths; subjects loaded fresh for scheduled actions; ExecuteScheduledAsync re-checking rules when due (ADR 0005); keys and JSON for persistent job stores; due times in the past and overdue actions (RuleEngineOptions); OpenTelemetry and ILogger; "dispatching scheduled actions" guide Designed 2026-10-28/29: time semantics, envelope and scheduled actions, observability. Detail below
0.9: Everything breaking The path model (variables proposal); #165; scope on rules, events and schemas, and scope matching; RuleEvent.Tenant and the tenant in scheduled-action keys; catalog document format version and per-schema source/publishedAt/hash; ICatalogStore scope replace; telemetry tags; a public-API review (smaller surface, sealing, consistent contracts); public API tracking and package validation in CI Decided 2026-11-28/29 in the road to 1.0; PRD #170, detail below
0.10: Service to service Schema publishing (a publish is a snapshot of one scope; change detection); a PostgreSQL catalog store; the state snapshotter (explicit API first); "Evolving event schemas" guide Ends monolith-first: several services share one engine
1.0: Stable The promise in the road to 1.0 (decision 14), after 0.9–0.10 run in a real service (and a small 0.11 if that use requires fixes). Release readiness: benchmarks (#27), XML docs, guides, a documentation site (see below) Packages are already published from 0.5.0
1.x Functions ([Experimental]); rule storage, history and tracking with tenancy (a layer above the engine); first-match / exclusive groups; rule chaining; operations dashboard; EF Core snapshotter; scheduler integration packages; list operations; the fluent rule builder (pushed back 2026-11-28, when needed) All additive by design; order to be decided

0.7 — PRD #113 ✅

Issue Slice Type Blocked by PR Spec
#81 Parse rule arrays rule by rule AFK — #125 parse-rule-by-rule
#114 Context declarations always name their provider AFK — #126 context-provider-always-written
#115 Typed actions and their parameters in the catalog AFK — #121 typed-actions
#116 Paths in action parameters ($path) AFK #115 #123 path-parameters
#117 Validate action parameters against their schema AFK #115, #116 #124 parameter-validation
#118 RuleLoom.AspNetCore: MapRuleLoom endpoints AFK #81 #127 map-ruleloom
#119 Sample and guide for typed actions and MapRuleLoom HITL #81, #114–#118 #128 sample-typed-actions

0.8 — PRD #134 ✅

Issue Slice Type Blocked by PR Spec
#135 TemporalRules and the catalog's time zone AFK — #145 time-semantics
#136 Dates as calendar days AFK #135 #153 time-semantics
#137 Schedules in calendar days and from dates AFK #135 #154 time-semantics
#138 The RuleEvent envelope and $event paths AFK — #146 rule-event-and-scheduled-actions
#139 Event subjects and scheduled-action keys AFK #138 #149 rule-event-and-scheduled-actions
#140 ExecuteScheduledAsync AFK #139 #150 rule-event-and-scheduled-actions
#141 Due times in the past and overdue actions AFK #140 #151 rule-event-and-scheduled-actions
#142 OpenTelemetry traces and metrics, and logging AFK #140 #152 observability
#143 Sample and guides: dispatching scheduled actions HITL #135–#142 #156 sample-scheduling

Also #157: telemetry fixes found while building the sample (findings 2 and 7). Follow-ups: #155 (shared test helpers), #158 (demo samples: console #160, web shop #161; spec).

Fixes from an external evaluation of 0.8.0 (2026-11)

Issue Title Release
#163 Duplicate JSON keys crash parsing or are silently resolved 0.8.1 (#166) ✅
#164 A throwing property getter is read as null instead of failing the rule 0.8.1 (#168) ✅
#165 changed is true for every field when there is no previous state 0.9 (breaking; a slice of PRD #170)

0.9 — PRD #170

Everything breaking before 1.0, from the road to 1.0 and the variables proposal.

Issue Slice Type Blocked by PR Spec
#171 Path roots as registered variables (PathKind, internal built-ins, reserved brackets) AFK —
#165 changed without a previous state AFK #171
#172 Scope: one engine for several services' events AFK #171
#173 Tenant on RuleEvent and in scheduled-action keys AFK #172
#174 Catalog document format version and scope snapshots in the catalog store AFK #172
#175 Public-API review before 1.0 HITL #171, #165, #172–#174
#176 Public API tracking and package validation in CI AFK #175
#177 0.9 docs, upgrading guide and samples HITL #171–#176, #165

📋 Backlog — not yet scheduled

Grouped by theme. Each item needs a decision (keep / drop / reorder) and, if kept, a PRD or issue. Source points to where the idea was originally written down.

Core API & correctness

Item Notes Source
Pluggable value comparer (IValueComparer) Deferred from #22; built-in rules are fixed for now PRD #22 Out of Scope
StopOnFirstMatch option Stop after the first matching rule old roadmap §1.1.1
Separate EvaluationContext data from path resolution (IPathResolver) Testability analysis §6
Path whitelisting for untrusted rules Security, when end users author rules; comes with schema-based validation in 0.6 analysis §13
Rule indexing by event type Performance analysis §9
Package layering review (before 1.0) RuleLoom.Abstractions holds implementation (JSON parser, PathResolver, EvaluationContext, value comparison, RulePath) and references RuleLoom.Schemas; an abstractions package is usually the one others reference. Decide what is contract and what moves to RuleLoom #107 discussion

Scheduling follow-ups (deferred from PRD #1)

Item Notes Source
Scheduler backends (IScheduler; Hangfire, Quartz, background service) RuleLoom currently only computes ScheduledFor; integration packages are post-1.0 PRD #1 Out of Scope
Timezone support Decided in the time-semantics review below: the catalog's time zone (0.8) PRD #1 Out of Scope
Past due times and overdue actions; validation of zero/negative Amount Past due times run immediately; skipping overdue actions (SkipOverdueActions, OverdueGracePeriod) decided in the 0.8 scheduling spec; Amount validation still open; 0.8 PRD #1 plan
Cron / recurring schedules, business-day calculations PRD #1 Out of Scope; old roadmap Phase 4.4

Time semantics review (needs a proper breakdown)

Decided 2026-10-28 in a design review: spec, ADR 0004. Date-times without an offset are read in the catalog's time zone (IANA id, default UTC); dates are calendar days; Days in schedules are calendar days; one public TemporalRules holds the policy (on TimeZoneInfo). Breaking for dates, without a compatibility switch. Becomes three issues of 0.8's PRD. Times of day (TimeOnly) wait for path functions.

Path variables and functions (for consideration)

Raised on 2026-10-06 while reviewing #38 / PR #50. Worth a design pass before more $ names are added. Proposal (2026-11-28): variables, contexts and functions as registered objects: lex, bind, evaluate; functions as nodes. Reviewed 2026-11-28: closed $ variables and the breaking changes in 0.9.0 (with #165), functions ([Experimental]) in a 1.x minor (road to 1.0). The notes below are the original ideas.

Today $current and $previous are the only variables, written as plain path prefixes, and the knowledge of what is valid lives in three places: EvaluationContext.Resolve, ChangedOperator (which strips the scope) and the parser's RuleJsonValidator (which rejects unknown $ names). Every new variable would mean touching all three.

Ideas to explore:

  • One place for variables: a single resolver/registry that the engine, changed, the parser and RuleValidator (#39) all consult, instead of hard-coded checks. A sign of success: changed no longer has to strip a $current./$previous. prefix from its operand to get the bare property (#50); operators should get the property and pick a state through the API instead.
  • A public API to define and register variables, e.g. $event (event metadata), $rule, $tenant, or application-specific ones, registered alongside operators and actions (and through DI, #5).
  • Functions, e.g. #now(), #today(), #now(Europe/London), with the # sigil reserved for them in 0.6 (@ is taken by contexts, PRD #87). They'd have to use the injected TimeProvider, so they stay deterministic in tests, and they tie directly into the time semantics review above. Times of day (TimeOnly, "after 18:00") were deferred to this item by that review: #now()/#today() should return values in the catalog's time zone (TemporalRules).

Questions:

  • Syntax: settled in 0.6 — $ for RuleLoom's variables, @ for contexts, # for functions.
  • Strings vs structure: parse function calls out of path strings (a small expression language), or add a structured JSON node such as { "function": "now", "args": ["Europe/London"] } (a new ConditionNode type) that the parser and UIs handle without string parsing?
  • Registration and discovery: how do custom variables and functions declare their arguments and return types, so RuleValidator and rule-authoring UIs (Schema System) can check and offer them?
  • Safety: what custom functions may do when end users write rules, and whether results are cached per event.
  • Overlap with expression support (e.g. Price * 1.2 > 100), which the March analysis also suggested (analysis §7); functions could be its first step or a separate feature.

Schema & validation

0.6 (PRD #87) delivers schemas, contexts, path validation and the catalog (#109); typed actions and parameter validation follow in 0.7 (PRD #113). Design decisions are in vision.md. Earlier sketch: old roadmap §1.2.

The schema is intended as the single source for:

  • UI form generation: fields, types and labels for rule-authoring UIs (read from the catalog: catalog.ToJson()).
  • Path validation / whitelisting: reject unknown paths when a rule is saved (0.6). RuleValidator in #22 can't do this because it doesn't know an event's CLR type.
  • Path cache: pre-warm or bound the shared accessor cache (#15) to schema paths, possibly as a DI registration option. Today the cache grows with every distinct (type, path), which is fine while rules are developer-authored.
  • Typed JSON values: produce real dates and numbers at parse time; #22's ISO-string coercion becomes a fallback.
  • Declared-type limits: describe payloads whose properties are declared as object or an interface. Path resolution follows their runtime values since #68, but a schema still can't know their fields from the declared type.

Event system & configuration (old Phase 1.3)

RuleEvent became the event envelope, decided in the 0.5 spike. IRuleRepository is dropped: rule storage is the consumer's, and the library defines no rule source (vision.md). Still open: an in-process IRuleEventPublisher, and a fluent RuleEngineBuilder (overlaps with #5's RuleLoomBuilder; reconcile before starting). Detail: old roadmap §1.3.

Performance & benchmarks — #27

BenchmarkDotNet suite (path resolution, condition evaluation, JSON parsing, engine end-to-end, allocations), published results in docs/benchmarks.md, a README Performance section, and a manual CI workflow. After #22, before 1.0.

Packaging & documentation (old Phase 1.4)

XML docs on all public APIs (packages ship XML docs; missing ones outside Abstractions are suppressed until then), concept/operator guides, scenario samples. Detail: old roadmap §1.4, PRD #1 plan Phase 3.

Documentation site (raised 2026-10-19): publish the Markdown in docs/ as a website (GitHub Pages, built by a workflow on release), with API reference from the XML docs and more extensive examples (recipes for common setups: inside a single service, a service shared by others, contexts, schemas, scheduling). To explore which tool fits:

Tool Notes
DocFX .NET-native: Markdown guides plus API reference generated from the assemblies' XML docs, in one site; used by .NET libraries such as Polly
MkDocs + Material Very popular for prose docs, simple to run, good search; no .NET API reference of its own
Docusaurus / VitePress / Starlight Modern static-site generators (React, Vue, Astro), with versioned docs (Docusaurus) and good search; API reference needs a separate generator

Decide before 1.0 (an early, minimal site could come sooner), and move or keep the current guides accordingly.

Developer experience (old Phase 2)

Fluent rule builder API (scheduled for 0.6; post-1.0 typed rule consumers build on it); more operators — comparison (between in; gt gte lt lte are in #22), string (contains startsWith endsWith matches), collection (any all count), date. DI moved to #5. Detail: old roadmap Phase 2.

A test-helpers package for consumers (builders for OperatorContext, rules and fake actions) — raised when reviewing #34; reconsider once plugin authors exist. Source: OperatorContext spec Q3.

Rule management (old Phase 3)

Rule CRUD and multi-tenancy are the consumer's (vision.md). Still open for the library: rule versioning and lifecycle (draft/active/archived) as data in the rule model, a rule simulator and an evaluation trace. Detail: old roadmap Phase 3.

Infrastructure & scale (old Phase 4)

Persistence and distributed events (MassTransit/RabbitMQ) are the consumer's. OpenTelemetry traces and metrics and ILogger logging are in 0.8 (spec), the catalog REST API was in 0.7, and the operations dashboard (with an observer hook for execution history) is post-1.0. Detail: old roadmap Phase 4.


🚫 Out of scope

Visual rule builder UI (separate project), ML/AI rule suggestions, workflow/BPM engine capabilities, action chaining (use multiple rules).