test: define schema contract for topic fact graph

This commit is contained in:
2026-05-11 10:42:50 +09:00
parent cadc1b0733
commit fb140d7a50
5 changed files with 188 additions and 0 deletions

37
src/types/domain.ts Normal file
View File

@@ -0,0 +1,37 @@
export type TopicCategory = 'entity' | 'concept' | 'temporal' | 'custom';
export type TopicGranularity = 'abstract' | 'concrete' | 'mixed';
export type JsonPrimitive = string | number | boolean | null;
export type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };
export interface TopicRecord {
id: string;
name: string;
normalized_name: string;
category: TopicCategory;
granularity: TopicGranularity;
description: string | null;
metadata: string | null;
created_at: string;
updated_at: string;
}
export interface FactRecord {
id: string;
statement: string;
summary: string | null;
source: string | null;
confidence: number | null;
metadata: string | null;
created_at: string;
updated_at: string;
}
export interface FactTopicRecord {
fact_id: string;
topic_id: string;
role: string | null;
position: number;
created_at: string;
}