Skip to content

Add khepri predicate conformance tests for RulesEngineInternal#6822

Draft
ajpallares wants to merge 59 commits into
mainfrom
pallares/khepri-predicate-conformance
Draft

Add khepri predicate conformance tests for RulesEngineInternal#6822
ajpallares wants to merge 59 commits into
mainfrom
pallares/khepri-predicate-conformance

Conversation

@ajpallares

@ajpallares ajpallares commented May 20, 2026

Copy link
Copy Markdown
Member

Checklist

  • Tests

Motivation

Run khepri's predicate_conformance_v1.json against RulesEngineInternal using the same parameterized fixture runner introduced in #6885, so the in-repo and khepri-downloaded fixtures share one harness. Stacked on #6834 (top of the operator stack).

Description

  • Reuses the shared fixture runner to execute the downloaded khepri conformance suite alongside the in-repo fixtures.
  • Adds a build phase + script that downloads the conformance fixtures (git-ignored) before testing, and wires the CircleCI / fastlane jobs.
  • No production changes.

@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 20, 2026
@ajpallares ajpallares force-pushed the pallares/khepri-predicate-conformance branch from 16d04be to a1f4d02 Compare May 20, 2026 18:31
@ajpallares ajpallares changed the base branch from pallares/json-logic-iteration-operators to pallares/json-logic-min-max-operators May 20, 2026 18:31
@ajpallares

Copy link
Copy Markdown
Member Author

@RCGitBot please test run-rules-engine-conformance-tests

@github-actions

Copy link
Copy Markdown

🚀 Triggered run-rules-engine-conformance-testsPipeline #38046

@ajpallares ajpallares changed the title Add khepri predicate conformance tests for RulesEngine Add khepri predicate conformance tests for RulesEngineInternal May 21, 2026
@RevenueCat RevenueCat deleted a comment from github-actions Bot May 21, 2026
@ajpallares

Copy link
Copy Markdown
Member Author

@RCGitBot please test run-rules-engine-conformance-tests

@github-actions

Copy link
Copy Markdown

🚀 Triggered run-rules-engine-conformance-testsPipeline #38098

@ajpallares ajpallares changed the base branch from pallares/json-logic-min-max-operators to pallares/json-logic-iteration-mapping-operators May 27, 2026 08:51
@ajpallares ajpallares force-pushed the pallares/json-logic-iteration-mapping-operators branch from 2a0a33c to 46d6925 Compare June 2, 2026 12:43
@ajpallares ajpallares force-pushed the pallares/khepri-predicate-conformance branch from f1587b1 to 9ab3623 Compare June 2, 2026 12:43
@ajpallares ajpallares force-pushed the pallares/json-logic-iteration-mapping-operators branch from 46d6925 to 2a0a33c Compare June 2, 2026 12:48
@ajpallares ajpallares force-pushed the pallares/khepri-predicate-conformance branch from 9ab3623 to f1587b1 Compare June 2, 2026 12:48
…tures

Convert the hand-written operator unit tests for operators available at the
string+array level into declarative JSON predicate fixtures sharing khepri's
conformance format, run by a shared runner that auto-discovers every file in
PredicateFixtures/. `expected` is a khepri-compatible superset (Bool or
{ "error": ... }) plus optional `description` and `expectedWarnings`.

Adds a test-only Value: Decodable conformance so predicates and variables
decode straight into the engine's value model; production Value is unchanged.
Tests that can't be expressed as predicate->Bool stay in Swift; ValueTests
untouched. Test-only change.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 40901e5)
@ajpallares ajpallares force-pushed the pallares/json-logic-iteration-mapping-operators branch from 2a0a33c to df4b140 Compare June 2, 2026 14:14
@ajpallares ajpallares force-pushed the pallares/khepri-predicate-conformance branch from f1587b1 to 8830cf9 Compare June 2, 2026 14:15
ajpallares and others added 2 commits June 2, 2026 17:16
Load the in-repo fixtures once and feed the decoded cases straight into
the parameterized test, instead of collecting IDs and re-reading every
file to find the matching case per ID. PredicateConformanceFixtureCase
gains Identifiable + Sendable (for the arguments) and a
CustomTestStringConvertible extension so each case still displays by id.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares and others added 17 commits June 6, 2026 19:06
Add var-fed cases (including the single-array-arg NaN gotcha), min
fail-closed and empty-list fail-closed coverage. Collapse the two-pass
NaN scan + extremum into a single reducing fold. Pinned fixture count
294 -> 301.

