You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9152a7e
Browse filesBrowse the repository at this point in the historyBrowse files
test(cursor): pin the spare-budget refund's budget and ordering
Five regressions for the invocation refund landed in #4543.
- A just-over-cap argument (~2,117 bytes against the 2,048 cap) must come back
byte-exact. The existing fixture is 4,600 bytes, where thousands of spare bytes
surround the decision and an off-by-one in the cost arithmetic or in the
newline-anchored search cannot show.
- No result may be evicted to pay for a wider invocation line, and under the
fixture's uniform per-round costs the restored set must be the newest
contiguous suffix. That second claim is a direction check: flipping the walk to
oldest-first makes it a prefix and turns this red. The comment says so, and
says plainly that contiguity is not guaranteed under mixed sizes, because the
pass skips an unaffordable line with continue rather than break.
- A checkpoint-covered call must keep its argument tail in the replayed suffix.
Drop knownCallsOffset from the pass's callBefore bound and only this case
notices, since that term is identically zero on the full-replay path.
- A multi-byte argument must survive intact, with U+FFFD asserted absent so a
failure names itself rather than only showing unequal strings.
- The outputElided skip is load bearing, and finding that out took two tries. A
sweep of single-result fixtures said the guard was dead code — elision appeared
to always cut the invocation line too — and an adversarial counter-read found
the configuration that sweep could not reach. Truncation alone cannot pay for a
restoration: it undershoots its own budget by about 28 bytes. Initiator
recovery can. With a ~519.7 KiB system prompt the equal-share pass cuts two
trailing results to ~2.3 KiB, losing "output:" but keeping the clipped
invocation line, and recovery then drops the older elided sibling to fit the
user turn; those freed bytes become spare. The test searches that ~24-byte
window rather than pinning a literal size, because pinning one made it pass on
a two-character call id and fail on a twelve-character one, and it fails loudly
if the window disappears.
Each of the last three was verified by mutation. The two 600 KiB cap tests are
byte-identical. The only src change is the comment recording what the guard
actually depends on, and structure/providers/cursor.md records it too — the
earlier draft of both called the guard defensive, which was wrong.
0 commit comments