Repository navigation
Allow source replacements inside proved translation boundaries - #927
Merged
Merged
Conversation
Retained lines prove the original endpoints while absent interior lines may change. Missing or ambiguous endpoints and reordered retained lines still refuse, preserving whole request identity and byte limits. Signed-off-by: zlareb1 <[email protected]>
An interior replacement retains the proved whole-request endpoints. Use endpoint loss for the invalid-proof case and cover replacement identity, completion history and exact UTF-8 limits in the positive cases. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Translation reconciliation accepts interior source replacements when retained lines prove the original request boundaries.
Why
A completed translation request can remain a single request after text changes inside it. Requiring every historical line to remain present rejects those replacements even when both boundaries have unique retained origins. The proof can ignore absent interior lines while requiring retained lines to preserve their order and multiplicity.
Scope and risk
This changes raw source-origin projection, its focused cases and the architecture description. Missing or ambiguous endpoint origins, reordered retained lines and insertions at request boundaries still refuse. Prepared source validation, parser cuts, request references, fault identifiers, exact byte limits and completion history keep their existing checks. Some replacements still refuse when repeated text prevents a unique correspondence.
Compatibility, rollout and rollback
Tests
A small standard-library harness calls the maintained reconciliation APIs. Against the original production implementation, six replacement subcases fail; with this change, all seven test methods pass. Controls cover missing endpoints, retained-line reordering, ambiguous origins, boundary insertions, source mismatch, whole-request identity and faults, exact UTF-8 limits, unchanged oversized reuse and completion history.
CI exposed an obsolete completed-history negative case that expected an interior replacement to refuse. That case instead removes an endpoint line, retaining the conflict and empty-plan assertions. The existing positive history and exact UTF-8 bound cases cover both insertion and interior replacement, with assertions for original completion identity and unchanged history.
The committed pytest parametrizations are unrun locally because the existing environments lack the combined dependencies. The resource guard also refused the direct completed-history fixture before any test started. The source-origin and reconciliation code exercised by the seven-method harness is unchanged. Full CI on the final commit remains required. No dependencies were installed or overlaid.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex wrote the diff. Source review checked the endpoint proof and the unchanged reconciliation contracts.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.main; no migration changes.frontend/changed; no frontend files change.git commit -s).