Summary
Currently, the workspace builder (pkg/analyzer/workspace/builder.go) always writes the raw log content to a fixed filename raw.log. This loses the semantic meaning of the original log file name, which could provide useful context to the LLM agent during analysis.
Current Behavior
WriteRawLog() always writes to raw.log regardless of the original file name
- The system prompt in
pkg/analyzer/analyzer.go references raw.log as a hardcoded path
NewBuilder does not receive the original file name
Proposed Behavior
- Pass the original log file name (or a sanitized version) into
NewBuilder
- Write the log content using a semantically meaningful name derived from the source, e.g.
hdfs-datanode.log, apache-access.log
- Fall back to
raw.log if no source name is available
- Update the system prompt to reference the actual file name
- Update
AGENTS.md.tmpl if it references raw.log
Motivation
When the LLM agent sees raw.log, it has no context about what system or service produced the logs. A semantic file name like hadoop-namenode.log immediately tells the agent what it's looking at, potentially improving analysis quality.
Files to Change
pkg/analyzer/workspace/builder.go — accept and use source file name
pkg/analyzer/analyzer.go — pass original file path, update system prompt
cmd/lapp/debug.go — pass original file path to builder
pkg/analyzer/workspace/templates/AGENTS.md.tmpl — update if it references raw.log
- Tests in
pkg/analyzer/workspace/builder_test.go
Summary
Currently, the workspace builder (
pkg/analyzer/workspace/builder.go) always writes the raw log content to a fixed filenameraw.log. This loses the semantic meaning of the original log file name, which could provide useful context to the LLM agent during analysis.Current Behavior
WriteRawLog()always writes toraw.logregardless of the original file namepkg/analyzer/analyzer.goreferencesraw.logas a hardcoded pathNewBuilderdoes not receive the original file nameProposed Behavior
NewBuilderhdfs-datanode.log,apache-access.lograw.logif no source name is availableAGENTS.md.tmplif it referencesraw.logMotivation
When the LLM agent sees
raw.log, it has no context about what system or service produced the logs. A semantic file name likehadoop-namenode.logimmediately tells the agent what it's looking at, potentially improving analysis quality.Files to Change
pkg/analyzer/workspace/builder.go— accept and use source file namepkg/analyzer/analyzer.go— pass original file path, update system promptcmd/lapp/debug.go— pass original file path to builderpkg/analyzer/workspace/templates/AGENTS.md.tmpl— update if it referencesraw.logpkg/analyzer/workspace/builder_test.go