/** * Core types for the 0xRay Governance System. * These types are used by the GovernanceService, Governance MCP, * and all integrations. */ export type ProposalType = 'fix' | 'refactor' | 'guard' | 'automate' | 'codify' | 'strategic' | 'compliance' | 'metamorphosis'; export interface GovernanceProposal { id: string; type: ProposalType; title: string; description: string; evidence?: string[]; source?: 'inference' | 'reflection' | 'manual' | 'ci' | 'phase-planning' | 'metamorphosis'; confidence?: number; metadata?: Record; tags?: string[]; } export interface GovernanceVote { server: string; decision: 'approve' | 'reject' | 'abstain' | 'needs_revision'; confidence: number; reasoning: string; weight?: number; moralTension?: 'Aligned' | 'Mild' | 'Significant' | 'Critical' | undefined; moralScore?: number | undefined; moralFusion?: number | undefined; detectedVirtues?: string[] | undefined; detectedConcerns?: string[] | undefined; } export interface GovernanceResult { proposalId: string; finalDecision: 'approve' | 'reject' | 'needs_revision' | 'abstain'; averageConfidence: number; votes: GovernanceVote[]; reasoningSummary: string; recommendedActions?: string[]; externalContext?: Record; moralOverride?: 'rejected_critical' | 'downgraded_significant' | 'none'; metamorphosisScore?: number; } export interface GovernanceContext { project?: string; phase?: string; source?: string; reflectionId?: string; inferenceCycleId?: string; tags?: string[]; } export interface GovernOptions { requireExternalDynamo?: boolean; minConfidence?: number; enableSolarAdjustment?: boolean; timeoutMs?: number; maxAbstentionThreshold?: number; metamorphosisThreshold?: number; } export interface GovernanceRequest { proposals: GovernanceProposal[]; context?: GovernanceContext; options?: GovernOptions; } export interface GovernanceResponse { results: GovernanceResult[]; overallDecision: 'approve' | 'needs_revision' | 'reject'; summary: { total: number; approved: number; needsRevision: number; rejected: number; }; } export interface ActiveCodexSnapshot { source: string | null; loaded_at: string; term_count: number; version: string; last_updated?: string; governance_ssot: boolean; is_fallback: boolean; note: string; dynamo_required: boolean; codex?: Record; } export interface ICodexPolicyProvider { getCurrentCodex(includeRaw?: boolean): Promise; getTermCount(): Promise; } export declare function normalizeProposalWithSource(proposal: GovernanceProposal): GovernanceProposal & { source: string; };