Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01ESFAnh2t9HmLwng8oW95St
213 lines
7.3 KiB
TypeScript
213 lines
7.3 KiB
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
import { ChatGateway } from './chat.gateway.js';
|
|
|
|
const CONVERSATION_ID = 'conversation-1';
|
|
const CANARY = 'sk_canary12345678';
|
|
|
|
/**
|
|
* Task 5 fence (F, GREEN control): the redaction boundary is pre-Task-5 egress/persistence
|
|
* functionality, orthogonal to runtime routing — it must keep holding unchanged across Task 5.
|
|
* After Step Three, `relayEvent` consumes normalized {@link LegacyRuntimeEvent}s and never reads
|
|
* the runtime slot, a pi session, or records usage: the runtime owns all session/token
|
|
* bookkeeping and hands finished usage back on the `settled` event. So this control fronts slot0
|
|
* with a bare, getSession-less stub — proving the redaction path is independent of the runtime —
|
|
* and drives the gateway with the normalized event vocabulary (`text_delta` / `settled`).
|
|
*/
|
|
function clientConversationKey(clientId: string, conversationId: string): string {
|
|
return `${clientId} |