Skip to content

Adds constraint-type defaults, partitioner warnings, and model dtype passthrough - #11

Merged
aaronstevenwhite merged 8 commits into
FACTSlab:mainfrom
pkuchmiichuk:ukr-core
Aug 21, 2026
Merged

Adds constraint-type defaults, partitioner warnings, and model dtype passthrough#11
aaronstevenwhite merged 8 commits into
FACTSlab:mainfrom
pkuchmiichuk:ukr-core

Conversation

@pkuchmiichuk

Copy link
Copy Markdown
Collaborator

Description

Change Files
ListConstraint subclasses now default constraint_type to their own discriminator value, so constraints no longer have to restate it at construction (UniquenessConstraint(property_expression=...) instead of also passing constraint_type="uniqueness"). bead/lists/constraints.py
ListPartitioner now warns once per expression when a constraint property expression cannot be evaluated, and once per type when a constraint type is not enforced during assignment. Previously a misconfigured constraint scored zero on every iteration and was silently ignored. bead/lists/partitioner.py
Causal LMs load in the checkpoint's own dtype by default (dtype="auto"), rather than being forced to float32. Loading a half-precision checkpoint as float32 doubled its memory. bead/items/adapters/huggingface.py
The requested dtype is threaded from LanguageModelScorer through to the adapter. bead/items/scoring.py

All four are backward compatible. The new dtype parameters are keyword arguments defaulting to "auto", and the constraint defaults only add a value where one previously had to be supplied.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Tests (adding or updating tests)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have run uv run ruff check . and uv run ruff format .
  • I have run uv run pyright with no errors
  • I have added tests that prove my fix/feature works
  • All tests pass (uv run pytest tests/)
  • I have updated documentation as needed

Testing

Test file Covers
tests/lists/test_constraints.py Each constraint type constructs without an explicit constraint_type, and the discriminator still round-trips.
tests/lists/test_partitioner.py The unresolved-expression warning fires once per expression.
tests/lists/test_partitioner_batch.py The unenforced-type warning fires once per constraint type.
tests/items/adapters/test_huggingface.py The adapter forwards dtype to from_pretrained and defaults to "auto".
tests/items/test_scoring.py LanguageModelScorer passes its dtype through to the adapter.

@aaronstevenwhite

Copy link
Copy Markdown
Collaborator

Please bump the minor version and add a changelog entry, then I will merge to main.

@pkuchmiichuk

Copy link
Copy Markdown
Collaborator Author

Please bump the minor version and add a changelog entry, then I will merge to main.

Done!

The Format job failed on a ruff version CI never pinned. Both the Lint and
Format jobs installed ruff unpinned, so they picked up 0.16, which formats
Python inside Markdown code blocks. uv.lock resolves ruff 0.14.14, so a
contributor running the documented "uv run ruff format ." saw a clean tree
while CI reformatted six docs files it had never touched before. Both jobs
now install the locked version, named once in a workflow-level RUFF_VERSION.

Also dates the 0.9.0 entry to the day it ships and records the version in
uv.lock, which pyproject.toml and bead.__init__ already carry.
bead.__version__ restated the version as a second literal, and the 0.8.0 release
bumped pyproject.toml and uv.lock without it, so the package reported 0.7.0 while
the installed distribution reported 0.8.0. It now reads the version back out of
the distribution metadata, which removes the literal that drifted rather than
resynchronising it.

The CHANGELOG entry and its compare link are the manual steps that remain, so
tests/test_version.py pins them to the declared version alongside a check that
the importable version still matches pyproject.toml. Each test was confirmed to
fail against a simulated drift of the case it covers.
@aaronstevenwhite
aaronstevenwhite merged commit 75e9793 into FACTSlab:main Aug 21, 2026
8 checks 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.

2 participants