packages/core/src/domain/value-objects/__tests__/schema-drift.test.ts mechanically guards ThemeConfig and its sub-objects (colors, layout, avatar, end-of-conversation survey) against schemas/theme.schema.json. The same drift policy is documented in AGENTS.md → Schema Sync Rule for every other JSON-serialisable type — but only ThemeConfig has the test. We want the same protection for the rest.
Tasks
Approach
Each new test follows the same pattern as the existing one:
const EXPECTED: { [K in keyof Required<T>]: true } = { /* ... */ };
expect(keys(schema.properties)).toEqual(keys(EXPECTED));
The mapped-type contract catches TS-only drift; the JSON read catches schema-only drift. For AIChunk's discriminated-union case, iterate schema.oneOf[*].properties and compare each variant.
Some connectors live outside @chativa/core — the test for them belongs in their own package's __tests__ folder, not in core, to avoid a cross-package import.
Acceptance criteria
Spun out of todos.md.
packages/core/src/domain/value-objects/__tests__/schema-drift.test.tsmechanically guardsThemeConfigand its sub-objects (colors, layout, avatar, end-of-conversation survey) againstschemas/theme.schema.json. The same drift policy is documented inAGENTS.md → Schema Sync Rulefor every other JSON-serialisable type — but onlyThemeConfighas the test. We want the same protection for the rest.Tasks
Optionsinterface with its schema:WebSocketConnectorOptions↔schemas/connectors/websocket.schema.jsonSignalRConnectorOptions↔schemas/connectors/signalr.schema.jsonDirectLineConnectorOptions↔schemas/connectors/directline.schema.jsonSseConnectorOptions↔schemas/connectors/sse.schema.jsonHttpConnectorOptions↔schemas/connectors/http.schema.jsonDummyConnectorconstructor options ↔schemas/connectors/dummy.schema.jsonIncomingMessage↔schemas/messages/incoming-message.schema.jsonOutgoingMessage↔schemas/messages/outgoing-message.schema.jsonMessageAction↔schemas/messages/message-action.schema.jsonHistoryResult↔schemas/messages/history-result.schema.jsonConversation↔schemas/messages/conversation.schema.jsonSurveyPayload↔schemas/messages/survey-payload.schema.jsonAIChunk(union) ↔schemas/genui/ai-chunk.schema.jsonApproach
Each new test follows the same pattern as the existing one:
The mapped-type contract catches TS-only drift; the JSON read catches schema-only drift. For
AIChunk's discriminated-union case, iterateschema.oneOf[*].propertiesand compare each variant.Some connectors live outside
@chativa/core— the test for them belongs in their own package's__tests__folder, not in core, to avoid a cross-package import.Acceptance criteria
pnpm test.Spun out of
todos.md.