fix: settle files that differ from their own serialization - #33
Merged
Conversation
The refresh ran ten full passes and never converged. The digests alternated between two states rather than drifting, which is not a pipeline that has more work to do: it is two files being rewritten every pass. A provider returned titles containing a literal newline. The serializer wrote them verbatim while the strict parser collapses whitespace on read, so those entries could never equal their own re-serialization. The corpus digest moved on every pass and the loop exhausted its ten-run ceiling. Two changes. The serializer collapses whitespace inside every field value, so a multi-line value cannot reach a file. And the post-run fixup decides whether to write by comparing the serialized form against the file, rather than by asking whether a canonicalization rule reported a change: a file can differ from its own serialization with no rule firing, which is exactly this case, and the old gate skipped the write while the difference remained. Verified on the corpus rescued from the failed run: the first pass repairs the two files, the second and third change nothing, and no file churns. Both changes are covered by tests confirmed to fail when each is reverted.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
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.
Corrected refresh run 32039247944 ran ten passes and never converged: digests alternated between two states rather than drifting, and every pass logged the same
Post-run fixup: corrected 2 .bib files.A provider returned titles containing a literal newline. The serializer wrote that verbatim while the strict parser collapses whitespace on read, so those entries could never equal their own re-serialization; the corpus digest moved every pass and the loop burned its ten-run ceiling. Three files affected (two sources plus one a2i2 copy).
Two changes. The serializer collapses whitespace inside every field value, so a multi-line value cannot reach a file. And the post-run fixup compares the serialized form against the file rather than asking whether a canonicalization rule reported a change: a file can differ from its own serialization with no rule firing, and the old gate skipped the write while the difference remained, which is why the damaged files never healed.
Verified on the corpus rescued from the failed run (3742 files, preserved by the artifact step added in #32): pass1 fixed=2, pass2 fixed=0, pass3 fixed=0, zero files churning. Both changes mutation-tested; reverting either fails a test. The postrun one needed a new test, since the existing suite missed that mutation.
ruff clean, mypy clean (55 files), pyrefly 0 errors, pytest 2026 passed, 2 skipped.