From e2ea8308d74582d5651ed933dea9428ce8982d25 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 17 Dec 2025 22:05:40 -0500 Subject: feat(ava): subagent hardening with audit logging Based on Anthropic's effective harnesses research. New modules: - Omni/Agent/AuditLog.hs: JSONL audit logging with SubagentId linking - Omni/Agent/Tools/AvaLogs.hs: Tool for Ava to query her own logs - Omni/Agent/Subagent/HARDENING.md: Design documentation Key features: - SubagentHandle with TVar status for async execution and polling - spawnSubagentAsync, querySubagentStatus, waitSubagent, cancelSubagent - User confirmation: spawn_subagent requires confirmed=true after approval - Audit logs stored in $AVA_DATA_ROOT/logs/{ava,subagents}/ - CLI: ava logs [--last=N] [] - read_ava_logs tool for Ava self-diagnosis Tasks: t-267, t-268, t-269, t-270, t-271 --- Omni/Agent/Paths.hs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Omni/Agent/Paths.hs') diff --git a/Omni/Agent/Paths.hs b/Omni/Agent/Paths.hs index 6facdc6..6df6991 100644 --- a/Omni/Agent/Paths.hs +++ b/Omni/Agent/Paths.hs @@ -1,5 +1,5 @@ -{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} -- | Configurable paths for Ava data directories. -- @@ -11,6 +11,9 @@ module Omni.Agent.Paths outreachDir, userScratchRoot, userScratchDir, + logsDir, + avaLogsDir, + subagentLogsDir, ) where @@ -21,9 +24,10 @@ import System.FilePath (()) import System.IO.Unsafe (unsafePerformIO) avaDataRoot :: FilePath -avaDataRoot = unsafePerformIO <| do - m <- lookupEnv "AVA_DATA_ROOT" - pure (fromMaybe "_/var/ava" m) +avaDataRoot = + unsafePerformIO <| do + m <- lookupEnv "AVA_DATA_ROOT" + pure (fromMaybe "_/var/ava" m) {-# NOINLINE avaDataRoot #-} skillsDir :: FilePath @@ -37,3 +41,12 @@ userScratchRoot = avaDataRoot "users" userScratchDir :: Text -> FilePath userScratchDir user = userScratchRoot Text.unpack user + +logsDir :: FilePath +logsDir = avaDataRoot "logs" + +avaLogsDir :: FilePath +avaLogsDir = logsDir "ava" + +subagentLogsDir :: FilePath +subagentLogsDir = logsDir "subagents" -- cgit v1.2.3