Merged
Conversation
Preserves the field invariant and related-field cross-invariant work from PR #110. Fixes: - Replace production .unwrap() calls in field_invariant.rs (table.get paths), lint.rs and parser.rs (chars.next()) with explicit match/ Option control flow to satisfy the Integrity & DST Patterns gate. - Fix rustfmt drift across all changed files. - Base branch corrected from main to staging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move field invariant check into field_constraints.rs, extract tests to field_invariant_tests.rs, compact constraint constructors, and update the readability baseline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #110. Preserves the field invariant and related-field cross-invariant work, fixes CI failures, and opens against staging instead of main.
Changes
[[field_invariant]]): cross-field validation on single entities withwhen/requirepredicate trees (leaves:absent,equals,empty; combinators:any_of,all_of,not)related(Target, fk).<FieldName> (in|not in) [...]for arbitrary field names (not juststatus)pre_upsert_field_invariant_checkswired into the OData write pipeline, newFieldInvariantviolation typeCI fixes (vs #110)
.unwrap()calls flagged by Integrity & DST Patterns gate:chars.next().unwrap()→let Some(first) = chars.next() else { return false }inis_identifier()/is_valid_field_identifier()table.get("key").unwrap()→match table.get("key")inFieldPredicate::from_toml_value()registry.read().unwrap()→match state.registry.read()in field constraint checksfield_invariant.rstests into separate file, extractedfield_constraints.rsto keep files under readability ratchet limitsVerification
cargo build --release— cleancargo test --workspace— all passcargo clippy --all-targets— zero warningscargo fmt --check— cleancargo test -p temper-server --test field_invariants -- --nocapture— 6/6 passcargo test -p temper-spec field_invariant— 21/21 passcargo test -p temper-spec parse_field_assert— 6/6 pass🤖 Generated with Claude Code