docs: replace vague provenance prose with recorded facts

This commit is contained in:
Turtle
2026-08-09 15:35:02 +08:00
parent 8c124f84b6
commit 9704749b01
380 changed files with 946 additions and 874 deletions

View File

@@ -838,7 +838,7 @@ describe('optional model-free tool-result pruning', () => {
})
describe('compaction region transaction', () => {
it('lands a framed, replayable checkpoint with exact pricing provenance', async () => {
it('lands a framed, replayable checkpoint with exact source seqs and token price', async () => {
const compact = service()
compact.rawOutput = [
{ type: 'reasoning', text: 'private compact thought' },

View File

@@ -618,7 +618,7 @@ describe('compactNow transaction and failure classification', () => {
const agent = fakeAgent(session, () => () => { released += 1 })
const append = session.append.bind(session)
vi.spyOn(session, 'append').mockImplementation(((type: string, ...rest: never[]) => {
if (type === 'compact/summary') throw new Error('provenance rejected')
if (type === 'compact/summary') throw new Error('summary record rejected')
return (append as (...args: never[]) => unknown)(type as never, ...rest)
}) as never)
@@ -627,7 +627,7 @@ describe('compactNow transaction and failure classification', () => {
expect(error.code).toBe('commit')
expect(released).toBe(1)
const end = session.events.findLast(event => event.type === 'compact/end')
expect(end?.type === 'compact/end' && end.data.error).toContain('provenance rejected')
expect(end?.type === 'compact/end' && end.data.error).toContain('summary record rejected')
expect(end?.type === 'compact/end' && end.data.turn).toBeNull()
})
@@ -637,14 +637,14 @@ describe('compactNow transaction and failure classification', () => {
const agent = fakeAgent(session, () => () => undefined)
const append = session.append.bind(session)
vi.spyOn(session, 'append').mockImplementation(((type: string, ...rest: never[]) => {
if (type === 'compact/summary') throw new Error('provenance rejected')
if (type === 'compact/summary') throw new Error('summary record rejected')
return (append as (...args: never[]) => unknown)(type as never, ...rest)
}) as never)
vi.spyOn(ctx.sessions, 'flush').mockRejectedValueOnce(new Error('disk full'))
const error = await rejection(compact.compactNow(agent, SIGNAL))
expect(error.code).toBe('commit')
expect(causeOf(error).message).toBe('provenance rejected')
expect(causeOf(error).message).toBe('summary record rejected')
vi.restoreAllMocks()
})