Skip to main content

A Complete Chronological Record

Every event that fires in Wolffish is logged to a daily markdown file. This gives you a complete chronological record of everything that happened — inputs, classifications, LLM calls, tool executions, safety decisions, memory operations, and more.

Location

brain/corpus/YYYY-MM-DD.log.md
One file per day. Today’s log is always at:
brain/corpus/$(date +%Y-%m-%d).log.md

How It Works

The corpus event bus wraps every emit() call with logging. Events are buffered for 2 seconds before flushing to disk — not quite real-time, but close enough for debugging.
Event logs are auto-cleaned after 7 days. If you need to preserve logs for longer, copy them out of the corpus/ directory or adjust the retention in config.json.

Event Types

The system emits 30+ event types. Here are the most useful for debugging:
EventWhen It Fires
input.receivedUser sends a message
input.classifiedMessage intent is determined
context.builtPrefrontal finishes assembling context
llm.requestRequest sent to LLM provider
llm.responseLLM returns a response
llm.stream.startStreaming begins
llm.stream.endStreaming completes
tool.calledLLM requests a tool call
tool.completedTool execution succeeds
tool.failedTool execution fails
safety.allowedAmygdala allows an operation
safety.blockedAmygdala blocks an operation
safety.approvedUser approves a blocked operation
safety.deniedUser denies a blocked operation
task.createdMotor begins a new task
task.stepA task step completes
task.completedTask finishes successfully
task.failedTask fails after retries
memory.savedHippocampus saves an episode
memory.retrievedHippocampus retrieves fragments
capability.loadedCerebellum loads a capability
capability.errorCapability fails to load
health.warningHypothalamus detects an issue
health.criticalSystem health is degraded

Log Format

Each entry looks like this:
## 14:30:22.847 [input.received]
- **turnId**: turn-a8f3c
- **channel**: desktop
- **content**: Can you check if the server is running?

## 14:30:22.901 [input.classified]
- **turnId**: turn-a8f3c
- **intent**: tool_use
- **confidence**: 0.94

## 14:30:23.156 [context.built]
- **turnId**: turn-a8f3c
- **tokens**: 8420
- **skills**: shell, filesystem
- **memoryFragments**: 2

## 14:30:24.302 [llm.response]
- **turnId**: turn-a8f3c
- **provider**: openai
- **model**: gpt-4o
- **toolCalls**: 1
- **inputTokens**: 8420
- **outputTokens**: 89

## 14:30:24.310 [tool.called]
- **turnId**: turn-a8f3c
- **taskId**: TASK-1747
- **tool**: shell_exec
- **args**: {"command": "systemctl status myapp"}

## 14:30:24.315 [safety.allowed]
- **turnId**: turn-a8f3c
- **tool**: shell_exec
- **reason**: no danger_patterns matched

## 14:30:25.102 [tool.completed]
- **turnId**: turn-a8f3c
- **taskId**: TASK-1747
- **tool**: shell_exec
- **duration**: 792ms
- **exitCode**: 0

## 14:30:25.108 [task.completed]
- **turnId**: turn-a8f3c
- **taskId**: TASK-1747
- **steps**: 1
- **totalDuration**: 792ms

Tracing a Message

Every event includes a turnId. To follow one message through the entire pipeline, grep for its turn ID:
grep -A 3 "turn-a8f3c" brain/corpus/2025-05-16.log.md
This shows you every event related to that interaction in chronological order.

Common Debugging Scenarios

Search the log for the turn ID and look for:
  1. input.classified — was the intent recognized as tool_use?
  2. context.built — was the capability’s skill included?
  3. llm.response — did the model output a toolCalls count > 0?
If the model didn’t produce a tool call, the issue is in the context (check the debug snapshot). If it did but nothing happened next, check for a safety.blocked event.

Live Monitoring

Watch the log in real time during development:
tail -f ~/.wolffish/workspace/brain/corpus/$(date +%Y-%m-%d).log.md
Combine with grep --line-buffered to filter for specific event types in real time:
tail -f brain/corpus/$(date +%Y-%m-%d).log.md | grep --line-buffered "safety\|tool\."