fix(semantic): suggest instead of auto-applying 24:00 -> 00:00 in time-only columns - #398
Merged
Merged
Conversation
…e-only columns TimeCanonicalExpert proposed '24:00' -> '00:00' at base_confidence 0.96, above the 0.95 auto threshold, so semantic_mode='auto' and 'review' both applied it. Its rationale, "the instant is unchanged", only holds when a date travels with the value: 24:00 on day D is 00:00 on day D+1. In a column of clock times alone the rewrite turns end-of-day into start-of-day, so a shift_end of 24:00 sorted before its shift_start. The proposal now scores 0.80, between the review (0.70) and auto (0.95) thresholds, so it is recorded as a suggestion and routed to a human in every mode. The rationale and docstring say why it is held for review. Suggestions are never learned into cleaning memory, so the replay case for time_canonical is replaced by a test that nothing is learned or replayed. The TruthBench logistics oracle for log-06 transport_time moves from REPAIR to REVIEW. That was the domain's only REPAIR cell and every domain must cover all dispositions, so log-07 tracking_status 'on time' -> 'on-time' is added as the domain's exact repair. Closes #305
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
FreshData benchmark report —
|
| fixture | n_rows | n_cols | p50 s | p95 s | peak MB | repair % | false-repair % | preserve % | trust | monotonic | export % |
|---|
Authored-code reduction (Metric 6)
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.
Summary
TimeCanonicalExpertproposed rewriting'24:00'to'00:00'at base confidence 0.96, above the 0.95 auto threshold, sosemantic_mode='auto'and'review'both applied it. The rationale, "the instant is unchanged", is only true when the value has a date: 24:00 on day D is 00:00 on day D+1. In a column of clock times alone, the rewrite turns end-of-day into start-of-day, so ashift_endof24:00sorted before itsshift_start.'24:00'is kept.time_canonicalmemory-replay case is replaced by a test that nothing is learned or replayed.transport_time'24:00'moves from REPAIR to REVIEW.tracking_status'on time'→'on-time'is added as the domain's exact repair. It is repaired automatically with full audit evidence.Tests
tests/test_semantic_time_24h.py:'24:00'is kept, the status issuggested, and the rationale is the new text.24:00and24:00:00.tests/test_semantic_repair_safety.py: atime_canonicalsuggestion is not learned and does not replay.tests/truthbench/test_fixtures.py: log-06 is REVIEW; the new log-07 REPAIR cell and its expected output are checked; the family list is updated.Verification
ruff check .: passed;mypy src/freshdata: no issuespytest -m "not online and not large": Python 3.12: 5140 passed, 13 skipped; Python 3.9 / pandas 1.5: 5136 passed, 17 skippedpytest tests/truthbench: 250 passedpython -m benchmarks.truthbench run --profile release --backends pandas,polars,duckdb --require-backends --repeats 2 --check: all 48 gates pass (also 48/48 on main 2d098cb)Closes #305