The
libs/veritas/area: ~64 Nx libraries that build Veritas, an AI-native news agency for Ghana and pan-Africa — from RSS ingestion and Ghanaian-language NLP through claim extraction, fact-checking, autonomous article/audio/video generation, a newsroom of AI agents, and the audience, distribution, and B2B monetization surfaces around them.
What this area is#
Veritas is a full news-media company expressed as code. The libs/veritas/
directory is not one package but a domain of roughly 64 separate Nx libraries,
each owning one capability of an autonomous newsroom: pulling in source
material, understanding it (including Ghanaian languages), verifying it,
generating publishable content across text/audio/video, distributing it through
web, USSD, TV, and watch surfaces, and selling structured access to it via a B2B
API. Almost every package is substantial implementation (the smallest is ~2,000
LOC); there are no empty scaffolds in this area.
The packages stack into clear tiers. At the foundation sit veritas-core
(branded primitives, Result types), veritas-models (Zod schemas +
validators), veritas-database (a generated Prisma client in
src/generated/client plus repositories), veritas-events (built on
@oshun/event-bus), veritas-cache, veritas-storage, veritas-search
(Elasticsearch), veritas-auth, and veritas-api-client. On top of that runs
the editorial pipeline: ingestion → NLP → claims/fact-checking → generation
→ production. A parallel agent newsroom (veritas-agents-*) wraps those
capabilities in role-based AI agents (Editor-in-Chief, correspondents,
fact-checkers) coordinated by an orchestrator. Surrounding all of it are
audience (recommendations, comments, community, newsletter, notifications),
distribution (USSD, platforms, regional, emergency), and commercial
(payments, billing, B2B SDKs, signup) layers.
The packages depend downward through the foundation tier and integrate with the
wider Oshun monorepo (@oshun/database, @oshun/event-bus, @oshun/auth)
rather than re-implementing infrastructure. NLP-heavy packages share
LLM/provider plumbing from veritas-nlp-core and veritas-llm; the agent
packages all extend BaseAgent from veritas-agents-core.
How it fits the wider system#
Consumers are the Veritas apps and BFF (not documented here) plus the agent
orchestrator, which composes these libraries into running workflows: ingestion
feeds claim extraction, claims feed fact-checking, verified material feeds
article and audio/video generation, and the output flows to distribution and
audience packages. The B2B tier (veritas-b2b-sdk, veritas-b2b-sdk-python,
@veritas/billing, @veritas/signup, @veritas/developer-support) exposes
that same content to external customers over a metered API. Boundaries:
foundation packages hold no business logic, agent packages hold orchestration
not transport, and Ghana-specific integrations (mobile money, Khaya NLP, USSD
telco gateways) are isolated in their own packages so the rest of the platform
stays provider-agnostic. The entity blocks below are grouped by tier for reading
order; walk the "used by" edges on any node to see its real consumers.
Entity catalog (65)#
The 65 tracked Nx projects in veritas, each a code-linked entity node — package, type, source path, declared targets, and its internal dependency graph (depends-on / used-by, resolved from the package manifests, §6/§8), read from the project graph. Grouped by architectural layer; walk the dependency links to travel the system. 65 of these carry an authored deep-dive (what / why / how it fits); the rest are generated scaffolds awaiting one.
domain (19)#
Veritas regional expansion - full coverage for Ghana's 16 regions with AI anchors and localized content
Regional coverage for Ghana's 16 regions (libs/veritas/regional/src): regional
AI anchors, location-based delivery (with an IPGeolocationService), language
support, and a WeatherService for localized content.
GHANA_REGIONS36getAllRegions36getRegion36getRegionByName36getNeighboringRegions36findRegionByCoordinates36getRegionsByLanguage36getTotalPopulation36getPopulationPercentage36REGIONAL_PRIORITY36LANGUAGE_COVERAGE36RegionalCoverageManager51createRegionalCoverageManager51CoverageAutomationConfig51 +34 moreGoverned news and audience training data collectors for Veritas
Phase 85–86 flywheel producer for the news agency
(libs/veritas/training-data/src): VeritasTrainingDataPipeline covers twelve
VeritasTrainingKind signals — article-classification, fact-check,
bias-detection, editorial-decision, headline-optimization,
story-clustering, source-reliability, and peers — emitted as
governance-gated (governanceGrantId), anonymized VeritasTrainingRecords to a
pluggable VeritasTrainingSink.
Veritas USSD channel - telco gateway integration for text-based news delivery
USSD news channel (libs/veritas/ussd/src): a USSDService with telco gateway
adapters (createGatewayAdapter/createGatewayManager) and a menu
navigator/renderer for text-based news delivery on feature phones.
DEFAULT_CHAR_LIMITS31MTNGatewayAdapter34VodafoneGatewayAdapter34AirtelTigoGatewayAdapter34GloGatewayAdapter34USSDGatewayManager34createGatewayManager34createGatewayAdapter34GatewayAdapter34ENGLISH_MENUS46TWI_MENUS46MenuRenderer46MenuNavigator46createMenuRenderer46 +14 moreCore AI agent framework with base classes, messaging, state management, and health monitoring
The AI-agent framework (libs/veritas/agents-core/src, ~7K LOC): the
BaseAgent base class plus messaging, ID factories
(createAgentId/createTaskId/createMessageId), a
createContextWindowManager, and state/health monitoring — the substrate every
other veritas-agents-* package extends.
TaskId9MessageId9createAgentId9createTaskId9createMessageId9AgentSpecialization9AgentStatus9HealthStatus9TaskPriority9TaskStatus9TaskType9MessageType9EventType9AgentCapabilities9 +70 moreEditorial agents for Veritas AI News Agency including Editor-in-Chief, Managing Editor, and Content Strategist
Editorial agents (libs/veritas/agents-editorial/src, ~7K LOC):
EditorInChiefAgent, ManagingEditorAgent, and ContentStrategistAgent (with
factory functions) — the top-of-newsroom decision agents.
NewsCategory11ContentFormat11PublicationPlatform11StoryStatus11EditorialDecisionType11BreakingNewsType11ReadingLevel11StoryAssignment11StoryRequirements11StorySource11StoryRevision11StoryMetrics11MultimediaAsset11EditorialFactor11 +82 moreMulti-agent orchestration for Veritas AI News Agency - agent registry, task routing, and conflict resolution
Multi-agent orchestration (libs/veritas/agents-orchestrator/src): an agent
registry (createAgentRegistry), task routing (createOrchestrator), and
conflict resolution (createConflictResolver) coordinating the agent newsroom.
RoutingStrategy95ConflictType95ResolutionStrategy95OrchestratorEventType95DEFAULT_ORCHESTRATOR_CONFIG95AgentRegistrationSchema107AssignmentOptionsSchema107OrchestratorConfigSchema107AgentRegistry117createAgentRegistry117RegistryConfig117TaskRouter123createTaskRouter123ConflictResolver129 +4 moreNext-generation AI features (libs/veritas/ai-next-gen/src, ~6.6K LOC):
real-time interactive AI anchors (Tavus CVI, createRealTimeAnchorManager),
OSINT collection (createOSINTManager: satellite imagery, social-media
forensics, document analysis), and an investigation workflow manager.
createRealTimeAnchorManager53createDefaultAnchorConfig53AnchorSelectorCriteria53AnchorSessionState53AnchorResponse53AnchorLLMClient53TavusStreamingClient53IAnchorMemoryExtractor53createOSINTManager73OSINTCollectionJob73OSINTDataSource73SatelliteImageryProvider73SocialMediaProvider73DocumentAnalysisProvider73 +23 moreA thin generated API client (libs/veritas/api-client/src/index.ts) that
re-exports createClient from client.js plus the OpenAPI
components/operations/paths/ webhooks types from a generated
openapi.ts — the typed HTTP surface for the platform API.
Audio production pipeline for news broadcasts - TTS, voice profiles, and rendering
Audio production pipeline for broadcasts (libs/veritas/audio-production/src):
a HybridTTSService, an ElevenLabs client/config, and voice-profile + rendering
config factories — TTS for news read-outs.
DEFAULT_ELEVENLABS_MODEL_ID126DEFAULT_GHANA_NLP_BASE_URL126DEFAULT_GHANA_NLP_TTS_PATH126DEFAULT_TIMEOUT_MS126DEFAULT_MAX_ATTEMPTS126DEFAULT_CACHE_CONFIG126DEFAULT_CIRCUIT_BREAKER_CONFIG126DEFAULT_RETRY_CONFIG126AUDIO_QUALITY_CONFIGS126ELEVENLABS_PRICE_PER_1K_CHARS126GHANA_NLP_PRICE_PER_1K_CHARS126normalizeBaseUrl126normalizeApiUrl126createElevenLabsConfigFromEnv126 +17 moreVeritas bias detection library with political bias scoring, coverage balance analysis, and blindspot detection
Bias detection (libs/veritas/bias-detection/src): political-bias scoring
(createPoliticalBiasScorer, createBiasScore) plus coverage-balance and
blindspot analysis per the package description — the editorial-neutrality check
on generated and ingested content.
PoliticalBiasBand44POLITICAL_BIAS_BANDS44POLITICAL_BIAS_LABELS44bandToAlignment44getBandDescription44GHANA_POLITICAL_SPECTRUM44GhanaPoliticalSpectrumParty44PoliticalBiasScoringResult44PoliticalBiasModel44IsotonicSegment44PoliticalBiasScoringConfig44BiasAssessmentMethodology44createBiasScore44alignmentToLean44 +52 moreVeritas community features: citizen journalism, SecureDrop, and gamification
Community features (libs/veritas/community/src): citizen journalism
(createCitizenJournalismManager), a SecureDrop-style anonymous submission flow
over an OnionService (createSecureDropManager), and gamification.
createCitizenJournalismManager53AIVerificationProvider53TIER_REQUIREMENTS53createSecureDropManager71EncryptionProvider71SecureStorageProvider71createGamificationManager89IQuizDistractorGenerator89BADGE_DEFINITIONS89ACHIEVEMENT_DEFINITIONS89Veritas fact-checking library with claim extraction, evidence retrieval, and multi-source validation
The fact-checking engine (libs/veritas/fact-checking/src, 14 files): claim
extraction, evidence retrieval and ranking (createAIEvidenceRanker),
multi-source credibility analysis (createAICredibilityAnalyzer,
createCustomCredibilityScorer), verdict generation
(createAIVerdictGenerator), a ClaimBuster client, and claim tracking.
ratingToScore116scoreToRating116normalizeRating116statusToRating116ratingToStatus116isConfidenceLevel116CONFIDENCE_LEVEL_INFO116scoreToConfidenceLevel116getConfidenceLevelInfo116getDomainCredibility134isFactCheckingOrg134isSocialMedia134getCredibilityDatabase134createCustomCredibilityScorer134 +38 moreGhana NLP integration for Veritas - translation, TTS, STT, and NER services
Ghana-specific NLP integration (libs/veritas/ghana-nlp/src) wrapping the Khaya
API (createKhayaClient) for translation, TTS, STT, and NER across Ghanaian
languages — the localized counterpart to veritas-nlp-core.
SupportedLanguage52LanguageInfo52LANGUAGE_REGISTRY52TranslationRequest52TranslationMetadata52TranslationResult52BatchTranslationRequest52BatchTranslationResult52TranslationErrorCode52TranslationError52AudioFormat52AudioQuality52TTSVoiceProfile52TTS_VOICE_REGISTRY52 +65 moreVeritas platform SDKs for smartwatch and TV apps
Platform SDKs for non-web surfaces (libs/veritas/platforms/src): smartwatch
and TV app SDKs — createAppleWatchSDK, createWearOSSDK, createAppleTVSDK,
createAndroidTVSDK, createFireTVSDK — plus media-monitoring.
createAppleWatchSDK48createWearOSSDK48PushNotificationProvider48WatchCacheProvider48COMPLICATION_TEMPLATES48createAppleTVSDK68createAndroidTVSDK68createFireTVSDK68VideoPlayerProvider68TVAnalyticsProvider68WhiteLabelManager88createMediaMonitoringManager88createWhiteLabelManager88EnterpriseNotificationProvider88 +2 moreRetrieval-augmented generation (libs/veritas/rag/src/index.ts): an
ArticleArchiveService for chunking/indexing articles, a
SemanticSearchService, and a ContextRetrievalService (token-budgeted context
for AI), behind an IEmbeddingService seam and a top-level RagService.
ArticleSourceSchema92ArticleMetadataSchema92SearchFiltersSchema92SearchOptionsSchema92ContextRetrievalOptionsSchema92DEFAULT_SEARCH_OPTIONS104DEFAULT_CONTEXT_RETRIEVAL_OPTIONS104DEFAULT_RAG_SERVICE_CONFIG104createIndexBuilder127createEmbeddingServiceFromEnv127createChunker127ArticleArchiveService138createArticleArchiveService138SemanticSearchService138 +5 moreResearch assistant for Veritas AI News Agency - historical context, related stories, and background briefings
Research assistant for the newsroom (libs/veritas/research-assistant/src):
createHistoricalContextBuilder, createRelatedStoriesDiscovery, and
createBriefingGenerator over a createRagPipeline, surfaced through
createResearchAssistant for background briefings on a developing story.
SourceReferenceSchema69TimelineEventSchema69BriefingRequestSchema69ResearchAssistantConfigSchema69DEFAULT_RESEARCH_ASSISTANT_CONFIG80ResearchAssistant87createResearchAssistant87createResearchAssistantFromPipeline87HistoricalContextBuilder94createHistoricalContextBuilder94RelatedStoriesDiscovery97createRelatedStoriesDiscovery97BriefingGenerator100createBriefingGenerator100Multi-platform social publishing (libs/veritas/social-automation/src, 18
files): platform adapters for Instagram, TikTok, YouTube, Facebook, Twitter/X,
LinkedIn, and WhatsApp behind a unified BullMQ-backed createScheduler, with
per-platform formatting and analytics.
PLATFORM_LIMITS133PRIORITY_LEVELS133createInstagramAdapter139InstagramClientOptions139InstagramMediaType139createTikTokAdapter139TikTokClientOptions139TikTokPublishOptions139TikTokPrivacy139createYouTubeAdapter139YouTubeClientOptions139YouTubeVideoMetadata139YouTubePrivacy139createTwitterAdapter139 +37 moreVeritas story clustering algorithms for news grouping and timeline construction
Story-clustering algorithms (libs/veritas/story-clustering/src, ~10K LOC / 29
files) for grouping related coverage and building timelines: centroid
management, merge/branch event emission, a processing queue, and per-cluster
language metadata.
EmbeddingModelConfig50EmbeddingResult50EmbeddingTextResult50SemanticScore50RerankInput50ClusterCandidateSignals50OverlapSignals50DEFAULT_SCORING_WEIGHTS50CanonicalScoringResult50TimelineConfig50DEFAULT_TIMELINE_CONFIG50ClusteringMethod50StoryCluster50StoryClusterMetadata50 +199 moreVeritas video production library - script generation, avatar management, video rendering, and HLS transcoding
Video production library (libs/veritas/video-production/src, ~20K LOC / 38
files): script generation, avatar management (VoiceAvatarSyncService), an
STTService, AR overlay/session builders, a VideoAgent, and rendering/HLS
transcoding for video news.
DEFAULT_HEYGEN_AUTH_HEADER156DEFAULT_TAVUS_BASE_URL156DEFAULT_DID_BASE_URL156DEFAULT_SHOTSTACK_BASE_URL156DEFAULT_SHOTSTACK_RENDER_PATH156DEFAULT_TIMEOUT_MS156DEFAULT_MAX_ATTEMPTS156DEFAULT_HLS_SEGMENT_SECONDS156DEFAULT_HLS_RENDITIONS156VERTICAL_HLS_RENDITIONS156SQUARE_HLS_RENDITIONS156createTavusConfigFromEnv156createDIDConfigFromEnv156createShotstackConfigFromEnv156 +317 moreinfra (1)#
Journalism-optimized LLM integration for Veritas AI News Agency
Journalism-optimized LLM client (libs/veritas/llm/src):
createJournalismLLMClient with a ContentSafetyService, a
createCostOptimizer, and env-driven config — the newsroom's guarded,
cost-aware gateway to LLMs.
JournalismContextSchema83ContentConstraintsSchema83JournalismMessageSchema83JournalismLLMRequestSchema83CLAUDE_MODELS91OPENAI_MODELS91ALL_MODELS91TASK_MODEL_RECOMMENDATIONS91DEFAULT_CONFIG91getModelConfig91getRecommendedModel91stimateCost91findCheapestModel91createConfigFromEnv91 +23 moreunclassified (45)#
A/B testing framework for headlines, recommendations, and UI/UX experiments
A/B testing framework (libs/veritas/ab-testing/src): an ABTestingEngine plus
an experiment analyzer and headline/recommendation testing managers for UI/UX
and content experiments.
ABTestingEngine82InMemoryExperimentStorage82InMemoryAssignmentStorage82InMemoryEventStorage82createABTestingEngine82ExperimentStorage82AssignmentStorage82EventStorage82ExperimentAnalyzer94createExperimentAnalyzer94calculateSampleStats94zTestProportions94TestMeans94chiSquaredTest94 +17 moreUsage billing system for the Veritas B2B API
Usage billing for the B2B API (libs/veritas/billing/src, has a README):
pricing tiers, usage metering (createUsageTracker), invoice generation,
subscription management, usage alerts, and Stripe payment processing.
PRICING_TIERS99FREE_TIER99BASIC_TIER99PRO_TIER99ENTERPRISE_TIER99getPricingTier99getVisibleTiers99getMonthlyPrice99calculateOverageCharges99getNextTierUp99isFeatureAvailable99getFeatureLimit99compareTiers99isUpgrade99 +18 moreAI-powered developer support chatbot for the Veritas B2B API
AI-powered developer-support chatbot for the B2B API
(libs/veritas/developer-support/src, has a README): createChatbot over a
curated createKnowledgeBase using Claude or GPT-4, with conversation
management, analytics, and an embeddable widget.
DeveloperSupportChatbot88createChatbot88ConversationManager91createConversationManager91TopicDetector91InMemoryConversationStorage91ConversationStorage91CreateConversationOptions91KnowledgeBase101createKnowledgeBase101SupportWidget104createWidget104generateEmbedCode104WidgetState104 +9 more24/7 YouTube Live Stream infrastructure for Veritas News
24/7 YouTube live-stream infrastructure (libs/veritas/live-stream/src, ~16K
LOC / 22 files): AI chat moderation (AIModerationService), an
AIResponseGenerator, an EngagementAnalyticsService, and breaking-news
banner/archive components for a continuous live channel.
StreamConfigSchema51YouTubeConfigSchema51StreamQualitySchema51StreamStatusSchema51StreamHealthSchema51VideoConfigSchema51AudioConfigSchema51RTMPDestinationSchema51RTMPServer63createRTMPServer63YouTubeLiveClient66createYouTubeLiveClient66StreamHealthMonitor69createHealthMonitor69 +32 moreSelf-service signup flow and enterprise sales automation for the Veritas B2B API
Self-service signup and enterprise-sales automation for the B2B API
(libs/veritas/signup/src): onboarding flow with analytics, calendar, email,
and notification services (real and in-memory/console implementations).
SignupFlowManager114InMemorySignupSessionStorage114InMemoryAccountStorage114ConsoleEmailService114InMemoryAnalyticsService114SimplePasswordHasher114createSignupFlowManager114SignupSessionStorage114AccountStorage114Account114EmailService114AnalyticsService114FunnelStats114PasswordHasher114 +15 moreDevOps and infrastructure management agents for Veritas AI News Agency
DevOps/infrastructure agent (libs/veritas/agents-devops/src): a single
DevOpsAgent (createDevOpsAgent) for infrastructure-management tasks within
the agent framework.
EnvironmentType12ResourceType12CloudProvider12IncidentSeverity12IncidentStatus12AlertType12ScalingAction12OptimizationType12EnvironmentTypeSchema12ResourceTypeSchema12CloudProviderSchema12IncidentSeveritySchema12IncidentStatusSchema12AlertTypeSchema12 +28 moreFact-checking agents for Veritas AI News Agency with IFCN methodology compliance
The fact-checking agent (libs/veritas/agents-fact-checking/src):
FactCheckerAgent (createFactCheckerAgent) wrapping the
veritas-fact-checking engine with IFCN methodology compliance per its
description.
IFCNComplianceScore13IFCNComplianceIssue13VerificationPriority13ClaimSource13VerificationErrorCode13VerificationRequest13VerificationJob13StageTransition13VerificationMetrics13VerificationError13DEFAULT_FACT_CHECKER_CONFIG13FactCheckSummary13ClaimSimilarityMatch13ClaimSourceSchema13 +19 moreJournalism agents for Veritas AI News Agency
Journalism agents (libs/veritas/agents-journalism/src, ~11K LOC / 15 files): a
set of correspondent agents — PoliticalCorrespondentAgent,
BusinessCorrespondentAgent, InvestigativeCorrespondentAgent,
RegionalCorrespondentAgent, SportsCorrespondentAgent,
BreakingNewsCorrespondentAgent — covering distinct beats.
composeParliamentReportage12buildParliamentFacts12mplateReportage12ReportageLLM12ParliamentReportage12ReportageOptions12SourceReliability22SourceType22StoryUrgency22GhanaRegion22GhanaPoliticalParty22GhanaInstitution22GhanaElectionType22BillStage22 +97 moreProduct management and user research agents for Veritas AI News Agency
Product-management agent (libs/veritas/agents-product/src): a
ProductManagerAgent (createProductManagerAgent) for product and
user-research tasks.
FeedbackSentiment12FeaturePriority12FeedbackSentimentSchema12FeatureStatusSchema12FeaturePrioritySchema12ThreatLevelSchema12MarketSegmentSchema12MetricTypeSchema12FeedbackAnalysis12ProductRoadmap12PrioritizationResult12CompetitiveAnalysis12UserJourneyMap12ProductHealthDashboard12 +3 moreQA and testing automation agents for Veritas AI News Agency
QA/testing-automation agent (libs/veritas/agents-qa/src): a QAAgent
(createQAAgent) for automated quality-assurance work in the agent newsroom.
TestStatus12TestPriority12CoverageType12RegressionSeverity12PerformanceMetricType12BugStatus12TestStatusSchema12TestPrioritySchema12CoverageTypeSchema12RegressionSeveritySchema12PerformanceMetricTypeSchema12BugStatusSchema12TestStep12TestError12 +23 moreSocial media management agents for Veritas AI News Agency
Social-media management agents (libs/veritas/agents-social-media/src):
SocialMediaManagerAgent/SocialMediaAgent that plan and supervise
cross-platform posting (paired with veritas-social-automation for transport).
ContentType13PostStatus13EngagementType13SentimentCategory13CrisisSeverity13CrisisType13CrisisStatus13ViralityLevel13GHANA_PLATFORM_POPULARITY13PlatformLimits13MediaAttachment13PollData13ThreadPost13SentimentAnalysis13 +21 moreAnalytics library for event tracking, user engagement, content performance, and revenue metrics
Analytics library (libs/veritas/analytics/src, 14 files): an
AnalyticsService with pluggable handlers (console/HTTP), a
createPIIScrubber, and event-name filtering for tracking engagement, content
performance, and revenue metrics.
EventTracker12MemoryStorageAdapter12createConsoleHandler12createHttpHandler12createEventNameFilter12createPIIScrubber12EventHandler12EventFilter12EventTransformer12TrackerConfig12StorageAdapter12TrackingContext12EngagementMetricsCalculator28CohortAnalyzer28 +47 moreHistorical archive and 'On This Day' features for Veritas News
Historical archive and "On This Day" features (libs/veritas/archive/src):
createArchiveManager, createOnThisDayManager, a createStoryTracker, and
collections management for the back catalog.
ArchiveManager61createArchiveManager61ArchiveConfig61ArchiveEvents61OnThisDayManager72createOnThisDayManager72OnThisDayConfig72OnThisDayEvents72StoryTracker83createStoryTracker83StoryTrackingConfig83StoryTrackingEvents83CollectionsManager94createCollectionsManager94 +2 moreAutonomous article generation with research, multi-source synthesis, citations, and fact-verification
Autonomous article generation (libs/veritas/article-generation/src): a
pipeline of createResearchGatherer → createOutlineBuilder →
createContentGenerator → createArticleRefiner, orchestrated by
createArticleGenerator for multi-source synthesis with citations and
fact-verification.
DEFAULT_GENERATOR_CONFIG117DEFAULT_GHANA_CONTEXT117gatherResearch134OutlineBuilderConfig148buildOutline148ContentGeneratorConfig163generateContent163ArticleRefinerConfig178refineArticle178generateArticle193quickGenerateArticle193Veritas authentication integration with @oshun/auth
Authentication integration over @oshun/auth (libs/veritas/auth/src):
AuthService, ApiKeyService, KeyService, OAuthService, PhoneOtpService,
and GuestSessionService — covering both human (phone OTP/OAuth) and API-key
auth.
VERITAS_ROLE_HIERARCHY52VERITAS_ROLE_LABELS52VERITAS_TO_OSHUN_ROLE52hasMinimumVeritasRole52ALL_VERITAS_PERMISSIONS52VERITAS_ROLE_PERMISSIONS52hasVeritasPermission52getVeritasPermissions52VeritasAuthUser52VeritasUserEntity52VeritasTokenPayload52VeritasAuthContext52ApiKeyEntity52ApiKeyCreateInput52 +121 moreAutomated content generators for weather, sports, markets, traffic, fuel, and load shedding
Template-driven content generators (libs/veritas/automated-content/src, 20
files) for recurring data-driven stories: weather, sports
(createSportsGenerator with an HTTP provider), markets, traffic, fuel prices,
and load-shedding schedules — Ghana-relevant automated beats.
GenerationOptionsSchema145DEFAULT_SPORTS_CONFIG145DEFAULT_MARKET_CONFIG145DEFAULT_TRAFFIC_CONFIG145DEFAULT_FUEL_CONFIG145DEFAULT_LOADSHED_CONFIG145AutomatedContentGenerator163WEATHER_TEMPLATE169SPORTS_TEMPLATE169MARKET_TEMPLATE169TRAFFIC_TEMPLATE169FUEL_TEMPLATE169LOADSHED_TEMPLATE169ALL_TEMPLATES169 +13 moreOfficial JavaScript/TypeScript SDK for the Veritas News B2B API
The official JavaScript/TypeScript SDK for the Veritas News B2B API
(libs/veritas/b2b-sdk/src): a createClient plus helpers like
createKeywordAlert for external customers consuming articles, fact-checks,
entities, and alerts.
VeritasClient36createClient36VeritasError116AuthenticationError116ForbiddenError116NotFoundError116ValidationError116RateLimitError116ServerError116TimeoutError116NetworkError116RetryExhaustedError116ConfigurationError116FeedResource131 +6 moreThe official Python SDK for the B2B API (libs/veritas/b2b-sdk-python, has a
README, ~4.7K LOC of Python): async + sync clients, full endpoint coverage,
retries with backoff, rate-limit handling, pagination iterators, and sandbox
detection — the Python counterpart to veritas-b2b-sdk.
Profitability and business optimization for Veritas News
Profitability and business optimization (libs/veritas/business/src): managers
for API- revenue, ad-placement optimization, infrastructure-cost optimization,
AI-efficiency, and resource scaling — the platform's commercial-tuning logic.
AdPlacementOptimizer125SubscriptionConversionOptimizer125APIRevenueManager125SponsorshipAutomation125createAdPlacementOptimizer125createSubscriptionConversionOptimizer125createAPIRevenueManager125createSponsorshipAutomation125InfrastructureCostOptimizer148AIEfficiencyManager148ResourceScalingManager148createInfrastructureCostOptimizer148createAIEfficiencyManager148createResourceScalingManager148Caching layer for the Veritas news platform
Caching layer (libs/veritas/cache/src/index.ts): VeritasCacheService,
GlobalCacheService, a VeritasRealtimeService, and purpose-built caches such
as createArticleCache, plus env-driven cache/pub-sub client factories.
createVeritasCacheService63getGlobalCacheService63hasGlobalCacheService63clearGlobalCacheService63VeritasCacheStats63createArticleCache83CachedArticleWithRelations83CachedArticleMetadata83CachedArticleList83ArticleListFilters83createSearchCache100CachedSearchResults100SearchFilters100TrendingTopic100 +70 moreAI-powered claim extraction for Veritas journalism platform
AI-powered claim extraction (libs/veritas/claims/src): createClaimExtractor
and an LLM-backed createLLMExtractor, with text-position mapping
(createTextPositionMap, createBoundary) so extracted claims point back to
exact source spans — the input stage for fact-checking.
IMPORTANCE_THRESHOLDS53ClaimImportanceSchema53ExtractionMethodSchema53CheckworthinessLevelSchema53ClaimBoundarySchema53ClaimEntitySchema53ClaimCategorizationSchema53ClaimImportanceScoreSchema53ExtractedClaimSchema53ClaimExtractionInputSchema53generateBatchId76generateExtractionId76splitIntoSentences76normalizeText76 +40 moreInternal CMS and editorial tools for Veritas News
Internal CMS and editorial tooling (libs/veritas/cms/src): content/workflow
managers, a breaking-news manager, an AI-assist manager (AIService), and push
notifications for the newsroom's editors.
ContentManager82createContentManager82ContentManagerConfig82ContentManagerEvents82WorkflowManager93createWorkflowManager93DEFAULT_WORKFLOW_STAGES93WorkflowConfig93WorkflowEvents93BreakingNewsManager105createBreakingNewsManager105BreakingNewsConfig105BreakingNewsEvents105PushNotificationService105 +5 moreComment system and AI moderation for Veritas News
Comment system with AI moderation (libs/veritas/comments/src):
createCommentSystem, a createModerator, a community manager, and a
dashboard, with notification hooks.
CommentSystem91createCommentSystem91CommentSystemConfig91CommentSystemEvents91AIModerator102PerspectiveAPIClient102createModerator102DEFAULT_THRESHOLDS102ModerationConfig102ModerationEvents102ModerationDashboard115createDashboard115DashboardConfig115DashboardEvents115 +6 moreBlockchain-based content authentication and verification for Veritas News
Content authentication and provenance (libs/veritas/content-auth/src):
content-hashing, a blockchain timestamping/certificate flow
(BlockchainService, createBlockchainTimestampManager,
createCertificateManager), plus reverse-image-search and a DetectionService
for verifying media authenticity.
ContentHashManager99BlockchainTimestampManager99CertificateManager99createContentHashManager99createBlockchainTimestampManager99createCertificateManager99MediaOriginManager118EditHistoryManager118DeviceSigningManager118createMediaOriginManager118createEditHistoryManager118createDeviceSigningManager118ManipulationDetectionManager143DeepfakeDetectionManager143 +4 moreContent classification library for topic detection, sensitivity analysis, and priority scoring
Content classification (libs/veritas/content-classification/src): topic
detection (createTopicClassifier), sensitivity analysis
(createSensitivityClassifier), and priority scoring (createPriorityScorer),
composed by a createUnifiedClassifier.
DEFAULT_SENSITIVITY_CATEGORIES89BREAKING_NEWS_KEYWORDS89GHANA_BREAKING_KEYWORDS89classifyTopic101classifySensitivity115isContentSafe115scorePriority130isContentUrgent130EditorialRecommendations145classifyContent145quickContentCheck145getEditorialRecommendations145Core types and primitives for the Veritas news platform
Foundation primitives for the platform (libs/veritas/core/src/index.ts):
branded types (Uuid, UrlString, CountryCode, Slug) with
constructors/validators, Result/AsyncResult, pagination and metadata
interfaces, and error-response helpers. Everything else builds on these types.
UrlString9CountryCode9Slug9createUuid9createUrlString9createCountryCode9createSlug9isValidUrlString9isValidCountryCode9isValidSlug9Cursor9PaginatedResponse9PaginationParams9Metadata9 +238 moreDatabase layer for the Veritas news platform
The database layer (libs/veritas/database), by far the largest package (~144K
LOC across 96 files, mostly the generated Prisma client under
src/generated/client). Exports prisma/createPrismaClient, transaction
helpers (withTransaction, withSerializableTransaction), health checks, and a
repositories/ set; integrates with @oshun/database patterns.
getPrismaClient14createPrismaClient14disconnect14getHealthInfo14withReadOnlyTransaction14withSerializableTransaction14xecuteWithRetry14xecuteWithMetrics14withDatabaseError14withRetry14Prisma14TransactionOptions14TransactionIsolationLevel14TransactionClient14 +69 moreCrisis and emergency features for Veritas News - alerts, distribution, and election coverage
Crisis/emergency features (libs/veritas/emergency/src): emergency alert and
distribution managers (email + push), plus an election "war room" manager for
high-stakes live coverage.
EmergencyAlertManager81createEmergencyAlertManager81EMERGENCY_KEYWORDS81EmergencyAlertConfig81EmergencyAlertEvents81SignalSourceConfig81EmergencyDistributionManager94InMemoryRecipientDirectory94createEmergencyDistributionManager94DistributionConfig94DistributionEvents94RecipientDirectory94RecipientLookupOptions94EmailDistributionService94 +4 moreEvent-driven architecture for the Veritas news platform
Event-driven backbone (libs/veritas/events/src/index.ts) built on
@oshun/event-bus: createEventBus, createVeritasPublisher,
createVeritasSubscriber, and the VERITAS_EVENT_TYPES taxonomy for
cross-domain publish/subscribe with batching and pattern matching.
VeritasEventType67ArticleCreatedPayload67ArticleUpdatedPayload67ArticlePublishedPayload67ArticleUnpublishedPayload67ArticleIngestedPayload67ArticleProcessedPayload67ArticleEnrichedPayload67ArticleTranslatedPayload67ClaimVerifiedPayload67FactCheckStartedPayload67FactCheckCompletedPayload67StoryClusterUpdatedPayload67StoryClusterMergedPayload67 +29 morePan-African geographic expansion and market entry for Veritas News
Pan-African geographic expansion (libs/veritas/expansion/src): market
research, content adaptation, AI-anchor, translation/voice/avatar services for
entering new African markets beyond Ghana.
MarketResearchManager100createMarketResearchManager100ContentAdaptationManager110createContentAdaptationManager110AIAnchorManager110createAIAnchorManager110Headline generation, scoring, and A/B testing for Veritas news platform
Headline generation and optimization (libs/veritas/headline-service/src):
createHeadlineGenerator plus an createEngagementScorer, createSEOScorer,
createClickbaitDetector, and an A/B-test manager, all under HeadlineService.
DEFAULT_SEO_CONFIG77DEFAULT_ENGAGEMENT_CONFIG77DEFAULT_CLICKBAIT_CONFIG77DEFAULT_GHANA_SETTINGS77DEFAULT_HEADLINE_CONFIG77HeadlineTypeSchema86HeadlineStyleSchema86HeadlineGenerationRequestSchema86TestConfigSchema86SEOScorer94createSEOScorer94EngagementScorer95createEngagementScorer95ClickbaitDetector98 +6 moreCore ingestion primitives for Veritas news platform
Core ingestion primitives (libs/veritas/ingestion-core/src): RSS/Atom feed
parsing (feed/parser.ts), HTTP fetch, content normalization, an HTML scraper
with a robots.ts robots-txt guard, and SimHash near-duplicate detection
(dedup/simhash.ts).
fetchTextWithTimeout67buildConditionalHeaders67isHtmlContentType67isXmlContentType67FetchTimeoutError67FetchByteLimitError67arseFeedToItems77arseFeedMetadata77isValidFeedXml77detectFeedType77xtractArticleFromHtml85isHtmlContent85xtractLinks85xtractFeedLinks85 +20 moreKnowledge graph integration for Veritas news platform with entity extraction, relationship mapping, and temporal tracking
Knowledge-graph integration (libs/veritas/knowledge-graph/src): entity
extraction (createEntityExtractor), relationship mapping, temporal tracking,
and typed entity profile services — PoliticianProfileService,
OrganizationProfileService, LocationProfileService, EventProfileService —
under KnowledgeGraphService.
KnowledgeGraphService44createKnowledgeGraphService44DEFAULT_EXTRACTION_CONFIG88DEFAULT_GRAPH_QUERY_OPTIONS88DEFAULT_KNOWLEDGE_GRAPH_CONFIG88GHANA_POLITICAL_PARTIES88NewsEntityTypeSchema96RelationshipTypeSchema96EntityMentionSchema96ExtractionConfigSchema96EntityExtractor104createEntityExtractor104EntityLinker104createEntityLinker104 +24 moreZod schemas and validation for Veritas domain models
Zod schemas and validation utilities for all Veritas domain models
(libs/veritas/models/src/index.ts), exporting the schemas plus validate,
createValidator, and createTypeGuard so API edges validate at run time, not
just compile time.
ValidationError34ValidationIssue34validate34validateOrThrow34validateOrUndefined34validateOrDefault34createValidator34validatePartial34validateStrict34validateArray34validateAndTransform34validateBatch34createTypeGuard34mergeValidationErrors34 +3 moreNewsletter and email automation platform for Veritas News
Newsletter/email automation (libs/veritas/newsletter/src): a
createNewsletterManager and createAutomationManager with template rendering
and provider services for both Mailchimp and AWS SES.
EmailService68createSendGridService68createMailchimpService68createSESService68EmailServiceConfig68EmailProviderInterface68EmailWebhookEvent68TemplateManager82createTemplateManager82TemplateManagerConfig82MJMLCompiler82TemplateEngine82NewsletterManager94createNewsletterManager94 +8 moreCore NLP primitives for Veritas news platform
Core NLP provider plumbing (libs/veritas/nlp-core/src): factory functions for
multiple model/search providers — createAnthropicProvider,
createCohereProvider, createBraveProvider (and env-from variants) — giving
the rest of the platform a unified NLP/embedding/search provider abstraction.
DEFAULT_TOPIC_LABELS114GHANA_LANGUAGES114xtractSingleWordKeywords120xtractKeyphrases120scoreSentences120containsClaimIndicator120getClaimType120createHuggingFaceProvider140createHuggingFaceProviderFromEnv140HuggingFaceConfig140createOpenAIProvider140createOpenAIProviderFromEnv140OpenAIConfig140createAnthropicProvider140 +31 moreUnified notification service with push, email, SMS, and in-app support
Unified notification service (libs/veritas/notifications/src): a
NotificationService fronting push, email, SMS, in-app, and WhatsApp providers
(createPushProvider, createSMSProvider, createWhatsAppProvider, …).
NotificationError92isInQuietHours92getNextActiveTime92calculateSMSSegments92runcateForSMS92renderTemplate92generateNotificationId92DEFAULT_TIMING_CONFIG92PRIORITY_VALUES92DEFAULT_CHANNEL_PREFERENCES92NotificationPrioritySchema92NotificationUrgencySchema92NotificationCategorySchema92PushMessageSchema92 +32 moreVeritas ongoing operations: security, compliance, QA, monitoring, automation
Ongoing-operations toolkit (libs/veritas/operations/src): security,
compliance, QA, monitoring, and automation managers — e.g. accessibility-test
and app-store-review managers, an IncidentNotificationService, and a
FactCheckService wrapper for operational use.
SecurityAuditManager175createSecurityAuditManager175PenetrationTestManager175createPenetrationTestManager175PhishingDetectionManager175createPhishingDetectionManager175IncidentResponseManager175createIncidentResponseManager175ThreatModelManager175createThreatModelManager175TestSuiteManager203createTestSuiteManager203LoadTestManager203createLoadTestManager203 +36 morePayments library (libs/veritas/payments/src, ~8K LOC): Ghana mobile money
(MTN/Vodafone/ AirtelTigo) via Paystack/Flutterwave, Stripe for international
cards, and Flutterwave for pan-African coverage — provider factories under a
UnifiedPaymentService with auto-routing, subscriptions, webhooks, and refunds.
formatMoney138getMobileOperatorFromNumber138calculateTransactionFee138generateTransactionReference138PaymentError138PhoneNumberSchema138InitiatePaymentSchema138CreateSubscriptionSchema138CreateRefundSchema138DEFAULT_HUBTEL_BASE_URL138DEFAULT_FLUTTERWAVE_BASE_URL138DEFAULT_STRIPE_API_VERSION138MOBILE_MONEY_PAYSTACK_PROVIDERS138MOBILE_MONEY_FLUTTERWAVE_NETWORKS138 +10 moreReal-time data integrations for Veritas News - sports, financial, weather, and utility data
Real-time external-data integrations (libs/veritas/realtime-data/src): sports,
financial (with a MobileMoneyService), weather, and utility data managers
feeding the automated-content and live surfaces.
SportsDataManager96createSportsDataManager96GHANA_COMPETITIONS96SportsDataConfig96SportsDataEvents96FinancialDataManager108createFinancialDataManager108GSE_STOCKS108FOREX_PAIRS108COMMODITIES108FinancialDataConfig108FinancialDataEvents108AlertThresholds108BogDataProvider108 +16 moreRecommendation engine for Veritas news platform with content-based filtering, collaborative filtering, diversity injection, and real-time personalization
Recommendation engine (libs/veritas/recommendations/src): content-based and
collaborative filtering services, a DiversityService for diversity injection,
and a RealTimePersonalizationService, composed under RecommendationService.
DEFAULT_RECOMMENDATION_CONFIG98DEFAULT_COLLABORATIVE_CONFIG98DEFAULT_CONTENT_BASED_CONFIG98DEFAULT_DIVERSITY_CONFIG98DEFAULT_REALTIME_CONFIG98DEFAULT_HYBRID_CONFIG98INTERACTION_WEIGHTS98DWELL_TIME_THRESHOLDS98DEFAULT_RECOMMENDATION_LIMIT98MAX_RECOMMENDATION_LIMIT98DEFAULT_DIVERSITY_FACTOR98DEFAULT_NOVELTY_FACTOR98DEFAULT_BREAKING_BOOST98CACHE_TTL_SECONDS98 +32 moreVeritas risk mitigation: technical, legal, business, and reputational risks
Risk-mitigation library (libs/veritas/risk/src):
technical/legal/business/reputational risk handling, including a
createBackupManager, a CrisisNotificationService, and bias/fact-check/NLP
service hooks for risk monitoring.
HallucinationMonitor81createHallucinationMonitor81BackupManager81createBackupManager81RateLimitManager81createRateLimitManager81DisasterRecoveryManager81createDisasterRecoveryManager81CopyrightComplianceManager108createCopyrightComplianceManager108DefamationDetectionManager108createDefamationDetectionManager108DataProtectionAuditManager108createDataProtectionAuditManager108 +18 moreElasticsearch client wrapper with index management, query builders, search ranking, and analytics
Elasticsearch client wrapper (libs/veritas/search/src/index.ts): index/alias
management, bulk and query builders, search ranking, and a
SearchAnalyticsService (with an in-memory analytics storage option) for the
platform's search surface.
createClient122createClientFromEnv122getClusterHealth122ing122getClusterInfo122SearchClient122createSearchClient122createSearchClientFromEnv122createIndex137deleteIndex137openIndex137closeIndex137refreshIndex137flushIndex137 +74 moreSEO and discovery optimization for Veritas News
SEO and discovery optimization (libs/veritas/seo/src): sitemap and
structured-data generators, a Web Stories generator, and Core Web Vitals
monitoring backed by a createLighthouseWebVitalsRunner.
SitemapGenerator60createSitemapGenerator60SitemapGeneratorConfig60ArticleProvider60StructuredDataGenerator71createStructuredDataGenerator71StructuredDataConfig71WebVitalsMonitor81InMemoryWebVitalsStorage81createWebVitalsMonitor81createLighthouseWebVitalsRunner81DEFAULT_CWV_THRESHOLDS81WebVitalsMonitorConfig81WebVitalsStorage81 +4 moreContent storage utilities (libs/veritas/storage/src/index.ts) for articles,
media (video/audio/image variants, thumbnails), and archives —
ArticleStorageService, MediaStorageService, ArchiveStorageService under
the unified VeritasStorageService, with rich metadata/format types.
MAX_URL_EXPIRY50CONTENT_TYPE_MIME50VIDEO_QUALITY_BITRATES50AUDIO_QUALITY_BITRATES50ARCHIVE_PREFIXES65getMonthPartition65joinPath65getArticlePath65getDraftPath65getArticleAssetsPath65getVideoPath65getVideoThumbnailPath65getVideoManifestPath65getAudioPath65 +29 more