File size: 1,490 Bytes
9ef99c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
export type NexusTier = "low" | "high" | "max";
export type TaskType = "code" | "math" | "writing" | "reasoning" | "world_knowledge" | "multi_step" | "data_analysis" | "conversation";

export interface ReasoningBudget {
  taskType: TaskType;
  complexity: "low" | "medium" | "high" | "extreme";
  riskScore: number;
  allowedDepth: number;
  branches: string[];
  chiefModel: string;
}

export interface TriStructurePack {
  symbolic: string;
  invariants: string;
  formal: string;
}

export interface BranchOutput {
  branchName: string;
  hypotheses: string[];
  artifacts: string[];
  notes: string;
  contradictions: string[];
  confidence: number;
}

export interface ScratchpadEntry {
  branch: string;
  timestamp: number;
  content: string;
  type: "hypothesis" | "artifact" | "note" | "contradiction";
}

export interface Scratchpad {
  entries: ScratchpadEntry[];
  sharedArtifacts: Map<string, string>;
}

export interface VerificationResult {
  branchScores: Map<string, number>;
  counterexamples: string[];
  contradictions: string[];
  provenInvariants: string[];
  uncertaintyScore: number;
  weakPoints: string[];
}

export interface ARDRState {
  originalPrompt: string;
  tier: NexusTier;
  budget: ReasoningBudget;
  triPack: TriStructurePack;
  scratchpad: Scratchpad;
  branchOutputs: BranchOutput[];
  verification: VerificationResult;
  recurrenceCount: number;
  finalResponse: string;
}

export interface BranchConfig {
  model: string;
  systemPrompt: string;
}