Repository navigation
Merged
Conversation
…ives its own merge (#440) The guard compared origin/main's lib-memory-dir.sh against a keyed old->new allowance and asserted whenever old_code was not found. That was correct while #436 was open and unsatisfiable the moment it merged: origin/main then held new_code, old_code was gone, and the guard failed on the default branch itself. _apply_sanctioned_divergence() now recognizes old-absent/new-present as the post-merge steady state rather than staleness, only asserting when neither side is found. Co-Authored-By: Max <noreply>
…ile Windows skip (#440) Self-review on #440 found that the three new _apply_sanctioned_divergence regression tests, added inside tests/test_case_divergence_298.py, silently inherited that module's whole-file `pytestmark` skip on win32 -- a skip that exists for the file's bash-spawning tests and does not describe these three, which are pure Python string manipulation. Relocated them to a new file, tests/test_sanctioned_divergence_state_440.py, so they actually run on windows-latest CI instead of reporting green while never executing. Co-Authored-By: Max <noreply>
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.
Closes #440
main was red on every ubuntu leg and macos 3.11 the instant #429's own sanctioned-divergence allowance (PR #436) merged. test_the_per_tool_call_path_is_not_touched in tests/test_case_divergence_298.py compares scripts/lib-memory-dir.sh against origin/main and allows one keyed old-to-new substitution (_SANCTIONED_DIVERGENCE), guarded by an integrity check that the old code must still be findable on origin/main. That check was correct while #436 was open and unsatisfiable the moment it merged: origin/main then held the new code, the old code was gone, and the guard asserted on the default branch itself.
The guard recognized only two states (old code present: substitute; neither present: stale) and needed a third: old code absent and new code present is the post-merge steady state, not staleness. _apply_sanctioned_divergence() now checks for the new code before asserting, and passes the comparison through unchanged when it is already there. Only genuine staleness (neither found) still asserts.
Pinned with three tests that construct both shapes directly from _SANCTIONED_DIVERGENCE's own recorded strings, not from wherever origin/main happens to sit when they run: test_sanctioned_divergence_applies_pre_merge_shape, test_sanctioned_divergence_accepts_post_merge_shape, test_sanctioned_divergence_still_asserts_when_genuinely_stale.
Reproduction
Red before the fix, with the exact CI assertion. Green after.
A second commit on this branch, from self-review
The spawned auditor found that the three new unit tests, as first written inside tests/test_case_divergence_298.py, would themselves inherit that module's whole-file pytest.mark.skipif(sys.platform == "win32") -- a skip that exists for the file's bash-spawning tests and does not describe these three, which are pure Python string manipulation. Confirmed against a real windows-latest job log (the whole file collects as one skip block). Fixed by relocating the three tests to a new file, tests/test_sanctioned_divergence_state_440.py, which imports _SANCTIONED_DIVERGENCE and _apply_sanctioned_divergence from the guarded module. They now run on every platform.
A third finding, reported for filing rather than fixed here
Both the reviewer's own investigation and the auditor independently confirmed, from real CI job logs (PR #436 -- the PR that introduced the now-repaired allowance -- and PR #439, an unrelated currently-open PR), that test_the_per_tool_call_path_is_not_touched silently self-skips ("origin/main not available") on every pull_request-triggered CI run in this repository. actions/checkout's default behaviour on pull_request events never makes origin/main a resolvable ref (only the synthetic merge-ref commit is fetched), so this guard has only ever exercised its assertions after a squash-merge lands on main via a push event -- structurally too late to block a bad merge, and exactly how #429's allowance shipped unverified through its own PR review (PR #436 was itself 13/13 green while silently skipping the very check it claims to guard).
Not fixed in this diff: it needs a CI workflow fetch-depth/trigger design decision (a full fetch-depth: 0 costs matrix-wide clone time on every job; a narrower explicit git fetch origin main step is untested here and would need its own CI verification cycle before landing), it touches a different file (.github/workflows/tests.yml) with repo-wide blast radius, and it deserves its own review rather than a rider on this fix.
Tests
Full suite: 1804 passed, 43 skipped, both before and after the relocation commit (net test count unchanged -- three tests moved files). Changelog fragment validated with .oss/assemble_changelog.py --check.
Review
Spawned reviewer (Explore): NO FINDINGS, checked three-state edge cases, tautology risk on the new tests, refactor-preserves-behaviour, stale docstrings, other call sites.
Spawned auditor (oss:auditor): FINDINGS: 2 (both class B, "a guard that did not run", both ranked misreports) -- the Windows-skip-inheritance defect above (fixed) and the PR-skip defect above (report-for-filing, agreed with my classification).