feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
37
server/supabase/functions/_shared/generation-receipt.test.ts
Normal file
37
server/supabase/functions/_shared/generation-receipt.test.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import {
|
||||
GenerationReceiptError,
|
||||
parseGenerationPurpose,
|
||||
parseGenerationReceiptId,
|
||||
} from './generation-receipt.ts'
|
||||
|
||||
function assert(condition: boolean, message: string): void {
|
||||
if (!condition) throw new Error(message)
|
||||
}
|
||||
|
||||
Deno.test('generation receipt purpose is explicit and fail closed', () => {
|
||||
assert(parseGenerationPurpose(null) === null, 'missing purpose should preserve generic LLM calls')
|
||||
assert(parseGenerationPurpose('talk_response') === 'talk_response', 'Talk purpose should be accepted')
|
||||
assert(parseGenerationPurpose('command_response') === 'command_response', 'Command purpose should be accepted')
|
||||
assert(parseGenerationPurpose('action_response') === 'action_response', 'Action purpose should be accepted')
|
||||
let rejected = false
|
||||
try {
|
||||
parseGenerationPurpose('meeting_document')
|
||||
} catch (error) {
|
||||
rejected = error instanceof GenerationReceiptError
|
||||
}
|
||||
assert(rejected, 'unknown purpose should be rejected')
|
||||
})
|
||||
|
||||
Deno.test('generation receipt RPC result requires a UUID', () => {
|
||||
const id = '29100000-0000-4000-8000-000000000001'
|
||||
assert(parseGenerationReceiptId({ generationId: id.toUpperCase() }) === id, 'UUID should normalize')
|
||||
for (const value of [null, {}, { generationId: 'bad' }]) {
|
||||
let rejected = false
|
||||
try {
|
||||
parseGenerationReceiptId(value)
|
||||
} catch (error) {
|
||||
rejected = error instanceof GenerationReceiptError
|
||||
}
|
||||
assert(rejected, 'invalid receipt should be rejected')
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue