Skip to content

fix(#734): drop the #662 sanctioned-divergence tuple stranded by #726's own composition - #735

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/734
Sep 19, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/734

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

What was red

Push run 35448300892 on main at 7ba7609 (the squash merge of PR #732) failed every
ubuntu-latest and macos-latest pytest leg in
tests/test_case_divergence_298.py::test_the_per_tool_call_path_is_not_touched, with:

AssertionError: scripts/lib-memory-dir.sh: neither the old nor the new code of this
sanctioned substitution is on origin/main -- origin/main has moved and this allowance
needs re-deriving, not blindly re-applying

Windows legs pass (the module is skipif'd on win32, pre-existing and untouched by this
diff).

Root cause

_SANCTIONED_DIVERGENCE["scripts/lib-memory-dir.sh"] carried a #662 tuple pinning the
_LAZY_PYTHON_GUARD insertion into the no-jq elif branch against a two-argument python
invocation. PR #732's own #726 fix changed the real script to a three-argument
invocation, composing the guard directly into it in one already-merged commit, without
updating the older #662 entry to match. Once #726 landed, neither the #662 tuple's
old_code nor its new_code was still a substring of origin/main's
scripts/lib-memory-dir.sh -- exactly the "neither old nor new" failure the guard
exists to raise.

Fix

Removed the stale #662 tuple entirely, replacing it with an explanatory comment. No
coverage is lost: the later #726 tuple's own new_code already carries the
_LAZY_PYTHON_GUARD line as its literal first line, so the "guard precedes the python
invocation" invariant #662 existed to pin is still asserted via that tuple's own
elif-branch match against origin/main. Verified programmatically that all 11 remaining
tuples across both files' _SANCTIONED_DIVERGENCE entries resolve to "new-present"
(already-shipped, no-op) against current origin/main -- none stale.

Also fixed a now-stale "#429 and #662 both touch lib-memory-dir.sh" cross-reference in
two files' prose (found in self-review), updated to "#429 and #726".

Tests

Red (fresh worktree cut from origin/main at 7ba7609, before any edit):
python3 -m pytest tests/test_case_divergence_298.py::test_the_per_tool_call_path_is_not_touched -q
-> 1 failed, matching the issue's quoted error string verbatim.

Green (after both commits):
python3 -m pytest tests/test_case_divergence_298.py tests/test_sanctioned_divergence_state_440.py -q --no-cov
-> 26 passed, 0 failed.

Review

Two spawns (Explore, oss:auditor), concurrent, both told not to mutate. Tree snapshot
compare: clean. Explore found one cosmetic cross-reference finding (fixed, see above).
oss:auditor found 0 findings across all 4 checked classes and independently re-ran the
previously-failing test to confirm the fix is non-vacuous.

Closes #734.

[AI-generated]

…s own composition

`tests/test_case_divergence_298.py::test_the_per_tool_call_path_is_not_touched`
was red on ubuntu-latest and macos-latest after #732 merged. The
`_SANCTIONED_DIVERGENCE["scripts/lib-memory-dir.sh"]` entry for #662's
`_LAZY_PYTHON_GUARD` insertion still pinned the pre-#726 two-argument
python-fallback invocation as both its old_code and new_code, while #726
(shipped in #732) composed the guard directly into a three-argument
invocation and never updated this older entry to match. Since origin/main
only moves forward, neither shape is a substring of the real file, so the
guard's own "neither old nor new" assertion fired.

Remove the stale tuple: #726's own tuple already re-asserts the guard line
as the first line of its new_code, so removing the redundant #662 entry
loses no coverage of the guard-precedes-invocation invariant. Verified every
remaining `_SANCTIONED_DIVERGENCE` entry (both files) resolves to
new-present against current origin/main -- no other entry carries the same
staleness risk right now.

Closes #734

Co-Authored-By: Max <noreply>
…ple's removal

Self-review (Explore reviewer) flagged that removing #662's own
_SANCTIONED_DIVERGENCE tuple in 1cd7679 left two docstrings still citing
"#429 and #662 both touch lib-memory-dir.sh" as the illustrative example of
a file carrying more than one allowance. #662's guard insertion no longer
has a standalone tuple -- it now only survives embedded inside #726's -- so
#662 is no longer an accurate second example; #726 is. Updates both
occurrences (tests/test_case_divergence_298.py and
tests/test_sanctioned_divergence_state_440.py). Cosmetic/documentation only,
no behavior change; targeted suite re-run green (26 passed).

Co-Authored-By: Max <noreply>
@fdaviddpt
fdaviddpt merged commit e0dc0a6 into main Sep 19, 2026
16 checks passed
@fdaviddpt
fdaviddpt deleted the fix/734 branch September 19, 2026 16:06
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.

main is red at 7ba7609 (#732): stale _SANCTIONED_DIVERGENCE entry in test_case_divergence_298.py for lib-memory-dir.sh's elif/python branch

1 participant