> ## Documentation Index
> Fetch the complete documentation index at: https://crafts69guy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Changelog

> Version history and release notes

## Current Version: 1.0.7

<Info>
  This project follows [Semantic Versioning](https://semver.org/) and [Keep a Changelog](https://keepachangelog.com/) format.
</Info>

***

## \[1.0.7] - 2025-12-31

### Added

<CardGroup cols={2}>
  <Card title="Typed Path Autocomplete" icon="wand-magic-sparkles">
    IDE autocomplete for object paths
  </Card>

  <Card title="Path Utility Types" icon="code">
    `Path<T>`, `NumericPath<T>`, `StringPath<T>`
  </Card>
</CardGroup>

**🎯 Typed Path Autocomplete**

* `createRuleHelpers<T>()` now accepts generic type for path autocomplete
* IDE will suggest valid paths like `'user.name'`, `'order.total'`
* Type-safe: numeric operators only accept numeric paths

**📦 New Utility Types**

* `Path<T>` - All valid dot-notation paths
* `PathValue<T, P>` - Get value type at path
* `NumericPath<T>`, `StringPath<T>`, `BooleanPath<T>`, `ArrayPath<T>`

### Changed

* Consolidated `RuleHelpers` types into single generic class
* Backward compatible: untyped usage works as before

***

## \[1.0.6] - 2025-12-25

### Added

* TypeScript declaration files with improved JSDoc

### Changed

* Extended `in`, `notIn`, `oneOf` to accept string paths for dynamic array lookup

***

## \[1.0.5] - 2025-12-20

### Fixed

* Type definition fixes and alignment with implementation

***

## \[1.0.4] - 2025-12-15

### Fixed

**🐛 Type Definition Fixes**

* `evaluateExpr` now returns `EvaluationResult` with `success` property
* `RuleHelpers` comparison methods treat `options` as optional
* `PathResolver.resolve` method name aligned with implementation
* Added `flags` property to `StringOptions` for regex

### Changed

* Removed unsupported `caseInsensitive` and `trim` from type options
* Added `persistence` config type for `StatefulRuleEngine`

***

## \[1.0.3] - 2025-12-09

### Added

<CardGroup cols={2}>
  <Card title="Stateful Rule Engine" icon="rotate">
    Event-driven state tracking
  </Card>

  <Card title="State Change Operators" icon="arrow-trend-up">
    6 new operators for detecting changes
  </Card>
</CardGroup>

**🔄 Stateful Rule Engine**

* `StatefulRuleEngine` class for state tracking and event-driven evaluation
* Event system: `triggered`, `untriggered`, `changed`, `evaluated`
* History storage with configurable size limits
* Batch evaluation with `evaluateBatch()`

**📈 State Change Operators**

* `changed`, `changedBy`, `changedFrom`, `changedTo`, `increased`, `decreased`

### Changed

* Bundle size optimized: ESM/CJS reduced by 62% (\~45KB, 11KB gzipped)

***

## \[1.0.2] - 2025-08-20

### Added

**New String Length Validation Helpers**

* `validation.minLength(path, minLength)` - Validates minimum string length
* `validation.maxLength(path, maxLength)` - Validates maximum string length
* `validation.lengthRange(path, min, max)` - Validates string length range
* `validation.exactLength(path, length)` - Validates exact string length

**Development Tools**

* Claude Code integration context (`CLAUDE.md`)
* Comprehensive test coverage expansion with 382+ new test cases
* Enhanced basic core functionality tests
* Expanded logical operator test coverage
* Comprehensive string operator validation

### Changed

* Improved CI/CD pipeline with Claude Code Review workflow
* Enhanced test suite organization with better edge case coverage:
  * Empty string handling
  * Boundary condition testing
  * Very long string validation
  * Comprehensive string length scenarios

### Fixed

* Various code quality improvements
* Better error handling and validation coverage

***

## \[1.0.0] - 2025-08-12

<Info>
  🎉 First stable release of Rule Engine JS
</Info>

### Core Features

**Engine**

* High-performance rule evaluation with caching
* Dynamic field comparison support
* Built-in security protections
* TypeScript definitions
* Zero external dependencies

**Operators**

```javascript theme={null}
// Comparison
eq, neq, gt, gte, lt, lte

// Logical
and, or, not

// String
contains, startsWith, endsWith, regex

// Array
in, notIn

// Special
between, isNull, isNotNull
```

### Performance

* LRU caching for expressions and path resolution
* Performance metrics tracking
* Bundle size \< 25KB gzipped
* Multiple output formats (UMD, ESM, CommonJS)

### Developer Experience

* Rule helpers for clean, readable syntax
* Comprehensive error handling with detailed context
* Extensive test coverage (>90%)
* Complete TypeScript support
* Field comparison helpers for dynamic rules

### Security

* Prototype pollution protection
* Function access prevention
* Safe path resolution
* Configurable security settings

### Build System

* Optimized Rollup configuration
* Multiple output formats
* Bundle size analysis
* Quality checks integration

***

## \[0.9.0] - Development Phase

### Added

* Core engine architecture
* Basic operator implementations
* Initial testing framework

### Changed

* Refined API design based on testing

### Fixed

* Various bug fixes during development

***

## Version History

<AccordionGroup>
  <Accordion title="v1.0.7 - Typed Path Autocomplete">
    Generic `RuleHelpers<T>` with IDE path autocomplete support
  </Accordion>

  <Accordion title="v1.0.6 - Dynamic Array Paths">
    Extended operators to accept string paths for array lookup
  </Accordion>

  <Accordion title="v1.0.5 - Type Fixes">
    Type definition fixes and alignment
  </Accordion>

  <Accordion title="v1.0.4 - Type Alignment">
    Fixed type definition mismatches
  </Accordion>

  <Accordion title="v1.0.3 - Stateful Engine">
    StatefulRuleEngine with state change operators and event system
  </Accordion>

  <Accordion title="v1.0.2 - String Validation">
    String length validation helpers and expanded test coverage
  </Accordion>

  <Accordion title="v1.0.0 - Stable Release">
    First stable release with complete feature set
  </Accordion>
</AccordionGroup>

***

## v1.0.0 Highlights

**Key Features:**

* **Zero Dependencies**: Lightweight with no external dependencies
* **High Performance**: Intelligent caching with LRU eviction
* **Type Safe**: Full TypeScript support with comprehensive type definitions
* **Secure**: Built-in protection against common security vulnerabilities
* **Flexible**: Support for dynamic field comparison and custom operators
* **Developer Friendly**: Clean API with helper functions for rule construction

**Use Cases:**

* User access control and permissions
* Business rule validation
* Form validation with dynamic dependencies
* Content filtering and recommendations
* Dynamic pricing and discount logic
* Workflow and approval processes

**Quick Start:**

```javascript theme={null}
import { createRuleEngine, createRuleHelpers } from 'rule-engine-js';

const engine = createRuleEngine();
const rules = createRuleHelpers();

const rule = rules.and(
  rules.gte('user.age', 18),
  rules.eq('user.status', 'active'),
  rules.in('user.role', ['admin', 'user'])
);

const result = engine.evaluateExpr(rule, userData);
```

***

## Migration Guides

<Tabs>
  <Tab title="v1.0.6 → v1.0.7">
    **No breaking changes**

    New typed path autocomplete:

    ```typescript theme={null}
    interface MyContext {
      user: { name: string; age: number };
    }

    // With type - get IDE autocomplete
    const rules = createRuleHelpers<MyContext>();
    rules.gte('user.age', 18); // ✓ autocomplete

    // Without type - works as before
    const rules = createRuleHelpers();
    rules.gte('any.path', 18);
    ```
  </Tab>

  <Tab title="v1.0.5 → v1.0.6">
    **No breaking changes**

    Dynamic array paths for `in`, `notIn`, `oneOf`:

    ```javascript theme={null}
    rules.in('role', 'allowedRoles'); // string path to array
    ```
  </Tab>

  <Tab title="v1.0.2 → v1.0.3">
    **No breaking changes**

    New stateful engine available:

    ```javascript theme={null}
    import { StatefulRuleEngine } from 'rule-engine-js';

    const statefulEngine = new StatefulRuleEngine(baseEngine);
    statefulEngine.evaluate('temp', { increased: ['temperature'] }, data);
    ```
  </Tab>
</Tabs>

***

## Contributing to Changelog

When contributing, please follow these guidelines:

1. **Add entries under `[Unreleased]`** for new changes

2. **Use standard categories:**
   * `Added` - New features
   * `Changed` - Changes in existing functionality
   * `Deprecated` - Soon-to-be removed features
   * `Removed` - Removed features
   * `Fixed` - Bug fixes
   * `Security` - Vulnerability fixes

3. **Format:** `- Brief description of change (#PR-number)`

4. **Move entries to dated release** when releasing

***

## Support

<CardGroup cols={2}>
  <Card title="GitHub Issues" icon="github" href="https://github.com/crafts69guy/rule-engine-js/issues">
    Report bugs and request features
  </Card>

  <Card title="Discussions" icon="comments" href="https://github.com/crafts69guy/rule-engine-js/discussions">
    Ask questions and share ideas
  </Card>

  <Card title="Documentation" icon="book" href="/">
    Browse full documentation
  </Card>

  <Card title="Contributing" icon="code-pull-request" href="/contributing">
    Contribution guidelines
  </Card>
</CardGroup>
