File size: 558 Bytes
662ceed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import type { AgentName, Verdict, LedgeResult } from '../types.js';
import { appendEntry, verifyChain } from '../worm.js';
export function sealDecision(eventId: string, agent: AgentName, action: string, verdict: Verdict, citations: string[]): LedgeResult {
const entry = appendEntry(eventId, agent, action, verdict, citations);
return {
sequence: entry.seq,
prevHash: entry.prev_hash,
hash: entry.hash,
sealed: true
};
}
export function verifyLedger(): { valid: boolean; errors: string[] } {
return verifyChain();
}
|