/** * Librarian contextual conflict detector — cross-entity semantic consistency * checks run before every knowledge write. * * Goes beyond simple key-collision detection by checking whether an incoming * entry is semantically inconsistent with existing facts about the same entity * or about related entities in the knowledge graph. * * Two detection passes (called by `detectContextualConflict`): * 1. Same-entity conflicts — compare incoming fact against sibling keys on the * same entity (e.g. `launch_date` in the future while `status` is "launched"). * 2. Relationship conflicts — walk the `entityRelationship` graph to check * cross-entity invariants (e.g. active project lead whose `employment_status` * is "departed"). * * All checks are implemented as specific named rules in `sameEntityConflict` * and `relationshipConflict`. Rules return `null` when satisfied and a human- * readable `reason` string when violated. Adding a new rule is additive. * * Requires a Prisma transaction client (`tx`) so checks run within the same * transaction as the write they are guarding. */ import { KnowledgeEntry, PrismaClient } from '../generated/prisma/client'; import { EntryInput } from '../types'; type TransactionClient = Omit; type ContextualConflict = { matchedEntries: KnowledgeEntry[]; reason: string; }; export declare function detectContextualConflict(candidate: EntryInput, tx: TransactionClient): Promise; export {}; //# sourceMappingURL=contextual-conflicts.d.ts.map