How song-g-s/engima works
SWE-agent turns an issue or challenge into an agent-run repository change: the runner prepares an environment, the agent interacts with a language model and executes actions in that environment, then the run records a trajectory and submission. The repository also includes a web interface for launching and observing runs, a trajectory inspector, and EnIGMA-oriented challenge tools. The main workflow is supported by the excerpts and source index; some web and challenge-tool wiring is not shown, so those connections are omitted or marked unverified.
Main entry points: agents.py Agent loop · run.py Run coordinator · swe_env.py Repository environment · hooks.py Live update hooks
Components 23
Run orchestration
- Run coordinator
run.py - Run trajectories
run.py - Runtime configuration
sweagent/utils/config.py
Agent runtime
- Agent loop
sweagent/agent/agents.py - Agent commands
sweagent/agent/commands.py - Response parsing
sweagent/agent/parsing.py - Language models
sweagent/agent/models.py - History processing
sweagent/agent/history_processors.py - Output summarizer
sweagent/agent/summarizer.py - Interactive tools
sweagent/agent/interactive_commands.py
Execution environment
- Repository environment
sweagent/environment/swe_env.py - Container utilities
sweagent/environment/utils.py
Web interface
- Web run API
sweagent/api/server.py - Live update hooks
sweagent/api/hooks.py - Run interface
sweagent/frontend/src/Run.js - Trajectory inspector
inspector/server.py
EnIGMA tools
- CTF batch runner
solve_all_ctf.py - Decompile commands
config/commands/decompile.py - Disassembly commands
config/commands/disassemble.py - Challenge file map
config/commands/filemap.py - Ghidra decompiler
docker/ghidra_scripts/DecompileToJson.java - Ghidra disassembler
docker/ghidra_scripts/DisassembleToJson.java
Other components
- Engineer
Connections 26
- Engineer → Run coordinator: starts run
README.md - Run coordinator → Repository environment: creates environment
run.py - Run coordinator → Agent loop: runs agent
run.py - Run coordinator → Run trajectories: saves results
run.py - Agent loop → Language models: queries model
sweagent/agent/agents.py - Agent loop → Response parsing: parses responses
sweagent/agent/agents.py - Agent loop → Agent commands: uses commands
sweagent/agent/agents.py - Agent loop → History processing: processes history
sweagent/agent/agents.py - Agent loop → Output summarizer: uses summarizer
sweagent/agent/agents.py - Agent loop → Repository environment: executes actions
sweagent/agent/agents.py - Agent loop → Interactive tools: uses tools
sweagent/agent/agents.py - Repository environment → Container utilities: uses utilities
sweagent/environment/swe_env.py - Run coordinator → Runtime configuration: loads configuration
run.py - Engineer → Run interface: uses interface
README.md - Web run API → Run coordinator: starts run
sweagent/api/server.py - Web run API → Live update hooks: registers hooks
sweagent/api/server.py - Live update hooks → Agent loop: observes agent
sweagent/api/hooks.py - Live update hooks → Repository environment: observes environment
sweagent/api/hooks.py - Run interface → Web run API
- Trajectory inspector → Run trajectories: serves trajectories
inspector/server.py - CTF batch runner → Run coordinator: invokes runner
solve_all_ctf.py - Decompile commands → Ghidra decompiler
- Disassembly commands → Ghidra disassembler
- Agent loop → Decompile commands
- Agent loop → Disassembly commands
- Agent loop → Challenge file map