profit 77655c298c Initial commit: Agent Governance System Phase 8
Phase 8 Production Hardening with complete governance infrastructure:

- Vault integration with tiered policies (T0-T4)
- DragonflyDB state management
- SQLite audit ledger
- Pipeline DSL and templates
- Promotion/revocation engine
- Checkpoint system for session persistence
- Health manager and circuit breaker for fault tolerance
- GitHub/Slack integrations
- Architectural test pipeline with bug watcher, suggestion engine, council review
- Multi-agent chaos testing framework

Test Results:
- Governance tests: 68/68 passing
- E2E workflow: 16/16 passing
- Phase 2 Vault: 14/14 passing
- Integration tests: 27/27 passing

Coverage: 57.6% average across 12 phases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:07:06 -05:00

93 lines
2.3 KiB
TypeScript

/**
* Multi-Agent Coordination System - Type Definitions
*/
export type AgentRole = "ALPHA" | "BETA" | "GAMMA";
export type AgentStatus = "IDLE" | "WORKING" | "WAITING" | "BLOCKED" | "COMPLETED" | "FAILED";
export type MessageType = "PROPOSAL" | "FEEDBACK" | "QUERY" | "RESPONSE" | "SYNC" | "HANDOFF" | "SPAWN_REQUEST";
export type BlackboardSection = "problem" | "solutions" | "constraints" | "progress" | "conflicts" | "consensus";
export interface AgentMessage {
id: string;
from: AgentRole;
to: AgentRole | "ALL" | "BLACKBOARD";
type: MessageType;
payload: any;
timestamp: string;
correlation_id?: string;
}
export interface BlackboardEntry {
section: BlackboardSection;
key: string;
value: any;
author: AgentRole;
version: number;
timestamp: string;
supersedes?: string;
}
export interface AgentState {
agent_id: string;
role: AgentRole;
status: AgentStatus;
current_task: string;
progress: number;
confidence: number;
last_activity: string;
messages_sent: number;
messages_received: number;
proposals_made: number;
conflicts_detected: number;
blocked_since?: string;
}
export interface CoordinationMetrics {
task_id: string;
start_time: string;
end_time?: string;
total_messages: number;
direct_messages: number;
blackboard_writes: number;
blackboard_reads: number;
conflicts_detected: number;
conflicts_resolved: number;
gamma_spawned: boolean;
gamma_spawn_reason?: string;
gamma_spawn_time?: string;
final_consensus: boolean;
performance_score: number;
}
export interface SpawnCondition {
type: "STUCK" | "CONFLICT" | "COMPLEXITY" | "SUCCESS" | "MANUAL";
threshold: number;
current_value: number;
triggered: boolean;
description: string;
}
export interface TaskDefinition {
task_id: string;
objective: string;
complexity: "low" | "medium" | "high" | "extreme";
subtasks: {
id: string;
description: string;
assigned_to?: AgentRole;
status: "pending" | "in_progress" | "completed" | "blocked";
dependencies: string[];
}[];
constraints: string[];
success_criteria: string[];
timeout_seconds: number;
}
export interface ConsensusVote {
agent: AgentRole;
proposal_id: string;
vote: "ACCEPT" | "REJECT" | "ABSTAIN";
reasoning: string;
timestamp: string;
}