A rule must say when it applies; the ledger says what was read, not what was shown #162

Merged
bvandeusen merged 6 commits from dev into main 2026-09-16 17:50:08 -04:00
Showing only changes of commit 957a72c501 - Show all commits
+19 -6
View File
@@ -149,16 +149,29 @@ def test_shortening_a_line_does_not_decide_what_it_says_about_holding():
precisely because the session may no longer HOLD what it was told — and
the tail is the entire difference a reader can act on.
`compact` and `seen` are independent axes. How much room a line gets is a
fact about its rank; whether the session holds it is a fact about the
ledger; and neither may be allowed to answer the other's question.
`compact` and the ledger are independent axes. How much room a line gets is
a fact about its rank; what the session holds is a fact about the ledger;
and neither may be allowed to answer the other's question.
THREE STATES SINCE #4100, so this checks three. The axis grew and the test
grew with it — pinning only two would leave the compact branch free to
collapse the new middle state into either neighbour, which is the same
regression this was written for with one more place to hide.
"""
rule = fake_rule(id=4, title="dev is home", when_to_apply=_TRIGGER)
seen = _rule_hint_line(rule, where="here", seen=True, compact=True)
fresh = _rule_hint_line(rule, where="here", seen=False, compact=True)
assert seen != fresh
assert "no longer hold it" in seen
named = _rule_hint_line(rule, where="here", seen=True, compact=True)
held = _rule_hint_line(rule, where="here", seen=True, held=True, compact=True)
assert len({fresh, named, held}) == 3, (
"the compact branch collapsed two holding states into one line"
)
assert "not in this session's loaded set" in fresh
assert "not opened" in named
assert "no longer hold it" in held
# The claim that most needs to survive shortening: a line the session never
# opened must not imply it did, however little room the line was given.
assert "no longer hold it" not in named
def test_a_compact_line_is_materially_shorter_than_a_full_one():