doc(tui): drop a stale justification and clarify the fixture's tool text

Two comment-only corrections from the final review round.

The `isCompactCheckpoint` redundancy note appealed to the mandatory-marker
invariant to explain something the enclosing branch now states outright:
after e029ffb88 both call sites are literally inside an
`isReplacementSurfaceEvent` branch, so the appeal became retained
reasoning. Say the call sites test it directly.

`appendPreCompactionLog` implied its tool-result content is what survives
compaction, but `bash`'s presenter is static, so the string never reaches
a fixture — the fixtures pin that the shadowed step's card survives.
Neutral text plus a note on where the card body comes from, so a later
reader does not "fix" a fixture to make the sentence true. Verified by the
absence of fixture drift from changing the string.
This commit is contained in:
Hypatia May
2026-07-29 18:16:31 +08:00
parent b0c7a4f324
commit fc5e2632d6
2 changed files with 8 additions and 7 deletions
+3 -5
View File
@@ -110,11 +110,9 @@ export function transcriptToolCallIds(session: Session): Set<string> {
* `tool/result`, a regenerated `assistant/message`) rewrite one node for the
* model and mark no boundary in the conversation.
*
* The replacement check is redundant at both current call sites, because a
* surface-eligible non-append event is a replacement: the marker is mandatory,
* so `Session.append` and the replay fold reject an event that carries none.
* The check keeps the exported predicate true to its name for a third caller,
* rather than making that caller repeat it.
* Both current call sites already test the replacement themselves. The check
* keeps the exported predicate true to its name for a third caller, rather than
* making that caller repeat it.
* @param event - event to test.
* @returns true when the event compacted a surface range.
*/
+5 -2
View File
@@ -195,7 +195,10 @@ interface CompactionRange {
/**
* Append one prompt / tool-call / tool-result step, the history a compaction
* shadows on the model surface and the transcript must keep showing.
* shadows on the model surface and the transcript must keep showing. The prompt
* text is rendered verbatim; the tool card's body comes from `bash`'s static
* presenter, so the fixtures pin that the shadowed step's card survives rather
* than the result content below.
*/
function appendPreCompactionLog(session: Session): CompactionRange {
const user = session.append('user/message', createUserMessage({
@@ -220,7 +223,7 @@ function appendPreCompactionLog(session: Session): CompactionRange {
step: 1,
message: createToolResultMessage({
callId: CallId('old-tool'),
content: [{ type: 'text', text: 'tool output that stays readable after compaction' }],
content: [{ type: 'text', text: 'shadowed step tool output' }],
isError: false,
}),
}, { surfaceOp: 'append' })