Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /**
* @module Types/Validation
* @description Validation result types for article quality and cross-reference checks.
*/
import type { ArticleType } from './article.js';
// ---------------------------------------------------------------------------
// Evening analysis validation
// ---------------------------------------------------------------------------
/** Word-count breakdown for each editorial pillar section */
export interface SectionWordCounts {
leadParagraph: number;
parliamentaryPulse: number;
governmentWatch: number;
oppositionDynamics: number;
lookingAhead: number;
}
/** Structural completeness result for an evening analysis article */
export interface StructureValidation {
hasLeadParagraph: boolean;
hasParliamentaryPulse: boolean;
hasGovernmentWatch: boolean;
hasOppositionDynamics: boolean;
hasLookingAhead: boolean;
wordCounts: SectionWordCounts;
meetsMinimumLength: boolean;
hasAllPillars: boolean;
}
/** Source attribution validation result */
export interface SourceValidation {
count: number;
sources: string[];
hasSources: boolean;
}
/** Full validation result for an evening analysis article */
export interface EveningAnalysisValidation {
filepath: string;
filename: string;
structure: StructureValidation;
analyticalDepth: number;
historicalContext: number;
internationalComparison: boolean;
forwardLooking: boolean;
partyPerspectives: number;
sources: SourceValidation;
totalWordCount: number;
qualityScore: number;
}
// ---------------------------------------------------------------------------
// Article quality enhancer
// ---------------------------------------------------------------------------
/** Configurable quality thresholds for editorial standards */
export interface QualityThresholds {
minQualityScore: number;
minAnalyticalDepth: number;
minPartySources: number;
minCrossReferences: number;
requireWhyThisMatters: boolean;
requireHistoricalContext: boolean;
recommendHistoricalContext: boolean;
recommendInternationalComparison: boolean;
/** Recommend economic context from World Bank data (non-blocking) */
recommendEconomicContext?: boolean;
/** Recommend Swedish statistical context from SCB (non-blocking) */
recommendSCBContext?: boolean;
}
/** Measured quality metrics for a single article */
export interface QualityMetrics {
analyticalDepth: number;
partyCount: number;
crossReferences: number;
hasWhyThisMatters: boolean;
hasHistoricalContext: boolean;
hasInternationalComparison: boolean;
/** Whether the article contains economic context (World Bank indicators, GDP, unemployment, etc.) */
hasEconomicContext?: boolean;
/** Whether the article contains Swedish statistical context (SCB official statistics) */
hasSCBContext?: boolean;
/** Whether the article contains statistical claims that could be fact-checked */
hasStatisticalClaims?: boolean;
/** Whether the article has a language-switcher nav element */
hasLanguageSwitcher?: boolean;
/** Whether the article has an article-top-nav div with back-to-news link */
hasArticleTopNav?: boolean;
/** Whether the article has a back-to-news link (in top nav or footer) */
hasBackToNews?: boolean;
}
/** Quality assessment result for a single article */
export interface QualityResult {
passed: boolean;
articlePath: string;
error?: string;
qualityScore?: number;
metrics?: QualityMetrics;
issues?: string[];
warnings?: string[];
thresholds?: QualityThresholds;
}
// ---------------------------------------------------------------------------
// Cross-reference validation
// ---------------------------------------------------------------------------
/** Validation result for a single article's MCP source coverage */
export interface CrossRefValidationResult {
articleType: string;
requiredTools: string[];
usedTools: string[];
missingTools: string[];
extraTools: string[];
crossReferencesInText: string[];
sourceCount: number;
hasMinimumSources: boolean;
allRequiredToolsUsed: boolean;
hasCrossReferencesInText: boolean;
passed: boolean;
score: number;
}
/** Single article item submitted for batch validation */
export interface ArticleBatchItem {
type: string;
content: string;
mcpCalls: ReadonlyArray<{ readonly tool: string }>;
}
/** Aggregated results from a batch of article validations */
export interface BatchValidationResult {
total: number;
passed: number;
failed: number;
avgScore: number;
passRate: number;
details: CrossRefValidationResult[];
}
/** CI-friendly summary exported from batch validation */
export interface CISummary {
status: 'success' | 'failure';
total: number;
passed: number;
failed: number;
passRate: string;
avgScore: string;
timestamp: string;
}
/** Map from article type to required MCP tool names */
export type RequiredToolsMap = Record<ArticleType | string, readonly string[]>;
|