fix(tests): a repro artifact can be regenerated after its input bytes move - #384
Merged
Merged
Conversation
… move The documented two-pass regeneration (reference `--write`, port `OWN_SHADOW_WRITE=1`, reference `--write`) could not start once the input of a committed artifact changed. The reference carried the port's committed capture through verbatim; that capture attests the OLD bytes, so the artifact failed to verify and the writer refused (exit 1). The port's writer in turn refuses until the artifact's bytes equal the file on disk (exit 101). Each side waited for the other, and the only way out was to delete the artifact by hand. The writer no longer carries a foreign capture of other bytes into a rewritten artifact: it is dropped with its reason, exactly like a pre-v3 entry, and the port re-runs and authors its own. Verify mode drops nothing, so a moved input still reads as a stale artifact. The control `carry-moved-input` drives a state no committed fixture can reach (an artifact and its input are always regenerated together). Without the fix it fails three ways: the stale capture is carried, nothing says why, and the rewritten artifact does not verify. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
9 of 10 tasks
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.
Что и зачем
Документированная перегенерация repro-артефактов в два прохода (
python tests/test_repro_fixtures.py --write→OWN_SHADOW_WRITE=1 cargo test -p own-shadow --test engine→ снова--write) не могла начаться, если изменились входные байты закоммиченного артефакта. Python переносил закоммиченную запись Rust-движка как есть; она свидетельствует о старых байтах, артефакт не проходил проверку, и писатель отказывался (код 1). Rust-писатель, в свою очередь, отказывается, пока байты артефакта не совпадут с файлом на диске (код 101). Выход был один — удалить артефакт руками.Теперь писатель не переносит чужую запись о других байтах: она отбрасывается с пометкой, как запись до v3, и порт заново пишет свою. Режим проверки ничего не отбрасывает, так что сдвинувшийся вход по-прежнему читается как устаревший артефакт.
Тип изменения
Как проверено
python tests/run_tests.pyruff check .иmypypython scripts/<...>.py --selftest)Linux (WSL),
ruff 0.15.8,mypy 1.19.1.Сквозное воспроизведение: к
tests/fixtures/repro/canonical_key_order.facts.jsonдописан перевод строки.main--write, проход 1NOTE: … attests other bytes …OWN_SHADOW_WRITE=1 cargo test -p own-shadow --test engine--write, проход 2cargo test -p own-shadowcarry-moved-inputбез исправления падает тремя способами (запись перенесена; причина не названа; артефакт не проходит проверку).tests/test_checkpoint_status.pyзелёный: якоря мутационных кампаний на месте (carry_foreignвownlang/repro.pyне тронут, правка в писателе теста).python tests/run_tests.pyгонялся на дереве с обоими исправлениями до коммита; единственное падение там — контроль P-037 «dirty tree», который на закоммиченном дереве проходит.Связанные issue
Нет. Найдено при перегенерации фикстур в исследовательской ветке.
Чеклист
feat:,fix:,docs:…)Документация не требуется: порядок из
docs/notes/p022-shadow-acceptance.mdтеперь работает как написан.🤖 Generated with Claude Code