Files
ci/src/types/escalation.ts
T
Jon Chery 04c4489e70 fix(P01): migrate audit trail to git-native and replace audit_file with commit_hash
---ci---
project: ci
phase: 1
milestone: v0.8
status: in_progress
decisions:
  - id: D-024
    decision: Audit trail reads from git log instead of .ciagent/audit/*.json
    rationale: Git-native context means audit data should come from commit history, not files
    confidence: 0.88
  - id: D-025
    decision: Replace audit_file with commit_hash in Escalation type
    rationale: Escalations are committed to git; reference by hash instead of deprecated file path
    confidence: 0.90
requirements:
  covered: [FIX-04, FIX-05]
---/ci---

FIX-04: audit.ts logDecision/logEscalation now emit deprecation warnings
and are no-ops (decisions/escalations live in ---ci--- blocks). readAudit()
and getAuditSummary() parse git log for ---ci--- blocks instead of reading
.ciagent/audit/*.json files. ArtifactManager no longer creates audit dir.

FIX-05: Escalation type replaces audit_file: string with commit_hash: string.
All consumers updated (escalation.ts, ollama-base.ts, opencode.ts).
Audit tests rewritten for git-native approach.
2026-05-29 20:02:07 +00:00

51 lines
1.2 KiB
TypeScript

export type EscalationType =
| "irreversible_action"
| "verification_failure"
| "low_confidence_decision"
| "security_escalation"
| "specification_ambiguity";
export type EscalationResolution =
| "approved"
| "rejected"
| "modified"
| "pending"
| "timeout_auto_proceed";
export interface EscalationOption {
id: string;
label: string;
description: string;
recommended: boolean;
}
export interface Escalation {
id: string;
timestamp: string;
type: EscalationType;
phase: string;
plan?: string;
task?: string;
description: string;
context: string;
options: EscalationOption[];
default_option_id: string;
resolution: EscalationResolution;
resolved_at?: string;
resolution_detail?: string;
commit_hash: string;
}
export interface EscalationResult {
escalation: Escalation;
chosen_option_id: string;
timestamp: string;
}
export const ESCALATION_TYPES: Record<EscalationType, string> = {
irreversible_action: "Irreversible Action",
verification_failure: "Verification Failure",
low_confidence_decision: "Low Confidence Decision",
security_escalation: "Security Escalation",
specification_ambiguity: "Specification Ambiguity",
};