Stop paying twice for a block a retry can still throw away
A memory whose block ends on the newest action is the one memory a player can reach: retry and take-switching both refuse anything else. Each retry of that turn withdrew the memory and wrote it again, and a block closes every six actions while a normal turn writes two, so that was one turn in three. SETTLE_SLACK asks for one action past a block before the block is summarized. The block is still MEMORY_INTERVAL actions; only the moment moves. This is not the pre-SP4 holdback returning: that one was about a retry rewriting text in place, which sibling attempts and forget_node settled, and correctness still rests on the withdrawal rather than on the slack. Undo and delete can carry a summarized node back to the tip, so the withdrawal path stays reachable, just rarely. The slack buys nothing back. The block that just closed is still in the history window in full, so a memory of it says what the model can already read. Tests: the settling suite asserts the new rule and that a retry at the tip finds nothing to withdraw; the rewrite suite builds thirteen actions so both of its blocks settle; the one path test that ended on a block boundary sets the slack to zero, because it is about which actions a block is read from rather than about when a block forms. 632 green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NcrxCJjqgDvAkamKeLWdn
This commit is contained in:
@@ -69,8 +69,13 @@ def db():
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
|
||||
|
||||
def make_adventure(db, *, actions=12, key="sk-test-key", email="rewrite@example.com"):
|
||||
"""An adventure whose bank was written by the old prompt."""
|
||||
def make_adventure(db, *, actions=13, key="sk-test-key", email="rewrite@example.com"):
|
||||
"""An adventure whose bank was written by the old prompt.
|
||||
|
||||
Thirteen actions, not twelve: two blocks of six, plus the one action that
|
||||
settles the second of them. A block is not summarized while it ends on the
|
||||
newest action. See `memorybank.SETTLE_SLACK`.
|
||||
"""
|
||||
user = models.User(is_guest=False, email=email)
|
||||
db.add(user)
|
||||
db.flush()
|
||||
|
||||
Reference in New Issue
Block a user