Skip to content

Releases: block/verdikt

v0.2.0

05 Feb 22:57
9ecdad8

Choose a tag to compare

What's New

Verdict Convenience Extensions (verdikt-core)

  • failureCount - number of failures (0 if passed)
  • failedRuleNames - list of failed rule names (empty if passed)
  • hasFailure(ruleName) - check if a specific rule failed
  • failuresMatching { } - filter failures by predicate

Engine Event Collector (verdikt-engine)

  • EngineEvent sealed class with structured event types for real-time observability
  • EngineEventCollector SAM interface for receiving events during evaluation
  • CompositeCollector for combining multiple collectors
  • Optional collector parameter on evaluate() and evaluateAsync() (backward compatible)

Flow Extensions (verdikt-engine)

  • evaluateAsFlow(facts) - returns Flow<EngineEvent> for sync evaluation
  • evaluateAsyncAsFlow(facts) - returns Flow<EngineEvent> for async evaluation

Other

  • EngineResult.failuresOfType<T>() for type-safe failure retrieval
  • Enhanced Guard documentation with "Guard vs Condition" distinction

See CHANGELOG.md for full details.

v0.1.0 - Initial Release

04 Feb 20:28

Choose a tag to compare

Verdikt v0.1.0

Initial release of Verdikt - a type-safe, multiplatform rules engine for Kotlin.

Modules

  • verdikt-core: Core rules DSL and evaluation
  • verdikt-test: Testing utilities
  • verdikt-engine: Forward-chaining production rules engine with Rete optimization

Features

Core Rule Engine (verdikt-core)

  • Rule<Fact, Cause> and AsyncRule<Fact, Cause> interfaces
  • RuleSet<Fact, Cause> for composing multiple rules
  • Verdict<Cause> sealed interface with Pass and Fail results
  • Typed failure reasons with Failure<Cause>
  • DSL builders: rules { }, rule(name) { }, condition { }, asyncCondition { }
  • Side effects for observability

Production Rules Engine (verdikt-engine)

  • Forward-chaining with automatic fixpoint iteration
  • Rete network for optimized pattern matching
  • EngineConfig for iteration limits and tracing
  • Execution tracing with EngineResult.trace
  • Phased execution with phase(name) { }
  • Guards for conditional rule execution
  • Priority-ordered rule execution

Testing Utilities (verdikt-test)

  • assertPasses() / assertFails() for rules and rule sets
  • Fluent assertion DSL

Platform Support

  • JVM (11+)
  • Android
  • iOS (arm64, x64, simulatorArm64)
  • macOS (arm64, x64)
  • Linux (x64)
  • JavaScript (browser, Node.js)

Installation

// build.gradle.kts
dependencies {
    implementation("xyz.block:verdikt-core:0.1.0")
    implementation("xyz.block:verdikt-engine:0.1.0")
    testImplementation("xyz.block:verdikt-test:0.1.0")
}

See the README for full documentation.