Skip to content

feat: Add support for fact-to-fact comparison#2

Merged
kennyth01 merged 1 commit intomainfrom
feat/fact-to-fact-comparison
Mar 1, 2026
Merged

feat: Add support for fact-to-fact comparison#2
kennyth01 merged 1 commit intomainfrom
feat/fact-to-fact-comparison

Conversation

@kennyth01
Copy link
Owner

Implements dynamic fact-to-fact comparison allowing rules to compare two runtime facts instead of comparing a fact to a static value. This enables flexible rule evaluation where comparison values can change based on context.

Key changes:

  • Modified Rule::evaluateCondition() to resolve fact references in value field
  • Updated Rule::interpretCondition() to display fact-to-fact comparisons
  • Added comprehensive test coverage with testFactToFactComparison()
  • Updated README with usage examples and documentation
  • Created examples/fact-to-fact-comparison.php with real-world scenarios

Benefits:

  • Dynamic thresholds without modifying rule definitions
  • Runtime flexibility for different scenarios
  • Support for nested fact paths (e.g., user.age vs requirements.minimumAge)

Closes #1

Made-with: Cursor

Implements dynamic fact-to-fact comparison allowing rules to compare two
runtime facts instead of comparing a fact to a static value. This enables
flexible rule evaluation where comparison values can change based on context.

Key changes:
- Modified Rule::evaluateCondition() to resolve fact references in value field
- Updated Rule::interpretCondition() to display fact-to-fact comparisons
- Added comprehensive test coverage with testFactToFactComparison()
- Updated README with usage examples and documentation
- Created examples/fact-to-fact-comparison.php with real-world scenarios

Benefits:
- Dynamic thresholds without modifying rule definitions
- Runtime flexibility for different scenarios
- Support for nested fact paths (e.g., user.age vs requirements.minimumAge)

Closes #1

Made-with: Cursor
@kennyth01 kennyth01 merged commit a399082 into main Mar 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add support for fact-to-fact comparison

1 participant