Skip to content

fix(context): quoted allowed values, dotted names, explicit confidence phrases, strict protection after resolution - #369

Merged
kevincostner17 merged 1 commit into
mainfrom
fix/context-compiler
Sep 15, 2026
Merged

kevincostner17 merged 1 commit into
mainfrom
fix/context-compiler

Conversation

@kevincostner17

Copy link
Copy Markdown
Contributor

Summary

Fixes four context-compiler parsing and compile bugs.

Behaviour notes: / no longer splits dedup keys either; sentences with no space after a period are no longer split; unquoted abbreviations in value lists lose their final period (quote them to keep it).

Tests

New tests/context/test_compiler_parsing_fixes.py:

  • the repro from each issue;
  • list-splitting cases (Oxford comma, ;, brackets, CA, OR, WA, quotes, apostrophes);
  • the dedup-key split is unchanged;
  • dotted names with and without column renaming; decimals and abbreviations;
  • bare numbers are unparsed and raise under strict, while explicit confidence phrasings still parse;
  • schema-free vs schema-bound flows give the same result; non-strict still protects the column;
  • a rule restated in different words is caught at resolution without duplicate issues.

Verification

  • ruff check .: clean
  • mypy src/freshdata: no issues (202 files)
  • py3.12: 4287 passed, 6 skipped
  • py3.9: 4283 passed, 10 skipped
  • Golden and TruthBench expectations unchanged

Closes #301
Closes #302
Closes #303
Closes #304

…e phrases, strict protection after schema resolution

- split_value_list no longer splits on "/" and keeps quoted values whole.
  When a list has "," or ";", only those separate values; the last item may
  still split once on a trailing "and"/"or", and a leading "and"/"or" is
  dropped. Without commas, "and"/"or" still separate values ("dedupe by email
  and phone"). "Trinidad and Tobago, Chile" and "N/A, OK" now compile to the
  real values instead of fragments. The docstring and context docs say that
  ambiguous values need quoting.
- The sentence splitter ends a sentence at "." only before whitespace or end
  of line, so "file.name is unique." is no longer split into "file" and a
  rule bound to the unrelated "name" column. Decimals are unaffected.
- parse_confidence accepts a number only after a confidence word
  (confidence, certainty, probability, sure) or with "%"/"percent". Before,
  any bare number counted ("3 neighbours" became 0.03, "age > 50" became
  0.5). Those conditions are now unparsed and raise under strict.
- resolve_policy re-runs restatement and protection checks once it resolves
  constraints from a schema-free policy, and merges new issues without
  duplicates. fd.clean(policy=..., strict=True) now raises
  protection_conflict like the schema-bound flows; non-strict mode records
  the issue and demotes the repair.

Closes #301
Closes #302
Closes #303
Closes #304
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3f66f571-8950-4918-bca4-ea160d792543


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.

@github-actions

Copy link
Copy Markdown

FreshData benchmark report — performance

  • freshdata: ?
  • python: ?
  • platform: ?
fixture n_rows n_cols p50 s p95 s peak MB repair % false-repair % preserve % trust monotonic export %

Authored-code reduction (Metric 6)

@kevincostner17
kevincostner17 merged commit c13b423 into main Sep 15, 2026
21 checks passed
kevincostner17 added a commit that referenced this pull request Sep 15, 2026
Add Unreleased Added, Changed and Fixed entries for merged PRs #351,
#352, #353, #354, #356, #357, #358, #360, #361, #362, #363, #364, #365,
#367, #368, #369, #370, #371, #372, #374, #375, #377, #378 and #379.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment