Reference implementation for the Phoenix Architecture. Work in progress.
aicoding.leaflet.pub/
ai
coding
crazy
1/**
2 * Evidence model — proof that an IU meets its risk-tier requirements.
3 */
4
5export enum EvidenceKind {
6 TYPECHECK = 'typecheck',
7 LINT = 'lint',
8 BOUNDARY_VALIDATION = 'boundary_validation',
9 UNIT_TEST = 'unit_tests',
10 PROPERTY_TEST = 'property_tests',
11 STATIC_ANALYSIS = 'static_analysis',
12 THREAT_NOTE = 'threat_note',
13 HUMAN_SIGNOFF = 'human_signoff',
14}
15
16export enum EvidenceStatus {
17 PASS = 'PASS',
18 FAIL = 'FAIL',
19 PENDING = 'PENDING',
20 SKIPPED = 'SKIPPED',
21}
22
23export interface EvidenceRecord {
24 evidence_id: string;
25 kind: EvidenceKind;
26 status: EvidenceStatus;
27 iu_id: string;
28 /** Canonical nodes this evidence covers */
29 canon_ids: string[];
30 /** Hash of the artifact this evidence was run against */
31 artifact_hash?: string;
32 message?: string;
33 timestamp: string;
34}
35
36export interface PolicyEvaluation {
37 iu_id: string;
38 iu_name: string;
39 risk_tier: string;
40 required: string[];
41 satisfied: string[];
42 missing: string[];
43 failed: string[];
44 verdict: 'PASS' | 'FAIL' | 'INCOMPLETE';
45}
46
47export interface CascadeEvent {
48 source_iu_id: string;
49 source_iu_name: string;
50 failure_kind: string;
51 affected_iu_ids: string[];
52 actions: CascadeAction[];
53}
54
55export interface CascadeAction {
56 iu_id: string;
57 iu_name: string;
58 action: string;
59 reason: string;
60}