Co-authored-by: Cursor <cursoragent@cursor.com>
…erators' into pallares/json-logic-min-max-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
…ators' into pallares/json-logic-iteration-mapping-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	RulesEngineInternal/Operators/IterationOperators.swift
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
Strengthens iteration-operator coverage for none/map/filter/reduce:
- Add object-item named-property fixtures (none/map/filter) — the most
  common real-world shape, previously untested (only scalar/empty items).
- Assert map/filter return real arrays by folding through reduce
  (count/sum) instead of relying solely on string coercion.
- Add a reduce fixture pinning that the initial accumulator is evaluated
  even for a non-array source (matches initial = apply(values[2], data)).
- Reword the none non-array rationale: current json-logic-js implements
  none directly with !Array.isArray(x) || !x.length, not via filter.

Expected fixture count 341 -> 345.

Co-authored-by: Cursor <cursoragent@cursor.com>
…teration-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
Label each operator grouping in Operators.dispatch per PR review feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the all-match fixture and add cases where only the first or only
the middle item matches, addressing PR review feedback that the existing
some coverage was order dependent.

Co-authored-by: Cursor <cursoragent@cursor.com>
khepri guards all with notEmpty, so it returns false for an empty array
like json-logic-js; drop the inaccurate claim that khepri returns true.

Co-authored-by: Cursor <cursoragent@cursor.com>
…erators' into pallares/json-logic-min-max-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
Remove the duplicate WorkflowsCacheTests.swift PBXFileReference introduced
during a merge, and add a dedicated "Min and max" grouping comment so the
min/max cases are no longer lumped under arithmetic.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ators' into pallares/json-logic-iteration-mapping-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
…teration-mapping-operators

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
#	Tests/RulesEngineInternalTests/PredicateFixtures/max.json
#	Tests/RulesEngineInternalTests/PredicateFixtures/min.json
Co-authored-by: Cursor <cursoragent@cursor.com>
Downloads khepri's predicate_conformance_v1.json and evaluates each fixture
through the shared runner, reusing the same Swift Testing harness as the
in-repo predicate fixtures. Adds the on-demand run-rules-engine-conformance-tests
CI job, the test_rules_engine_conformance Fastlane lane, and an Xcode build
phase + scheme pre-action that auto-download the fixtures locally.

The conformance suite is skipped in the standard test plan since it depends on
fixtures downloaded from the private khepri repo; it runs only in the dedicated
on-demand job. No production changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares ajpallares force-pushed the pallares/khepri-predicate-conformance branch from 4846750 to 4492257 Compare June 9, 2026 10:33
@ajpallares

Copy link
Copy Markdown
Member Author

@RCGitBot please test run-rules-engine-conformance-tests

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚀 Triggered run-rules-engine-conformance-testsPipeline #39101

The download-fixtures pre-action used a truncated execution ActionType
(Xcode.IDEStandardExecutionActionsCore.ExecutionActionType) which Xcode 26
rejects as an invalid extension identifier, crashing workspace load during
xcodebuild -resolvePackageDependencies. Use the full .ShellScriptAction type.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares

Copy link
Copy Markdown
Member Author

@RCGitBot please test run-rules-engine-conformance-tests

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚀 Triggered run-rules-engine-conformance-testsPipeline #39103

Base automatically changed from pallares/json-logic-iteration-mapping-operators to main June 9, 2026 11:47
…cate-conformance

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	RulesEngineInternal/Operators/Operators.swift
#	Tests/RulesEngineInternalTests/PredicateFixtureTests.swift
#	Tests/RulesEngineInternalTests/PredicateFixtures/reduce.json
ajpallares and others added 4 commits June 9, 2026 17:50
Mirror the in-repo PredicateFixtureTests: load and decode the fixture
envelope once into a static and pass the cases straight into the
parameterized test, instead of re-reading and re-decoding the file on
every single fixture invocation. Test-only change.

Co-authored-by: Cursor <cursoragent@cursor.com>
…mance' into pallares/khepri-predicate-conformance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant