Skip to content

Retain terminal translation origins across link changes - #963

Merged
zlareb1 merged 6 commits into
mainfrom
fix/i18n-terminal-route-provenance
Nov 20, 2026
Merged

zlareb1 merged 6 commits into
mainfrom
fix/i18n-terminal-route-provenance

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Related: #1076
Related: #1077

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry

Translation planning retains original request boundaries when a paragraph append coincides with a change between a native link and its English fallback.

Why

The preparer can choose a different legal route for an existing link as translated pages become available. Comparing prepared prefixes then rejects a paragraph append even when the raw source proves which original request owns it. Shorter native routes can also make the complete prepared container smaller.

Scope and risk

Prove the append boundary through the existing complete raw-to-prepared source maps. Keep raw-prefix and parser checks, heading ownership, original separators, complete coverage, request identities and byte limits. Changed requests require their own current-input completions.

The regression cases cover both route directions, a smaller prepared container, changed earlier requests, invented targets, altered prose and unsafe appended blocks.

A cleanup-order unit fixture uses the shared manual clock to retain its intended cleanup reserve. Its phase limit, ordering assertions and separate expired-phase coverage stay intact; production deadlines and cleanup behavior do not change.

The presence deadline fixture controls which namespace tasks have completed at the cutoff, preserving the configured deadline and testing cancellation of the pending namespace. It does not require answered tasks to finish within a wall-clock scheduling window.

The replicated-erasure fixture regression uses the lease table published on the base branch. It checks lease acquisition, missing-table refusal and the published database-specific Keeper root.

Compatibility, rollout and rollback

  • Wire, defaults and operator steps: none.
  • Existing translation histories and generated files remain intact.
  • Reverting restores the conservative refusal for this combination.

Tests

  • 46 focused origin and completed-history checks pass:
    python -m pytest -q tests/unit/test_i18n_source_origins.py tests/unit/test_i18n_completed_history.py -k 'terminal or interior_boundary or source_transformation'
  • Five focused cleanup-order and expired-phase cases pass:
    python -m pytest -q tests/unit/test_cell_control.py -k 'uncertain_commit or expired_phase or terminal_mode_failure'
  • Ruff lint, format, documentation prose and diff checks pass.
  • Four focused fixture cases pass on the current composition:
    python -m pytest -q tests/unit/test_erasure_replicated_fixture.py tests/unit/test_code_presence.py -k 'replicated or past_the_deadline'
    These cover the presence cutoff, lease acquisition/release, missing-table refusal and separate fixture roots. The hosted replicated-erasure shard also passes: 563 passed, 169 skipped and 1 xpassed.
  • An earlier hosted run failed the cleanup-order fixture because its expected CLOSE marker was absent. The fixture now controls elapsed time; the exact scheduling cause of that run remains unproved.
  • An earlier hosted run reported an expected answered namespace as unknown in the presence fixture. That is a legal result when its real 50 ms window expires; the exact scheduling cause remains unproved. The controlled cutoff retains the unknown/deadline, answered/absent and summary assertions and checks that pending work is cancelled.
  • An earlier hosted integration run failed two replicated-clear cases with UNKNOWN_TABLE for their private lease table. The base branch provisions that table; the regression checks the published fixture without changing production lease rules.
  • Hosted CI on the current head has 49 successful checks and two expected publication skips; all four workflows succeed.
  • Required GitHub CI passes on the current head.
  • Fresh independent technical and content reviews have no findings.

AI assistance in the code (leave one):

  • AI-generated: Codex wrote the implementation, regression cases and documentation. The failing cases were reproduced before the fix and the retained ownership checks were reviewed.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Required format, lint, type and unit gates pass in GitHub CI.
  • No generated files or schemas require regeneration.
  • Documentation describes the source ownership proof and its limits.
  • Repository text follows the public-copy rules.
  • Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 20, 2026 11:01pm UTC

Request Review

Use the shared manual clock for the cleanup-order case so scheduler delay cannot exhaust the intended reserve. Preserve the phase limit, operation ordering and expired-phase coverage.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Wait for answered namespaces before returning the pending task at the configured cutoff. Keep the deadline verdict and elapsed limit assertions, and verify that the pending handler is cancelled. This tests deadline classification without requiring unrelated work to finish in a real scheduling window.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Fenced memory inserts require a lease table in the selected schema. Give each fixture database its own Keeper root while preserving the replicated content checks.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 96be03c)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Keep the published database-specific Keeper path and check it in the fixture regression. Preserve the completed source changes and their full CI evidence while resolving the actual target conflict.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 6367c00 into main Nov 20, 2026
51 checks passed
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