Skip to content

Retain each completed translation reply's source partition - #877

Merged
zlareb1 merged 2 commits into
mainfrom
feat/i18n-completed-history
Nov 18, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
feat/i18n-completed-history

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #847
Related: #873

Changelog category (leave one):

  • Improvement

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

  • Wire, settings and operator steps: none.
  • Matching consumers must authenticate each selected reply against its own complete source partition. This PR changes no executor, generated translation or paid execution policy.
  • Rollback removes the separate planner and restores the shared calculation in place. No stored application data changes.

Tests

  • A missing-feature regression fails before implementation because the new API is absent.
  • 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.
  • Ruff, formatting, diff and prose checks pass. Full suites run in GitHub CI and must pass before merge; no heavy local suite ran.

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

  • Required GitHub CI passes on the current head.
  • No migration, schema, SDK, plugin or frontend changes.
  • The architecture guide describes the new contract and caller obligations.
  • Existing generated translations and paid execution policy retain their values.
  • Commits are signed off.

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]>
@zlareb1
zlareb1 merged commit 31f1c5b into main Nov 18, 2026
81 of 82 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant