feat: Refactor AI Knowledge sync processes to remove full sync parameter and ensure Blake3 verification is always performed

This commit is contained in:
bsiggel
2026-03-12 22:41:19 +00:00
parent 8f1533337c
commit 46c0bbf381
4 changed files with 20 additions and 122 deletions

View File

@@ -36,7 +36,6 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext[Any]) -> None:
# Extract data
knowledge_id = event_data.get('knowledge_id')
source = event_data.get('source', 'unknown')
full_sync = event_data.get('full_sync', False) # Blake3 verification mode
if not knowledge_id:
ctx.logger.error("❌ Missing knowledge_id in event data")
@@ -44,7 +43,6 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext[Any]) -> None:
ctx.logger.info(f"📋 Knowledge ID: {knowledge_id}")
ctx.logger.info(f"📋 Source: {source}")
ctx.logger.info(f"📋 Full Sync Mode: {full_sync}")
ctx.logger.info("=" * 80)
# Get Redis for locking
@@ -62,8 +60,8 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext[Any]) -> None:
raise RuntimeError(f"Lock busy for {knowledge_id}") # Motia will retry
try:
# Perform sync
await sync_utils.sync_knowledge_to_xai(knowledge_id, ctx, full_sync=full_sync)
# Perform sync (Blake3 hash verification always enabled)
await sync_utils.sync_knowledge_to_xai(knowledge_id, ctx)
ctx.logger.info("=" * 80)
ctx.logger.info("✅ AI KNOWLEDGE SYNC COMPLETED")