Skip to content

feat: constrain combinatrix with trilean predicate trees and cover the valid combinations - #110

Open
Mearman wants to merge 4 commits into
mainfrom
feat/trilean-combinatorics
Open

Mearman wants to merge 4 commits into
mainfrom
feat/trilean-combinatorics

Conversation

@Mearman

@Mearman Mearman commented Oct 29, 2026

Copy link
Copy Markdown
Member

Adds packages/trilean-combinatorics: trileanConstraint turns a trilean predicate tree into a combinatrix Constraint (unassigned dimensions resolve as not yet known, unset ones as known absent, so a definite answer on a partial assignment holds on every completion), and coveringArray is a strategy yielding a t-wise covering array of a model's valid combinations, checked by property tests against an independent isCoveringArray oracle. It also exports trilean's default evaluation budgets so the adapter can refuse an oversized tree when the constraint is defined.

This stays a draft until combinatrix 1.0.0 is on npm: the package pins it, the registry only has a 0.0.0 placeholder, so pnpm install --frozen-lockfile cannot pass yet and pnpm-lock.yaml is deliberately unchanged here. Once it is published, pnpm install regenerates the lockfile and that commit is the last thing this needs.

@Mearman
Mearman marked this pull request as ready for review October 29, 2026 09:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-10-29T09:11:54.421408Z
We couldn’t complete this review. Comment @codex security review to try again.
a4564ba Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

DEFAULT_MAX_EVALUATION_NODES and DEFAULT_MAX_NESTING_DEPTH are what
createEvaluator and createSyncEvaluator apply when maxNodes and
maxNestingDepth are not given. Exporting them lets a caller check a tree
against the same limits before evaluating it, rather than copying the
numbers, which would drift when the defaults change.
combinatrix is an org-owned package released by its own semantic-release CI
with trusted publishing, like the two packages already exempted, and the
workspace is about to depend on it.
…n trees and cover them

Adds packages/trilean-combinatorics, depending on trilean and on combinatrix.

trileanConstraint turns a predicate tree given as JSON into a combinatrix
Constraint. The tree is validated with PredicateNodeSchema and walked: node
kinds the adapter has no resolver for (collections, lookup, delegate,
treeReference), reference keys that are not strings or name no dimension,
units on references, calls to unregistered functions and referenced domains
holding null are all refused at definition time, and so is a tree larger or
deeper than trilean's default evaluation budget. Evaluation uses the
synchronous evaluator with an unassigned dimension resolved as not yet known
and an unset one as known absent, so a definite answer on a partial
assignment holds for every completion. An indeterminate result once every
dependency is assigned throws UndecidedConstraintError instead of breaking
the contract.

coveringArray is a strategy yielding a covering array of strength t over the
solution set: every t-tuple of values that some valid combination contains
appears in a yielded row, built greedily and deterministically from the full
solution set. isCoveringArray is the independent brute-force check, used as
the oracle of property tests over seeded random models.

The package is ESM only, as combinatrix is, and pins the first combinatrix
version that will be published.
@Mearman
Mearman force-pushed the feat/trilean-combinatorics branch from d6957b6 to a4564ba Compare October 29, 2026 09:11
@Mearman

Mearman commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman enabled auto-merge (rebase) October 29, 2026 09:12
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.

1 participant