Keep fork boundary tests aligned with inherited actions

This commit is contained in:
Brennan Benson
2026-11-08 02:16:19 -08:00
parent f4989d0408
commit cf9fa17e04
2 changed files with 1 additions and 33 deletions
@@ -743,7 +743,7 @@ it('refuses an imported ACP tip with assistant prose but no native terminal evid
role,
blocks: [{ type: 'text', text: role === 'user' ? 'Remember 57319' : 'Remembered' }]
},
{ fence: 1 }
{ fence: 1, turnScope: { kind: 'thread' } }
)
}
const record = agentSessionRecordFixture({
@@ -1,32 +0,0 @@
import { expect, it } from 'vitest'
import { agentJournalItemKey } from '../../../../../../shared/agent-session/journal/agent-session-journal-item-key'
import type { ForkMarker } from '../agent-session-fork-marker'
import { remapForkChildBoundary } from '../../../rewind/agent-session-fork-boundary-remap'
import { fixture, appendItems, item, body } from './agent-session-history-contract-test-fixture'
function marker(): ForkMarker {
return {
forkedFrom: {
sessionId: 'source-session',
itemId: 'source-reply',
childBoundary: { kind: 'item', itemId: agentJournalItemKey(item(2)) }
},
sourceName: 'Original chat'
}
}
it('does not move a pre-clear inherited boundary when only later context is rewound', async () => {
await appendItems(4)
const old = fixture.journal.currentRead().items
const boundary = marker().forkedFrom.childBoundary
const kept = [{ identity: item(3), body: body('item-3'), ownerFence: 0 }]
expect(remapForkChildBoundary(boundary, old, kept, old[1].sequence)).toEqual({
kind: 'item',
itemId: 'codex:thread-1:turn-1:2'
})
expect(
remapForkChildBoundary(boundary, old, [
{ identity: item(1), body: body('item-1'), ownerFence: 0 }
])
).toEqual({ kind: 'item', itemId: 'codex:thread-1:turn-1:1' })
})