Skip to content

Cap ContextColumn.cells at u8::MAX, matching context_columns - #275

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-08-25-issue-198
Open

Cap ContextColumn.cells at u8::MAX, matching context_columns#275
thedavidmeister wants to merge 1 commit into
mainfrom
2026-08-25-issue-198

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #198

The defect

Expression.context_columns carries #[validate(length(max = "u8::MAX"))]. Its
sibling axis, ContextColumn.cells, carried no length bound at all — one axis of
the same context matrix rejected a 256th entry while the other accepted 100000.

The fix

cells gets the identical length(max = "u8::MAX"). Both axes of the matrix are
now bounded the same way, and the model no longer says two different things about
how big a context matrix may be.

The columns cap is not raised. The issue's other branch — bump 255 to 256
because a u8 index addresses 0..=255 — reads the attribute as a bound on the
index; it is a bound on the count, which is what length(max) measures. Caps in
this org are floor-only: a cap is not raised to admit one more entry. With the two
axes symmetric, the code now shows 255 as the rule rather than as an off-by-one in
one field, which is the "document 255" branch the issue offers.

The only documents this newly rejects are those with more than 255 cells in a
single column. cells appears nowhere in this repo outside this type and its
tests, so nothing here indexes past 255 today.

Relation to the other open issues on this file

QA

  • Discriminating tests: meta::types::interpreter_caller::v1::tests::test_length_constraints, extended with the cells boundary (255 cells in one column validate, 256 fail) — fails on base, verified by deleting the new attribute at v1.rs:145 and rerunning: called Result::unwrap_err() on an Ok value: InterpreterCallerMeta { ... } panicking at v1.rs:348, the 256-cell assertion. Attribute restored, re-run green (17 passed, 0 failed).
  • Mutations applied: v1.rs:145 remove #[validate(length(max = "u8::MAX"))] from ContextColumn.cells (= the pre-fix body) -> killed by test_length_constraints. v1.rs:127 the same removal on Expression.context_columns is outside this diff and already killed by test_length_constraints and test_context_columns_max_255.
  • Oracle: the type's own declared bound, not the implementation — context_columns states the context-matrix axis bound as "the count fits in a u8" (255), and cells is the other axis of that same matrix, so its expected boundary is 255 pass / 256 fail regardless of what the code did.
  • Category check: the issue asks two things — (1) the 255-vs-256 columns cap, (2) the missing cells cap. (2) is fixed here with the boundary test above. (1) is ruled rather than changed: it is a count cap and caps are not raised, so context_columns and its two boundary tests are deliberately untouched and the symmetry added here is the issue's own "document 255" branch. Both covered.
  • Not run locally: the full suite (shared machine) — CI covers it. Run locally: cargo test -p rain-metadata --lib meta::types::interpreter_caller::v1 (17 passed), cargo fmt --check -p rain-metadata, cargo clippy -p rain-metadata --lib --all-targets -- -D warnings (clean).

The two axes of the context matrix were bounded differently:
context_columns rejected a 256th entry while cells took any number.
Both now carry the same count cap. The columns cap is not raised.

Closes #198

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ab455f9d-3a75-485d-9be6-d8f0b2e3f297

📥 Commits

Reviewing files that changed from the base of the PR and between 45ca96c and f67d202.

📒 Files selected for processing (1)
  • crates/cli/src/meta/types/interpreter_caller/v1.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Expression.context_columns capped at 255 while ContextColumn.cells is unbounded — u8 addressing suggests 256 and a matching cells cap

1 participant