Define an idempotent failed-block writing policy#589
Draft
claell wants to merge 3 commits into
Draft
Conversation
* Format failed blocks with BibtexFormat.parsing_failed_comment.\n* Preserve the documented source-line placeholder.
* Write retained raw failures unchanged by default. * Offer explicit annotate and fail-closed policies. * Document why normal mutable blocks cannot safely use stale raw source.
* Recognize an existing annotation attached to the next failed block. * Avoid adding a second terminal newline to retained raw source. * Keep repeated opt-in annotation writes idempotent.
This was referenced Jul 16, 2026
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
annotateand fail-closedraisepolicies.Closes #588.
Dependency and commit structure
The first commit is the same focused configured-comment fix already represented by #530 / draft PR #566. It is included so the policy branch is executable against current
main. The policy and annotation-idempotence changes are the second and third commits. After #566 merges, this branch should be rebased to remove the prerequisite diff.Validation
tests/test_entrypoint.py.Review note
The proposed default changes from generated annotation to exact raw preservation. This is a deliberate integrity choice, but it is user-visible and needs maintainer review. The previous behavior remains available explicitly as
annotate; strict consumers gainraise. There is intentionally no discard policy.The implementation also avoids adding a second terminal newline to failed raw source. Without that detail, even
annotatechanges the failure's line count and cannot recognize its own diagnostic on the next cycle.AI assistance
This pull request was prepared with ChatGPT Codex using GPT-5.6 Sol with high reasoning effort. Codex assisted with policy design, dependency isolation, regression analysis, newline edge-case repair, and validation. Automated validation is not a substitute for maintainer review.