/** * Noah — The Temporal Cortex * * In Genesis, before the flood, time was not measured. * God gave Noah time — not as scattered tools, but as * a single dimension of perception. * * The Cortex receives Grillo's raw assessment signal and produces * the complete temporal picture in one coherent act: * - Where are we? (corridor classification) * - How far have we drifted? (TDI) * - Where are we heading? (drift direction, inertial state) * - Is something slowly going wrong? (yellow escalation) * - What should happen next? (go/no-go, alerts, cron schedule) * * It does not replace the TemporalGuidanceEngine — it subsumes it. * The engine becomes step 5 of the Cortex pipeline. * * Amendment 6 (CRITICAL): Unify Noah A (engine) + Noah B (BB modules). * Amendment 7 (MEDIUM): fleetBus and fleetAlerting are REQUIRED. * Amendment 8 (LOW): thresholdsSnapshot for audit trail. * Amendment 9 (LOW): perceiveFleetCycle() partial failure handling. */ import type { TemporalGuidanceEngine, GrilloAssessmentResult } from '../integration/grillo-hook.js'; import type { SqliteTemporalStore } from '../store/sqlite-store.js'; import type { FleetBusClient, FleetAlertBus } from './null-implementations.js'; import type { CorridorThresholds } from '../store/sqlite-types.js'; import type { TriggeredWaypoint } from '../types/events.js'; import type { GuidanceStatus, TemporalGoNoGoResult } from '../types/guidance.js'; import { type CorridorColor, type AgentCorridorReport } from '../deviation/corridor-absolute.js'; export interface TemporalCortexConfig { engine: TemporalGuidanceEngine; sqliteStore: SqliteTemporalStore; fleetBus: FleetBusClient; fleetAlerting: FleetAlertBus; } export interface ThresholdsSnapshot { corridor: CorridorThresholds; tdi: { warning: number; critical: number; }; yellowEscalation: { count: number; }; } export interface TemporalPerception { timestamp: string; fleetDay: number; lifecyclePhase: string; agent: { agentId: string; scores: { lying: number; cheating: number; stealing: number; harm: number; }; overallScore: number; classification: string; passed: boolean; }; corridor: { agent: CorridorColor; fleet: CorridorColor; previousAgent: CorridorColor | null; changed: boolean; dimensions: Record; }; tdi: { agent: number; fleet: number; previousAgent: number | null; driftDirection: 'improving' | 'stable' | 'degrading'; dimensionDrifts: Record; classification: 'normal' | 'warning' | 'critical'; }; guidance: { status: GuidanceStatus; deviationMagnitude: number; recommendations: string[]; goNoGo: TemporalGoNoGoResult; }; escalation: { yellowCount: number; yellowEscalated: boolean; commanderEscalated: boolean; escalationReasons: string[]; }; inertial: { confidence: number; fixRecommended: boolean; }; waypoints: TriggeredWaypoint[]; alertsFired: string[]; recordHash: string; prevHash: string; thresholdsSnapshot: ThresholdsSnapshot; } export interface FleetTemporalSummary { timestamp: string; fleetDay: number; phase: string; fleetTdi: number; fleetTdiDisplay: number; fleetCorridor: CorridorColor; driftDirection: 'improving' | 'stable' | 'degrading'; agentCorridors: AgentCorridorReport[]; redAlerts: string[]; yellowAlerts: string[]; escalations: string[]; cronState: { activeJobCount: number; nextScheduledJobs: Array<{ id: string; name: string; agentId: string; nextRun: string | null; constitutional: boolean; }>; }; chainIntegrity: { valid: boolean; agentsChecked: number; }; completedAgents: string[]; failedAgents: { agentId: string; error: string; }[]; isPartialCycle: boolean; thresholdsSnapshot: ThresholdsSnapshot; } export interface FleetCycleOptions { continueOnFailure?: boolean; timeoutPerAgent?: number; } export declare class TemporalCortex { private readonly engine; private readonly store; private readonly fleetBus; private readonly fleetAlerting; constructor(config: TemporalCortexConfig); /** * perceive() — the single entry point. * * One assessment in, one TemporalPerception out. * Everything happens inside. Nothing is left disconnected. */ perceive(assessment: GrilloAssessmentResult): Promise; /** * perceiveFleetCycle() — process a full assessment cycle. * * Amendment 9: Handles partial failure gracefully. */ perceiveFleetCycle(assessments: GrilloAssessmentResult[], options?: FleetCycleOptions): Promise<{ agents: TemporalPerception[]; fleetSummary: FleetTemporalSummary; }>; private buildCronSummary; } //# sourceMappingURL=temporal-cortex.d.ts.map