Repository navigation
Retain each completed translation reply's source partition - #877
Merged
Merged
Conversation
Plan a complete current cover from explicit reply variants across genuine source partitions. Preserve the full catalog and require reuse eligibility for every reply before selecting corrections. Signed-off-by: zlareb1 <[email protected]>
Exact whole matches keep the separator from their own source partition, so composing completed requests cannot add or remove a blank line. Signed-off-by: zlareb1 <[email protected]>
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.
Related: #847
Related: #873
Changelog category (leave one):
Changelog entry
Translation reconciliation retains each completed reply's original source partition when planning corrections across source updates.
Why
A later translation can reuse older replies while generating only a changed section. Treating those replies as one request history assigns some replies to a container that never produced them. A separate completed-history planner keeps each reply variant tied to its actual complete partition and whole request slot.
Scope and risk
The pure planner requires the complete partition and reply catalog, explicit reuse eligibility for every reply, and a digest of that metadata. Selected reply references derive an ordered complete current cover without caller-supplied cuts. Each current separator must match the selected reply's own original partition separator. Same-input faults produce corrections; changed inputs retain their original identity and use current source. Eligible same-input alternatives require reuse. Completed wholes are never split to fit the byte bound.
The caller must authenticate catalog completeness, actual reply variants, source and settlement evidence, eligibility, uncertainty, partial attempts, refusals and security policy. A consistent metadata digest cannot establish those facts or admit provider calls. Unselected replies, faults and origin evidence remain in the result.
The existing single-history API retains its contract. A shared raw-origin calculation is factored behind its existing completed-unit guard. The architecture guide describes the separate completed-history contract.
Compatibility, rollout and rollback
Tests
python -m pytest tests/unit/test_i18n_completed_history.py tests/unit/test_i18n_source_origins.py -q -p no:randomly -o addopts=: 74 focused cases pass. They cover provenance, variant-specific faults, full-catalog eligibility, free alternatives, exact current coverage, raw-source proofs, refusal, separator ownership in both directions and UTF8 bounds.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex wrote the planner, tests and contract text; the publisher reviewed the complete diff, provenance boundaries and focused evidence.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist