/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Harakiri Veda — audit agent spec (node 401)
 *
 * Veda is the auditor. Every audit rule is a guard; nothing passes on vibes.
 * The kernel holds Veda's node identity and verdict channel; the actual
 * auditing runs in userspace (veda-watch daemon) and reports verdicts back
 * through /proc/harakiri/veda.
 *
 * Audit law (mirrors veda-audit.rustba):
 *   effect auditStructure : Document { needs ... }
 *   effect auditTruth     : Document { needs every_claim_cited == true }
 *
 * Verdicts: VEDA_PASS, VEDA_FAIL, VEDA_MANUAL (needs human eyes)
 */

#ifndef _HARAKIRI_VEDA_H
#define _HARAKIRI_VEDA_H

#include <linux/types.h>

#define VEDA_AGENT_ID   401
#define VEDA_AGENT_NAME "veda"

/* Verdict codes */
#define VEDA_PASS   0
#define VEDA_FAIL   1
#define VEDA_MANUAL 2

/* Audit target types */
#define VEDA_TARGET_RESUME  1
#define VEDA_TARGET_MODEL   2
#define VEDA_TARGET_PAGE    3
#define VEDA_TARGET_APK     4
#define VEDA_TARGET_DOC     5

struct veda_verdict {
    char target[256];   /* what was audited */
    u32  target_type;
    u32  verdict;       /* PASS / FAIL / MANUAL */
    u32  guards_run;
    u32  guards_failed;
    char failed[1024];  /* comma-separated failed guard names */
};

/* Userspace daemon posts verdicts; kernel tracks the latest per target */
int veda_post_verdict(const struct veda_verdict *v);
int veda_latest_verdict(const char *target, struct veda_verdict *out);

#endif /* _HARAKIRI_VEDA_H */
