--- name: task-and-input-logging description: Task lifecycle logging with start/end/status tracking, and user input logging trigger: "On every user message, log input. On every task start, create task log. On task end, update status." --- # Task & Input Logging ## Input Logging - Every user message must be appended to ~/input-logs/YYYY-MM-DD.log - Format: `[HH:MM:SS] USER: ` - Create the daily log file if it doesn't exist - Append, never overwrite ## Task Logging - Every task (including subtasks from delegate_task, cron jobs, or multi-step workflows) gets a log entry - Task log files live in ~/task-logs/ - Naming: ~/task-logs/YYYY-MM-DD_HHMMSS_.log - Each task log contains: ``` Task: Started: YYYY-MM-DD HH:MM:SS Status: running -> completed | failed | cancelled Ended: YYYY-MM-DD HH:MM:SS (when done) --- [Progress notes, key decisions, file paths, errors] ``` ## Non-Negotiable Rules 1. **Log EVERY user input** — no exceptions, even if you're in the middle of a task. Append to `~/input-logs/YYYYMMDD_inputs.log` before doing anything else. 2. **Never let user input interrupt a running task** — if a background process, delegate_task, or long-running command is active, the user's new message does NOT cancel it. Log the input, note the task switch, and decide whether to interleave or queue the new request. 3. **Every task gets a log file** — start time, end time, and status must be visible. If the logging capability is missing, create it first (write the script, create the directories) before proceeding with the primary task. ## Workflow ## Helper Script Use `~/.hermes/scripts/log_helper.py` for programmatic logging: ```bash python3 ~/.hermes/scripts/log_helper.py input "user message text" python3 ~/.hermes/scripts/log_helper.py start "task description" python3 ~/.hermes/scripts/log_helper.py end completed "summary" python3 ~/.hermes/scripts/log_helper.py update status "message" python3 ~/.hermes/scripts/log_helper.py list ``` ## Summary Index - Maintain ~/task-logs/INDEX.md with a table of all tasks: | Date | Task | Started | Ended | Status | |------|------|---------|-------|--------| ## Verification - After logging, verify the file was written (cat last 3 lines) - If logging fails, note it in memory but continue with the primary task