Repository navigation
tests/test_ruleset_hint_tracking_branch.py: the re-run the hint offers is dated later than the first run, so a leg's seed made again, even in the same second, is another commit and fails "kept at its commit" where it passed by the clock (#922) - #943
Conversation
…s is dated later than the first run, so a leg's seed made again, even in the same second, is another commit and fails "kept at its commit" where it passed by the clock (#922) `tip(...) == before[repo]` compared a leg's tip with the first run's, and the second run set no committer date. A seed commit made again in the same second, with the same tree, identity and message, is the same object, so with `_take_held_seed` disabled the scaffold-code case still passed. The second run now carries GIT_COMMITTER_DATE 2031-01-01, as the dedicated reuse test does, so a re-made seed has another id. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis test-only change makes the operator re-run use a fixed later GIT_COMMITTER_DATE, ensuring any incorrectly recreated seed has a different commit ID and causing the existing push or tip-preservation assertions to catch regressions that could previously pass when commits were created in the same second. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
(lane openRepoShape-3, 2026-10-18T16:37:31Z) RV943's independent review of #943 at Mutants. Re-made in RV943's own scratch copy of the head, with
The 2031 date cannot make an assertion pass without testing anything.
Tests, run one at a time under a stub gh that exits 97,
Merge: NITs, none blocking:
It lands under Brett Heap's v1.2.0 merge word once Lane: openreposhape-3 (openRepoShape-3) |
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 6 hours by commenting |



Closes #922.
What changed, and why
One file, a test:
tests/test_ruleset_hint_tracking_branch.py. The tools are untouched.U007, "kept at its commit" cannot see a same-second commit.
test_the_hint_names_one_exit_and_taking_it_finishes_the_runcompares each leg's tip after the re-run with the first run's (tip(...) == before[repo]), and the re-run set no committer date. A seed commit made again in the same second, with the same tree, identity and message, is the same object, so a re-run that made a new seed for a leg it should have kept pushed the object the leg already held, and the comparison passed by the clock.The re-run (
operator) now carriesGIT_COMMITTER_DATE2031-01-01, from a newLATERconstant besideSCAFFOLDED, so a seed made again has another id. The module docstring and the comment above the comparison say so.Decisions the Direction leaves open:
GIT_COMMITTER_DATE"and an author date if it matters". It does not: the committer date is part of the commit id, so it alone gives the new commit another one. The mutant runs below pin the author date to the same value in both runs and the mutants still fail, which shows it.tests/test_scaffold_reuse_seeded_legs.py:160-161), not a date read from the first run's commit. It is later than any first run until 2031, and a reader sees the same device in both tests.git-filter-repopresent). Oneoperatordict is simpler than a branch on the case.Left out of scope
The issue has no "Needs a ruling" or "Documented limit" section, so nothing was left out under that rule. Nothing outside the one test file was touched, and no other test file needed a change:
tests/test_scaffold_reuse_seeded_legs.pyandtests/test_dry_run_asks_remotes.pyimportrefusingandtemplatefrom this file and pass unchanged.Tests
Each run under a stub
ghfirst on PATH that exits 97,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR, onepytestprocess at a time,-p no:cacheprovider -o tmp_path_retention_policy=failed, wrapped intimeout 2400.tests/test_shape_doctor.pywas not run: noshape-doctor.pyand no helper it imports changed.Mutants
Both are made in a scratch clone of this branch's base, in
scaffold-project.py's_seed_legs, and neither is in this PR. The failing run is-k "test_the_hint_names_one_exit and scaffold", six cases:scaffold-specholds no seed after its first run (the first leg's push is the one refused), so the two spec cases cannot tell the mutants from the tool.To fix "the same second" and not leave it to the clock, a run marked "pinned" exports
GIT_AUTHOR_DATEandGIT_COMMITTER_DATEas the same instant to the whole pytest process, so the first run and the re-run commit at the same time to the second;run_scriptpasses the process environment through. The new test's ownLATERoverrides the committer date of the re-run only.Mutant A: reuse of a held seed switched off.
if reused.get(role):becomesif False and reused.get(role):, so_take_held_seedis never taken and the leg's seed is made again and pushed as it was.scaffold-code-trunkpassed;scaffold-code-mainand bothscaffold-rootcases made the seed again in another second and failedThe new test fails at
assert again.returncode == 0, again.stderr + again.stdout(line 427): the seed made again is another commit, its push over the held one is refused (! [rejected] HEAD -> main (fetch first)), and the tool exits 2 with the ruleset hint.Mutant B: the seed made again and forced over the held one. Mutant A, and the leg's push becomes
+HEAD:refs/heads/<branch>, so the push is accepted and the leg's tip moves.scaffold-codecases passed; the twoscaffold-rootcases made the seed again in another second and failedThe new test fails at
assert tip(remotes / repo, tracking) == before[repo], repo(line 443), the "kept at its commit" assertion, onAtlas-spec.git: the tip is a different commit from the first run's. This is the assertion #922 is about. Therev-list --count --allassertion just above it passes under this mutant, since a forced push leaves one commit, so the tip comparison is the only one that sees it.Fix mutant: the fix is the one line
operator = {**refusing(template), **LATER}; withoutLATERthe test is the old test, and the "old" rows above are its result.Merge results
git merge-tree --write-tree HEAD origin/main(origin/main64464d31064c062cc3b9dd6900493ef3d99ec533): clean, tree938ca5e3392ffdde60be1eb626f6e3354e8a32a4.tests/test_ruleset_hint_tracking_branch.py(gh pr list --state open --limit 100 --json number,headRefOid,files, 7 open): none, so there is no other head to merge against.Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Ensure hint-tracking tests distinguish regenerated seed commits from reused commits by dating reruns later than the initial run.
Bug Fixes:
Enhancements:
Tests: