Skip to content

Reuse source discovery during translation candidate checks - #938

Merged
zlareb1 merged 1 commit into
mainfrom
fix/i18n-candidate-inventory-reuse
Nov 19, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/i18n-candidate-inventory-reuse

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026

Copy link
Copy Markdown
Member

Changelog category

  • Performance Improvement

Changelog entry

Translation validation reuses its discovered source membership when checking current outputs, while rechecking each source path and hash.

Why

Each current translated output enumerates the tracked source set again even though its validation pass already has that inventory. Pass the existing membership snapshot to candidate validation instead of repeating repository discovery for each output.

Scope and risk

Change two functions in the translation lifecycle validator and add seven focused regression cases. Standalone candidate checks still discover their own inventory. Current candidates check source membership, a regular source path, the source hash and model before comparing content. A new validation pass discovers source additions and removals.

Only membership is reused within a pass; source bytes and path-safety results are not cached. The snapshot is not an atomic filesystem reservation. Link checks, English fallback validation, source-origin handling and output generation retain their existing behavior.

Compatibility, rollout and rollback

  • Wire: none. One internal helper gains an optional inventory argument.
  • Operator steps: none.
  • Rollback: revert the validator and its tests; no translation or stored data changes.

Tests

  • Seven focused real-parser tests pass. Six fail on the original implementation and pass after the fix; the source-byte-change control passes in both versions. They cover fixed discovery counts, invalid content, source-file and ancestor symlinks, changed or missing source bytes, and additions/removals across independent passes.
  • Ruff check/format, syntax, prose and whitespace checks pass. The remaining lifecycle functions and translation, chunk, origin and dependency-lock files are unchanged.
  • No whole-corpus validation, broad local suite or provider call was run. These checks do not establish the cause of a hosted timeout or a full-corpus speedup. Full repository checks run in GitHub CI.

AI assistance in the code

  • AI-generated: Codex wrote the validator change and tests. Source membership, path safety, freshness and test boundaries were checked.

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

Checklist

  • Full format, lint, typecheck and unit checks pass in GitHub CI.
  • No translated output, generated API, migration, plugin or frontend change.
  • Public text passes prose checks.
  • Commits are signed off.

Current translated pages share the inventory already discovered by their validation pass. Each candidate still checks its source path and hash at use; standalone calls discover their own inventory.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit c09bd4c into main Nov 19, 2026
44 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